GNU Radio 3.6.5 C++ API
|
00001 /* Configure the RS codec with fixed parameters for CCSDS standard 00002 * (255,223) code over GF(256). Note: the conventional basis is still 00003 * used; the dual-basis mappings are performed in [en|de]code_rs_ccsds.c 00004 * 00005 * Copyright 2002 Phil Karn, KA9Q 00006 * May be used under the terms of the GNU General Public License (GPL) 00007 */ 00008 #define DTYPE unsigned char 00009 00010 #include <gr_core_api.h> 00011 00012 static inline int mod255(int x){ 00013 while (x >= 255) { 00014 x -= 255; 00015 x = (x >> 8) + (x & 255); 00016 } 00017 return x; 00018 } 00019 #define MODNN(x) mod255(x) 00020 00021 extern unsigned char CCSDS_alpha_to[]; 00022 extern unsigned char CCSDS_index_of[]; 00023 extern unsigned char CCSDS_poly[]; 00024 00025 #define MM 8 00026 #define NN 255 00027 #define ALPHA_TO CCSDS_alpha_to 00028 #define INDEX_OF CCSDS_index_of 00029 #define GENPOLY CCSDS_poly 00030 #define NROOTS 32 00031 #define FCR 112 00032 #define PRIM 11 00033 #define IPRIM 116 00034 #define A0 (NN) 00035 00036 #define ENCODE_RS encode_rs_8 00037 #define DECODE_RS decode_rs_8 00038 00039 GR_CORE_API void ENCODE_RS(DTYPE *data,DTYPE *parity); 00040 GR_CORE_API int DECODE_RS(DTYPE *data, int *eras_pos, int no_eras);