GNU Radio 3.6.3 C++ API
fixed.h
Go to the documentation of this file.
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
4  *
5  * Copyright 2002 Phil Karn, KA9Q
6  * May be used under the terms of the GNU General Public License (GPL)
7  */
8 #define DTYPE unsigned char
9 
10 #include <gr_core_api.h>
11 
12 static inline int mod255(int x){
13  while (x >= 255) {
14  x -= 255;
15  x = (x >> 8) + (x & 255);
16  }
17  return x;
18 }
19 #define MODNN(x) mod255(x)
20 
21 extern unsigned char CCSDS_alpha_to[];
22 extern unsigned char CCSDS_index_of[];
23 extern unsigned char CCSDS_poly[];
24 
25 #define MM 8
26 #define NN 255
27 #define ALPHA_TO CCSDS_alpha_to
28 #define INDEX_OF CCSDS_index_of
29 #define GENPOLY CCSDS_poly
30 #define NROOTS 32
31 #define FCR 112
32 #define PRIM 11
33 #define IPRIM 116
34 #define A0 (NN)
35 
36 #define ENCODE_RS encode_rs_8
37 #define DECODE_RS decode_rs_8
38 
39 GR_CORE_API void ENCODE_RS(DTYPE *data,DTYPE *parity);
40 GR_CORE_API int DECODE_RS(DTYPE *data, int *eras_pos, int no_eras);