1 /* Configure the RS codec with fixed parameters for CCSDS standard
2 * (255,223) code over GF(256). Note: the conventional basis is still
3 * used; the dual-basis mappings are performed in [en|de]code_rs_ccsds.c
5 * Copyright 2002 Phil Karn, KA9Q
6 * May be used under the terms of the GNU General Public License (GPL)
8 #define DTYPE unsigned char
10 static inline int mod255(int x){
13 x = (x >> 8) + (x & 255);
17 #define MODNN(x) mod255(x)
19 extern unsigned char CCSDS_alpha_to[];
20 extern unsigned char CCSDS_index_of[];
21 extern unsigned char CCSDS_poly[];
25 #define ALPHA_TO CCSDS_alpha_to
26 #define INDEX_OF CCSDS_index_of
27 #define GENPOLY CCSDS_poly
34 #define ENCODE_RS encode_rs_8
35 #define DECODE_RS decode_rs_8
37 void ENCODE_RS(DTYPE *data,DTYPE *parity);
38 int DECODE_RS(DTYPE *data, int *eras_pos, int no_eras);