Dirac - A Video Codec

Created by the British Broadcasting Corporation.


ArithCodec< T >::Context Class Reference

A class for binary contexts. More...

#include <arith_codec.h>

List of all members.

Public Member Functions

Private Member Functions

Private Attributes


Detailed Description

template<class T>
class ArithCodec< T >::Context

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).


Constructor & Destructor Documentation

template<class T>
ArithCodec< T >::Context::Context  )  [inline]
 

Default constructor initialises counts to 1 each of 0 and 1.

template<class T>
ArithCodec< T >::Context::Context int  cnt0,
int  cnt1
[inline]
 

Constructor initialises the counts to those set.

template<class T>
ArithCodec< T >::Context::Context const Context cpy  )  [inline]
 

template<class T>
ArithCodec< T >::Context::~Context  )  [inline]
 


Member Function Documentation

template<class T>
code_t ArithCodec< T >::Context::GetCount0  )  const [inline]
 

template<class T>
code_t ArithCodec< T >::Context::GetCount1  )  const [inline]
 

template<class T>
bool ArithCodec< T >::Context::GetSymbol const code_t  num,
Triple trip_val
const [inline]
 

Given a number, which should be in the range [0,m_weight) return the corresponding symbol. The range [0,m_weight) is partitioned into portions [0,count0), [count0,m_weight) corresponding to 0 and 1.

template<class T>
const Triple& ArithCodec< T >::Context::GetTriple const bool  symbol  )  const [inline]
 

template<class T>
void ArithCodec< T >::Context::HalveCounts  )  [inline]
 

template<class T>
void ArithCodec< T >::Context::IncrCount bool  Symbol,
int  amnt
[inline]
 

Increment the count of Symbol by amnt. /param Symbol the symbol whose count is to be incremented (false=0, true=1) /param amnt the amount to increment by

template<class T>
Context& ArithCodec< T >::Context::operator= const Context rhs  )  [inline]
 

template<class T>
void ArithCodec< T >::Context::SetCounts int  cnt0,
int  cnt1
[inline]
 

Sets the counts, and then the triples to reflect the counts.

template<class T>
void ArithCodec< T >::Context::SetTriples  )  [inline, private]
 

template<class T>
code_t ArithCodec< T >::Context::Weight  )  const [inline]
 


Member Data Documentation

template<class T>
code_t ArithCodec< T >::Context::count0 [private]
 

template<class T>
code_t ArithCodec< T >::Context::count1 [private]
 

template<class T>
Triple ArithCodec< T >::Context::trip0 [private]
 

template<class T>
Triple ArithCodec< T >::Context::trip1 [private]
 


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

© 2004 British Broadcasting Corporation. Dirac code licensed under the Mozilla Public License (MPL) Version 1.1.
HTML documentation generated by Dimitri van Heesch's excellent Doxygen tool.