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

Classes

struct  acProbs_s
 
struct  acSymbol_s
 

Public Member Functions

 idCompressor_Arithmetic (void)
 
void Init (idFile *f, bool compress, int wordLength)
 
void FinishCompress (void)
 
int Write (const void *inData, int inLength)
 
int Read (void *outData, int outLength)
 
- Public Member Functions inherited from idCompressor_BitStream
 idCompressor_BitStream (void)
 
float GetCompressionRatio (void) const
 
- 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 Types

typedef struct
idCompressor_Arithmetic::acProbs_s 
acProbs_t
 
typedef struct
idCompressor_Arithmetic::acSymbol_s 
acSymbol_t
 

Private Member Functions

void InitProbabilities (void)
 
void UpdateProbabilities (acSymbol_t *symbol)
 
int ProbabilityForCount (unsigned int count)
 
void CharToSymbol (byte c, acSymbol_t *symbol)
 
void EncodeSymbol (acSymbol_t *symbol)
 
int SymbolFromCount (unsigned int count, acSymbol_t *symbol)
 
int GetCurrentCount (void)
 
void RemoveSymbolFromStream (acSymbol_t *symbol)
 
void PutBit (int bit)
 
int GetBit (void)
 
void WriteOverflowBits (void)
 

Private Attributes

acProbs_t probabilities [1<< AC_WORD_LENGTH]
 
int symbolBuffer
 
int symbolBit
 
unsigned short low
 
unsigned short high
 
unsigned short code
 
unsigned int underflowBits
 
unsigned int scale
 

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 Member Functions inherited from idCompressor_BitStream
void InitCompress (const void *inData, const int inLength)
 
void InitDecompress (void *outData, int outLength)
 
void WriteBits (int value, int numBits)
 
int ReadBits (int numBits)
 
void UnreadBits (int numBits)
 
int Compare (const byte *src1, int bitPtr1, const byte *src2, int bitPtr2, int maxBits) const
 
- Protected Attributes inherited from idCompressor_BitStream
byte buffer [65536]
 
int wordLength
 
int readTotalBytes
 
int readLength
 
int readByte
 
int readBit
 
const bytereadData
 
int writeTotalBytes
 
int writeLength
 
int writeByte
 
int writeBit
 
bytewriteData
 
- Protected Attributes inherited from idCompressor_None
idFilefile
 
bool compress
 

Detailed Description

Definition at line 1378 of file Compressor.cpp.

Member Typedef Documentation

Constructor & Destructor Documentation

idCompressor_Arithmetic::idCompressor_Arithmetic ( void  )
inline

Definition at line 1380 of file Compressor.cpp.

Member Function Documentation

void idCompressor_Arithmetic::CharToSymbol ( byte  c,
acSymbol_t symbol 
)
private

Definition at line 1649 of file Compressor.cpp.

void idCompressor_Arithmetic::EncodeSymbol ( acSymbol_t symbol)
private

Definition at line 1609 of file Compressor.cpp.

void idCompressor_Arithmetic::FinishCompress ( void  )
virtual

Reimplemented from idCompressor_BitStream.

Definition at line 1729 of file Compressor.cpp.

int idCompressor_Arithmetic::GetBit ( void  )
private

Definition at line 1587 of file Compressor.cpp.

int idCompressor_Arithmetic::GetCurrentCount ( void  )
private

Definition at line 1485 of file Compressor.cpp.

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

Reimplemented from idCompressor_BitStream.

Definition at line 1434 of file Compressor.cpp.

void idCompressor_Arithmetic::InitProbabilities ( void  )
private

Definition at line 1446 of file Compressor.cpp.

int idCompressor_Arithmetic::ProbabilityForCount ( unsigned int  count)
private

Definition at line 1494 of file Compressor.cpp.

void idCompressor_Arithmetic::PutBit ( int  bit)
private

Definition at line 1660 of file Compressor.cpp.

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

Reimplemented from idCompressor_BitStream.

Definition at line 1744 of file Compressor.cpp.

void idCompressor_Arithmetic::RemoveSymbolFromStream ( acSymbol_t symbol)
private

Definition at line 1554 of file Compressor.cpp.

int idCompressor_Arithmetic::SymbolFromCount ( unsigned int  count,
acSymbol_t symbol 
)
private

Definition at line 1541 of file Compressor.cpp.

void idCompressor_Arithmetic::UpdateProbabilities ( acSymbol_t symbol)
private

Definition at line 1465 of file Compressor.cpp.

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

Reimplemented from idCompressor_BitStream.

Definition at line 1695 of file Compressor.cpp.

void idCompressor_Arithmetic::WriteOverflowBits ( void  )
private

Definition at line 1680 of file Compressor.cpp.

Member Data Documentation

unsigned short idCompressor_Arithmetic::code
private

Definition at line 1407 of file Compressor.cpp.

unsigned short idCompressor_Arithmetic::high
private

Definition at line 1406 of file Compressor.cpp.

unsigned short idCompressor_Arithmetic::low
private

Definition at line 1405 of file Compressor.cpp.

acProbs_t idCompressor_Arithmetic::probabilities[1<< AC_WORD_LENGTH]
private

Definition at line 1400 of file Compressor.cpp.

unsigned int idCompressor_Arithmetic::scale
private

Definition at line 1409 of file Compressor.cpp.

int idCompressor_Arithmetic::symbolBit
private

Definition at line 1403 of file Compressor.cpp.

int idCompressor_Arithmetic::symbolBuffer
private

Definition at line 1402 of file Compressor.cpp.

unsigned int idCompressor_Arithmetic::underflowBits
private

Definition at line 1408 of file Compressor.cpp.


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