# Dirac - A Video Codec

Created by the British Broadcasting Corporation.

Public Member Functions | Private Member Functions | Private Attributes
dirac::EncoderParams Class Reference

Parameters for the encoding process. More...

`#include <common.h>`

Inheritance diagram for dirac::EncoderParams:

List of all members.

## Public Member Functions
| EncoderParams (const VideoFormat &video_format, PictureType ftype=INTER_PICTURE, unsigned int num_refs=2, bool set_defaults=true)
| Default constructor.
bool | Verbose () const
| Returns true if we're operating verbosely, false otherwise.
bool | LocalDecode () const
| Returns a flag indicating that we're doing local decoding.
bool | Lossless () const
| Get whether we're doing lossless coding.
bool | FullSearch () const
| Get whether we're doing full-search motion estimation.
int | XRangeME () const
| Get the horizontal search range for full-search motion estimation.
int | YRangeME () const
| Get the vertical search range for full-search motion estimation.
bool | CombinedME () const
| Get whether we're doing combined component motion estimation.
float | Qf () const
| Get the quality factor.
int | NumL1 () const
| Return the nominal number of L1 pictures before the next I picture.
int | L1Sep () const
| Return the separation between L1 pictures (and between L1 and I pictures)
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.
PrefilterType | Prefilter () const
| Return what prefiltering is in place.
int | PrefilterStrength () const
| Return the prefiltering strength.
float | ILambda () const
| Return the Lagrangian parameter to be used for I pictures.
float | L1Lambda () const
| Return the Lagrangian parameter to be used for L1 pictures.
float | L2Lambda () const
| Return the Lagrangian parameter to be used for L2 pictures.
float | L1MELambda () const
| Return the Lagrangian ME parameter to be used for L1 pictures.
float | L2MELambda () const
| Return the Lagrangian ME parameter to be used for L2 pictures.
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 pictures.
WltFilter | InterTransformFilter ()
| Return the Wavelet filter to be used for Inter pictures.
int | TargetRate ()
| Return the Target Bit Rate in kbps.
bool | UsingAC () const
| Return true if using Arithmetic coding.
void | SetVerbose (bool v)
| Sets verbosity on or off.
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 | SetFullSearch (const bool fs)
| Set whether we're doing full-search motion estimation.
void | SetCombinedME (const bool cme)
| Set whether we're doing combined component motion estimation.
void | SetXRangeME (const int xr)
| Set the horizontal search range for full-search motion estimation.
void | SetYRangeME (const int yr)
| Set the vertical search range for full-search motion estimation.
void | SetQf (const float qfac)
| Set the quality factor.
void | SetNumL1 (const int nl)
| Set the nominal number of L1 pictures between I pictures.
void | SetL1Sep (const int lsep)
| Set the separation between L1 pictures.
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 | SetPrefilter (const PrefilterType pf, const int str)
| 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 pictures.
void | SetInterTransformFilter (unsigned int wf_idx)
| Set the Wavelet filter to be used for inter pictures.
void | SetIntraTransformFilter (WltFilter wf)
| Set the Wavelet filter to be used for intra pictures.
void | SetUsualCodeBlocks (const PictureType &ftype)
| Set the number of code blocks for all levels.
void | SetInterTransformFilter (WltFilter wf)
| Set the Wavelet filter to be used for inter pictures.
void | SetTargetRate (const int rate)
| Set the target bit rate.
void | SetUsingAC (bool using_ac)
| Set the arithmetic coding flag.
Public Member Functions inherited from dirac::CodecParams
| CodecParams (const VideoFormat &video_format=VIDEO_FORMAT_CUSTOM, PictureType ftype=INTRA_PICTURE, unsigned int num_refs=0, bool set_defaults=true)
| Default constructor.
int | PictureCodingMode () const
| Returns the picture coding mode (independent of source format)
bool | FieldCoding () const
| Returns true if the pictures are being coded as fields (mode 1 or 3)
bool | TopFieldFirst () const
| Returns true if the topmost field comes first in time when coding.
int | Xl () const
| Return the picture/field luma width.
int | Yl () const
| Return the picture/field luma height.
int | ChromaXl () const
| Return the picture/field chroma width.
int | ChromaYl () const
| Return the picture/field chroma height.
unsigned int | LumaDepth () const
| Returns the luma depth.
unsigned int | ChromaDepth () const
| Returns the chroma depth.
bool | ZeroTransform () const
| Return zero transform flag being used for picture (de)coding.
WltFilter | TransformFilter () const
| Return the wavelet filter currently being used for picture (de)coding.
unsigned int | TransformDepth () const
| Return the transform depth being used for picture (de)coding.
CodeBlockMode | GetCodeBlockMode () const
| Return multiple quantisers flag being used for picture (de)coding.
bool | SpatialPartition () const
| Return the spatial partitioning flag being used for picture (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 picture (de)coding.
PicturePredParams & | GetPicPredParams ()
| Return the picture prediction params.
const PicturePredParams & | GetPicPredParams () const
| Return the picture prediction params.
void | SetPictureCodingMode (int pic_coding)
| Sets whether input is coded as fields or quincunxially.
void | SetTopFieldFirst (bool topf)
| Sets whether the topmost field comes first in time [NB: TBD since this duplicates metadata in the sequence header].
void | SetXl (const int x)
| Set the picture/field luma width.
void | SetYl (const int y)
| Set the picture/field luma height.
void | SetChromaXl (const int x)
| Set the frame/field chroma width.
void | SetChromaYl (const int y)
| Set the frame/field chroma height.
void | SetLumaDepth (unsigned int luma_depth)
| Set Luma Depth.
void | SetChromaDepth (unsigned int chroma_depth)
| Set Chroma Depth.
void | SetZeroTransform (bool zero_transform)
| Set the zero transform flag being used for picture (de)coding.
void | SetTransformFilter (const WltFilter wf)
| Set the wavelet filter used for picture (de)coding.
void | SetTransformFilter (unsigned int wf_idx)
| Set the wavelet filter used for picture (de)coding.
void | SetTransformDepth (unsigned int wd)
| Set the transform depth used for picture (de)coding and allocate for the code blocks array.
void | SetCodeBlockMode (unsigned int cb_mode)
| Set the multiple quantisers flag usedto picture (de)coding.
void | SetSpatialPartition (bool spatial_partition)
| Set the spatial partition flag usedto picture (de)coding.
void | SetCodeBlocks (unsigned int level, unsigned int hblocks, unsigned int vblocks)
| Set the number of code blocks for a particular level.
void | SetVideoFormat (const VideoFormat vd)
| Set the video format used for picture (de)coding.

## Private Member Functions
void | CalcLambdas (const float qf)
| Calculate the Lagrangian parameters from the quality factor.

## Private Attributes
bool | m_verbose
| Code/decode with commentary if true.
bool | m_loc_decode
| Flag indicating we're doing local decoding.
bool | m_lossless
| A flag indicating we're doing lossless coding.
bool | m_full_search
| A flag indicating whether we're doing full-search block matching.
bool | m_combined_me
| A flag indicating whether we're doing combined component motion estimation.
int | m_x_range_me
| The horizontal range for full-search block matching.
int | m_y_range_me
| The vertical range for full-search block matching.
float | m_qf
| Quality factor.
int | m_num_L1
| Number of L1 pictures before next I picture.
int | m_L1_sep
| Separation between L1 pictures.
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.
PrefilterType | m_prefilter
| Indicator for prefiltering.
int | m_prefilter_strength
| Prefiltering strength.
float | m_I_lambda
| Lagrangian parameter for Intra picture coding.
float | m_L1_lambda
| Lagrangian parameter for L1 picture coding.
float | m_L2_lambda
| Lagrangian parameter for L2 picture 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 pictures.
WltFilter | m_inter_wltfilter
| Wavelet filter for Inter pictures.
int | m_target_rate
| Target bit rate.
bool | m_using_ac
| Arithmetic coding flag.

## Additional Inherited Members
Protected Member Functions inherited from dirac::CodecParams
WltFilter | TransformFilter (unsigned int wf_idx)
| Return the Wavelet filter associated with the wavelet index.

## Detailed Description

Parameters for the encoding process, derived from CodecParams.

## Constructor & Destructor Documentation

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

## Member Function Documentation

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

Referenced by SetQf().

bool dirac::EncoderParams::CombinedME | ( |  | ) | const
| inline

References m_combined_me.

float dirac::EncoderParams::CPD | ( |  | ) | const
| inline

References m_cpd.

const EntropyCorrector& dirac::EncoderParams::EntropyFactors | ( |  | ) | const
| inline

References m_ent_correct.

EntropyCorrector& dirac::EncoderParams::EntropyFactors | ( |  | ) |
| inline

References m_ent_correct.

bool dirac::EncoderParams::FullSearch | ( |  | ) | const
| inline

References m_full_search.

int dirac::EncoderParams::GOPLength | ( |  | ) | const

float dirac::EncoderParams::ILambda | ( |  | ) | const
| inline

References m_I_lambda.

WltFilter dirac::EncoderParams::InterTransformFilter | ( |  | ) |
| inline

References m_inter_wltfilter.

WltFilter dirac::EncoderParams::IntraTransformFilter | ( |  | ) |
| inline

References m_intra_wltfilter.

float dirac::EncoderParams::L1Lambda | ( |  | ) | const
| inline

References m_L1_lambda.

float dirac::EncoderParams::L1MELambda | ( |  | ) | const
| inline

References m_L1_me_lambda.

int dirac::EncoderParams::L1Sep | ( |  | ) | const
| inline

References m_L1_sep.

float dirac::EncoderParams::L2Lambda | ( |  | ) | const
| inline

References m_L2_lambda.

float dirac::EncoderParams::L2MELambda | ( |  | ) | const
| inline

References m_L2_me_lambda.

bool dirac::EncoderParams::LocalDecode | ( |  | ) | const
| inline

References m_loc_decode.

bool dirac::EncoderParams::Lossless | ( |  | ) | const
| inline

References m_lossless.

int dirac::EncoderParams::NumL1 | ( |  | ) | const
| inline

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

References m_num_L1.

char* dirac::EncoderParams::OutputPath | ( |  | ) | const
| inline

References m_output_path.

PrefilterType dirac::EncoderParams::Prefilter | ( |  | ) | const
| inline

References m_prefilter.

int dirac::EncoderParams::PrefilterStrength | ( |  | ) | const
| inline

References m_prefilter_strength.

float dirac::EncoderParams::Qf | ( |  | ) | const
| inline

References m_qf.

void dirac::EncoderParams::SetCombinedME | ( | const bool | cme | ) |
| inline

References m_combined_me.

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

References m_cpd.

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

References m_ent_correct.

void dirac::EncoderParams::SetFullSearch | ( | const bool | fs | ) |
| inline

References m_full_search.

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

void dirac::EncoderParams::SetInterTransformFilter | ( | WltFilter | wf | ) |
| inline

References m_inter_wltfilter.

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

void dirac::EncoderParams::SetIntraTransformFilter | ( | WltFilter | wf | ) |
| inline

References m_intra_wltfilter.

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

References m_L1_sep.

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::SetNumL1 | ( | const int | nl | ) |
| inline

References m_num_L1.

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

References m_output_path.

void dirac::EncoderParams::SetPrefilter | ( | const PrefilterType | pf,
|  | const int | str
| ) |  |
| inline

References m_prefilter, and m_prefilter_strength.

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

References CalcLambdas(), and m_qf.

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

References m_target_rate.

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

References m_ufactor.

void dirac::EncoderParams::SetUsingAC | ( | bool | using_ac | ) |
| inline

References m_using_ac.

void dirac::EncoderParams::SetUsualCodeBlocks | ( | const PictureType & | ftype | ) |

void dirac::EncoderParams::SetVerbose | ( | bool | v | ) |
| inline

References m_verbose.

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

References m_vfactor.

void dirac::EncoderParams::SetXRangeME | ( | const int | xr | ) |
| inline

References m_x_range_me.

void dirac::EncoderParams::SetYRangeME | ( | const int | yr | ) |
| inline

References m_y_range_me.

int dirac::EncoderParams::TargetRate | ( |  | ) |
| inline

References m_target_rate.

float dirac::EncoderParams::UFactor | ( |  | ) | const
| inline

References m_ufactor.

bool dirac::EncoderParams::UsingAC | ( |  | ) | const
| inline

References m_using_ac.

bool dirac::EncoderParams::Verbose | ( |  | ) | const
| inline

References m_verbose.

float dirac::EncoderParams::VFactor | ( |  | ) | const
| inline

References m_vfactor.

int dirac::EncoderParams::XRangeME | ( |  | ) | const
| inline

References m_x_range_me.

int dirac::EncoderParams::YRangeME | ( |  | ) | const
| inline

References m_y_range_me.

## Member Data Documentation

bool dirac::EncoderParams::m_combined_me
| private

Referenced by CombinedME(), and SetCombinedME().

float dirac::EncoderParams::m_cpd
| private

Referenced by CPD(), and SetCPD().

EntropyCorrector* dirac::EncoderParams::m_ent_correct
| private

Referenced by EntropyFactors(), and SetEntropyFactors().

bool dirac::EncoderParams::m_full_search
| private

Referenced by FullSearch(), and SetFullSearch().

float dirac::EncoderParams::m_I_lambda
| private

Referenced by ILambda().

WltFilter dirac::EncoderParams::m_inter_wltfilter
| private

Referenced by InterTransformFilter(), and SetInterTransformFilter().

WltFilter dirac::EncoderParams::m_intra_wltfilter
| private

Referenced by IntraTransformFilter(), and SetIntraTransformFilter().

float dirac::EncoderParams::m_L1_lambda
| private

Referenced by L1Lambda().

float dirac::EncoderParams::m_L1_me_lambda
| private

Referenced by L1MELambda().

int dirac::EncoderParams::m_L1_sep
| private

Referenced by L1Sep(), and SetL1Sep().

float dirac::EncoderParams::m_L2_lambda
| private

Referenced by L2Lambda().

float dirac::EncoderParams::m_L2_me_lambda
| private

Referenced by L2MELambda().

bool dirac::EncoderParams::m_loc_decode
| private

Referenced by LocalDecode(), and SetLocalDecode().

bool dirac::EncoderParams::m_lossless
| private

Referenced by Lossless(), and SetLossless().

int dirac::EncoderParams::m_num_L1
| private

Referenced by NumL1(), and SetNumL1().

std::string dirac::EncoderParams::m_output_path
| private

Referenced by OutputPath(), and SetOutputPath().

PrefilterType dirac::EncoderParams::m_prefilter
| private

Referenced by Prefilter(), and SetPrefilter().

int dirac::EncoderParams::m_prefilter_strength
| private

Referenced by PrefilterStrength(), and SetPrefilter().

float dirac::EncoderParams::m_qf
| private

Referenced by Qf(), and SetQf().

int dirac::EncoderParams::m_target_rate
| private

Referenced by SetTargetRate(), and TargetRate().

float dirac::EncoderParams::m_ufactor
| private

Referenced by SetUFactor(), and UFactor().

bool dirac::EncoderParams::m_using_ac
| private

Referenced by SetUsingAC(), and UsingAC().

bool dirac::EncoderParams::m_verbose
| private

Referenced by SetVerbose(), and Verbose().

float dirac::EncoderParams::m_vfactor
| private

Referenced by SetVFactor(), and VFactor().

int dirac::EncoderParams::m_x_range_me
| private

Referenced by SetXRangeME(), and XRangeME().

int dirac::EncoderParams::m_y_range_me
| private

Referenced by SetYRangeME(), and YRangeME().

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.