1 /* This function wraps around the fixed 8-bit decoder, performing the
2 * basis transformations necessary to meet the CCSDS standard
3 *
4 * Copyright 2002, Phil Karn, KA9Q
5 * May be used under the terms of the GNU Lesser General Public License (LGPL)
6 */
7 #include "ccsds.h"
8 #include "fec.h"
9
decode_rs_ccsds(data_t * data,int * eras_pos,int no_eras,int pad)10 int decode_rs_ccsds(data_t *data,int *eras_pos,int no_eras,int pad){
11 int i,r;
12 data_t cdata[NN];
13
14 /* Convert data from dual basis to conventional */
15 for(i=0;i<NN-pad;i++)
16 cdata[i] = Tal1tab[data[i]];
17
18 r = decode_rs_8(cdata,eras_pos,no_eras,pad);
19
20 if(r > 0){
21 /* Convert from conventional to dual basis */
22 for(i=0;i<NN-pad;i++)
23 data[i] = Taltab[cdata[i]];
24 }
25 return r;
26 }
27