41 #ifndef __BCH_CODE__H__ 42 #define __BCH_CODE__H__ 55 #define BCH_DEFAULT_M 6 56 #define BCH_DEFAULT_LENGTH 36 57 #define BCH_DEFAULT_T 4 58 #define BCH_DEFAULT_K 12 61 #define BCH_MAX_P 7 // MAX_M+1 62 #define BCH_MAX_LUT 64 // 2^MAX_M 63 #define BCH_MAX_SQ 8 // SQRT(MAX_LUT) -- (?) 68 #if defined(_MSC_VER) || defined(_WIN32_WCE) 69 typedef unsigned __int64
_64bits;
75 static bool _isBitSet(_64bits bn,
int which_bit);
76 static void _setBit(_64bits &bn,
int which_bit);
83 static int*
toBitPattern(
int b[], _64bits n,
int n_bits);
96 bool decode(
int &err_n, _64bits &orig_n,
const int encoded_bits[BCH_DEFAULT_LENGTH]);
98 void encode(_64bits &encoded_n,
const _64bits orig_n);
99 bool decode(
int &err_n, _64bits &orig_n,
const _64bits encoded_n);
103 BCH(
int _m,
int _length,
int _t);
118 std::vector<std::vector<int> >
_elp;
132 #endif // __BCH_CODE__H__
#define BCH_DEFAULT_LENGTH