summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/lib/reed-solomon/int.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/int.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/int.h')
-rw-r--r--gnuradio-core/src/lib/reed-solomon/int.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/gnuradio-core/src/lib/reed-solomon/int.h b/gnuradio-core/src/lib/reed-solomon/int.h
new file mode 100644
index 000000000..403d68757
--- /dev/null
+++ b/gnuradio-core/src/lib/reed-solomon/int.h
@@ -0,0 +1,55 @@
+/* Include file to configure the RS codec for integer symbols
+ *
+ * Copyright 2002, Phil Karn, KA9Q
+ * May be used under the terms of the GNU General Public License (GPL)
+ */
+#define DTYPE int
+
+#include <gr_core_api.h>
+
+/* Reed-Solomon codec control block */
+struct GR_CORE_API rs {
+ unsigned int mm; /* Bits per symbol */
+ unsigned int nn; /* Symbols per block (= (1<<mm)-1) */
+ int *alpha_to; /* log lookup table */
+ int *index_of; /* Antilog lookup table */
+ int *genpoly; /* Generator polynomial */
+ unsigned int nroots; /* Number of generator roots = number of parity symbols */
+ unsigned int fcr; /* First consecutive root, index form */
+ unsigned int prim; /* Primitive element, index form */
+ unsigned int iprim; /* prim-th root of 1, index form */
+};
+
+static inline int modnn(struct rs *rs,int x){
+ while (x >= rs->nn) {
+ x -= rs->nn;
+ x = (x >> rs->mm) + (x & rs->nn);
+ }
+ return x;
+}
+#define MODNN(x) modnn(rs,x)
+
+#define MM (rs->mm)
+#define NN (rs->nn)
+#define ALPHA_TO (rs->alpha_to)
+#define INDEX_OF (rs->index_of)
+#define GENPOLY (rs->genpoly)
+#define NROOTS (rs->nroots)
+#define FCR (rs->fcr)
+#define PRIM (rs->prim)
+#define IPRIM (rs->iprim)
+#define A0 (NN)
+
+#define ENCODE_RS encode_rs_int
+#define DECODE_RS decode_rs_int
+#define INIT_RS init_rs_int
+#define FREE_RS free_rs_int
+
+GR_CORE_API void ENCODE_RS(void *p,DTYPE *data,DTYPE *parity);
+GR_CORE_API int DECODE_RS(void *p,DTYPE *data,int *eras_pos,int no_eras);
+void *INIT_RS(unsigned int symsize,unsigned int gfpoly,unsigned int fcr,
+ unsigned int prim,unsigned int nroots);
+GR_CORE_API void FREE_RS(void *p);
+
+
+