ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

Common::Huffman< BITSTREAM > Class Template Reference

Huffman bitstream decoding. More...

#include <huffman.h>

Collaboration diagram for Common::Huffman< BITSTREAM >:

List of all members.

Classes

struct  PrefixEntry
 Prefix lookup table used to speed up the decoding of short codes. More...
struct  Symbol

Public Member Functions

 Huffman (uint8 maxLength, uint32 codeCount, const uint32 *codes, const uint8 *lengths, const uint32 *symbols=nullptr)
 Construct a Huffman decoder.
uint32 getSymbol (BITSTREAM &bits) const
 Return the next symbol in the bitstream.

Private Types

typedef List< SymbolCodeList
typedef Array< CodeListCodeLists

Private Attributes

CodeLists _codes
 Lists of codes and their symbols, sorted by code length.
PrefixEntry _prefixTable [1<< _prefixTableBits]

Static Private Attributes

static const uint8 _prefixTableBits = 8

Detailed Description

template<class BITSTREAM>
class Common::Huffman< BITSTREAM >

Huffman bitstream decoding.

Used in engines:

  • scumm

Definition at line 50 of file huffman.h.


Member Typedef Documentation

template<class BITSTREAM >
typedef List<Symbol> Common::Huffman< BITSTREAM >::CodeList [private]

Definition at line 73 of file huffman.h.

template<class BITSTREAM >
typedef Array<CodeList> Common::Huffman< BITSTREAM >::CodeLists [private]

Definition at line 74 of file huffman.h.


Constructor & Destructor Documentation

template<class BITSTREAM >
Common::Huffman< BITSTREAM >::Huffman ( uint8  maxLength,
uint32  codeCount,
const uint32 codes,
const uint8 lengths,
const uint32 symbols = nullptr 
)

Construct a Huffman decoder.

Parameters:
maxLength Maximal code length. If 0, it's searched for.
codeCount Number of codes.
codes The actual codes.
lengths Lengths of the individual codes.
symbols The symbols. If 0, assume they are identical to the code indices.

Definition at line 92 of file huffman.h.


Member Function Documentation

template<class BITSTREAM >
uint32 Common::Huffman< BITSTREAM >::getSymbol ( BITSTREAM &  bits  )  const

Return the next symbol in the bitstream.

Definition at line 138 of file huffman.h.


Member Data Documentation

template<class BITSTREAM >
CodeLists Common::Huffman< BITSTREAM >::_codes [private]

Lists of codes and their symbols, sorted by code length.

Definition at line 77 of file huffman.h.

template<class BITSTREAM >
PrefixEntry Common::Huffman< BITSTREAM >::_prefixTable[1<< _prefixTableBits] [private]

Definition at line 88 of file huffman.h.

template<class BITSTREAM >
const uint8 Common::Huffman< BITSTREAM >::_prefixTableBits = 8 [static, private]

Definition at line 87 of file huffman.h.


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


Generated on Sat May 18 2019 05:06:00 for ResidualVM by doxygen 1.7.1
curved edge   curved edge