altEngine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Functions
huffman.c File Reference
#include "huffman.h"
Include dependency graph for huffman.c:

Classes

struct  _huffman_node
 
struct  _huffman_encode_table
 

Functions

static void _huffman_write_tree_and_make_encode_table (unsigned char *out, unsigned long *outbitctr, unsigned long outlen, struct _huffman_encode_table *et, unsigned long code, unsigned int bits, struct _huffman_node *t)
 
static struct _huffman_node_huffman_read_tree (const unsigned char *in, unsigned long *inbitctr, unsigned long inlen, unsigned char **heapptr, unsigned char *heapend)
 
unsigned long huffman_compress (const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long outlen, void *huffheap)
 
unsigned long huffman_decompress (const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long outlen, void *huffheap)
 

Function Documentation

static struct _huffman_node* _huffman_read_tree ( const unsigned char *  in,
unsigned long *  inbitctr,
unsigned long  inlen,
unsigned char **  heapptr,
unsigned char *  heapend 
)
staticread

Here is the caller graph for this function:

static void _huffman_write_tree_and_make_encode_table ( unsigned char *  out,
unsigned long *  outbitctr,
unsigned long  outlen,
struct _huffman_encode_table et,
unsigned long  code,
unsigned int  bits,
struct _huffman_node t 
)
static

Here is the caller graph for this function:

unsigned long huffman_compress ( const unsigned char *  in,
unsigned long  inlen,
unsigned char *  out,
unsigned long  outlen,
void *  huffheap 
)

Huffman encode a block of data

Parameters
inInput data
inlenInput data length
outOutput buffer
outlenOutput buffer length
huffheapHeap memory to use for compression (must be HUFFHEAP_SIZE in size)
Returns
Size of encoded result or 0 on out buffer overrun

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned long huffman_decompress ( const unsigned char *  in,
unsigned long  inlen,
unsigned char *  out,
unsigned long  outlen,
void *  huffheap 
)

Huffman decode a block of data

Parameters
inInput data
inlenLength of input data
outOutput buffer
outlenLength of output buffer
huffheapHeap memory to use for decompression (must be HUFFHEAP_SIZE in size)
Returns
Size of decoded result or 0 on out buffer overrun or corrupt input data

Here is the call graph for this function:

Here is the caller graph for this function: