Go to the source code of this file.
bool rar_add_value |
( |
struct huffman_code * |
code, |
|
|
int |
value, |
|
|
int |
codebits, |
|
|
int |
length |
|
) |
| |
Definition at line 33 of file huffman-rar.c.
35 int lastnode, bitpos, bit;
42 if (length < code->minlength)
46 for (bitpos = length - 1; bitpos >= 0; bitpos--) {
47 bit = (codebits >> bitpos) & 1;
49 warn(
"Invalid data in bitstream");
61 warn(
"Invalid data in bitstream");
bool rar_create_code |
( |
struct huffman_code * |
code, |
|
|
uint8_t * |
lengths, |
|
|
int |
numsymbols |
|
) |
| |
Definition at line 68 of file huffman-rar.c.
70 int symbolsleft = numsymbols;
77 for (i = 1; i <= 0x0F; i++) {
78 for (j = 0; j < numsymbols; j++) {
83 if (--symbolsleft <= 0)
Definition at line 137 of file huffman-rar.c.
141 memset(code, 0,
sizeof(*code));
static bool rar_make_table_rec |
( |
struct huffman_code * |
code, |
|
|
int |
node, |
|
|
int |
offset, |
|
|
int |
depth, |
|
|
int |
maxdepth |
|
) |
| |
|
static |
Definition at line 92 of file huffman-rar.c.
94 int currtablesize = 1 << (maxdepth - depth);
96 if (node < 0 || code->numentries <= node) {
97 warn(
"Invalid data in bitstream");
103 for (i = 0; i < currtablesize; i++) {
108 else if (depth == maxdepth) {
Definition at line 8 of file huffman-rar.c.
17 void *new_tree = calloc(new_capacity,
sizeof(*code->
tree));
19 warn(
"OOM during decompression");
24 code->
tree = new_tree;