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

Constituent: test_huff     Tag: linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

HUFF.h File Reference

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

#include "LDT/BA.h"
#include "PBI/Endianness.h"

Include dependency graph for HUFF.h:

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


Data Structures

struct  _HUFF_code
 Structure to contain the Huffman code, both the bit pattern and its length. More...
struct  _HUFF_symbol_bf
 The information associate with a decoded symbol. More...
union  _HUFF_symbol

Defines

#define HUFF_N_WA(_cnt)   (HUFF_N_HEAP(_cnt) + HUFF_N_PARENTS(_cnt))
 Gives the number of elements needed by the temporary wa array based of the number of elements in the frequency table.
#define HUFF_ENCODE(_out, _buffer, _togo, _codes, _sym)
 Macro to encode one symbol using the specified code table.

Typedefs

typedef _HUFF_dtable HUFF_dtable
typedef _HUFF_code HUFF_code
 Typedef for struct _HUFF_code.
typedef _HUFF_symbol_bf HUFF_symbol_bf
typedef _HUFF_symbol HUFF_symbol

Functions

int HUFF_build (HUFF_code *codes, const unsigned int *freqs, int count, unsigned int *wa)
int HUFF_buildDense (HUFF_code *codes, const unsigned int *freq, const unsigned int *valid, int nvalid, unsigned int *wa)
int HUFF_buildSparse (HUFF_code *codes, const unsigned int *freq, const unsigned int *valid, int nvalid, unsigned int *wa)
int HUFF_bcompress (void *out, unsigned int boff, void *max, const HUFF_code *codes, const unsigned char *in, int cnt, int *unencoded)
int HUFF_size (const HUFF_code *codes, const unsigned int *freqs, int count)
int HUFF_sizeDense (const HUFF_code *codes, const unsigned int *freq, const unsigned int *valid, int nvalid)
int HUFF_sizeSparse (const HUFF_code *codes, const unsigned int *freq, const unsigned int *valid, int nvalid)
int HUFF_dtableSizeof (int nsymbols)
void HUFF_dtableBuild (HUFF_dtable *dtable, const unsigned char *sym_lens, int nsymbols)
void HUFF_dtableBiase (HUFF_dtable *dtable, int biase)
void HUFF_dtablePrint (const HUFF_dtable *dtable)
unsigned int HUFF_decode (const HUFF_dtable *dtable, const unsigned int *src, unsigned int boff)
int HUFF_decompressBytes (unsigned char *dst, int cnt, const void *src, unsigned int boff, const HUFF_dtable *dtable)
int HUFF_decompressShorts (unsigned short int *dst, int cnt, const void *src, unsigned int boff, const HUFF_dtable *dtable)
int HUFF_decompressLongs (unsigned int *dst, int cnt, const void *src, unsigned int boff, const HUFF_dtable *dtable)
void HUFF_codesPrint (const HUFF_code *codes, int ncodes)

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.

Define Documentation

#define HUFF_ENCODE _out,
_buffer,
_togo,
_codes,
_sym   ) 
 

Value:

{                                                         \
    HUFF_code   code = _codes[_sym];                      \
    int          len =  code.len;                         \
    unsigned int pat = code.pat;                          \
    BA_WRITE_R(_out, _buffer, _togo, pat, len);           \
}
Macro to encode one symbol using the specified code table.

Parameters:
_out The output buffer
_buffer The temporary 32-bit staging buffer
_togo The number of bits available in the staging buffer
_codes The list of codes
_sym The symbol/index into the list of codes
This would be much nicer as an inline, but 3 values are potentially modified, _out, _buffer and _togo, possibly making it inefficient since one of more of these values would have to be passed by address.

#define HUFF_N_WA _cnt   )     (HUFF_N_HEAP(_cnt) + HUFF_N_PARENTS(_cnt))
 

Gives the number of elements needed by the temporary wa array based of the number of elements in the frequency table.

Returns:
The number of elements needed by the temporary wa array
Parameters:
_cnt The number of elements in the frequency table.


Generated on Thu Dec 7 04:58:27 2006 by  doxygen 1.4.4