doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
idCompressor_Huffman Class Reference
Inheritance diagram for idCompressor_Huffman:
idCompressor_None idCompressor idFile

Public Member Functions

 idCompressor_Huffman (void)
 
void Init (idFile *f, bool compress, int wordLength)
 
void FinishCompress (void)
 
float GetCompressionRatio (void) const
 
int Write (const void *inData, int inLength)
 
int Read (void *outData, int outLength)
 
- Public Member Functions inherited from idCompressor_None
 idCompressor_None (void)
 
const char * GetName (void)
 
const char * GetFullPath (void)
 
int Length (void)
 
ID_TIME_T Timestamp (void)
 
int Tell (void)
 
void ForceFlush (void)
 
void Flush (void)
 
int Seek (long offset, fsOrigin_t origin)
 
- Public Member Functions inherited from idFile
virtual ~idFile (void)
 
virtual void Rewind (void)
 
virtual int Printf (const char *fmt,...) id_attribute((format(printf
 
virtual int virtual int VPrintf (const char *fmt, va_list arg)
 
virtual int WriteFloatString (const char *fmt,...) id_attribute((format(printf
 
virtual int virtual int ReadInt (int &value)
 
virtual int ReadUnsignedInt (unsigned int &value)
 
virtual int ReadShort (short &value)
 
virtual int ReadUnsignedShort (unsigned short &value)
 
virtual int ReadChar (char &value)
 
virtual int ReadUnsignedChar (unsigned char &value)
 
virtual int ReadFloat (float &value)
 
virtual int ReadBool (bool &value)
 
virtual int ReadString (idStr &string)
 
virtual int ReadVec2 (idVec2 &vec)
 
virtual int ReadVec3 (idVec3 &vec)
 
virtual int ReadVec4 (idVec4 &vec)
 
virtual int ReadVec6 (idVec6 &vec)
 
virtual int ReadMat3 (idMat3 &mat)
 
virtual int WriteInt (const int value)
 
virtual int WriteUnsignedInt (const unsigned int value)
 
virtual int WriteShort (const short value)
 
virtual int WriteUnsignedShort (unsigned short value)
 
virtual int WriteChar (const char value)
 
virtual int WriteUnsignedChar (const unsigned char value)
 
virtual int WriteFloat (const float value)
 
virtual int WriteBool (const bool value)
 
virtual int WriteString (const char *string)
 
virtual int WriteVec2 (const idVec2 &vec)
 
virtual int WriteVec3 (const idVec3 &vec)
 
virtual int WriteVec4 (const idVec4 &vec)
 
virtual int WriteVec6 (const idVec6 &vec)
 
virtual int WriteMat3 (const idMat3 &mat)
 

Private Member Functions

void AddRef (byte ch)
 
int Receive (huffmanNode_t *node, int *ch)
 
void Transmit (int ch, byte *fout)
 
void PutBit (int bit, byte *fout, int *offset)
 
int GetBit (byte *fout, int *offset)
 
void Add_bit (char bit, byte *fout)
 
int Get_bit ()
 
huffmanNode_t ** Get_ppnode ()
 
void Free_ppnode (huffmanNode_t **ppnode)
 
void Swap (huffmanNode_t *node1, huffmanNode_t *node2)
 
void Swaplist (huffmanNode_t *node1, huffmanNode_t *node2)
 
void Increment (huffmanNode_t *node)
 
void Send (huffmanNode_t *node, huffmanNode_t *child, byte *fout)
 

Private Attributes

byte seq [65536]
 
int bloc
 
int blocMax
 
int blocIn
 
int blocNode
 
int blocPtrs
 
int compressedSize
 
int unCompressedSize
 
huffmanNode_ttree
 
huffmanNode_tlhead
 
huffmanNode_tltail
 
huffmanNode_tloc [HMAX+1]
 
huffmanNode_t ** freelist
 
huffmanNode_t nodeList [768]
 
huffmanNode_tnodePtrs [768]
 

Additional Inherited Members

- Static Public Member Functions inherited from idCompressor
static idCompressorAllocNoCompression (void)
 
static idCompressorAllocBitStream (void)
 
static idCompressorAllocRunLength (void)
 
static idCompressorAllocRunLength_ZeroBased (void)
 
static idCompressorAllocHuffman (void)
 
static idCompressorAllocArithmetic (void)
 
static idCompressorAllocLZSS (void)
 
static idCompressorAllocLZSS_WordAligned (void)
 
static idCompressorAllocLZW (void)
 
- Protected Attributes inherited from idCompressor_None
idFilefile
 
bool compress
 

Detailed Description

Definition at line 819 of file Compressor.cpp.

Constructor & Destructor Documentation

idCompressor_Huffman::idCompressor_Huffman ( void  )
inline

Definition at line 821 of file Compressor.cpp.

Member Function Documentation

void idCompressor_Huffman::Add_bit ( char  bit,
byte fout 
)
private

Definition at line 952 of file Compressor.cpp.

void idCompressor_Huffman::AddRef ( byte  ch)
private

Definition at line 1130 of file Compressor.cpp.

void idCompressor_Huffman::FinishCompress ( void  )
virtual

Reimplemented from idCompressor_None.

Definition at line 1294 of file Compressor.cpp.

void idCompressor_Huffman::Free_ppnode ( huffmanNode_t **  ppnode)
private

Definition at line 1002 of file Compressor.cpp.

int idCompressor_Huffman::Get_bit ( )
private

Definition at line 967 of file Compressor.cpp.

huffmanNode_t ** idCompressor_Huffman::Get_ppnode ( )
private

Definition at line 986 of file Compressor.cpp.

int idCompressor_Huffman::GetBit ( byte fout,
int offset 
)
private

Definition at line 936 of file Compressor.cpp.

float idCompressor_Huffman::GetCompressionRatio ( void  ) const
virtual

Reimplemented from idCompressor_None.

Definition at line 1353 of file Compressor.cpp.

void idCompressor_Huffman::Increment ( huffmanNode_t node)
private

Definition at line 1087 of file Compressor.cpp.

void idCompressor_Huffman::Init ( idFile f,
bool  compress,
int  wordLength 
)
virtual

Reimplemented from idCompressor_None.

Definition at line 872 of file Compressor.cpp.

void idCompressor_Huffman::PutBit ( int  bit,
byte fout,
int offset 
)
private

Definition at line 921 of file Compressor.cpp.

int idCompressor_Huffman::Read ( void outData,
int  outLength 
)
virtual

Reimplemented from idCompressor_None.

Definition at line 1313 of file Compressor.cpp.

int idCompressor_Huffman::Receive ( huffmanNode_t node,
int ch 
)
private

Definition at line 1206 of file Compressor.cpp.

void idCompressor_Huffman::Send ( huffmanNode_t node,
huffmanNode_t child,
byte fout 
)
private

Definition at line 1227 of file Compressor.cpp.

void idCompressor_Huffman::Swap ( huffmanNode_t node1,
huffmanNode_t node2 
)
private

Definition at line 1014 of file Compressor.cpp.

void idCompressor_Huffman::Swaplist ( huffmanNode_t node1,
huffmanNode_t node2 
)
private

Definition at line 1051 of file Compressor.cpp.

void idCompressor_Huffman::Transmit ( int  ch,
byte fout 
)
private

Definition at line 1247 of file Compressor.cpp.

int idCompressor_Huffman::Write ( const void inData,
int  inLength 
)
virtual

Reimplemented from idCompressor_None.

Definition at line 1265 of file Compressor.cpp.

Member Data Documentation

int idCompressor_Huffman::bloc
private

Definition at line 832 of file Compressor.cpp.

int idCompressor_Huffman::blocIn
private

Definition at line 834 of file Compressor.cpp.

int idCompressor_Huffman::blocMax
private

Definition at line 833 of file Compressor.cpp.

int idCompressor_Huffman::blocNode
private

Definition at line 835 of file Compressor.cpp.

int idCompressor_Huffman::blocPtrs
private

Definition at line 836 of file Compressor.cpp.

int idCompressor_Huffman::compressedSize
private

Definition at line 838 of file Compressor.cpp.

huffmanNode_t** idCompressor_Huffman::freelist
private

Definition at line 845 of file Compressor.cpp.

huffmanNode_t* idCompressor_Huffman::lhead
private

Definition at line 842 of file Compressor.cpp.

huffmanNode_t* idCompressor_Huffman::loc[HMAX+1]
private

Definition at line 844 of file Compressor.cpp.

huffmanNode_t* idCompressor_Huffman::ltail
private

Definition at line 843 of file Compressor.cpp.

huffmanNode_t idCompressor_Huffman::nodeList[768]
private

Definition at line 847 of file Compressor.cpp.

huffmanNode_t* idCompressor_Huffman::nodePtrs[768]
private

Definition at line 848 of file Compressor.cpp.

byte idCompressor_Huffman::seq[65536]
private

Definition at line 831 of file Compressor.cpp.

huffmanNode_t* idCompressor_Huffman::tree
private

Definition at line 841 of file Compressor.cpp.

int idCompressor_Huffman::unCompressedSize
private

Definition at line 839 of file Compressor.cpp.


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