GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > LDT / V0-3-4
Constituent: encdec_unit_test     Tag: sun-gcc
#include "LDT/APM.h"
#include "LDT/APE.h"
#include "LDT/APD.h"
#include "LDT/HUFF.h"
#include "PBS/TMR.h"
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <math.h>
Include dependency graph for encdec_unit_test.c:
Data Structures | |
struct | _Ctl |
struct | _MethodCommon |
struct | _MethodResult |
struct | _Test |
Typedefs | |
typedef enum _Options | Options |
typedef _Ctl | Ctl |
typedef _MethodCommon | MethodCommon |
typedef _MethodResult | MethodResult |
typedef _Test | Test |
Enumerations | |
enum | _Options { OPT_M_HCODE = 0x1 } |
Functions | |
int | test_conductor (int argc, char **argv) |
Tests the Arithmetic Probability and Huffman Encoding/Decoding for byte-sized tables. | |
static int | test_driver (const char *banner, unsigned int options, const int *freqs, int nfreqs, const unsigned char *symbols, int nsymbols, unsigned int *table, unsigned char *ebuf, unsigned int esiz, unsigned char *dbuf, unsigned int dsiz) |
Does a of the Arithmetic Probability Encoding and Huffman encoders using a byte-wide table. | |
static int | cheap_testA (unsigned int options) |
Cheap test of the encode/decode of a test distribution. | |
static int | cheap_test0 (unsigned int options) |
Cheap test of the encode/decode of a test distribution. | |
static int | cheap_test1 (unsigned int options) |
Cheap test of the encode/decode of a test distribution. | |
static int | cheap_test2 (unsigned int options) |
Cheap test of the encode/decode of a test distribution. This uses a table with an odd number of symbols, just to make sure that the binary search in the symbol lookup does not have problems. | |
static int | cheap_test3 (unsigned int options) |
Cheap test of the encode/decode of a test distribution. | |
static int | cheap_test4 (unsigned int options) |
Cheap test of the encode/decode of a test distribution. | |
static int | ap_composite_test (unsigned int options) |
Composite test of byte encoder. | |
static int | ap_file_test (const char *fileName, unsigned int options) |
Tests the encoding/decoding of the specified file. | |
static int | ap_self_encdec (const char *banner, unsigned int options, const unsigned char *symbols, int nsymbols) |
Encodes, then decodes the specified set of symbols. | |
static int | ap_test (MethodResult *result, const int *freqs, int nfreqs, const unsigned char *symbols, int nsymbols, unsigned int *table, unsigned char *ebuf, unsigned int esiz, unsigned char *dbuf, unsigned int dsiz) |
static int | huff_test (MethodResult *result, const unsigned int *freqs, int nfreqs, const unsigned char *symbols, int nsymbols, unsigned int *table, unsigned char *ebuf, unsigned int esiz, unsigned char *dbuf, unsigned int dsiz) |
static int | check (const unsigned int *table) |
static unsigned int | get_ctl (Ctl *ctl, int argc, char *const argv[]) |
Examines the command line parameters and fills in the test control structure. | |
static unsigned const char * | get_contents (const char *fileName, int *rsize) |
Reads in the specified file. | |
static void | report_test (const Test *test, unsigned int options) |
static double | get_byte_esize (const unsigned int *freqs, int nfreqs, const unsigned char *samples, int nsamples) |
Calculates the size, in bits, of the sample distribution based on the specified frequency table. | |
int | main (int argc, char **argv) |
Main program, it takes no arguments. | |
Variables | |
const unsigned int | Freqs [] |
Frequency distribution used in many of the tests. |
CVS $Id: encdec_unit_test.c,v 1.4 2006/11/01 21:23:34 russell Exp $
|
|
|
Composite test of byte encoder.
|
|
Tests the encoding/decoding of the specified file.
|
|
Encodes, then decodes the specified set of symbols.
|
|
Cheap test of the encode/decode of a test distribution.
|
|
Cheap test of the encode/decode of a test distribution.
|
|
Cheap test of the encode/decode of a test distribution. This uses a table with an odd number of symbols, just to make sure that the binary search in the symbol lookup does not have problems.
|
|
Cheap test of the encode/decode of a test distribution.
|
|
Cheap test of the encode/decode of a test distribution.
|
|
Cheap test of the encode/decode of a test distribution.
|
|
printf ("Symbol = %d\n", sym1); |
|
Calculates the size, in bits, of the sample distribution based on the specified frequency table.
|
|
Reads in the specified file.
|
|
Examines the command line parameters and fills in the test control structure.
|
|
Main program, it takes no arguments.
|
|
Tests the Arithmetic Probability and Huffman Encoding/Decoding for byte-sized tables.
|
|
Does a of the Arithmetic Probability Encoding and Huffman encoders using a byte-wide table.
|
|
Initial value: { 1195, 190, 102, 160, 187, 64, 157, 405, 1 }
|