diff options
Diffstat (limited to 'decode_rs_ccsds.c')
-rw-r--r-- | decode_rs_ccsds.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/decode_rs_ccsds.c b/decode_rs_ccsds.c new file mode 100644 index 0000000..0e246b4 --- /dev/null +++ b/decode_rs_ccsds.c @@ -0,0 +1,26 @@ +/* This function wraps around the fixed 8-bit decoder, performing the + * basis transformations necessary to meet the CCSDS standard + * + * Copyright 2002, Phil Karn, KA9Q + * May be used under the terms of the GNU Lesser General Public License (LGPL) + */ +#include "ccsds.h" +#include "fec.h" + +int decode_rs_ccsds(data_t *data,int *eras_pos,int no_eras,int pad){ + int i,r; + data_t cdata[NN]; + + /* Convert data from dual basis to conventional */ + for(i=0;i<NN-pad;i++) + cdata[i] = Tal1tab[data[i]]; + + r = decode_rs_8(cdata,eras_pos,no_eras,pad); + + if(r > 0){ + /* Convert from conventional to dual basis */ + for(i=0;i<NN-pad;i++) + data[i] = Taltab[cdata[i]]; + } + return r; +} |