Dirac - A Video Codec

Created by the British Broadcasting Corporation.


ArithCodec< T > Class Template Reference

Abstract binary arithmetic coding class. More...

#include <arith_codec.h>

List of all members.

Public Member Functions

Protected Types

Protected Member Functions

Protected Attributes

Static Protected Attributes

Private Member Functions

Private Attributes


Detailed Description

template<class T>
class ArithCodec< T >

This is an abtract binary arithmetic encoding class, used as the base for concrete classes that encode motion vectors and subband residues.
Parameters:
T a container (most probably, or array) type


Member Typedef Documentation

template<class T>
typedef uint32_t ArithCodec< T >::calc_t [protected]
 

template<class T>
typedef uint16_t ArithCodec< T >::code_t [protected]
 


Constructor & Destructor Documentation

template<class T>
ArithCodec< T >::ArithCodec BasicOutputManager bits_out,
size_t  number_of_contexts
 

Creates an ArithCodec object to decode input based on a set of parameters.

Parameters:
bits_out output for encoded bits
number_of_contexts the number of contexts used

template<class T>
ArithCodec< T >::ArithCodec BitInputManager bits_in,
size_t  number_of_contexts
 

Creates an ArithCodec object to decode input based on a set of parameters.

Parameters:
bits_in source of bits to be decoded
number_of_contexts the number of contexts used

template<class T>
ArithCodec< T >::~ArithCodec  )  [virtual]
 

Destructor is virtual as this class is abstract.

template<class T>
ArithCodec< T >::ArithCodec const ArithCodec< T > &  cpy  )  [private]
 


Member Function Documentation

template<class T>
virtual int ArithCodec< T >::ChooseContext const T &  data  )  const [protected, pure virtual]
 

Implemented in BandCodec, and MvDataCodec.

template<class T>
virtual int ArithCodec< T >::ChooseContext const T &  data,
const int  bin_number
const [protected, pure virtual]
 

Implemented in BandCodec, and MvDataCodec.

template<class T>
int ArithCodec< T >::Compress T &  in_data  ) 
 

Compress takes a type T object (a container or array) and compresses it using the abstract function DoWorkCode() which is overridden in subclasses. It returns the number of bits written.

Parameters:
in_data the input to be compressed. Non-const, since the compression may be lossy.

template<class T>
void ArithCodec< T >::DecodeSymbol bool &  symbol,
int  context_num
[protected]
 

template<class T>
void ArithCodec< T >::Decompress T &  out_data,
int  num_bits
 

Decompresses the bitstream, up to the number of bits specified and writes into the output

subclasses.

Parameters:
out_data the output into which the decompressed data is written.
num_bits the number of bits to be read from the bitstream. [May be eliminated in future revisions. TJD 13 April 2004.]

template<class T>
virtual void ArithCodec< T >::DoWorkCode T &  in_data  )  [protected, pure virtual]
 

Implemented in BandCodec, LFBandCodec, IntraDCBandCodec, and MvDataCodec.

template<class T>
virtual void ArithCodec< T >::DoWorkDecode T &  out_data,
int  num_bits
[protected, pure virtual]
 

Implemented in BandCodec, LFBandCodec, IntraDCBandCodec, and MvDataCodec.

template<class T>
void ArithCodec< T >::EncodeSymbol const bool  symbol,
const int  context_num
[inline, protected]
 

template<class T>
void ArithCodec< T >::EncodeTriple const Triple c  )  [protected]
 

template<class T>
void ArithCodec< T >::FlushDecoder  )  [protected]
 

template<class T>
void ArithCodec< T >::FlushEncoder  )  [protected]
 

template<class T>
virtual void ArithCodec< T >::InitContexts  )  [protected, pure virtual]
 

Implemented in BandCodec, and MvDataCodec.

template<class T>
void ArithCodec< T >::InitDecoder  )  [protected]
 

template<class T>
void ArithCodec< T >::InitEncoder  )  [protected]
 

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

template<class T>
void ArithCodec< T >::RemFromStream const Triple c  )  [protected]
 

template<class T>
virtual void ArithCodec< T >::ResetAll  )  [protected, pure virtual]
 

Implemented in BandCodec, and MvDataCodec.

template<class T>
virtual void ArithCodec< T >::Resize const int  context_num  )  [protected, pure virtual]
 

Implemented in BandCodec, and MvDataCodec.

template<class T>
void ArithCodec< T >::SetCurrentCount const int  context_num  )  [protected]
 

template<class T>
virtual void ArithCodec< T >::Update const bool  symbol,
const int  context_num
[protected, pure virtual]
 

Implemented in BandCodec, and MvDataCodec.


Member Data Documentation

template<class T>
const code_t ArithCodec< T >::CODE_2ND_MSB = ((0xffff + 1) >> 2) [static, protected]
 

template<class T>
const code_t ArithCodec< T >::CODE_MAX = 0xffff [static, protected]
 

template<class T>
const code_t ArithCodec< T >::CODE_MSB = ((0xffff + 1) >> 1) [static, protected]
 

template<class T>
int ArithCodec< T >::m_bit_count [private]
 

template<class T>
BitInputManager* ArithCodec< T >::m_bit_input [private]
 

template<class T>
BasicOutputManager* ArithCodec< T >::m_bit_output [private]
 

template<class T>
code_t ArithCodec< T >::m_code [private]
 

template<class T>
std::vector<Context> ArithCodec< T >::m_context_list [protected]
 

template<class T>
code_t ArithCodec< T >::m_count [private]
 

template<class T>
code_t ArithCodec< T >::m_high_code [private]
 

template<class T>
code_t ArithCodec< T >::m_low_code [private]
 

template<class T>
int ArithCodec< T >::m_max_count [private]
 

template<class T>
long ArithCodec< T >::m_underflow [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.