|
OpenJPEG 1.5.2
|
Functions used to compute the Reed-Solomon parity and check of byte arrays. More...
Macros | |
| #define | B0 0 |
| #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@.nosp@m.ka9q.nosp@m..ampr.nosp@m..org) September 1996. | |
Functions | |
| static gf | modnn (int x) |
| void | init_rs (int k) |
| Initialization function. | |
| void | generate_gf (void) |
| These two functions must be called in this order (e.g., by init_rs()) before any encoding/decoding. | |
| 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 |
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@.nosp@m.ka9q.nosp@m..ampr.nosp@m..org) September 1996.
This file is derived from the program "new_rs_erasures.c" by Robert Morelos-Zaragoza (rober.nosp@m.t@sp.nosp@m.ectra.nosp@m..eng.nosp@m..hawa.nosp@m.ii.e.nosp@m.du) and Hari Thirumoorthy (harit.nosp@m.@spe.nosp@m.ctra..nosp@m.eng..nosp@m.hawai.nosp@m.i.ed.nosp@m.u), Aug 1995
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.
References A0, Alpha_to, CLEAR, encode_rs(), Gg, Index_of, KK, modnn(), and NN.
Referenced by encode_rs(), encode_rs(), and jpwl_epb_fill().
| int eras_dec_rs | ( | dtype * | data, |
| int * | eras_pos, | ||
| int | no_eras ) |
References A0, Alpha_to, B0, CLEAR, COPY, COPYDOWN, eras_dec_rs(), Index_of, KK, min, modnn(), and NN.
Referenced by eras_dec_rs(), eras_dec_rs(), and jpwl_epb_correct().
| void gen_poly | ( | void | ) |
References Alpha_to, B0, gen_poly(), Gg, Index_of, KK, modnn(), and NN.
Referenced by gen_poly(), and init_rs().
| void generate_gf | ( | void | ) |
These two functions must be called in this order (e.g., by init_rs()) before any encoding/decoding.
References A0, Alpha_to, generate_gf(), Index_of, MM, NN, and Pp.
Referenced by generate_gf(), and init_rs().
| void init_rs | ( | int | k | ) |
Initialization function.
References gen_poly(), generate_gf(), init_rs(), KK, and NN.
Referenced by init_rs(), jpwl_epb_correct(), and jpwl_epb_fill().
|
static |
References MM, modnn(), and NN.
Referenced by encode_rs(), eras_dec_rs(), gen_poly(), and modnn().
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().