Add huffman decoding for C

This commit is contained in:
James Bowes 2012-08-09 16:09:29 -03:00
parent 4b82b83e02
commit 11fd9f1f4a
6 changed files with 193 additions and 30 deletions

12
huffman.h Normal file
View file

@ -0,0 +1,12 @@
struct huffman_node {
int weight;
void *value;
struct huffman_node *left;
struct huffman_node *right;
};
struct huffman_node *huffman_build_tree(void **values, int count);
void *huffman_lookup (struct huffman_node *tree, unsigned char *bits,
int *bits_read);