GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LSEC / dev > lsec / rhel5-64


Interface   Data Structures   File List   Data Fields   Globals  

compress.ic File Reference

The histogram and compress functions, as static inlines for efficiency. More...

#include <compress.h>
#include <LSEC_p.h>
#include <LDT/APE.h>
#include <LDT/HDE.h>

Functions

static __inline void LSEC_compress (LSEC_compression *cpr, void *ctx, unsigned int sym)
static __inline unsigned LSEC_compressH (LSEC_compression *cpr, int sym, unsigned int *buf, unsigned int pos)
 Encode a symbol using the Huffman table supplied by a compression.
static __inline void LSEC_histogram (LSEC_compression *cpr, int sym)
 Increment the bin of a histogram.
static __inline void LSEC_histogramH (LSEC_compression *cpr, int sym)
 Increment the bin of a Huffman histogram.
void LSEC_compress (LSEC_compression *cpr, void *ctx, unsigned sym)
 Encode a symbol using the frequency and lookup table supplied by a compression.


Detailed Description

The histogram and compress functions, as static inlines for efficiency.

Author:
James Swain & Owen Saxton
$Id: compress.ic,v 1.9 2011/03/27 17:48:20 saxton Exp $

Function Documentation

void LSEC_compress ( LSEC_compression cpr,
void *  ctx,
unsigned  sym 
)

Encode a symbol using the frequency and lookup table supplied by a compression.

This function does not return errors since propogation of those errors to a point in LSEC where reasonable decisions about error handling can be made is problematic. Instead, errors are latched and can be checked using LSEC_checkCompression.

Parameters:
cpr Pointer to an initialsed, populated and processed compression structure
ctx Context, pointer to the arithmetic encoder context
sym Symbol to compress

References _LSEC_compression::encerr, _LSEC_compression::fwlu, _LSEC_compression::mask, _LSEC_compression::ovrflw, and _LSEC_compression::table.

unsigned LSEC_compressH ( LSEC_compression cpr,
int  sym,
unsigned int *  buf,
unsigned int  pos 
) [static]

Encode a symbol using the Huffman table supplied by a compression.

This function does not check for errors since only a programming error could cause one, and speed is of the essence.

Parameters:
cpr Pointer to an initialsed, populated and processed compression structure
sym Symbol to compress
buf The address of the buffer to hold the encoded value.
pos The current bit position within the buffer.
Returns:
The updated bit position within buf.

References _LSEC_compression::hde.

Referenced by LSEC_encodeCal().

void LSEC_histogram ( LSEC_compression cpr,
int  sym 
) [static]

Increment the bin of a histogram.

Parameters:
cpr Pointer to an allocated, initialised, compression structure
sym Symbol to add to the histogram
This function does not return errors since propogation of those errors to a point in LSEC where reasonable decisions about error handling can be made is problematic. Instead, errors are latched and can be checked using LSEC_checkCompression.

References _LSEC_compression::hist, _LSEC_compression::mask, and _LSEC_compression::ovrflw.

Referenced by LSEC_histoCalMeans().

void LSEC_histogramH ( LSEC_compression cpr,
int  sym 
) [static]

Increment the bin of a Huffman histogram.

Parameters:
cpr Pointer to an allocated, initialised, compression structure
sym Symbol to add to the histogram
This function does not check for errors.

References _LSEC_compression::hist0.

Referenced by LSEC_histogramCal().


Generated on Mon Mar 28 10:58:03 2011 by  doxygen 1.5.8