GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LSEC / V6-1-0 > lsec / sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

compress.c File Reference

Routines acting upon the compression structure. More...

#include "LSEC/LSEC_msgs.h"
#include "compress_p.h"
#include "LDT/APM.h"
#include "PBS/MBA.h"
#include "MSG/MSG_pubdefs.h"
#include <string.h>

Functions

unsigned LSEC_checkCompression (LSEC_compression *cpr)
 Check if there were errors during the histogram or encode operations.
void LSEC_clearCompression (LSEC_compression *cpr)
 Clear the compression structrure of any data from a previous cycle.
void LSEC_deleteCompression (LSEC_compression *cpr)
 Free the memory associated with the compression structure.
unsigned int LSEC_getBin (LSEC_compression *cpr, unsigned int bin)
 Return the contents of one bin of the histogram.
unsigned int LSEC_getCount (LSEC_compression *cpr)
 Return the number of non-zero bins in the histogram.
LSEC_compressionLSEC_newCompression (unsigned int nbits, const char *name)
 Allocate and initialise a new compression structure.
unsigned * LSEC_pack (LSEC_compression *cpr, unsigned *buffer)
 Pack the tables of a compression structure into a buffer.
size_t LSEC_packedSize32 (LSEC_compression *cpr)
 Calculate the size of a packed compression structure.
unsigned LSEC_process (LSEC_compression *cpr)
 Build the lookup, frequency and probability tables required by the APE.
void LSEC_reportCompression (LSEC_compression *cmp, FILE *fp)
 Describe the contents of a compression structure.
void LSEC_zeroBin (LSEC_compression *cpr, unsigned int bin)
 Set the selected bin of the histogram to zero.


Detailed Description

Routines acting upon the compression structure.

Author:
James Swain & Owen Saxton
Id

Function Documentation

unsigned LSEC_checkCompression ( LSEC_compression cpr  ) 

Check if there were errors during the histogram or encode operations.

Parameters:
cpr Pointer to a compression structure
Return values:
LSEC_SYMOOR If any of the symbols histogrammed or encoded by this compression structure were out of range
LSEC_AWEFAIL If there were any error during the encoding
LSEC_SUCCESS If there were no errors

void LSEC_clearCompression ( LSEC_compression cpr  ) 

Clear the compression structrure of any data from a previous cycle.

Parameters:
cpr Pointer to an allocated, initialised, compression structure

void LSEC_deleteCompression ( LSEC_compression cpr  ) 

Free the memory associated with the compression structure.

Parameters:
cpr Pointer to an allocated compression structure

unsigned int LSEC_getBin ( LSEC_compression cpr,
unsigned int  bin 
)

Return the contents of one bin of the histogram.

Parameters:
cpr Pointer to an allocated, initialised, populated, compression structure
bin ID of one of the bins of the histogram
Returns:
Contents of the bin

unsigned int LSEC_getCount ( LSEC_compression cpr  ) 

Return the number of non-zero bins in the histogram.

Parameters:
cpr Pointer to a compression structure
Returns:
Number of non-zero bins in the histogram

LSEC_compression* LSEC_newCompression ( unsigned int  nbits,
const char *  name 
)

Allocate and initialise a new compression structure.

Parameters:
name String used in the reporting of error to identify a compression structure
nbits Number of symbols in the complete range of possible symbols (including excluded internal sub-ranges), hence the number of bins in the histogram and frequency tables
Returns:
Pointer to an allocated and initialised LSEC_compression structure
The order of calling the functions presented here should be LSEC_newCompression LSEC_histogram - Repeat as necessary LSEC_process LSEC_pack LSEC_compress - Repeat as necessary LSEC_clearCompression : repeat as necessary : LSEC_deleteCompression

unsigned* LSEC_pack ( LSEC_compression cpr,
unsigned *  buffer 
)

Pack the tables of a compression structure into a buffer.

This routine selects sufficient data from the tables of the compression structure to be able to recreate the tables required to decompress the data, and pack it into the consignment

Parameters:
buffer Pointer to the start of the buffer to place the packed structure
cpr Pointer to an initialised, populated and processed compression structure
Returns:
Pointer to the word after this compression structure after packing

size_t LSEC_packedSize32 ( LSEC_compression cpr  ) 

Calculate the size of a packed compression structure.

This routine calculates the number of 32-bit words required to hold the packed compression structure

Parameters:
cpr Pointer to a compression structure
Returns:
Size of the packed compression structure

unsigned LSEC_process ( LSEC_compression cpr  ) 

Build the lookup, frequency and probability tables required by the APE.

Parameters:
cpr Pointer to an allocated, initialised, populated, compression structure
Return values:
LSEC_SUCCESS If the processing goes well

void LSEC_reportCompression ( LSEC_compression cmp,
FILE *  fp 
)

Describe the contents of a compression structure.

This routine formats the compression structure as ASCII text and writes it to the specified file

Parameters:
cmp Pointer to the compression structure
fp Pointer to the file used as the destination

void LSEC_zeroBin ( LSEC_compression cpr,
unsigned int  bin 
)

Set the selected bin of the histogram to zero.

This indicates that this symbol will be selectively removed from the uncompressed data stream before encoding

Parameters:
cpr Pointer to an allocated, initialised, populated, compression structure
bin ID of one of the bins of the histogram


Generated on Thu Aug 20 14:34:11 2009 by  doxygen 1.5.3