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 General Public License (GPL)
6  */
7 #define FIXED 1
8 #include "ccsds.h"
9 #include "fixed.h"
10 
decode_rs_ccsds(unsigned char * data,int * eras_pos,int no_eras)11 int decode_rs_ccsds(unsigned char* data, int* eras_pos, int no_eras)
12 {
13     int i, r;
14     unsigned char cdata[NN];
15 
16     /* Convert data from dual basis to conventional */
17     for (i = 0; i < NN; i++)
18         cdata[i] = Tal1tab[data[i]];
19 
20     r = decode_rs_8(cdata, eras_pos, no_eras);
21 
22     if (r > 0) {
23         /* Convert from conventional to dual basis */
24         for (i = 0; i < NN; i++)
25             data[i] = Taltab[cdata[i]];
26     }
27     return r;
28 }
29