GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > LDT / V0-2-0
Constituent: encdec     Tag: rad750
#include "LDT/HDE.h"
#include "LDT/HUFF.h"
#include "LDT/BFP.h"
#include "ffs.h"
#include "dprintf.h"
#include <math.h>
Include dependency graph for HDE.c:
Data Structures | |
struct | _HistLimits |
Min and Max indices of a histogram. More... | |
Defines | |
#define | NULL ((void *)(0)) |
Typedefs | |
typedef _HistLimits | HistLimits |
Typedef for struct _HistLimits. | |
Functions | |
static __inline HistLimits | hist_limits_find (const unsigned short int *hist, int cnt) |
static __inline int | hist_copy (unsigned int *dst, const unsigned short int *src, int min, int max) |
Copies the core of the histogram (i.e. from the first non-zero element to the last non-zero element. | |
static __inline unsigned int | huff_table_encode (unsigned int *buf, unsigned int pos, const HUFF_code *codes, const unsigned int *freq, int nentries, int nbits_min, int min) |
Encodes the Huffman encoding table. | |
static __inline unsigned int | huff_symbols_encode (unsigned int *buf, unsigned int pos, const HUFF_code *codes, const short int *symbols, int nsymbols) |
Encodes the pedestal subtracted ADC values using the specified Huffman codes. | |
_declare (static double calc_nbits(const int *f, int cnt, int tot)) | |
unsigned int | HDE_encodeSS (unsigned int *buf, unsigned int pos, 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. | |
double | calc_nbits (const int *f, int cnt, int tot) |
Calculates the number of bits need to encode a sample with the specified frequency distribution. |
CVS $Id: HDE.c,v 1.2 2006/09/13 17:58:41 russell Exp $
|
Typedef for struct _HistLimits. cal_hist_limits_find (const unsigned short int *hist, int cnt)
|
|
Calculates the number of bits need to encode a sample with the specified frequency distribution.
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) ] |
|
Encodes the specified symbols symbols using the specified histogram of frequencies. Both the symbols and the histogram are presented as 16-bit values.
|
|
Copies the core of the histogram (i.e. from the first non-zero element to the last non-zero element.
|
|
Encodes the pedestal subtracted ADC values using the specified Huffman codes.
|
|
Encodes the Huffman encoding table.
|