summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/lib/reed-solomon/fixed.h
diff options
context:
space:
mode:
authorManoj Gudi2013-10-07 20:19:55 +0530
committerManoj Gudi2013-10-07 20:20:35 +0530
commit1826d0763c8595997f5f4af1fdb0354e9c0998ad (patch)
treeacbd852cd5a1bf17241b1038b5e37a0e72e64612 /gnuradio-core/src/lib/reed-solomon/fixed.h
parent452defdb4a78e9e826740ddf4b9673e926c568a4 (diff)
parent24b640997ba7fee0c725e65f401f5cbebdab8d08 (diff)
downloadgnuradio-1826d0763c8595997f5f4af1fdb0354e9c0998ad.tar.gz
gnuradio-1826d0763c8595997f5f4af1fdb0354e9c0998ad.tar.bz2
gnuradio-1826d0763c8595997f5f4af1fdb0354e9c0998ad.zip
README change
Diffstat (limited to 'gnuradio-core/src/lib/reed-solomon/fixed.h')
-rw-r--r--gnuradio-core/src/lib/reed-solomon/fixed.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/gnuradio-core/src/lib/reed-solomon/fixed.h b/gnuradio-core/src/lib/reed-solomon/fixed.h
new file mode 100644
index 000000000..30091e7bf
--- /dev/null
+++ b/gnuradio-core/src/lib/reed-solomon/fixed.h
@@ -0,0 +1,40 @@
+/* Configure the RS codec with fixed parameters for CCSDS standard
+ * (255,223) code over GF(256). Note: the conventional basis is still
+ * used; the dual-basis mappings are performed in [en|de]code_rs_ccsds.c
+ *
+ * Copyright 2002 Phil Karn, KA9Q
+ * May be used under the terms of the GNU General Public License (GPL)
+ */
+#define DTYPE unsigned char
+
+#include <gr_core_api.h>
+
+static inline int mod255(int x){
+ while (x >= 255) {
+ x -= 255;
+ x = (x >> 8) + (x & 255);
+ }
+ return x;
+}
+#define MODNN(x) mod255(x)
+
+extern unsigned char CCSDS_alpha_to[];
+extern unsigned char CCSDS_index_of[];
+extern unsigned char CCSDS_poly[];
+
+#define MM 8
+#define NN 255
+#define ALPHA_TO CCSDS_alpha_to
+#define INDEX_OF CCSDS_index_of
+#define GENPOLY CCSDS_poly
+#define NROOTS 32
+#define FCR 112
+#define PRIM 11
+#define IPRIM 116
+#define A0 (NN)
+
+#define ENCODE_RS encode_rs_8
+#define DECODE_RS decode_rs_8
+
+GR_CORE_API void ENCODE_RS(DTYPE *data,DTYPE *parity);
+GR_CORE_API int DECODE_RS(DTYPE *data, int *eras_pos, int no_eras); \ No newline at end of file