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

Constituent: encdec     Tag: mv2304


Interface   Data Structures   File List   Data Fields   Globals  

HDE.h File Reference

Interface to the routines to encodes a distribution of symbols using a Huffman encoding technique. Routines are available to encode both the distribution itself and the resulting Huffman table. More...

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


Data Structures

struct  _HDE_assay
 The result of the histogram assessment. More...

Typedefs

typedef _HDE HDE
 Typedef for struct _HDE.
typedef _HDE_assay HDE_assay
 Typedef for _struct _HDE_assay.

Functions

void * HDE_construct (HDE *hde, unsigned int huffman_nbins)
 Constructs (initializes) the specified HDE structure.
unsigned int HDE_sizeof (unsigned int huffman_nbins)
 Returns the size, in bytes, for a handle to hold a Huffman distribution of huffman_bins.
unsigned int HDE_encodeSS (HDE *hde, unsigned int *buf, unsigned int pos, unsigned int huffman_bins, const unsigned short int *hist, int nbins, const short int *symbols, int nsymbols)
 Encodes the specified symbols symbols using the specified histogram of frequencies. Both the symbols and the histogram are presented as 16-bit values.
const HDE_assayHDE_assayLocate (const HDE *hde)
 Returns a pointer to the publically defined piece of this structure. This can be a one-time call, i.e. for any given HDE structure, this routine always returns the same value.
void HDE_histClearS (const HDE *hde, unsigned short int *hist)
 Clears the histogram using the active bin range stored in the HDE_assay block of the HDE structure.

Detailed Description

Interface to the routines to encodes a distribution of symbols using a Huffman encoding technique. Routines are available to encode both the distribution itself and the resulting Huffman table.

Author:
JJRussell - russell@slac.stanford.edu
   CVS $Id: HDE.h,v 1.2 2006/11/01 21:23:34 russell Exp $

Typedef Documentation

HDE_assay
 

Typedef for _struct _HDE_assay.

Warning:
The user should never allocate this structure. It should only be assessed via a pointer returned from HDE_assayLocate. The information in here is mainly for diagnostic purposes, allowing those outside the package to gain some insight or monitor the HDE's inner workings.
The one exception is that the field members min and cnt can be used to clear the histogram. This allows one to only zero those entries that have non-zero bins. Given that the size of the histogram may be large and that the number of incremented bins may be small, this is a big gain in efficiency. Consider histogramming an 12 bit ADC. A pedestal subtracted histogram could be out to 8192 bins, whereas the actual distribution may be < 100 bins


Function Documentation

const HDE_assay * HDE_assayLocate const HDE hde  ) 
 

Returns a pointer to the publically defined piece of this structure. This can be a one-time call, i.e. for any given HDE structure, this routine always returns the same value.

Returns:
Pointer to the HDE_assay structure
Parameters:
hde The HDE control structure
The information returned is mainly of diagnostic use. However, knowing the min and max bin entry allows one to efficiently clear a previously used histogram.

void HDE_construct HDE hde,
unsigned int  nhuff
 

Constructs (initializes) the specified HDE structure.

Returns:
The next address after this structure.
Parameters:
hde The HDE control structure to construct
nhuff The maximum number of Huffman encoding bins that this control structure is meant to support.
The size of this structure should be acquired by a call to HDE_sizeof. The parameter huffman_nbins must be the same in the call to HDE_sizeof and HDE_construct.

unsigned int HDE_encodeSS HDE hde,
unsigned int *  buf,
unsigned int  pos,
unsigned int  nhuff,
const unsigned short int *  hist,
int  nbins,
const short int *  symbols,
int  nsymbols
 

Encodes the specified symbols symbols using the specified histogram of frequencies. Both the symbols and the histogram are presented as 16-bit values.

Returns:
The updated bit write position
Parameters:
hde The HDE control structure
buf The output buffer address
pos The current write bit offset
nhuff Provides a means to limit the size of the huffman encoding region to a region that is smaller than what was specified during the HDE construction (i.e. the nhuff parameter) The construction value is used, if this value is 0 or larger.
hist The frequency histogram. The histogram is such that it extends -/+ nbins from this pointer. That is, this is the center of the histogram.
nbins The half width of the histogram
symbols The array of symbols
nsymbols The number of symbols

void HDE_histClearS const HDE hde,
unsigned short int *  hist
 

Clears the histogram using the active bin range stored in the HDE_assay block of the HDE structure.

Parameters:
hde The HDE control handle
hist The histogram to clear
This routine must be called after HDE_encodeSS has been called, since it is that routine that sets up the HDE_assay block

unsigned int HDE_sizeof unsigned int  nhuff  ) 
 

Returns the size, in bytes, for a handle to hold a Huffman distribution of huffman_bins.

Parameters:
nhuff The maximum size of the Huffman encoding area Suggested values are small powers of 2 like 32, 64, 128. Note also up to 3 bins may be used to hold describe the underflow, overflow and exception areas. Currently these 3 are mapped into 1 bin, but this may change in a future implementation
For the most part, this only provides a working area. On host-based workstations with expandable stacks, this memory would go on the stack, but, it is too large to do this for embedded systems.


Generated on Thu Dec 7 05:02:30 2006 by  doxygen 1.4.4