ZBar Bar Code Reader Library  version 0.10
rs.c File Reference
Include dependency graph for rs.c:

Functions

static void rs_calc_syndrome (const rs_gf256 *_gf, int _m0, unsigned char *_s, int _npar, const unsigned char *_data, int _ndata)
 
void rs_compute_genpoly (const rs_gf256 *_gf, int _m0, unsigned char *_genpoly, int _npar)
 
int rs_correct (const rs_gf256 *_gf, int _m0, unsigned char *_data, int _ndata, int _npar, const unsigned char *_erasures, int _nerasures)
 
static int rs_cubic_solve (const rs_gf256 *_gf, unsigned _a, unsigned _b, unsigned _c, unsigned char _x[3])
 
void rs_encode (const rs_gf256 *_gf, unsigned char *_data, int _ndata, const unsigned char *_genpoly, int _npar)
 
static int rs_find_roots (const rs_gf256 *_gf, unsigned char *_epos, const unsigned char *_lambda, int _nerrors, int _ndata)
 
static unsigned rs_gdiv (const rs_gf256 *_gf, unsigned _a, unsigned _b)
 
void rs_gf256_init (rs_gf256 *_gf, unsigned _ppoly)
 
static unsigned rs_gmul (const rs_gf256 *_gf, unsigned _a, unsigned _b)
 
static unsigned rs_gsqrt (const rs_gf256 *_gf, unsigned _a)
 
static unsigned rs_hgmul (const rs_gf256 *_gf, unsigned _a, unsigned _logb)
 
static void rs_init_lambda (const rs_gf256 *_gf, unsigned char *_lambda, int _npar, const unsigned char *_erasures, int _nerasures, int _ndata)
 
static int rs_modified_berlekamp_massey (const rs_gf256 *_gf, unsigned char *_lambda, const unsigned char *_s, unsigned char *_omega, int _npar, const unsigned char *_erasures, int _nerasures, int _ndata)
 
static void rs_poly_copy (unsigned char *_p, const unsigned char *_q, int _dp1)
 
static void rs_poly_div_x (unsigned char *_p, const unsigned char *_q, int _dp1)
 
static void rs_poly_mul_x (unsigned char *_p, const unsigned char *_q, int _dp1)
 
static void rs_poly_mult (const rs_gf256 *_gf, unsigned char *_p, int _dp1, const unsigned char *_q, int _ep1, const unsigned char *_r, int _fp1)
 
static void rs_poly_zero (unsigned char *_p, int _dp1)
 
static int rs_quadratic_solve (const rs_gf256 *_gf, unsigned _b, unsigned _c, unsigned char _x[2])
 
static int rs_quartic_solve (const rs_gf256 *_gf, unsigned _a, unsigned _b, unsigned _c, unsigned _d, unsigned char _x[3])
 

Function Documentation

static void rs_calc_syndrome ( const rs_gf256 _gf,
int  _m0,
unsigned char *  _s,
int  _npar,
const unsigned char *  _data,
int  _ndata 
)
static

References rs_gf256::exp, rs_gf256::log, and rs_hgmul().

Referenced by rs_correct().

Here is the call graph for this function:

Here is the caller graph for this function:

void rs_compute_genpoly ( const rs_gf256 _gf,
int  _m0,
unsigned char *  _genpoly,
int  _npar 
)

References rs_gf256::exp, rs_gf256::log, rs_hgmul(), and rs_poly_zero().

Referenced by rs_encode().

Here is the call graph for this function:

Here is the caller graph for this function:

int rs_correct ( const rs_gf256 _gf,
int  _m0,
unsigned char *  _data,
int  _ndata,
int  _npar,
const unsigned char *  _erasures,
int  _nerasures 
)

References rs_gf256::exp, rs_gf256::log, rs_calc_syndrome(), rs_find_roots(), rs_gdiv(), rs_hgmul(), and rs_modified_berlekamp_massey().

Referenced by qr_code_decode(), and rs_encode().

Here is the call graph for this function:

Here is the caller graph for this function:

static int rs_cubic_solve ( const rs_gf256 _gf,
unsigned  _a,
unsigned  _b,
unsigned  _c,
unsigned char  _x[3] 
)
static

References rs_gf256::exp, rs_gf256::log, rs_gdiv(), rs_gmul(), and rs_quadratic_solve().

Referenced by rs_quartic_solve().

Here is the call graph for this function:

Here is the caller graph for this function:

void rs_encode ( const rs_gf256 _gf,
unsigned char *  _data,
int  _ndata,
const unsigned char *  _genpoly,
int  _npar 
)
static int rs_find_roots ( const rs_gf256 _gf,
unsigned char *  _epos,
const unsigned char *  _lambda,
int  _nerrors,
int  _ndata 
)
static

References rs_gf256::exp, rs_gf256::log, rs_hgmul(), and rs_quartic_solve().

Referenced by rs_correct().

Here is the call graph for this function:

Here is the caller graph for this function:

static unsigned rs_gdiv ( const rs_gf256 _gf,
unsigned  _a,
unsigned  _b 
)
static

References rs_gf256::exp, and rs_gf256::log.

Referenced by rs_correct(), rs_cubic_solve(), rs_quadratic_solve(), and rs_quartic_solve().

Here is the caller graph for this function:

void rs_gf256_init ( rs_gf256 _gf,
unsigned  _ppoly 
)

References rs_gf256::exp, and rs_gf256::log.

Referenced by qr_reader_init(), and rs_encode().

Here is the caller graph for this function:

static unsigned rs_gmul ( const rs_gf256 _gf,
unsigned  _a,
unsigned  _b 
)
static

References rs_gf256::exp, and rs_gf256::log.

Referenced by rs_cubic_solve(), rs_encode(), rs_modified_berlekamp_massey(), rs_quadratic_solve(), and rs_quartic_solve().

Here is the caller graph for this function:

static unsigned rs_gsqrt ( const rs_gf256 _gf,
unsigned  _a 
)
static

References rs_gf256::exp, and rs_gf256::log.

Referenced by rs_quadratic_solve(), and rs_quartic_solve().

Here is the caller graph for this function:

static unsigned rs_hgmul ( const rs_gf256 _gf,
unsigned  _a,
unsigned  _logb 
)
static
static void rs_init_lambda ( const rs_gf256 _gf,
unsigned char *  _lambda,
int  _npar,
const unsigned char *  _erasures,
int  _nerasures,
int  _ndata 
)
static

References rs_hgmul(), and rs_poly_zero().

Referenced by rs_modified_berlekamp_massey().

Here is the call graph for this function:

Here is the caller graph for this function:

static int rs_modified_berlekamp_massey ( const rs_gf256 _gf,
unsigned char *  _lambda,
const unsigned char *  _s,
unsigned char *  _omega,
int  _npar,
const unsigned char *  _erasures,
int  _nerasures,
int  _ndata 
)
static

References rs_gf256::log, rs_gmul(), rs_hgmul(), rs_init_lambda(), rs_poly_copy(), rs_poly_mul_x(), and rs_poly_mult().

Referenced by rs_correct().

Here is the caller graph for this function:

static void rs_poly_copy ( unsigned char *  _p,
const unsigned char *  _q,
int  _dp1 
)
static

Referenced by rs_modified_berlekamp_massey().

Here is the caller graph for this function:

static void rs_poly_div_x ( unsigned char *  _p,
const unsigned char *  _q,
int  _dp1 
)
static

Referenced by rs_encode().

Here is the caller graph for this function:

static void rs_poly_mul_x ( unsigned char *  _p,
const unsigned char *  _q,
int  _dp1 
)
static

Referenced by rs_modified_berlekamp_massey().

Here is the caller graph for this function:

static void rs_poly_mult ( const rs_gf256 _gf,
unsigned char *  _p,
int  _dp1,
const unsigned char *  _q,
int  _ep1,
const unsigned char *  _r,
int  _fp1 
)
static

References rs_gf256::log, rs_hgmul(), and rs_poly_zero().

Referenced by rs_modified_berlekamp_massey().

Here is the call graph for this function:

Here is the caller graph for this function:

static void rs_poly_zero ( unsigned char *  _p,
int  _dp1 
)
static

Referenced by rs_compute_genpoly(), rs_encode(), rs_init_lambda(), and rs_poly_mult().

Here is the caller graph for this function:

static int rs_quadratic_solve ( const rs_gf256 _gf,
unsigned  _b,
unsigned  _c,
unsigned char  _x[2] 
)
static

References rs_gf256::exp, rs_gf256::log, rs_gdiv(), rs_gmul(), rs_gsqrt(), and rs_hgmul().

Referenced by rs_cubic_solve(), and rs_quartic_solve().

Here is the call graph for this function:

Here is the caller graph for this function:

static int rs_quartic_solve ( const rs_gf256 _gf,
unsigned  _a,
unsigned  _b,
unsigned  _c,
unsigned  _d,
unsigned char  _x[3] 
)
static

References rs_gf256::exp, rs_gf256::log, rs_cubic_solve(), rs_gdiv(), rs_gmul(), rs_gsqrt(), rs_hgmul(), and rs_quadratic_solve().

Referenced by rs_encode(), and rs_find_roots().

Here is the caller graph for this function: