Merge branch 'dfsg-orig'
[debian/gnuradio] / gnuradio-core / src / lib / reed-solomon / encode_rs_ccsds.c
1 /* This function wraps around the fixed 8-bit encoder, 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
8 #include "fixed.h"
9 #include "ccsds.h"
10
11 void encode_rs_ccsds(unsigned char *data,unsigned char *parity){
12   int i;
13   unsigned char cdata[NN-NROOTS];
14
15   /* Convert data from dual basis to conventional */
16   for(i=0;i<NN-NROOTS;i++)
17     cdata[i] = Tal1tab[data[i]];
18
19   encode_rs_8(cdata,parity);
20
21   /* Convert parity from conventional to dual basis */
22   for(i=0;i<NN-NROOTS;i++)
23     parity[i] = Taltab[parity[i]];
24 }