# Dirac - A Video Codec

Created by the British Broadcasting Corporation.

# dirac::BandCodec Class Reference

A general class for coding and decoding wavelet subband data. More...

`#include <band_codec.h>`

Inheritance diagram for dirac::BandCodec:

[legend]
Collaboration diagram for dirac::BandCodec:

[legend]

List of all members.

## Public Member Functions

- BandCodec (SubbandByteIO *subband_byteio, size_t number_of_contexts, const SubbandList &band_list, int band_num, const bool is_intra)
    Constructor.

## Protected Member Functions

- void CodeVal (PicArray &in_data, const int xpos, const int ypos, const ValueType val)
    Code an individual quantised value and perform inverse-quantisation.
- void DecodeVal (PicArray &out_data, const int xpos, const int ypos)
    Decode an individual quantised value and perform inverse-quantisation.
- void CodeQIndexOffset (const int offset)
    Encode the offset for a code block quantiser.
- int DecodeQIndexOffset ()
    Decode the offset for a code block quantiser.
- void SetToVal (const CodeBlock &code_block, PicArray &pic_data, const ValueType val)
    Set a code block area to a given value.
- void ClearBlock (const CodeBlock &code_block, PicArray &pic_data)
    Set all block values to 0.

## Protected Attributes

- bool m_is_intra
    Flag indicating whether the band comes from an intra frame.
- int m_bnum
    variables
- const Subband m_node
    the subband being coded
- int m_last_qf_idx
    the quantisation index of the last codeblock
- int m_qf
    quantisation value
- ValueType m_offset
    reconstruction point
- bool m_nhood_nonzero
    True if neighbours non-zero.
- Subband m_pnode
    the parent subband
- int m_pxp
    coords of the parent subband
- int m_pyp
- int m_pxl
- int m_pyl
- int m_pxpos
    position of the parent coefficient
- int m_pypos
- bool m_parent_notzero
    True if the parent of a coeff is not zero.

## Private Member Functions

- virtual void DoWorkCode (PicArray &in_data)
- virtual void DoWorkDecode (PicArray &out_data)
- virtual void CodeCoeffBlock (const CodeBlock &code_block, PicArray &in_data)
- virtual void DecodeCoeffBlock (const CodeBlock &code_block, PicArray &out_data)
- int ChooseFollowContext (const int bin_number) const
    A function for choosing the context for "follow bits".
- int ChooseInfoContext () const
    A function for choosing the context for "information bits".
- int ChooseSignContext (const PicArray &data, const int xpos, const int ypos) const
    A function for choosing the context for sign bits.
- BandCodec (const BandCodec &cpy)
    Private, bodyless copy constructor: class should not be copied.
- BandCodec & operator= (const BandCodec &rhs)
    Private, bodyless copy operator=: class should not be assigned.

## Detailed Description

A general class for coding and decoding wavelet subband data, deriving from the abstract ArithCodec class.

## Constructor & Destructor Documentation

dirac::BandCodec::BandCodec | ( | SubbandByteIO * | subband_byteio,
|  | size_t | number_of_contexts,
|  | const SubbandList & | band_list,
|  | int | band_num,
|  | const bool | is_intra |
| ) |  |  |

Creates a BandCodec object to encode subband data

Parameters:

  | subband_byteio | input/output for the encoded bits
  | number_of_contexts | the number of contexts used in the encoding process
  | band_list | the set of all the subbands
  | band_num | the number of the subband being coded
  | is_intra | Flag indicating whether the band comes from an intra frame

dirac::BandCodec::BandCodec | ( | const BandCodec & | cpy | ) | `[private]`

## Member Function Documentation

void dirac::BandCodec::CodeVal | ( | PicArray & | in_data,
|  | const int | xpos,
|  | const int | ypos,
|  | const ValueType | val |
| ) |  |  | `[inline, protected]`

void dirac::BandCodec::DecodeVal | ( | PicArray & | out_data,
|  | const int | xpos,
|  | const int | ypos |
| ) |  |  | `[inline, protected]`

void dirac::BandCodec::CodeQIndexOffset | ( | const int | offset | ) | `[protected]`

int dirac::BandCodec::DecodeQIndexOffset | ( |  | ) | `[protected]`

void dirac::BandCodec::SetToVal | ( | const CodeBlock & | code_block,
|  | PicArray & | pic_data,
|  | const ValueType | val |
| ) |  |  | `[inline, protected]`

void dirac::BandCodec::ClearBlock | ( | const CodeBlock & | code_block,
|  | PicArray & | pic_data |
| ) |  |  | `[inline, protected]`

virtual void dirac::BandCodec::DoWorkCode | ( | PicArray & | in_data | ) | `[private, virtual]`

Reimplemented in dirac::LFBandCodec, and dirac::IntraDCBandCodec.

virtual void dirac::BandCodec::DoWorkDecode | ( | PicArray & | out_data | ) | `[private, virtual]`

Reimplemented in dirac::LFBandCodec, and dirac::IntraDCBandCodec.

virtual void dirac::BandCodec::CodeCoeffBlock | ( | const CodeBlock & | code_block,
|  | PicArray & | in_data |
| ) |  |  | `[private, virtual]`

Reimplemented in dirac::LFBandCodec, and dirac::IntraDCBandCodec.

virtual void dirac::BandCodec::DecodeCoeffBlock | ( | const CodeBlock & | code_block,
|  | PicArray & | out_data |
| ) |  |  | `[private, virtual]`

Reimplemented in dirac::LFBandCodec, and dirac::IntraDCBandCodec.

int dirac::BandCodec::ChooseFollowContext | ( | const int | bin_number | ) | const`[inline, private]`

int dirac::BandCodec::ChooseInfoContext | ( |  | ) | const`[inline, private]`

int dirac::BandCodec::ChooseSignContext | ( | const PicArray & | data,
|  | const int | xpos,
|  | const int | ypos |
| ) |  |  | const`[inline, private]`

BandCodec& dirac::BandCodec::operator= | ( | const BandCodec & | rhs | ) | `[private]`

## Member Data Documentation

bool dirac::BandCodec::m_is_intra `[protected]`

int dirac::BandCodec::m_bnum `[protected]`

const Subband dirac::BandCodec::m_node `[protected]`

int dirac::BandCodec::m_last_qf_idx `[protected]`

int dirac::BandCodec::m_qf `[protected]`

ValueType dirac::BandCodec::m_offset `[protected]`

bool dirac::BandCodec::m_nhood_nonzero `[protected]`

Subband dirac::BandCodec::m_pnode `[protected]`

int dirac::BandCodec::m_pxp `[protected]`

int dirac::BandCodec::m_pyp `[protected]`

int dirac::BandCodec::m_pxl `[protected]`

int dirac::BandCodec::m_pyl `[protected]`

int dirac::BandCodec::m_pxpos `[protected]`

int dirac::BandCodec::m_pypos `[protected]`

bool dirac::BandCodec::m_parent_notzero `[protected]`

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

- band_codec.h

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