GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > LDT / V0-4-0

Constituent: encdec     Tag: sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

APM.h File Reference

Arithmetic Probability Encoder, interface to the modeling table routines. More...

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


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.

Detailed Description

Arithmetic Probability Encoder, interface to the modeling table routines.

Author:
JJRussell - russell@slac.stanford.edu

   CVS $Id: APM.h,v 1.2 2006/01/24 00:20:23 russell Exp $

Function Documentation

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.

Returns:
The sum of the frequency distribution (not all that interesting)
Parameters:
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.
As a performance hint, symbols that have 0 probability of occurring should not be present in the frequency distribution. In this case, one should define a lookup table mapping only the non-zero values.

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.


Generated on Fri Jun 19 01:48:26 2009 by  doxygen 1.5.3