GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > LDT / V0-0-0

Constituent: encdec     Tag: linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

HUFF.h File Reference

Huffman Encode/Decode, interface file. More...

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Data Structures

struct  _HUFF_code
 Huffman code for a symbol. More...

struct  _HUFF_node
 Node in a Huffman tree. More...


Typedefs

typedef _HUFF_node HUFF_node
 Typedef for struct _HUFF_node.

typedef _HUFF_code HUFF_code
 Typedef for struct _HUFF_code.


Functions

void HUFF_accumulate (int *freqs, const unsigned char *original, int size)
 Accumulates the frequency distribution.

int HUFF_build (HUFF_code *table, const int *freqs, int count)
 Builds a Huffman code table from the input frequency distribution.

int HUFF_compress (const unsigned char *original, int size, const HUFF_code *table, unsigned char **compressed)
 Compresses the input array original into the output array.

int HUFF_size (const HUFF_code *table, const int *freqs, int count)
 Computes the size, in bits, of the specified encode freqs.

int HUFF_uncompress (const unsigned char *compressed, unsigned char **original)
 Decompresses the input byte stream compressed.


Detailed Description

Huffman Encode/Decode, interface file.

Author:
JJRussell - russell@slac.stanford.edu

CVS $Id

Warning:
In their current state, these routines are not fit for Flight use. They can be used to determine compression factors and, in general, study the properties of Huffman encoding/decoding. However, they malloc all over the place and involve recursive calling techniques, neither of is appropriate for Flight code.

Function Documentation

void HUFF_accumulate int *  freqs,
const unsigned char *  original,
int  size
 

Accumulates the frequency distribution.

Parameters:
freqs The accumulated and appropriately scaled frequency distribution. Must be at 256 characters in width
original The input set of characters. The distribution is created from this set
size The number of characters in original

int HUFF_build HUFF_code table,
const int *  freqs,
int  count
 

Builds a Huffman code table from the input frequency distribution.

Returns:
Status
Parameters:
table The table, must have at least count elements
freqs The frequency distribution
count The number of elements in the frequency distribution

Here is the call graph for this function:

int HUFF_compress const unsigned char *  original,
int  size,
const HUFF_code table,
unsigned char **  compressed
 

Compresses the input array original into the output array.

Returns:
Size of the compressed data in bytes.
Parameters:
original The array of bytes to compress
size The number of bytes in original to compress
table A previously built Huffman table used to encode the data
compressed Returned as a pointer to the compressed data

int HUFF_size const HUFF_code table,
const int *  freqs,
int  count
 

Computes the size, in bits, of the specified encode freqs.

Returns:
The size in bits.
Parameters:
table The table, must have at least count elements
freqs The frequency distribution
count The number of elements in the frequency distribution

int HUFF_uncompress const unsigned char *  compressed,
unsigned char **  original
 

Decompresses the input byte stream compressed.

Returns:
The number of decompressed bytes, i.e. the size of original
Parameters:
compressed The compressed bit stream
original Returned as a pointer to the decompressed data

Here is the call graph for this function:


Generated on Sat Sep 24 20:25:58 2005 by doxygen 1.3.3