# Dirac - A Video Codec

Created by the British Broadcasting Corporation.

# dirac::CodecParams Class Reference

Parameters common to coder and decoder operation. More...

`#include <common.h>`

Inheritance diagram for dirac::CodecParams:

[legend]

List of all members.

## Public Member Functions

- CodecParams (const VideoFormat &vd, FrameType ftype, unsigned int num_refs, bool set_defaults)
    Default constructor.
- int XNumMB () const
    Return the number of macroblocks horizontally.
- int YNumMB () const
    Return the number of macroblocks vertically.
- int XNumBlocks () const
    Return the number of blocks horizontally.
- int YNumBlocks () const
    Returns the number of blocks vertically.
- bool Verbose () const
    Returns true if we're operating verbosely, false otherwise.
- bool Interlace () const
    Returns true if we're operatung using interlace tools [not currently defined].
- bool TopFieldFirst () const
    Returns true if the topmost field comes first in time [NB: TBD since this duplicates metadata in the sequence header].
- const OLBParams & LumaBParams (int n) const
    Return the Luma block parameters for each macroblock splitting level.
- const OLBParams & ChromaBParams (int n) const
    Return the Chroma block parameters for each macroblock splitting level.
- int OrigXl () const
    Return the original frame width.
- int OrigYl () const
    Return the original frame height.
- MVPrecisionType MVPrecision () const
    Return the number of accuracy bits used for motion vectors.
- bool ZeroTransform () const
    Return zero transform flag being used for frame (de)coding.
- WltFilter TransformFilter () const
    Return the wavelet filter currently being used for frame (de)coding.
- unsigned int TransformDepth () const
    Return the transform depth being used for frame (de)coding.
- CodeBlockMode GetCodeBlockMode () const
    Return multiple quantisers flag being used for frame (de)coding.
- bool SpatialPartition () const
    Return the spatial partitioning flag being used for frame (de)coding.
- bool DefaultSpatialPartition () const
    Return the default spatial partitioning flag being used for frame (de)coding.
- const CodeBlocks & GetCodeBlocks (unsigned int level) const
    Return the code blocks for a particular level.
- VideoFormat GetVideoFormat () const
    Return the video format currently being used for frame (de)coding.
- bool UsingGlobalMotion () const
    Return the global motion flag used for encoding/decoding.
- unsigned int FrameWeightsBits () const
    Return the number of frame weight precision bits.
- unsigned int Ref1Weight () const
    Return the Ref1 weight.
- unsigned int Ref2Weight () const
    Return the Ref2 weight.
- void SetXNumMB (const int xn)
    Set how many MBs there are horizontally.
- void SetYNumMB (const int yn)
    Set how many MBs there are vertically.
- void SetXNumBlocks (const int xn)
    Set how many blocks there are horizontally.
- void SetYNumBlocks (const int yn)
    Set how many blocks there are vertically.
- void SetVerbose (bool v)
    Sets verbosity on or off.
- void SetInterlace (bool intlc)
    Sets whether interlace tools are to be used.
- void SetTopFieldFirst (bool topf)
    Sets whether the topmost field comes first in time [NB: TBD since this duplicates metadata in the sequence header].
- void SetBlockSizes (const OLBParams &olbparams, const ChromaFormat cformat)
    Set the block sizes for all MB splitting levels given these prototype block sizes for level=2.
- void SetLumaBlockParams (const OLBParams &olbparams)
    Set block level luma params.
- void SetOrigXl (const int x)
    Set the original frame width.
- void SetOrigYl (const int y)
    Set the original frame height.
- void SetMVPrecision (const MVPrecisionType p)
    Set the number of accuracy bits for motion vectors.
- void SetMVPrecision (const MVPrecisionType p) const
- void SetZeroTransform (bool zero_transform)
    Set the zero transform flag being used for frame (de)coding.
- void SetTransformFilter (const WltFilter wf)
    Set the wavelet filter used for frame (de)coding.
- void SetTransformFilter (unsigned int wf_idx)
    Set the wavelet filter used for frame (de)coding.
- void SetTransformDepth (unsigned int wd)
    Set the transform depth used for frame (de)coding and allocate for the code blocks array.
- void SetCodeBlockMode (unsigned int cb_mode)
    Set the multiple quantisers flag usedto frame (de)coding.
- void SetSpatialPartition (bool spatial_partition)
    Set the spatial partition flag usedto frame (de)coding.
- void SetDefaultSpatialPartition (bool def_spatial_partition)
    Set the spatial partition flag usedto frame (de)coding.
- void SetCodeBlocks (unsigned int level, unsigned int hblocks, unsigned int vblocks)
    Set the number of code blocks for a particular level.
- void SetDefaultCodeBlocks (const FrameType &ftype)
    Set the default number of code blocks for all levels.
- void SetVideoFormat (const VideoFormat vd)
    Set the video format used for frame (de)coding.
- void SetUsingGlobalMotion (bool gm)
    Set the wavelet filter used for frame (de)coding.
- void SetFrameWeightsPrecision (unsigned int wt_prec)
    Set the frame weight precision bits used for (de)coding.
- void SetRef1Weight (unsigned int wt)
    Set the ref 1 frame weight.
- void SetRef2Weight (unsigned int wt)
    Set the ref 2 frame weight.

## Protected Member Functions

- WltFilter TransformFilter (unsigned int wf_idx)
    Return the Wavelet filter associated with the wavelet index.

## Private Attributes

- int m_x_num_mb
    The number of macroblocks horizontally.
- int m_y_num_mb
    The number of macroblocks verticaly.
- int m_x_num_blocks
    The number of blocks horizontally.
- int m_y_num_blocks
    The number of blocks vertically.
- bool m_verbose
    Code/decode with commentary if true.
- bool m_interlace
    True if input is interlaced, false otherwise.
- bool m_topfieldfirst
    True if interlaced and top field is first in temporal order.
- OneDArray< OLBParams > m_lbparams
- OneDArray< OLBParams > m_cbparams
- int m_orig_xl
    The original frame width.
- int m_orig_yl
    The original frame height.
- MVPrecisionType m_mv_precision
    The precision of motion vectors (number of accuracy bits eg 1=half-pel accuracy).
- VideoFormat m_video_format
    The video format being used.
- bool m_use_global_motion
    Global motion fields.
- unsigned int m_frame_weights_bits
    frame predicion parameters - precision
- unsigned int m_ref1_weight
    frame predicion parameters - reference frame 1 weight
- unsigned int m_ref2_weight
    frame predicion parameters - reference frame 1 weight
- bool m_zero_transform
    Zero transform flag.
- WltFilter m_wlt_filter
    The wavelet filter being used.
- unsigned int m_wlt_depth
    Wavelet depth.
- CodeBlockMode m_cb_mode
    Code block mode.
- bool m_spatial_partition
    Spatial partitioning flag.
- bool m_def_spatial_partition
    Default Spatial partitioning flag.
- OneDArray< CodeBlocks > m_cb
    Code block array. Number of entries is m_wlt_depth+1.

## Detailed Description

Parameters used throughout both the encoder and the decoder

## Constructor & Destructor Documentation

dirac::CodecParams::CodecParams | ( | const VideoFormat & | vd,
|  | FrameType | ftype,
|  | unsigned int | num_refs,
|  | bool | set_defaults |
| ) |  |  |

## Member Function Documentation

int dirac::CodecParams::XNumMB | ( |  | ) | const`[inline]`

References m_x_num_mb.

int dirac::CodecParams::YNumMB | ( |  | ) | const`[inline]`

References m_y_num_mb.

int dirac::CodecParams::XNumBlocks | ( |  | ) | const`[inline]`

References m_x_num_blocks.

int dirac::CodecParams::YNumBlocks | ( |  | ) | const`[inline]`

References m_y_num_blocks.

bool dirac::CodecParams::Verbose | ( |  | ) | const`[inline]`

References m_verbose.

bool dirac::CodecParams::Interlace | ( |  | ) | const`[inline]`

References m_interlace.

bool dirac::CodecParams::TopFieldFirst | ( |  | ) | const`[inline]`

References m_topfieldfirst.

const OLBParams& dirac::CodecParams::LumaBParams | ( | int | n | ) | const`[inline]`

References m_lbparams.

const OLBParams& dirac::CodecParams::ChromaBParams | ( | int | n | ) | const`[inline]`

References m_cbparams.

int dirac::CodecParams::OrigXl | ( |  | ) | const`[inline]`

References m_orig_xl.

int dirac::CodecParams::OrigYl | ( |  | ) | const`[inline]`

References m_orig_yl.

MVPrecisionType dirac::CodecParams::MVPrecision | ( |  | ) | const`[inline]`

References m_mv_precision.

bool dirac::CodecParams::ZeroTransform | ( |  | ) | const`[inline]`

References m_zero_transform.

WltFilter dirac::CodecParams::TransformFilter | ( |  | ) | const`[inline]`

References m_wlt_filter.

unsigned int dirac::CodecParams::TransformDepth | ( |  | ) | const`[inline]`

References m_wlt_depth.

CodeBlockMode dirac::CodecParams::GetCodeBlockMode | ( |  | ) | const`[inline]`

References m_cb_mode.

bool dirac::CodecParams::SpatialPartition | ( |  | ) | const`[inline]`

References m_spatial_partition.

bool dirac::CodecParams::DefaultSpatialPartition | ( |  | ) | const`[inline]`

References m_def_spatial_partition.

const CodeBlocks& dirac::CodecParams::GetCodeBlocks | ( | unsigned int | level | ) | const

VideoFormat dirac::CodecParams::GetVideoFormat | ( |  | ) | const`[inline]`

References m_video_format.

bool dirac::CodecParams::UsingGlobalMotion | ( |  | ) | const`[inline]`

References m_use_global_motion.

unsigned int dirac::CodecParams::FrameWeightsBits | ( |  | ) | const`[inline]`

References m_frame_weights_bits.

unsigned int dirac::CodecParams::Ref1Weight | ( |  | ) | const`[inline]`

References m_ref1_weight.

unsigned int dirac::CodecParams::Ref2Weight | ( |  | ) | const`[inline]`

References m_ref2_weight.

void dirac::CodecParams::SetXNumMB | ( | const int | xn | ) | `[inline]`

References m_x_num_mb.

void dirac::CodecParams::SetYNumMB | ( | const int | yn | ) | `[inline]`

References m_y_num_mb.

void dirac::CodecParams::SetXNumBlocks | ( | const int | xn | ) | `[inline]`

References m_x_num_blocks.

void dirac::CodecParams::SetYNumBlocks | ( | const int | yn | ) | `[inline]`

References m_y_num_blocks.

void dirac::CodecParams::SetVerbose | ( | bool | v | ) | `[inline]`

References m_verbose.

void dirac::CodecParams::SetInterlace | ( | bool | intlc | ) | `[inline]`

References m_interlace.

void dirac::CodecParams::SetTopFieldFirst | ( | bool | topf | ) | `[inline]`

References m_topfieldfirst.

void dirac::CodecParams::SetBlockSizes | ( | const OLBParams & | olbparams,
|  | const ChromaFormat | cformat |
| ) |  |  |

void dirac::CodecParams::SetLumaBlockParams | ( | const OLBParams & | olbparams | ) | `[inline]`

References m_lbparams.

void dirac::CodecParams::SetOrigXl | ( | const int | x | ) | `[inline]`

References m_orig_xl.

void dirac::CodecParams::SetOrigYl | ( | const int | y | ) | `[inline]`

References m_orig_yl.

void dirac::CodecParams::SetMVPrecision | ( | const MVPrecisionType | p | ) | `[inline]`

References m_mv_precision, and TESTM.

void dirac::CodecParams::SetMVPrecision | ( | const MVPrecisionType | p | ) | const`[inline]`

References m_mv_precision, and TESTM.

void dirac::CodecParams::SetZeroTransform | ( | bool | zero_transform | ) | `[inline]`

References m_zero_transform.

void dirac::CodecParams::SetTransformFilter | ( | const WltFilter | wf | ) | `[inline]`

References m_wlt_filter.

void dirac::CodecParams::SetTransformFilter | ( | unsigned int | wf_idx | ) |

void dirac::CodecParams::SetTransformDepth | ( | unsigned int | wd | ) |

void dirac::CodecParams::SetCodeBlockMode | ( | unsigned int | cb_mode | ) |

void dirac::CodecParams::SetSpatialPartition | ( | bool | spatial_partition | ) | `[inline]`

References m_spatial_partition.

void dirac::CodecParams::SetDefaultSpatialPartition | ( | bool | def_spatial_partition | ) | `[inline]`

References m_def_spatial_partition.

void dirac::CodecParams::SetCodeBlocks | ( | unsigned int | level,
|  | unsigned int | hblocks,
|  | unsigned int | vblocks |
| ) |  |  |

void dirac::CodecParams::SetDefaultCodeBlocks | ( | const FrameType & | ftype | ) |

void dirac::CodecParams::SetVideoFormat | ( | const VideoFormat | vd | ) | `[inline]`

References m_video_format.

void dirac::CodecParams::SetUsingGlobalMotion | ( | bool | gm | ) | `[inline]`

References m_use_global_motion.

void dirac::CodecParams::SetFrameWeightsPrecision | ( | unsigned int | wt_prec | ) | `[inline]`

References m_frame_weights_bits.

void dirac::CodecParams::SetRef1Weight | ( | unsigned int | wt | ) | `[inline]`

References m_ref1_weight.

void dirac::CodecParams::SetRef2Weight | ( | unsigned int | wt | ) | `[inline]`

References m_ref2_weight.

WltFilter dirac::CodecParams::TransformFilter | ( | unsigned int | wf_idx | ) | `[protected]`

## Member Data Documentation

int dirac::CodecParams::m_x_num_mb `[private]`

Referenced by SetXNumMB(), and XNumMB().

int dirac::CodecParams::m_y_num_mb `[private]`

Referenced by SetYNumMB(), and YNumMB().

int dirac::CodecParams::m_x_num_blocks `[private]`

Referenced by SetXNumBlocks(), and XNumBlocks().

int dirac::CodecParams::m_y_num_blocks `[private]`

Referenced by SetYNumBlocks(), and YNumBlocks().

bool dirac::CodecParams::m_verbose `[private]`

Referenced by SetVerbose(), and Verbose().

bool dirac::CodecParams::m_interlace `[private]`

Referenced by Interlace(), and SetInterlace().

bool dirac::CodecParams::m_topfieldfirst `[private]`

Referenced by SetTopFieldFirst(), and TopFieldFirst().

OneDArray<OLBParams> dirac::CodecParams::m_lbparams `[private]`

Referenced by LumaBParams(), and SetLumaBlockParams().

OneDArray<OLBParams> dirac::CodecParams::m_cbparams `[private]`

Referenced by ChromaBParams().

int dirac::CodecParams::m_orig_xl `[private]`

Referenced by OrigXl(), and SetOrigXl().

int dirac::CodecParams::m_orig_yl `[private]`

Referenced by OrigYl(), and SetOrigYl().

MVPrecisionType dirac::CodecParams::m_mv_precision `[mutable, private]`

Referenced by MVPrecision(), and SetMVPrecision().

VideoFormat dirac::CodecParams::m_video_format `[private]`

Referenced by GetVideoFormat(), and SetVideoFormat().

bool dirac::CodecParams::m_use_global_motion `[private]`

Referenced by SetUsingGlobalMotion(), and UsingGlobalMotion().

unsigned int dirac::CodecParams::m_frame_weights_bits `[private]`

Referenced by FrameWeightsBits(), and SetFrameWeightsPrecision().

unsigned int dirac::CodecParams::m_ref1_weight `[private]`

Referenced by Ref1Weight(), and SetRef1Weight().

unsigned int dirac::CodecParams::m_ref2_weight `[private]`

Referenced by Ref2Weight(), and SetRef2Weight().

bool dirac::CodecParams::m_zero_transform `[private]`

Referenced by SetZeroTransform(), and ZeroTransform().

WltFilter dirac::CodecParams::m_wlt_filter `[private]`

Referenced by SetTransformFilter(), and TransformFilter().

unsigned int dirac::CodecParams::m_wlt_depth `[private]`

Referenced by TransformDepth().

CodeBlockMode dirac::CodecParams::m_cb_mode `[private]`

Referenced by GetCodeBlockMode().

bool dirac::CodecParams::m_spatial_partition `[private]`

Referenced by SetSpatialPartition(), and SpatialPartition().

bool dirac::CodecParams::m_def_spatial_partition `[private]`

Referenced by DefaultSpatialPartition(), and SetDefaultSpatialPartition().

OneDArray<CodeBlocks> dirac::CodecParams::m_cb `[private]`

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

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