Dirac - A Video Codec

Created by the British Broadcasting Corporation.


Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
dirac::ArithCodecBase Class Reference

#include <arith_codec.h>

Inheritance diagram for dirac::ArithCodecBase:
Inheritance graph
[legend]
Collaboration diagram for dirac::ArithCodecBase:
Collaboration graph
[legend]

Public Member Functions

 ArithCodecBase (ByteIO *p_byteio, size_t number_of_contexts)
 Constructor. More...
 
virtual ~ArithCodecBase ()
 Destructor. More...
 

Protected Member Functions

void InitEncoder ()
 Initialises the Encoder. More...
 
void EncodeSymbol (const bool symbol, const int context_num)
 encodes a symbol and writes to output More...
 
void EncodeUInt (const unsigned int value, const int bin1, const int max_bin)
 
void EncodeSInt (const int value, const int bin1, const int max_bin)
 
void FlushEncoder ()
 flushes the output of the encoder. More...
 
int ByteCount () const
 
void InitDecoder (int num_bytes)
 Initialise the Decoder. More...
 
bool DecodeSymbol (int context_num)
 Decodes a symbol given a context number. More...
 
unsigned int DecodeUInt (const int bin1, const int max_bin)
 
int DecodeSInt (const int bin1, const int max_bin)
 

Protected Attributes

std::vector< Contextm_context_list
 List of contexts. More...
 

Private Member Functions

 ArithCodecBase (const ArithCodecBase &cpy)
 private, bodyless copy constructor: class should not be copied More...
 
ArithCodecBaseoperator= (const ArithCodecBase &rhs)
 private, bodyless copy operator=: class should not be assigned More...
 
void ReadAllData (int num_bytes)
 Read all the data in. More...
 
bool InputBit ()
 Read in a bit of data. More...
 

Private Attributes

unsigned int m_scount
 
unsigned int m_low_code
 Start of the current code range. More...
 
unsigned int m_range
 Length of the current code range. More...
 
ByteIOm_byteio
 Input/output stream of Dirac-format bytes. More...
 
int m_underflow
 Number of underflow bits. More...
 
char * m_decode_data_ptr
 A pointer to the data for reading in. More...
 
char * m_data_ptr
 A point to the byte currently being read. More...
 
int m_input_bits_left
 The index of the bit of the byte being read. More...
 
unsigned int m_code
 The present input code. More...
 

Constructor & Destructor Documentation

◆ ArithCodecBase() [1/2]

dirac::ArithCodecBase::ArithCodecBase ( ByteIO p_byteio,
size_t  number_of_contexts 
)

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

Parameters
p_byteioinput/output for encoded bits
number_of_contextsthe number of contexts used

◆ ~ArithCodecBase()

virtual dirac::ArithCodecBase::~ArithCodecBase ( )
virtual

Destructor is virtual as this class is abstract.

◆ ArithCodecBase() [2/2]

dirac::ArithCodecBase::ArithCodecBase ( const ArithCodecBase cpy)
private

Member Function Documentation

◆ ByteCount()

int dirac::ArithCodecBase::ByteCount ( ) const
protected

◆ DecodeSInt()

int dirac::ArithCodecBase::DecodeSInt ( const int  bin1,
const int  max_bin 
)
inlineprotected

References DecodeSymbol(), and DecodeUInt().

◆ DecodeSymbol()

bool dirac::ArithCodecBase::DecodeSymbol ( int  context_num)
inlineprotected

◆ DecodeUInt()

unsigned int dirac::ArithCodecBase::DecodeUInt ( const int  bin1,
const int  max_bin 
)
inlineprotected

References DecodeSymbol().

Referenced by DecodeSInt().

◆ EncodeSInt()

void dirac::ArithCodecBase::EncodeSInt ( const int  value,
const int  bin1,
const int  max_bin 
)
inlineprotected

References EncodeSymbol(), and EncodeUInt().

◆ EncodeSymbol()

void dirac::ArithCodecBase::EncodeSymbol ( const bool  symbol,
const int  context_num 
)
inlineprotected

◆ EncodeUInt()

void dirac::ArithCodecBase::EncodeUInt ( const unsigned int  value,
const int  bin1,
const int  max_bin 
)
inlineprotected

References EncodeSymbol().

Referenced by EncodeSInt().

◆ FlushEncoder()

void dirac::ArithCodecBase::FlushEncoder ( )
protected

◆ InitDecoder()

void dirac::ArithCodecBase::InitDecoder ( int  num_bytes)
protected

◆ InitEncoder()

void dirac::ArithCodecBase::InitEncoder ( )
protected

◆ InputBit()

bool dirac::ArithCodecBase::InputBit ( )
inlineprivate

References m_data_ptr, and m_input_bits_left.

Referenced by DecodeSymbol().

◆ operator=()

ArithCodecBase & dirac::ArithCodecBase::operator= ( const ArithCodecBase rhs)
private

◆ ReadAllData()

void dirac::ArithCodecBase::ReadAllData ( int  num_bytes)
private

Member Data Documentation

◆ m_byteio

ByteIO* dirac::ArithCodecBase::m_byteio
private

Referenced by EncodeSymbol().

◆ m_code

unsigned int dirac::ArithCodecBase::m_code
private

Referenced by DecodeSymbol().

◆ m_context_list

std::vector<Context> dirac::ArithCodecBase::m_context_list
protected

Referenced by DecodeSymbol(), and EncodeSymbol().

◆ m_data_ptr

char* dirac::ArithCodecBase::m_data_ptr
private

Referenced by InputBit().

◆ m_decode_data_ptr

char* dirac::ArithCodecBase::m_decode_data_ptr
private

◆ m_input_bits_left

int dirac::ArithCodecBase::m_input_bits_left
private

Referenced by InputBit().

◆ m_low_code

unsigned int dirac::ArithCodecBase::m_low_code
private

Referenced by DecodeSymbol(), and EncodeSymbol().

◆ m_range

unsigned int dirac::ArithCodecBase::m_range
private

Referenced by DecodeSymbol(), and EncodeSymbol().

◆ m_scount

unsigned int dirac::ArithCodecBase::m_scount
private

◆ m_underflow

int dirac::ArithCodecBase::m_underflow
private

Referenced by EncodeSymbol().


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.