# Dirac - A Video Codec

Created by the British Broadcasting Corporation.

# dirac::EncoderParams Class Reference

Parameters for the encoding process. More...

`#include <common.h>`

Inheritance diagram for dirac::EncoderParams:

[legend]
Collaboration diagram for dirac::EncoderParams:

[legend]

List of all members.

## Public Member Functions

- EncoderParams (const VideoFormat &video_format, FrameType ftype=INTER_FRAME, unsigned int num_refs=2, bool set_defaults=true)
    Default constructor.
- bool LocalDecode () const
    Returns a flag indicating that we're doing local decoding.
- bool Lossless () const
    Get whether we're doing lossless coding.
- float Qf () const
    Get the quality factor.
- int NumL1 () const
    Return the nominal number of L1 frames before the next I frame.
- int L1Sep () const
    Return the separation between L1 frames (and between L1 and I frames).
- float UFactor () const
    Return the amount we're weighting noise in the U component.
- float VFactor () const
    Return the amount we're weighting noise in the V component.
- float CPD () const
    Return the number of cycles per degree at the nominal viewing distance for the raster.
- bool Denoise () const
    Return whether input denoising is on or off.
- float ILambda () const
    Return the Lagrangian parameter to be used for I frames.
- float L1Lambda () const
    Return the Lagrangian parameter to be used for L1 frames.
- float L2Lambda () const
    Return the Lagrangian parameter to be used for L2 frames.
- float L1MELambda () const
    Return the Lagrangian ME parameter to be used for L1 frames.
- float L2MELambda () const
    Return the Lagrangian ME parameter to be used for L2 frames.
- int GOPLength () const
    Return the size of the GOP.
- char * OutputPath () const
    Return the output path to be used for storing diagnositic data.
- const EntropyCorrector & EntropyFactors () const
    Return a reference to the entropy factors.
- EntropyCorrector & EntropyFactors ()
    Return a reference to the entropy factors - we need to be able to change the values of the entropy factors in situ.
- WltFilter IntraTransformFilter ()
    Return the Wavelet filter to be used for intra frames.
- WltFilter InterTransformFilter ()
    Return the Wavelet filter to be used for Inter frames.
- int TargetRate ()
    Return the Target Bit Rate in kbps.
- void SetLocalDecode (const bool decode)
    Sets a flag indicating that we're producing a locally decoded o/p.
- void SetLossless (const bool l)
    Set whether we're doing lossless coding.
- void SetQf (const float qfac)
    Set the quality factor.
- void SetNumL1 (const int nl)
    Set the nominal number of L1 frames between I frames.
- void SetL1Sep (const int lsep)
    Set the separation between L1 frames.
- void SetUFactor (const float uf)
    Set the amount to weight noise in the U component.
- void SetVFactor (const float vf)
    Set the amount to weight noise in the V component.
- void SetCPD (const float cpd)
    Set the number of cycles per degree at the nominal viewing distance.
- void SetDenoise (const bool denoise)
    Set denoising value - true or false.
- void SetOutputPath (const char *op)
    Set the output path to be used for diagnostic data.
- void SetEntropyFactors (EntropyCorrector *entcorrect)
    Sets the entropy factors - TBD: set this up in a constructor and pass encoder params around entirely by reference.
- void SetIntraTransformFilter (unsigned int wf_idx)
    Set the Wavelet filter to be used for intra frames.
- void SetInterTransformFilter (unsigned int wf_idx)
    Set the Wavelet filter to be used for inter frames.
- void SetIntraTransformFilter (WltFilter wf)
    Set the Wavelet filter to be used for intra frames.
- void SetInterTransformFilter (WltFilter wf)
    Set the Wavelet filter to be used for inter frames.
- void SetTargetRate (const int rate)
    Set the target bit rate.

## Private Member Functions

- void CalcLambdas (const float qf)
    Calculate the Lagrangian parameters from the quality factor.

## Private Attributes

- bool m_loc_decode
    Flag indicating we're doing local decoding.
- bool m_lossless
    A flag indicating we're doing lossless coding.
- float m_qf
    Quality factor.
- int m_num_L1
    Number of L1 frames before next I frame.
- int m_L1_sep
    Separation between L1 frames.
- float m_ufactor
    factor for weighting U component quantisation errors
- float m_vfactor
    factor for weighting V component quantisation errors
- float m_cpd
    Cycles per degree assumed for viewing the video.
- bool m_denoise
    Flag indicating input denoising.
- float m_I_lambda
    Lagrangian parameter for Intra frame coding.
- float m_L1_lambda
    Lagrangian parameter for L1 frame coding.
- float m_L2_lambda
    Lagrangian parameter for L2 frame coding.
- float m_L1_me_lambda
    Lagrangian param for L1 motion estimation.
- float m_L2_me_lambda
    Lagrangian param for L2 motion estimation.
- EntropyCorrector * m_ent_correct
    Correction factors for quantiser selection.
- std::string m_output_path
    Output file path.
- WltFilter m_intra_wltfilter
    Wavelet filter for Intra frames.
- WltFilter m_inter_wltfilter
    Wavelet filter for Inter frames.
- int m_target_rate
    Target bit rate.

## Detailed Description

Parameters for the encoding process, derived from CodecParams.

## Constructor & Destructor Documentation

dirac::EncoderParams::EncoderParams | ( | const VideoFormat & | video_format,
|  | FrameType | ftype = `INTER_FRAME`,
|  | unsigned int | num_refs = `2`,
|  | bool | set_defaults = `true` |
| ) |  |  |

## Member Function Documentation

bool dirac::EncoderParams::LocalDecode | ( |  | ) | const`[inline]`

References m_loc_decode.

bool dirac::EncoderParams::Lossless | ( |  | ) | const`[inline]`

References m_lossless.

float dirac::EncoderParams::Qf | ( |  | ) | const`[inline]`

References m_qf.

int dirac::EncoderParams::NumL1 | ( |  | ) | const`[inline]`

Return the nominal number of L1 frames before the next I frame. Can be overridden by I-frame insertion

References m_num_L1.

int dirac::EncoderParams::L1Sep | ( |  | ) | const`[inline]`

References m_L1_sep.

float dirac::EncoderParams::UFactor | ( |  | ) | const`[inline]`

References m_ufactor.

float dirac::EncoderParams::VFactor | ( |  | ) | const`[inline]`

References m_vfactor.

float dirac::EncoderParams::CPD | ( |  | ) | const`[inline]`

References m_cpd.

bool dirac::EncoderParams::Denoise | ( |  | ) | const`[inline]`

References m_denoise.

float dirac::EncoderParams::ILambda | ( |  | ) | const`[inline]`

References m_I_lambda.

float dirac::EncoderParams::L1Lambda | ( |  | ) | const`[inline]`

References m_L1_lambda.

float dirac::EncoderParams::L2Lambda | ( |  | ) | const`[inline]`

References m_L2_lambda.

float dirac::EncoderParams::L1MELambda | ( |  | ) | const`[inline]`

References m_L1_me_lambda.

float dirac::EncoderParams::L2MELambda | ( |  | ) | const`[inline]`

References m_L2_me_lambda.

int dirac::EncoderParams::GOPLength | ( |  | ) | const`[inline]`

References m_L1_sep, and m_num_L1.

char* dirac::EncoderParams::OutputPath | ( |  | ) | const`[inline]`

References m_output_path.

const EntropyCorrector& dirac::EncoderParams::EntropyFactors | ( |  | ) | const`[inline]`

References m_ent_correct.

EntropyCorrector& dirac::EncoderParams::EntropyFactors | ( |  | ) | `[inline]`

References m_ent_correct.

WltFilter dirac::EncoderParams::IntraTransformFilter | ( |  | ) | `[inline]`

References m_intra_wltfilter.

WltFilter dirac::EncoderParams::InterTransformFilter | ( |  | ) | `[inline]`

References m_inter_wltfilter.

int dirac::EncoderParams::TargetRate | ( |  | ) | `[inline]`

References m_target_rate.

void dirac::EncoderParams::SetLocalDecode | ( | const bool | decode | ) | `[inline]`

References m_loc_decode.

void dirac::EncoderParams::SetLossless | ( | const bool | l | ) | `[inline]`

References m_lossless.

void dirac::EncoderParams::SetQf | ( | const float | qfac | ) | `[inline]`

References CalcLambdas(), and m_qf.

void dirac::EncoderParams::SetNumL1 | ( | const int | nl | ) | `[inline]`

References m_num_L1.

void dirac::EncoderParams::SetL1Sep | ( | const int | lsep | ) | `[inline]`

References m_L1_sep.

void dirac::EncoderParams::SetUFactor | ( | const float | uf | ) | `[inline]`

References m_ufactor.

void dirac::EncoderParams::SetVFactor | ( | const float | vf | ) | `[inline]`

References m_vfactor.

void dirac::EncoderParams::SetCPD | ( | const float | cpd | ) | `[inline]`

References m_cpd.

void dirac::EncoderParams::SetDenoise | ( | const bool | denoise | ) | `[inline]`

References m_denoise.

void dirac::EncoderParams::SetOutputPath | ( | const char * | op | ) | `[inline]`

References m_output_path.

void dirac::EncoderParams::SetEntropyFactors | ( | EntropyCorrector * | entcorrect | ) | `[inline]`

References m_ent_correct.

void dirac::EncoderParams::SetIntraTransformFilter | ( | unsigned int | wf_idx | ) |

void dirac::EncoderParams::SetInterTransformFilter | ( | unsigned int | wf_idx | ) |

void dirac::EncoderParams::SetIntraTransformFilter | ( | WltFilter | wf | ) | `[inline]`

References m_intra_wltfilter.

void dirac::EncoderParams::SetInterTransformFilter | ( | WltFilter | wf | ) | `[inline]`

References m_inter_wltfilter.

void dirac::EncoderParams::SetTargetRate | ( | const int | rate | ) | `[inline]`

References m_target_rate.

void dirac::EncoderParams::CalcLambdas | ( | const float | qf | ) | `[private]`

Referenced by SetQf().

## Member Data Documentation

bool dirac::EncoderParams::m_loc_decode`[private]`

Referenced by LocalDecode(), and SetLocalDecode().

bool dirac::EncoderParams::m_lossless`[private]`

Referenced by Lossless(), and SetLossless().

float dirac::EncoderParams::m_qf`[private]`

Referenced by Qf(), and SetQf().

int dirac::EncoderParams::m_num_L1`[private]`

Referenced by GOPLength(), NumL1(), and SetNumL1().

int dirac::EncoderParams::m_L1_sep`[private]`

Referenced by GOPLength(), L1Sep(), and SetL1Sep().

float dirac::EncoderParams::m_ufactor`[private]`

Referenced by SetUFactor(), and UFactor().

float dirac::EncoderParams::m_vfactor`[private]`

Referenced by SetVFactor(), and VFactor().

float dirac::EncoderParams::m_cpd`[private]`

Referenced by CPD(), and SetCPD().

bool dirac::EncoderParams::m_denoise`[private]`

Referenced by Denoise(), and SetDenoise().

float dirac::EncoderParams::m_I_lambda`[private]`

Referenced by ILambda().

float dirac::EncoderParams::m_L1_lambda`[private]`

Referenced by L1Lambda().

float dirac::EncoderParams::m_L2_lambda`[private]`

Referenced by L2Lambda().

float dirac::EncoderParams::m_L1_me_lambda`[private]`

Referenced by L1MELambda().

float dirac::EncoderParams::m_L2_me_lambda`[private]`

Referenced by L2MELambda().

EntropyCorrector* dirac::EncoderParams::m_ent_correct`[private]`

Referenced by EntropyFactors(), and SetEntropyFactors().

std::string dirac::EncoderParams::m_output_path`[private]`

Referenced by OutputPath(), and SetOutputPath().

WltFilter dirac::EncoderParams::m_intra_wltfilter`[private]`

Referenced by IntraTransformFilter(), and SetIntraTransformFilter().

WltFilter dirac::EncoderParams::m_inter_wltfilter`[private]`

Referenced by InterTransformFilter(), and SetInterTransformFilter().

int dirac::EncoderParams::m_target_rate`[private]`

Referenced by SetTargetRate(), and TargetRate().

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.