#include <arith_codec.h>
Public Member Functions | |
Context () | |
Default Constructor. | |
Context (int cnt0, int cnt1) | |
Constructor. | |
Context (const Context &cpy) | |
Copy constructor. | |
Context & | operator= (const Context &rhs) |
Assignment=. | |
~Context () | |
Destructor. | |
void | SetCounts (int cnt0, int cnt1) |
Sets the counts according to the input. | |
code_t | GetCount0 () const |
Returns the count of zeroes. | |
code_t | GetCount1 () const |
Returns the count of ones. | |
void | IncrCount (bool symbol, int amnt) |
Increment the count. | |
void | HalveCounts () |
Divide the counts by 2, making sure neither ends up 0. | |
code_t | Weight () const |
Return the m_m_weight, equal to the count of 0 plus the count of 1. | |
const Triple & | GetTriple (const bool symbol) const |
Return the triple associated with Symbol. | |
bool | GetSymbol (const code_t num, Triple &trip_val) const |
Given a number, return the corresponding symbol and triple. |
A class for binary contexts. Stores probabilities for 0 and 1 in terms of counts of numbers of occurrences, and also as Triples partitioning the interval [0,1) into two parts [0,p) and [p,1).
Definition at line 202 of file arith_codec.h.
|
Default Constructor. Default constructor initialises counts to 1 each of 0 and 1. Definition at line 209 of file arith_codec.h. References dirac::ArithCodec< T >::Context::SetCounts(). |
|
Constructor. Constructor initialises the counts to those set. Definition at line 218 of file arith_codec.h. References dirac::ArithCodec< T >::Context::SetCounts(). |
|
|
Increment the count. Increment the count of Symbol by amnt.
Definition at line 268 of file arith_codec.h. |
|
Sets the counts according to the input. Sets the counts, and then the triples to reflect the counts. Definition at line 248 of file arith_codec.h. Referenced by dirac::ArithCodec< T >::Context::Context(). |