GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > QSEC / V2-0-0
Constituent: qsec     Tag: linux-gcc
#include "decompress_p.h"
#include "LDT/APM.h"
#include <string.h>
#include <math.h>
Include dependency graph for decompress.c:
Functions | |
static const unsigned * | getwrd (const unsigned *buffer, unsigned *bcnt, unsigned *word, unsigned nbits) |
Get bits from a buffer. | |
double | calc_nbits (const int *f, int cnt, int tot) |
Calculate the number of bits need to encode a sample with the specified frequency distribution. | |
size_t | QSEC_sizeofDecompression (unsigned int nbits) |
Calculate the total size required to accomodate a decompression structure. | |
QSEC_decompression * | QSEC_constructDecompression (void *buffer, unsigned int nbits, const char *name) |
Initialise the buffer as a decompression structure. | |
QSEC_decompression * | QSEC_newDecompression (unsigned int nbits, const char *name) |
Allocate and initialise a new decompression structure. | |
void | QSEC_deleteDecompression (QSEC_decompression *dcm) |
Free the memory associated with the decompression structure. | |
void | QSEC_clearDecompression (QSEC_decompression *dcm) |
Clear the decompression structrure of any data from a previous cycle. | |
unsigned int | QSEC_getCount (QSEC_decompression *dcm) |
Return the number of non-zero bins in the histogram. | |
const unsigned int * | QSEC_unpack (QSEC_decompression *dcm, const unsigned int *buffer) |
Build the lookup and freqency tables by retrieving and unpacking data from the consignment. | |
unsigned | QSEC_decompress (QSEC_decompression *dcm, APD_dtx *dtx) |
Decode the next symbol. | |
void | QSEC_reportDecompression (QSEC_decompression *dcm, FILE *fp) |
Describe the contents of the decompression structure in formatted ASCII send to the file fp. |
|
Calculate the number of bits need to encode a sample with the specified frequency distribution. This is based on the following formula nbits = - TOT * SUM [ f[i] / TOT * ln (f[i] / TOT) ] = - TOT/TOT * SUM [ f[i] * (ln (f[i]) - ln (TOT)) ] = - SUM [ f[i] * ln (f[i] ] + SUM [ f[i] * ln (TOT) ] = - SUM [ f[i] * ln (f[i] ] + TOT * ln (TOT) ]
|
|
Get bits from a buffer.
|
|
Clear the decompression structrure of any data from a previous cycle.
|
|
Initialise the buffer as a decompression structure.
|
|
Decode the next symbol.
|
|
Free the memory associated with the decompression structure.
|
|
Return the number of non-zero bins in the histogram.
|
|
Allocate and initialise a new decompression structure.
|
|
Describe the contents of the decompression structure in formatted ASCII send to the file fp.
|
|
Calculate the total size required to accomodate a decompression structure.
|
|
Build the lookup and freqency tables by retrieving and unpacking data from the consignment.
|