GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LDT / dev > encdec / rhel6-64
Functions | |
unsigned int | APM_build (unsigned int *table, const unsigned int *freqs, int cnt) |
Creates an appropriately scaled probability table based on the the frequency distribution, f. |
CVS $Id: APM.h,v 1.3 2011/03/25 23:57:13 russell Exp $
unsigned int APM_build | ( | unsigned int * | table, | |
const unsigned int * | f, | |||
int | cnt | |||
) |
Creates an appropriately scaled probability table based on the the frequency distribution, f.
table | The table to be filled out. This must be an array of cnt + 2 values. The first entry is used to hold the number of entries in the table for integrity purposes, and the other extra entry is to hold the sum of the frequencies. | |
f | The frequency distribution of the symbols. There must be one entry, indexed by the symbol value, for each symbol | |
cnt | The number of entries (or the number of symbols, they are equivalent) in f. |
If symbols with a frequency of 0 appear in the input, this code will interpret such symbols as having a small, but finite, possibly of being present in an encoding scheme. Such symbols will be set to the lowest value probability, ensuring that they will get encoded.