GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> QSEC / V3-3-1 > qsec_wb / linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

decompress.h File Reference

Lowest-level decompression routines. More...

#include "LDT/APD.h"
#include <stdlib.h>
#include <stdio.h>

Typedefs

typedef struct QSEC_decompression_ QSEC_decompression
 Declaration of the opaque decompression structure.

Functions

void QSEC_clearDecompression (QSEC_decompression *dcm)
 Clear the decompression structrure of any data from a previous cycle.
QSEC_decompressionQSEC_constructDecompression (void *buffer, unsigned int nbits, const char *name)
 Initialise the buffer as a decompression structure.
unsigned int QSEC_decompress (QSEC_decompression *dcm, APD_dtx *dtx)
 Decode the next APE-encoded symbol.
int QSEC_decompressH (QSEC_decompression *dcm, const unsigned int *buff, unsigned int *posn)
 Decode the next Huffman-encoded symbol.
void QSEC_deleteDecompression (QSEC_decompression *dcm)
 Free the memory associated with the decompression structure.
unsigned int QSEC_getCount (QSEC_decompression *dcm)
 Return the number of non-zero bins in the histogram.
QSEC_decompressionQSEC_newDecompression (unsigned int nbits, const char *name)
 Allocate and initialise a new decompression structure.
void QSEC_reportDecompression (QSEC_decompression *dcm, FILE *fp)
 Describe the contents of the decompression structure in formatted ASCII sent to the file fp.
size_t QSEC_sizeofDecompression (unsigned int nbits)
 Calculate the total size required to accomodate a decompression structure.
const unsigned int * QSEC_unpack (QSEC_decompression *dcm, const unsigned int *buf)
 Unpack a histogram used for APE encoding.
const unsigned int * QSEC_unpackH (QSEC_decompression *dcm, const unsigned int *buf)
 Unpack a table used for Huffman encoding.


Detailed Description

Lowest-level decompression routines.

Author:
James Swain & Owen Saxton
Id
decompress.h,v 1.4 2010/08/12 21:58:25 saxton Exp

Function Documentation

void QSEC_clearDecompression ( QSEC_decompression dcm  ) 

Clear the decompression structrure of any data from a previous cycle.

Parameters:
dcm Pointer to an allocated, initialised, decompression structure

References QSEC_decompression_::desc, QSEC_decompression_::freq, QSEC_decompression_::nbits, QSEC_decompression_::rvlu, and QSEC_decompression_::table.

Referenced by QSEC_clearExpansion().

QSEC_decompression* QSEC_constructDecompression ( void *  buffer,
unsigned int  nbits,
const char *  name 
)

Initialise the buffer as a decompression structure.

Parameters:
buffer Pointer to the uninitialised memory to use for this decompression structure
nbits Number of bits in the symbols to be handled by this decompression strcuture
name String identifying this structure
Returns:
Pointer to an initialised decompression structure

References QSEC_decompression_::desc, QSEC_decompression_::freq, QSEC_decompression_::hdd, QSEC_decompression_::name, QSEC_decompression_::nbits, QSEC_decompression_::rvlu, and QSEC_decompression_::table.

Referenced by addDcm(), and QSEC_newDecompression().

unsigned int QSEC_decompress ( QSEC_decompression dcm,
APD_dtx *  dtx 
)

Decode the next APE-encoded symbol.

Parameters:
dcm Pointer to an initialsed, populated and processed decompression structure
dtx Pointer to the arithmetic encoder context
Returns:
The next symbol

References QSEC_decompression_::rvlu, and QSEC_decompression_::table.

Referenced by decodeCalMeans(), and decodeShorts().

int QSEC_decompressH ( QSEC_decompression dcm,
const unsigned int *  buff,
unsigned int *  posn 
)

Decode the next Huffman-encoded symbol.

Parameters:
dcm Pointer to an initialsed, populated and processed decompression structure.
buff Pointer to the buffer being decoded.
posn Pointer to the current bit position in the buffer. Is updated by this routine.
Returns:
The next symbol, which may be negative.

References QSEC_decompression_::hdd.

void QSEC_deleteDecompression ( QSEC_decompression dcm  ) 

Free the memory associated with the decompression structure.

Parameters:
dcm Pointer to an allocated decompression structure

unsigned int QSEC_getCount ( QSEC_decompression dcm  ) 

Return the number of non-zero bins in the histogram.

Parameters:
dcm Pointer to a decompression structure
Returns:
Number of non-zero bins in the histogram

References QSEC_decompression_::desc.

QSEC_decompression* QSEC_newDecompression ( unsigned int  nbits,
const char *  name 
)

Allocate and initialise a new decompression structure.

Parameters:
name String used in the reporting of error to identify a decompression structure
nbits Number of symbols in the complete range of possible symbols (including excluded internal sub-ranges), hence the number of bins in the histogram and frequency tables
Returns:
Pointer to an allocated and initialised QSEC_decompression structure

References QSEC_constructDecompression(), and QSEC_sizeofDecompression().

void QSEC_reportDecompression ( QSEC_decompression dcm,
FILE *  fp 
)

Describe the contents of the decompression structure in formatted ASCII sent to the file fp.

Parameters:
dcm Pointer to the decompression structure
fp Pointer to the file used as the destination

References calc_nbits(), QSEC_decompression_::desc, QSEC_decompression_::freq, QSEC_decompression_::name, QSEC_decompression_::nbits, QSEC_decompression_::rvlu, and QSEC_decompression_::table.

Referenced by QSEC_reportExpansion().

size_t QSEC_sizeofDecompression ( unsigned int  nbits  ) 

Calculate the total size required to accomodate a decompression structure.

Parameters:
nbits Number of symbols in the complete range of possible symbols (including excluded internal sub-ranges), hence the number of bins in the histogram and frequency tables
Returns:
Size of memory block required to accomodate a decompression structure

Referenced by addDcm(), QSEC_newDecompression(), and QSEC_sizeofExpansion().

const unsigned int* QSEC_unpack ( QSEC_decompression dcm,
const unsigned int *  buffer 
)

Unpack a histogram used for APE encoding.

This routine build the necessary lookup and freqency tables by unpacking data from the consignment.

Parameters:
dcm Pointer to an initialsed decompression structure
buffer Pointer to the start of the buffer holding the packed structure
Returns:
Pointer to the next input location or NULL if there is an error in the unpacking

References QSEC_decompression_::desc, QSEC_decompression_::freq, getwrd(), QSEC_decompression_::nbits, QSEC_decompression_::rvlu, and QSEC_decompression_::table.

Referenced by recoverUserAcd(), recoverUserCal(), recoverUserGem(), and recoverUserTkr().

const unsigned int* QSEC_unpackH ( QSEC_decompression dcm,
const unsigned int *  buffer 
)

Unpack a table used for Huffman encoding.

This routine build the necessary tables by unpacking data from the consignment.

Parameters:
dcm Pointer to an initialsed decompression structure
buffer Pointer to the start of the buffer holding the packed structure
Returns:
Pointer to the next input location or NULL if there is an error in the unpacking

References QSEC_decompression_::hdd.

Referenced by recoverUserCal().


Generated on Thu Jan 27 12:57:36 2011 by  doxygen 1.5.8