Classes | Public Member Functions

HuffmanEncodingTree Class Reference

This generates special cases of the huffman encoding tree using 8 bit keys with the additional condition that unused combinations of 8 bits are treated as a frequency of 1. More...

#include <DS_HuffmanEncodingTree.h>

Collaboration diagram for HuffmanEncodingTree:
Collaboration graph
[legend]

List of all members.

Classes

struct  CharacterEncoding
 Used to hold bit encoding for one character.

Public Member Functions

 HuffmanEncodingTree ()
 ~HuffmanEncodingTree ()
void EncodeArray (unsigned char *input, size_t sizeInBytes, RakNet::BitStream *output)
 Pass an array of bytes to array and a preallocated BitStream to receive the output.
unsigned DecodeArray (RakNet::BitStream *input, BitSize_t sizeInBits, size_t maxCharsToWrite, unsigned char *output)
void DecodeArray (unsigned char *input, BitSize_t sizeInBits, RakNet::BitStream *output)
void GenerateFromFrequencyTable (unsigned int frequencyTable[256])
 Given a frequency table of 256 elements, all with a frequency of 1 or more, generate the tree.
void FreeMemory (void)
 Free the memory used by the tree.

Detailed Description

This generates special cases of the huffman encoding tree using 8 bit keys with the additional condition that unused combinations of 8 bits are treated as a frequency of 1.

Definition at line 19 of file DS_HuffmanEncodingTree.h.


Constructor & Destructor Documentation

HuffmanEncodingTree::HuffmanEncodingTree (  ) 

Definition at line 17 of file DS_HuffmanEncodingTree.cpp.

HuffmanEncodingTree::~HuffmanEncodingTree (  ) 

Definition at line 22 of file DS_HuffmanEncodingTree.cpp.

Here is the call graph for this function:


Member Function Documentation

unsigned HuffmanEncodingTree::DecodeArray ( RakNet::BitStream input,
BitSize_t  sizeInBits,
size_t  maxCharsToWrite,
unsigned char *  output 
)

Definition at line 197 of file DS_HuffmanEncodingTree.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void HuffmanEncodingTree::DecodeArray ( unsigned char *  input,
BitSize_t  sizeInBits,
RakNet::BitStream output 
)

Definition at line 230 of file DS_HuffmanEncodingTree.cpp.

Here is the call graph for this function:

void HuffmanEncodingTree::EncodeArray ( unsigned char *  input,
size_t  sizeInBytes,
RakNet::BitStream output 
)

Pass an array of bytes to array and a preallocated BitStream to receive the output.

Parameters:
[in] input Array of bytes to encode
[in] sizeInBytes size of input
[out] output The bitstream to write to

Definition at line 166 of file DS_HuffmanEncodingTree.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void HuffmanEncodingTree::FreeMemory ( void   ) 

Free the memory used by the tree.

Definition at line 27 of file DS_HuffmanEncodingTree.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void HuffmanEncodingTree::GenerateFromFrequencyTable ( unsigned int  frequencyTable[256]  ) 

Given a frequency table of 256 elements, all with a frequency of 1 or more, generate the tree.

Definition at line 63 of file DS_HuffmanEncodingTree.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files: