Dirac - A Video Codec

Created by the British Broadcasting Corporation.


dirac::ArithCodec< T >::Context Class Reference

A class for binary contexts. More...

#include <arith_codec.h>

Collaboration diagram for dirac::ArithCodec< T >::Context:

Collaboration graph
[legend]
List of all members.

Public Member Functions

Private Member Functions

Private Attributes


Detailed Description

template<class T>
class dirac::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>
dirac::ArithCodec< T >::Context::Context  )  [inline]
 

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

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

Constructor initialises the counts to those set.

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

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


Member Function Documentation

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

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

template<class T>
bool dirac::ArithCodec< T >::Context::GetSymbol const calc_t  num,
const calc_t  factor,
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& dirac::ArithCodec< T >::Context::GetTriple const bool  symbol  )  const [inline]
 

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

template<class T>
void dirac::ArithCodec< T >::Context::IncrCount const bool  symbol  )  [inline]
 

Increment the count of symbol by 1.

Parameters:
symbol the symbol whose count is to be incremented (false=0, true=1)

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

Increment the count of Symbol by amnt.

Parameters:
symbol the symbol whose count is to be incremented (false=0, true=1)
amnt the amount to increment by

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

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

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

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

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


Member Data Documentation

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

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

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

template<class T>
Triple dirac::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.