Signal/Geometry Processing Library (SPL) 1.1.24 |

Public Member Functions | Static Public Member Functions | List of all members
SPL::MEncoder Class Reference
Arithmetic Coders » M-Coder

The M-Coder (binary) arithmetic encoder class. More...

`#include <mCoder.hpp>`

Inherits SPL::MCoder.

## Public Member Functions
| MEncoder (int numContexts=0, OutputBitStream *out=0)
| Create an encoder with a specified number of contexts that sends output to a given bit stream. More...
| ~MEncoder ()
| Destroy an encoder. More...
void | setNumContexts (int numContexts)
| Set the number of contexts. More...
int | getNumContexts () const
| Get the number of contexts. More...
void | clearContexts ()
| Clear the state of all of the contexts. More...
void | setOutput (OutputBitStream *out)
| Set the bit stream to use for output. More...
OutputBitStream * | getOutput () const
| Get the bit stream being used for output. More...
long | getSymCount () const
| Get the number of symbols that have been encoded so far. More...
long | getBitCount () const
| Get the number of bits (of encoded data) that have been output to the underlying bit stream so far. More...
void | start ()
| Start the arithmetic code word. More...
int | terminate ()
| Terminate the arithmetic code word. More...
int | encodeRegular (int contextId, int binVal)
| Encode a symbol in the specified context. More...
int | encodeBypass (int binVal)
| Encode a symbol in bypass mode (i.e., assuming that both symbols are equiprobable). More...
void | dump (std::ostream &out) const
| Dump the internal state of the encoder for debugging. More...

## Static Public Member Functions
static void | setDebugLevel (int debugLevel)
| Set the debug level. More...
static void | setDebugStream (std::ostream &debugStream)
| Set the stream for debugging output. More...
static std::ostream & | getDebugStream ()
| Get the stream used for debugging output. More...

## Detailed Description

The M-Coder (binary) arithmetic encoder class.

## Constructor & Destructor Documentation

SPL::MEncoder::MEncoder | ( | int | numContexts = `0`,
|  | OutputBitStream * | out = `0`
| ) |  |

Create an encoder with a specified number of contexts that sends output to a given bit stream.

SPL::MEncoder::~MEncoder | ( |  | ) |

Destroy an encoder.

## Member Function Documentation

void SPL::MEncoder::clearContexts | ( |  | ) |

Clear the state of all of the contexts.

void SPL::MEncoder::dump | ( | std::ostream & | out | ) | const

Dump the internal state of the encoder for debugging.

int SPL::MEncoder::encodeBypass | ( | int | binVal | ) |

Encode a symbol in bypass mode (i.e., assuming that both symbols are equiprobable).

int SPL::MEncoder::encodeRegular | ( | int | contextId,
|  | int | binVal
| ) |  |

Encode a symbol in the specified context.

The symbol binVal is encoded using context contextId.

std::ostream & SPL::MEncoder::getDebugStream | ( |  | ) |
| static

Get the stream used for debugging output.

void SPL::MEncoder::setDebugLevel | ( | int | debugLevel | ) |
| static

Set the debug level.

void SPL::MEncoder::setDebugStream | ( | std::ostream & | debugStream | ) |
| static

Set the stream for debugging output.

void SPL::MEncoder::setNumContexts | ( | int | numContexts | ) |

Set the number of contexts.

void SPL::MEncoder::start | ( |  | ) |

Start the arithmetic code word.

int SPL::MEncoder::terminate | ( |  | ) |

Terminate the arithmetic code word.

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

- mCoder.hpp
- mCoder.cpp