blob: 5a2ec70102671a6423474e8e263be344d5783b48 [file] [log] [blame]
Bill Yi4e213d52015-06-23 13:53:11 -07001/* 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 * fixed bug Aug 2007
6 * May be used under the terms of the GNU Lesser General Public License (LGPL)
7 */
8#include "ccsds.h"
9#include "fec.h"
10
11void encode_rs_ccsds(data_t *data,data_t *parity,int pad){
12 int i;
13 data_t cdata[NN-NROOTS];
14
15 /* Convert data from dual basis to conventional */
16 for(i=0;i<NN-NROOTS-pad;i++)
17 cdata[i] = Tal1tab[data[i]];
18
19 encode_rs_8(cdata,parity,pad);
20
21 /* Convert parity from conventional to dual basis */
22 for(i=0;i<NROOTS;i++)
23 parity[i] = Taltab[parity[i]];
24}