OpenJPEG
1.5.1
|
Functions used to compute the Reed-Solomon parity and check of byte arrays. More...
Macros | |
#define | B0 0 /* Different from the default 1 */ |
#define | A0 (NN) |
#define | CLEAR(a, n) |
#define | COPY(a, b, n) |
#define | COPYDOWN(a, b, n) |
Typedefs | |
typedef int | gf |
Reed-Solomon coding and decoding Phil Karn (karn@) September 1996. ka9q .ampr .orgMore... | |
Functions | |
static gf | modnn (int x) |
void | init_rs (int k) |
Initialization function. More... | |
void | generate_gf (void) |
These two functions must be called in this order (e.g., by init_rs()) before any encoding/decoding. More... | |
void | gen_poly (void) |
int | encode_rs (dtype *data, dtype *bb) |
int | eras_dec_rs (dtype *data, int *eras_pos, int no_eras) |
Variables | |
static int | KK |
int | Pp [MM+1] = { 1, 0, 1, 1, 1, 0, 0, 0, 1 } |
gf | Alpha_to [NN+1] |
gf | Index_of [NN+1] |
gf | Gg [NN-1] |
Functions used to compute the Reed-Solomon parity and check of byte arrays.
#define A0 (NN) |
Referenced by encode_rs(), eras_dec_rs(), and generate_gf().
#define B0 0 /* Different from the default 1 */ |
Referenced by eras_dec_rs(), and gen_poly().
#define CLEAR | ( | a, | |
n | |||
) |
Referenced by encode_rs(), and eras_dec_rs().
#define COPY | ( | a, | |
b, | |||
n | |||
) |
Referenced by eras_dec_rs().
#define COPYDOWN | ( | a, | |
b, | |||
n | |||
) |
Referenced by eras_dec_rs().
typedef int gf |
Reed-Solomon coding and decoding Phil Karn (karn@) September 1996. ka9q .ampr .org
This file is derived from the program "new_rs_erasures.c" by Robert Morelos-Zaragoza (rober) and Hari Thirumoorthy ( t@sp ectra .eng .hawa ii.e duharit), Aug 1995 @spe ctra. eng. hawai i.ed u
I've made changes to improve performance, clean up the code and make it easier to follow. Data is now passed to the encoding and decoding functions through arguments rather than in global arrays. The decode function returns the number of corrected symbols, or -1 if the word is uncorrectable.
This code supports a symbol size from 2 bits up to 16 bits, implying a block size of 3 2-bit symbols (6 bits) up to 65535 16-bit symbols (1,048,560 bits). The code parameters are set in rs.h.
Note that if symbols larger than 8 bits are used, the type of each data array element switches from unsigned char to unsigned int. The caller must ensure that elements larger than the symbol range are not passed to the encoder or decoder.
int eras_dec_rs | ( | dtype * | data, |
int * | eras_pos, | ||
int | no_eras | ||
) |
void gen_poly | ( | void | ) |
void generate_gf | ( | void | ) |
void init_rs | ( | int | k | ) |
Initialization function.
References gen_poly(), generate_gf(), KK, and NN.
Referenced by jpwl_epb_correct(), and jpwl_epb_fill().
|
static |
Referenced by encode_rs(), eras_dec_rs(), and gen_poly().
Referenced by encode_rs(), eras_dec_rs(), gen_poly(), and generate_gf().
Referenced by encode_rs(), and gen_poly().
Referenced by encode_rs(), eras_dec_rs(), gen_poly(), and generate_gf().
|
static |
Referenced by encode_rs(), eras_dec_rs(), gen_poly(), and init_rs().
int Pp[MM+1] = { 1, 0, 1, 1, 1, 0, 0, 0, 1 } |
Referenced by generate_gf().