GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > LDT / V0-3-3
Constituent: encdec     Tag: sun-gcc
#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 for struct _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) |
Builds the code table directly from the specified frequency array. | |
int | HUFF_buildDense (HUFF_code *codes, const unsigned int *freq, const unsigned int *valid, int nvalid, unsigned int *wa) |
Builds a dense list, that is the resulting code list is indexed in a space that is dense in the valid element numbering scheme. | |
int | HUFF_buildSparse (HUFF_code *codes, const unsigned int *freq, const unsigned int *valid, int nvalid, unsigned int *wa) |
Builds a sparse code list. That is the resulting code list is indexed in the same manner as the frequency array. Contrast this with HUFF_buildDense, where the resulting code list is indexed in the same manner as the valid array. Note that because the non-valid elements are not filled in, it is the caller's responsibility to avoid accessing these elements. | |
int | HUFF_bcompress (void *out, unsigned int boff, void *max, const HUFF_code *codes, const unsigned char *in, int cnt, int *unencoded) |
Convenience routine to compress a byte stream. | |
int | HUFF_size (const HUFF_code *codes, const unsigned int *freqs, int count) |
Computes the size, in bits, of the specified encode freqs. | |
int | HUFF_sizeDense (const HUFF_code *codes, const unsigned int *freq, const unsigned int *valid, int nvalid) |
Sizes the given frequency array using the specified code list. the code list is a dense list of the valid members. The valid members are specified either by the non-zero elements in the frequency array or the valid array. | |
int | HUFF_sizeSparse (const HUFF_code *codes, const unsigned int *freq, const unsigned int *valid, int nvalid) |
Sizes the given frequency array using the specified code list. the code list is a sparse list of the valid members. The valid members are specified either by the non-zero elements in the frequency array or the valid array. | |
int | HUFF_dtableSizeof (int nsymbols) |
Returns the size, in bytes, of the decoding table needed for the specified number of symbols. | |
void | HUFF_dtableBuild (HUFF_dtable *dtable, const unsigned char *sym_lens, int nsymbols) |
Construct a decoding table based on the lengths of symbols This constructs the huffman codes in the canonical form. | |
void | HUFF_dtableBiase (HUFF_dtable *dtable, int biase) |
Biases a previously constructed table by the amount specified. That is, an unbiased symbol value of 0, will be biased to the value specified by biase. | |
void | HUFF_dtablePrint (const HUFF_dtable *dtable) |
Provides an ASCII display of the decoding table. This is usually for debugging or diagnostic purposes. | |
unsigned int | HUFF_decode (const HUFF_dtable *dtable, const unsigned int *src, unsigned int boff) |
Decodes one symbol from the input bit source. | |
int | HUFF_decompressBytes (unsigned char *dst, int cnt, const void *src, unsigned int boff, const HUFF_dtable *dtable) |
Convenience routine to decode a bit stream using the specified table into a byte array. | |
int | HUFF_decompressShorts (unsigned short int *dst, int cnt, const void *src, unsigned int boff, const HUFF_dtable *dtable) |
Convenience routine to decode a bit stream using the specified table into a unsigned short array. | |
int | HUFF_decompressLongs (unsigned int *dst, int cnt, const void *src, unsigned int boff, const HUFF_dtable *dtable) |
Convenience routine to decode a bit stream using the specified table into a unsigned short array. | |
void | HUFF_codesPrint (const HUFF_code *codes, int ncodes) |
Prints an ASCII display of the specified codes. |
CVS $Id
|
Value: { \ HUFF_code code = _codes[_sym]; \ int len = code.len; \ unsigned int pat = code.pat; \ BA_WRITE_R(_out, _buffer, _togo, pat, len); \ }
|
|
Gives the number of elements needed by the temporary wa array based of the number of elements in the frequency table.
|
|
Convenience routine to compress a byte stream.
|
|
Builds the code table directly from the specified frequency array.
// // If some elements of the frequency array are 0, the working area // may be dimensioned smaller, however, by specifying the maximum // possible, one can do this a compile-time, avoiding run-time // allocations. // int freq[30]; HUFF_code codes[30]; int wa[HUFF_N_WA(30)]; accumulate (freqs, ....); dcnt = HUFF_build (codes, freq, 30, wa); |
|
Builds a dense list, that is the resulting code list is indexed in a space that is dense in the valid element numbering scheme.
|
|
Builds a sparse code list. That is the resulting code list is indexed in the same manner as the frequency array. Contrast this with HUFF_buildDense, where the resulting code list is indexed in the same manner as the valid array. Note that because the non-valid elements are not filled in, it is the caller's responsibility to avoid accessing these elements.
|
|
Prints an ASCII display of the specified codes.
|
|
Decodes one symbol from the input bit source.
|
|
Convenience routine to decode a bit stream using the specified table into a byte array.
|
|
Convenience routine to decode a bit stream using the specified table into a unsigned short array.
|
|
Convenience routine to decode a bit stream using the specified table into a unsigned short array.
|
|
Biases a previously constructed table by the amount specified. That is, an unbiased symbol value of 0, will be biased to the value specified by biase.
|
|
Construct a decoding table based on the lengths of symbols This constructs the huffman codes in the canonical form.
|
|
Provides an ASCII display of the decoding table. This is usually for debugging or diagnostic purposes.
|
|
Returns the size, in bytes, of the decoding table needed for the specified number of symbols.
|
|
Computes the size, in bits, of the specified encode freqs.
|
|
Sizes the given frequency array using the specified code list. the code list is a dense list of the valid members. The valid members are specified either by the non-zero elements in the frequency array or the valid array.
If valid array is specified as NULL, then only the non-zero elements of freq are considered valid.
|
|
Sizes the given frequency array using the specified code list. the code list is a sparse list of the valid members. The valid members are specified either by the non-zero elements in the frequency array or the valid array.
If valid array is specified as NULL, then only the non-zero elements of freq are considered valid.
|