# Dirac - A Video Codec

Created by the British Broadcasting Corporation.

# common.h File Reference

`#include <libdirac_common/arrays.h>`
`#include <libdirac_common/common_types.h>`
`#include <libdirac_common/dirac_assertions.h>`
`#include <vector>`
`#include <cmath>`

Include dependency graph for common.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Namespaces

- namespace dirac

## Classes

- class dirac::FrameSort
    Frame type Class. More...
- class dirac::PicArray
    A class for picture component data. More...
- class dirac::CostType
    A structure for recording costs, particularly in quantisation. More...
- class dirac::EntropyCorrector
    A class used for correcting estimates of entropy. More...
- class dirac::OLBParams
    Parameters for overlapped block motion compensation. More...
- class dirac::SeqParams
    Parameters relating to the video sequence being encoded/decoded. More...
- class dirac::Rational
    Class defining a rational number. More...
- class dirac::ParseParams
    Parameters relating to the complexity of encoder/decoder. More...
- class dirac::SourceParams
    Parameters relating to the source material being encoded/decoded. More...
- class dirac::FrameParams
    Parameters for initialising frame class objects. More...
- class dirac::CodeBlocks
    Structure to hold code block sizes when spatial partitioning is used. More...
- class dirac::CodecParams
    Parameters common to coder and decoder operation. More...
- class dirac::EncoderParams
    Parameters for the encoding process. More...
- class dirac::DecoderParams
    Parameters for the decoding process. More...
- class dirac::QuantiserLists
    Class for encapsulating quantiser data. More...

## Enumerations

- enum dirac::PredMode {
  dirac::INTRA, dirac::REF1_ONLY, dirac::REF2_ONLY, dirac::REF1AND2,
  dirac::UNDEFINED
  }
    Prediction modes for blocks. More...
- enum dirac::CompSort { dirac::Y_COMP, dirac::U_COMP, dirac::V_COMP }
    Types of picture component. More...
- enum dirac::AddOrSub { dirac::ADD, dirac::SUBTRACT }
    Addition or subtraction. More...
- enum dirac::Direction { dirac::FORWARD, dirac::BACKWARD }
    Forward or backward. More...
- enum dirac::CtxAliases {
  dirac::SIGN0_CTX, dirac::SIGN_POS_CTX, dirac::SIGN_NEG_CTX, dirac::Z_FBIN1z_CTX,
  dirac::Z_FBIN1nz_CTX, dirac::Z_FBIN2_CTX, dirac::Z_FBIN3_CTX, dirac::Z_FBIN4_CTX,
  dirac::Z_FBIN5_CTX, dirac::Z_FBIN6plus_CTX, dirac::NZ_FBIN1z_CTX, dirac::NZ_FBIN1nz_CTX,
  dirac::NZ_FBIN2_CTX, dirac::NZ_FBIN3_CTX, dirac::NZ_FBIN4_CTX, dirac::NZ_FBIN5_CTX,
  dirac::NZ_FBIN6plus_CTX, dirac::INFO_CTX, dirac::BLOCK_SKIP_CTX, dirac::Q_OFFSET_FOLLOW_CTX,
  dirac::Q_OFFSET_INFO_CTX, dirac::Q_OFFSET_SIGN_CTX, dirac::TOTAL_COEFF_CTXS
  }
    Contexts used for coefficient coding. More...
- enum dirac::MvCtxAliases {
  dirac::YDC_FBIN1_CTX, dirac::YDC_FBIN2plus_CTX, dirac::YDC_INFO_CTX, dirac::YDC_SIGN_CTX,
  dirac::UDC_FBIN1_CTX, dirac::UDC_FBIN2plus_CTX, dirac::UDC_INFO_CTX, dirac::UDC_SIGN_CTX,
  dirac::VDC_FBIN1_CTX, dirac::VDC_FBIN2plus_CTX, dirac::VDC_INFO_CTX, dirac::VDC_SIGN_CTX,
  dirac::REF1x_FBIN1_CTX, dirac::REF1x_FBIN2_CTX, dirac::REF1x_FBIN3_CTX, dirac::REF1x_FBIN4_CTX,
  dirac::REF1x_FBIN5plus_CTX, dirac::REF1x_INFO_CTX, dirac::REF1x_SIGN_CTX, dirac::REF1y_FBIN1_CTX,
  dirac::REF1y_FBIN2_CTX, dirac::REF1y_FBIN3_CTX, dirac::REF1y_FBIN4_CTX, dirac::REF1y_FBIN5plus_CTX,
  dirac::REF1y_INFO_CTX, dirac::REF1y_SIGN_CTX, dirac::REF2x_FBIN1_CTX, dirac::REF2x_FBIN2_CTX,
  dirac::REF2x_FBIN3_CTX, dirac::REF2x_FBIN4_CTX, dirac::REF2x_FBIN5plus_CTX, dirac::REF2x_INFO_CTX,
  dirac::REF2x_SIGN_CTX, dirac::REF2y_FBIN1_CTX, dirac::REF2y_FBIN2_CTX, dirac::REF2y_FBIN3_CTX,
  dirac::REF2y_FBIN4_CTX, dirac::REF2y_FBIN5plus_CTX, dirac::REF2y_INFO_CTX, dirac::REF2y_SIGN_CTX,
  dirac::PMODE_BIT0_CTX, dirac::PMODE_BIT1_CTX, dirac::MB_CMODE_CTX, dirac::MB_SPLIT_BIN1_CTX,
  dirac::MB_SPLIT_BIN2_CTX, dirac::MB_SPLIT_INFO_CTX, dirac::TOTAL_MV_CTXS
  }
    Contexts used for MV data coding. More...

## Functions

- VideoFormat dirac::IntToVideoFormat (int video_format)
    Function to convert an integer to a valid VideoFormat.
- ChromaFormat dirac::IntToChromaFormat (int chroma_format)
    Function to convert an integer to a valid VideoFormat.
- FrameRateType dirac::IntToFrameRateType (int frame_rate_idx)
    Function to convert an integer to a valid FrameRate type.
- AspectRatioType dirac::IntToAspectRatioType (int aspect_ratio_idx)
    Function to convert an integer to a valid AspectRatio type.
- SignalRangeType dirac::IntToSignalRangeType (int signal_range_idx)
    Function to convert an integer to a valid SignalRange type.
- MVPrecisionType dirac::IntToMVPrecisionType (int mv_prec)
    Function to convert an integer to a valid motion-vector precision type.
- ValueType dirac::BChk (const ValueType &num, const ValueType &max)
    A simple bounds checking function, very useful in a number of places.

## Detailed Description

This file contains common classes used throughout the encoder and decoder. The main classes are the encoder and decoder parameters for controlling the encode and decode processes. These are passed throughout the codec. There are also parameter classes for sequences and frames.

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