GNU Radio's SATELLITES Package

rs-common.h
Go to the documentation of this file.
1/* Stuff common to all the general-purpose Reed-Solomon codecs
2 * Copyright 2004 Phil Karn, KA9Q
3 * May be used under the terms of the GNU Lesser General Public License (LGPL)
4 */
5
6/* Reed-Solomon codec control block */
7 struct rs {
8 int mm; /* Bits per symbol */
9 int nn; /* Symbols per block (= (1<<mm)-1) */
10 data_t* alpha_to; /* log lookup table */
11 data_t* index_of; /* Antilog lookup table */
12 data_t* genpoly; /* Generator polynomial */
13 int nroots; /* Number of generator roots = number of parity symbols */
14 int fcr; /* First consecutive root, index form */
15 int prim; /* Primitive element, index form */
16 int iprim; /* prim-th root of 1, index form */
17 int pad; /* Padding bytes in shortened block */
18};
19
20 static inline int modnn(struct rs* rs, int x)
21{
22 while (x >= rs->nn) {
23 x -= rs->nn;
24 x = (x >> rs->mm) + (x & rs->nn);
25 }
26 return x;
27}
data_t
unsigned char data_t
Definition ccsds.h:1
modnn
static int modnn(struct rs *rs, int x)
Definition rs-common.h:20
rs
Definition rs-common.h:7
rs::nn
int nn
Definition rs-common.h:9
rs::nroots
int nroots
Definition rs-common.h:13
rs::iprim
int iprim
Definition rs-common.h:16
rs::genpoly
data_t * genpoly
Definition rs-common.h:12
rs::index_of
data_t * index_of
Definition rs-common.h:11
rs::fcr
int fcr
Definition rs-common.h:14
rs::mm
int mm
Definition rs-common.h:8
rs::pad
int pad
Definition rs-common.h:17
rs::prim
int prim
Definition rs-common.h:15
rs::alpha_to
data_t * alpha_to
Definition rs-common.h:10