M-ary arithmetic decoder class. More...
#include <arithCoder.hpp>
Public Member Functions | |
MultiArithDecoder (int maxContexts, InputBitStream *in=nullptr) | |
Create a decoder with the specified maximum number of contexts that sends output to the given bit stream. More... | |
~MultiArithDecoder () | |
Destroy the decoder. More... | |
InputBitStream * | getInput () const |
Get the bit stream from which to read encoded data. More... | |
void | setInput (InputBitStream *in) |
Set the bit stream from which to read encoded data. More... | |
SPL_ArithCoder_ulong | getBitCount () const |
Get the number of bits read so far. More... | |
SPL_ArithCoder_ulong | getSymCount () const |
Get the number of symbols decoded so far. More... | |
int | getMaxContexts () const |
Get the maximum number of contexts. More... | |
void | setContext (int contextId, int numSyms) |
Set the specified context to have the given number of symbols which are initially equiprobable. More... | |
void | setContext (int contextId, const std::vector< ArithCoder::Freq > &symFreqs, bool adaptive) |
Set the specified context to have symbols with the given frequencies and the given adaptivity. More... | |
int | start () |
Start a code word. More... | |
int | terminate () |
Terminate a code word (for synchronization with encoder). More... | |
int | decodeRegular (int contextId) |
Decode a symbol using the given context. More... | |
int | decodeBypass (int numSyms) |
Decode a symbol in bypass mode (i.e., all symbols equiprobable). More... | |
void | dump (std::ostream &out) const |
Dump the internal state of the decoder to the specified stream for debugging purposes. More... | |
Static Public Member Functions | |
static void | setDebugLevel (int debugLevel) |
Set the debug level. More... | |
static void | setDebugStream (std::ostream &out) |
Set the stream to use for debugging output. More... | |
static std::ostream & | getDebugStream () |
Get the stream used for debugging output. More... | |
M-ary arithmetic decoder class.
SPL::MultiArithDecoder::MultiArithDecoder | ( | int | maxContexts, |
InputBitStream * | in = nullptr |
||
) |
Create a decoder with the specified maximum number of contexts that sends output to the given bit stream.
SPL::MultiArithDecoder::~MultiArithDecoder | ( | ) |
Destroy the decoder.
int SPL::MultiArithDecoder::decodeBypass | ( | int | numSyms | ) |
Decode a symbol in bypass mode (i.e., all symbols equiprobable).
int SPL::MultiArithDecoder::decodeRegular | ( | int | contextId | ) |
Decode a symbol using the given context.
void SPL::MultiArithDecoder::dump | ( | std::ostream & | out | ) | const |
Dump the internal state of the decoder to the specified stream for debugging purposes.
void SPL::MultiArithDecoder::setContext | ( | int | contextId, |
int | numSyms | ||
) |
Set the specified context to have the given number of symbols which are initially equiprobable.
void SPL::MultiArithDecoder::setContext | ( | int | contextId, |
const std::vector< ArithCoder::Freq > & | symFreqs, | ||
bool | adaptive | ||
) |
Set the specified context to have symbols with the given frequencies and the given adaptivity.
int SPL::MultiArithDecoder::start | ( | ) |
Start a code word.
This function must be called before attempting to decode any symbols.
int SPL::MultiArithDecoder::terminate | ( | ) |
Terminate a code word (for synchronization with encoder).