From 5d69a524f81f234b3fbc41d49ba18d6f6886baba Mon Sep 17 00:00:00 2001 From: jcorgan Date: Thu, 3 Aug 2006 04:51:51 +0000 Subject: Houston, we have a trunk. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@3122 221aa14e-8319-0410-a670-987f0aec2ac5 --- gnuradio-core/src/lib/reed-solomon/char.h | 56 +++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 gnuradio-core/src/lib/reed-solomon/char.h (limited to 'gnuradio-core/src/lib/reed-solomon/char.h') diff --git a/gnuradio-core/src/lib/reed-solomon/char.h b/gnuradio-core/src/lib/reed-solomon/char.h new file mode 100644 index 000000000..2fbcb504a --- /dev/null +++ b/gnuradio-core/src/lib/reed-solomon/char.h @@ -0,0 +1,56 @@ +/* Include file to configure the RS codec for character symbols + * + * Copyright 2002, Phil Karn, KA9Q + * May be used under the terms of the GNU General Public License (GPL) + */ + +#define DTYPE unsigned char + +/* Reed-Solomon codec control block */ +struct rs { + unsigned int mm; /* Bits per symbol */ + unsigned int nn; /* Symbols per block (= (1<= 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_char +#define DECODE_RS decode_rs_char +#define INIT_RS init_rs_char +#define FREE_RS free_rs_char + +void ENCODE_RS(void *p,DTYPE *data,DTYPE *parity); +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); +void FREE_RS(void *p); + + + + + -- cgit From f914499f4a96fe69ab9cd8dba48f8e3bfc7a54e5 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 20 Jul 2011 18:38:36 -0700 Subject: core: API declaration macros for core class and function symbols --- gnuradio-core/src/lib/reed-solomon/char.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'gnuradio-core/src/lib/reed-solomon/char.h') diff --git a/gnuradio-core/src/lib/reed-solomon/char.h b/gnuradio-core/src/lib/reed-solomon/char.h index 2fbcb504a..f4db986c3 100644 --- a/gnuradio-core/src/lib/reed-solomon/char.h +++ b/gnuradio-core/src/lib/reed-solomon/char.h @@ -6,6 +6,8 @@ #define DTYPE unsigned char +#include + /* Reed-Solomon codec control block */ struct rs { unsigned int mm; /* Bits per symbol */ @@ -44,12 +46,11 @@ static inline int modnn(struct rs *rs,int x){ #define INIT_RS init_rs_char #define FREE_RS free_rs_char -void ENCODE_RS(void *p,DTYPE *data,DTYPE *parity); -int DECODE_RS(void *p,DTYPE *data,int *eras_pos,int no_eras); +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); -void FREE_RS(void *p); - +GR_CORE_API void FREE_RS(void *p); -- cgit From 8752b611c5351c61ba83ffc93fee23091f187e4b Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sat, 23 Jul 2011 22:47:36 -0700 Subject: atsc: added cmake support for gr-atsc (unix only) --- gnuradio-core/src/lib/reed-solomon/char.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnuradio-core/src/lib/reed-solomon/char.h') diff --git a/gnuradio-core/src/lib/reed-solomon/char.h b/gnuradio-core/src/lib/reed-solomon/char.h index f4db986c3..8010fb0b9 100644 --- a/gnuradio-core/src/lib/reed-solomon/char.h +++ b/gnuradio-core/src/lib/reed-solomon/char.h @@ -48,7 +48,7 @@ static inline int modnn(struct rs *rs,int x){ 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, +GR_CORE_API 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); -- cgit From 9c853b962d73565f2980789a32f347309bcc605f Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Tue, 25 Oct 2011 14:50:14 -0400 Subject: reed-solomon: fixed the signed/unsigned warnings in the RS code. Some of these had to be done through type-casting since changing the actual data type would cause the tests to fail. make test still passes. --- gnuradio-core/src/lib/reed-solomon/char.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnuradio-core/src/lib/reed-solomon/char.h') diff --git a/gnuradio-core/src/lib/reed-solomon/char.h b/gnuradio-core/src/lib/reed-solomon/char.h index 8010fb0b9..762e9e295 100644 --- a/gnuradio-core/src/lib/reed-solomon/char.h +++ b/gnuradio-core/src/lib/reed-solomon/char.h @@ -21,7 +21,7 @@ struct rs { unsigned char iprim; /* prim-th root of 1, index form */ }; -static inline int modnn(struct rs *rs,int x){ +static inline unsigned int modnn(struct rs *rs, unsigned int x){ while (x >= rs->nn) { x -= rs->nn; x = (x >> rs->mm) + (x & rs->nn); -- cgit From f919f9dcbb54a08e6e26d6c229ce92fb784fa1b2 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Fri, 13 Apr 2012 18:36:53 -0400 Subject: Removed whitespace and added dtools/bin/remove-whitespace as a tool to do this in the future. The sed script was provided by Moritz Fischer. --- gnuradio-core/src/lib/reed-solomon/char.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnuradio-core/src/lib/reed-solomon/char.h') diff --git a/gnuradio-core/src/lib/reed-solomon/char.h b/gnuradio-core/src/lib/reed-solomon/char.h index 762e9e295..7b2030a0b 100644 --- a/gnuradio-core/src/lib/reed-solomon/char.h +++ b/gnuradio-core/src/lib/reed-solomon/char.h @@ -32,7 +32,7 @@ static inline unsigned int modnn(struct rs *rs, unsigned int x){ #define MM (rs->mm) #define NN (rs->nn) -#define ALPHA_TO (rs->alpha_to) +#define ALPHA_TO (rs->alpha_to) #define INDEX_OF (rs->index_of) #define GENPOLY (rs->genpoly) #define NROOTS (rs->nroots) -- cgit