diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-01-02 21:55:13 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-01-02 21:55:13 +0100 |
commit | a31630e0d5b9880c716d9004ef4154396ba41ebc (patch) | |
tree | aebbd3b132e5f2dd31bc34750ccded2378fc687a /encode_rs_ccsds.c | |
parent | 9aaac5be9db5e1537badc65242412ef14c5096e3 (diff) | |
download | ka9q-fec-a31630e0d5b9880c716d9004ef4154396ba41ebc.tar.gz ka9q-fec-a31630e0d5b9880c716d9004ef4154396ba41ebc.tar.bz2 ka9q-fec-a31630e0d5b9880c716d9004ef4154396ba41ebc.zip |
Extract fec-3.0.1
Diffstat (limited to 'encode_rs_ccsds.c')
-rw-r--r-- | encode_rs_ccsds.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/encode_rs_ccsds.c b/encode_rs_ccsds.c new file mode 100644 index 0000000..5a2ec70 --- /dev/null +++ b/encode_rs_ccsds.c @@ -0,0 +1,24 @@ +/* This function wraps around the fixed 8-bit encoder, performing the + * basis transformations necessary to meet the CCSDS standard + * + * Copyright 2002, Phil Karn, KA9Q + * fixed bug Aug 2007 + * May be used under the terms of the GNU Lesser General Public License (LGPL) + */ +#include "ccsds.h" +#include "fec.h" + +void encode_rs_ccsds(data_t *data,data_t *parity,int pad){ + int i; + data_t cdata[NN-NROOTS]; + + /* Convert data from dual basis to conventional */ + for(i=0;i<NN-NROOTS-pad;i++) + cdata[i] = Tal1tab[data[i]]; + + encode_rs_8(cdata,parity,pad); + + /* Convert parity from conventional to dual basis */ + for(i=0;i<NROOTS;i++) + parity[i] = Taltab[parity[i]]; +} |