40 #ifndef SPL_mCoder_hpp 41 #define SPL_mCoder_hpp 47 #include <SPL/config.hpp> 74 static const unsigned char rangeTabLPS[64][4];
75 static const unsigned char transIdxLPS[64];
76 static const unsigned char transIdxMPS[64];
80 struct MCoder::Context {
82 unsigned char valMPS_;
85 unsigned char pStateIdx_;
122 void setNumContexts(
int numContexts);
127 int getNumContexts()
const;
132 void clearContexts();
147 long getSymCount()
const;
153 long getBitCount()
const;
174 int encodeRegular(
int contextId,
int binVal);
180 int encodeBypass(
int binVal);
189 static void setDebugLevel(
int debugLevel);
194 static void setDebugStream(std::ostream& debugStream);
199 static std::ostream& getDebugStream();
204 void dump(std::ostream& out)
const;
208 static int debugLevel_;
209 static std::ostream* debugStream_;
211 int encodeTerminate(
int binVal);
215 int writeBits(
int v,
int n);
229 std::vector<Context> contexts_;
232 unsigned char firstBitFlag_;
235 unsigned short codILow_;
238 unsigned short codIRange_;
241 unsigned long bitsOutstanding_;
261 return bitCount_ + bitsOutstanding_;
265 return contexts_.size();
309 void setNumContexts(
int numContexts);
314 int getNumContexts()
const;
331 void clearContexts();
336 long getBitCount()
const;
341 long getSymCount()
const;
363 int decodeRegular(
int contextId);
379 void dump(std::ostream& out)
const;
384 static void setDebugLevel(
int debugLevel);
389 static void setDebugStream(std::ostream& debugStream);
394 static std::ostream& getDebugStream();
398 static int debugLevel_;
399 static std::ostream* debugStream_;
400 int decodeTerminate();
416 unsigned short codIRange_;
419 unsigned short codIOffset_;
422 std::vector<Context> contexts_;
425 unsigned long bitCount_;
428 unsigned long symCount_;
444 return contexts_.size();
long getBitCount() const
Get the number of bits (of encoded data) that have been output to the underlying bit stream so far...
Definition: mCoder.hpp:259
Definition: Arcball.hpp:48
long getSymCount() const
Get the number of symbols decoded so far.
Definition: mCoder.hpp:439
The M-Coder (binary) arithmetic encoder class.
Definition: mCoder.hpp:96
long getBitCount() const
Get the number of bits read so far.
Definition: mCoder.hpp:435
OutputBitStream * getOutput() const
Get the bit stream being used for output.
Definition: mCoder.hpp:268
Output bit stream class.
Definition: bitStream.hpp:372
The M-Coder (binary) arithmetic decoder class.
Definition: mCoder.hpp:284
void setOutput(OutputBitStream *out)
Set the bit stream to use for output.
Definition: mCoder.hpp:272
int getNumContexts() const
Get the number of contexts.
Definition: mCoder.hpp:264
int getNumContexts() const
Get the number of contexts.
Definition: mCoder.hpp:443
void setInput(InputBitStream *in)
Set the input bit stream (i.e., the bit stream from which encoded data is to be read).
Definition: mCoder.hpp:451
long getSymCount() const
Get the number of symbols that have been encoded so far.
Definition: mCoder.hpp:254
InputBitStream * getInput() const
Get the input bit stream (i.e., the bit stream from which encoded data is to be read).
Definition: mCoder.hpp:447