11 #if MAX_CODE_LENGTH >= 6 13 1, 3, 2, 5, 5, 6, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0,
14 3, 2, 2, 2, 4, 6, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0,
15 4, 2, 2, 2, 3, 6, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0,
16 6, 4, 2, 2, 2, 3, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0,
17 6, 6, 3, 2, 2, 2, 4, 6, 6, 0, 0, 0, 0, 0, 0, 0,
18 6, 6, 4, 2, 2, 2, 3, 6, 6, 0, 0, 0, 0, 0, 0, 0,
19 6, 6, 6, 4, 2, 2, 2, 3, 6, 0, 0, 0, 0, 0, 0, 0,
20 6, 6, 6, 6, 3, 2, 2, 2, 4, 0, 0, 0, 0, 0, 0, 0,
21 6, 6, 5, 5, 5, 3, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0,
25 1, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0,
26 3, 3, 3, 3, 3, 3, 3, 4, 4, 0, 0, 0, 0, 0, 0, 0,
27 3, 3, 3, 3, 3, 3, 3, 4, 4, 0, 0, 0, 0, 0, 0, 0,
28 4, 3, 3, 3, 3, 3, 3, 3, 4, 0, 0, 0, 0, 0, 0, 0,
29 4, 3, 3, 3, 3, 3, 3, 3, 4, 0, 0, 0, 0, 0, 0, 0,
30 4, 3, 3, 3, 3, 3, 3, 3, 4, 0, 0, 0, 0, 0, 0, 0,
31 4, 4, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0,
32 4, 4, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0,
33 4, 4, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0,
42 static int comp_int(
const void *p1,
const void *p2)
44 return *((
const int *) p1) - *((
const int *) p2);
56 qsort(sorted, CONTEXT_COUNT,
sizeof(
int),
comp_int);
61 unsigned int nc = sorted[c] &
bitMask(CONTEXT_BITS);
65 if (c < CONTEXT_COUNT - 1) {
86 decodeTable[pl][v] = 100;
96 if (decodeTable[pl][v] == 100) {
97 decodeTable[pl][v] = nl;
99 printf(
"ERROR duplicate value\n");
103 decodeTable[pl][v] = nl;
114 if (decodeTable[pl][v] == 100) {
115 printf(
"ERROR missing value %d\n", v);
118 printf(
"%d", decodeTable[pl][v]);
const int MAX_CODE_LENGTH
const unsigned int staticdCount[1<<(2 *CONTEXT_BITS)]
unsigned int staticdBits[1<<(2 *CONTEXT_BITS)]
static int comp_int(const void *p1, const void *p2)
static unsigned int bitMask(unsigned int bitCount)
char decodeTable[1<< CONTEXT_BITS][MAX_CODE_VALUE]
static void initBitsTable()