#include <ArithmeticEncoder.h>

Public Member Functions | |
| ArithmeticEncoder (uint_t mode, Stream *stream=NULL, bool owner=true, ArithContext *ctx=NULL, bool eob=false) | |
| Constructor. | |
| virtual uint_t | decode (byte_t *block, uint_t num) |
| Decode data from the associated stream. | |
| uint_t | decode (ArithContext *ctx) |
| Decode a symbol with the given context. | |
| virtual uint_t | encode (const byte_t *block, uint_t num) |
| Encode data to the associated stream. | |
| void | encode (uint_t symbol, ArithContext *ctx) |
| Encode a symbol with the given context. | |
| void | setContext (ArithContext *ctx) |
| Set the default context. | |
| void | start (uint_t mode, Stream *stream, bool owner=true, ArithContext *ctx=NULL, bool eob=false) |
| Initialize for encoding or decoding. | |
Protected Member Functions | |
| virtual void | clear () |
| Revert to initial state. | |
| virtual void | finishEncoding () |
| Perform any necessary clean-up when encoding is finished. | |
This implementation is really due to Alistair Moffat. All I have really done here is "UTL-ify" it.
See Alistair's home page at: http://www.cs.mu.oz.au/~alistair/
Attributes
Definition at line 138 of file ArithmeticEncoder.h.
| utl::ArithmeticEncoder::ArithmeticEncoder | ( | uint_t | mode, | |
| Stream * | stream = NULL, |
|||
| bool | owner = true, |
|||
| ArithContext * | ctx = NULL, |
|||
| bool | eob = false | |||
| ) | [inline] |
Constructor.
| mode | io_rd to decode, io_wr to encode (see io_t) | |
| stream | (optional) associated stream | |
| owner | (optional : true) owner flag for stream | |
| ctx | (optional) default context | |
| eob | (optional : false) encode end-of-block? |
Definition at line 150 of file ArithmeticEncoder.h.
Decode data from the associated stream.
| block | block to decode into | |
| num | size of block |
Implements utl::Encoder.
| uint_t utl::ArithmeticEncoder::decode | ( | ArithContext * | ctx | ) | [inline] |
Decode a symbol with the given context.
| ctx | context |
Definition at line 274 of file ArithmeticEncoder.h.
References utl::Stream::getBit(), utl::ArithContext::interval(), utl::min(), utl::ArithContext::symbol(), utl::ArithContext::totFreq(), and utl::ArithContext::update().
Encode data to the associated stream.
| block | block to encode | |
| num | size of block |
Implements utl::Encoder.
| void utl::ArithmeticEncoder::encode | ( | uint_t | symbol, | |
| ArithContext * | ctx | |||
| ) | [inline] |
Encode a symbol with the given context.
| symbol | symbol to encode | |
| ctx | context |
Definition at line 227 of file ArithmeticEncoder.h.
References utl::ArithContext::interval(), utl::ArithContext::totFreq(), and utl::ArithContext::update().
| void utl::ArithmeticEncoder::setContext | ( | ArithContext * | ctx | ) | [inline] |
| void utl::ArithmeticEncoder::start | ( | uint_t | mode, | |
| Stream * | stream, | |||
| bool | owner = true, |
|||
| ArithContext * | ctx = NULL, |
|||
| bool | eob = false | |||
| ) |
Initialize for encoding or decoding.
| mode | io_rd to encode, io_wr to decode (see io_t) | |
| stream | (optional) associated stream | |
| owner | (optional : true) owner flag for stream | |
| ctx | (optional) default context | |
| eob | (optional : false) encode end-of-block? |
| virtual void utl::ArithmeticEncoder::clear | ( | ) | [protected, virtual] |
| virtual void utl::ArithmeticEncoder::finishEncoding | ( | ) | [protected, virtual] |
1.5.6