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:
Collaboration diagram for dirac::EncoderParams:

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 EntropyCorrectorEntropyFactors () const
 Return a reference to the entropy factors.
EntropyCorrectorEntropyFactors ()
 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 CodeBlocksGetCodeBlocks (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.
PicturePredParamsGetPicPredParams ()
 Return the picture prediction params.
const PicturePredParamsGetPicPredParams () 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.
EntropyCorrectorm_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

◆ EncoderParams()

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

References INTER_PICTURE.

Member Function Documentation

◆ CalcLambdas()

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

Referenced by SetQf().

◆ CombinedME()

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

References m_combined_me.

◆ CPD()

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

References m_cpd.

◆ EntropyFactors() [1/2]

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

References m_ent_correct.

◆ EntropyFactors() [2/2]

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

References m_ent_correct.

◆ FullSearch()

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

References m_full_search.

◆ GOPLength()

int dirac::EncoderParams::GOPLength ( ) const

◆ ILambda()

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

References m_I_lambda.

◆ InterTransformFilter()

WltFilter dirac::EncoderParams::InterTransformFilter ( )
inline

References m_inter_wltfilter.

◆ IntraTransformFilter()

WltFilter dirac::EncoderParams::IntraTransformFilter ( )
inline

References m_intra_wltfilter.

◆ L1Lambda()

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

References m_L1_lambda.

◆ L1MELambda()

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

References m_L1_me_lambda.

◆ L1Sep()

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

References m_L1_sep.

◆ L2Lambda()

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

References m_L2_lambda.

◆ L2MELambda()

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

References m_L2_me_lambda.

◆ LocalDecode()

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

References m_loc_decode.

◆ Lossless()

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

References m_lossless.

◆ NumL1()

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.

◆ OutputPath()

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

References m_output_path.

◆ Prefilter()

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

References m_prefilter.

◆ PrefilterStrength()

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

References m_prefilter_strength.

◆ Qf()

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

References m_qf.

◆ SetCombinedME()

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

References m_combined_me.

◆ SetCPD()

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

References m_cpd.

◆ SetEntropyFactors()

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

References m_ent_correct.

◆ SetFullSearch()

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

References m_full_search.

◆ SetInterTransformFilter() [1/2]

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

◆ SetInterTransformFilter() [2/2]

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

References m_inter_wltfilter.

◆ SetIntraTransformFilter() [1/2]

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

◆ SetIntraTransformFilter() [2/2]

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

References m_intra_wltfilter.

◆ SetL1Sep()

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

References m_L1_sep.

◆ SetLocalDecode()

void dirac::EncoderParams::SetLocalDecode ( const bool decode)
inline

References m_loc_decode.

◆ SetLossless()

void dirac::EncoderParams::SetLossless ( const bool l)
inline

References m_lossless.

◆ SetNumL1()

void dirac::EncoderParams::SetNumL1 ( const int nl)
inline

References m_num_L1.

◆ SetOutputPath()

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

References m_output_path.

◆ SetPrefilter()

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

◆ SetQf()

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

References CalcLambdas(), and m_qf.

◆ SetTargetRate()

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

References m_target_rate.

◆ SetUFactor()

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

References m_ufactor.

◆ SetUsingAC()

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

References m_using_ac.

◆ SetUsualCodeBlocks()

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

◆ SetVerbose()

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

References m_verbose.

◆ SetVFactor()

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

References m_vfactor.

◆ SetXRangeME()

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

References m_x_range_me.

◆ SetYRangeME()

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

References m_y_range_me.

◆ TargetRate()

int dirac::EncoderParams::TargetRate ( )
inline

References m_target_rate.

◆ UFactor()

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

References m_ufactor.

◆ UsingAC()

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

References m_using_ac.

◆ Verbose()

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

References m_verbose.

◆ VFactor()

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

References m_vfactor.

◆ XRangeME()

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

References m_x_range_me.

◆ YRangeME()

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

References m_y_range_me.

Member Data Documentation

◆ m_combined_me

bool dirac::EncoderParams::m_combined_me
private

Referenced by CombinedME(), and SetCombinedME().

◆ m_cpd

float dirac::EncoderParams::m_cpd
private

Referenced by CPD(), and SetCPD().

◆ m_ent_correct

EntropyCorrector* dirac::EncoderParams::m_ent_correct
private

◆ m_full_search

bool dirac::EncoderParams::m_full_search
private

Referenced by FullSearch(), and SetFullSearch().

◆ m_I_lambda

float dirac::EncoderParams::m_I_lambda
private

Referenced by ILambda().

◆ m_inter_wltfilter

WltFilter dirac::EncoderParams::m_inter_wltfilter
private

◆ m_intra_wltfilter

WltFilter dirac::EncoderParams::m_intra_wltfilter
private

◆ m_L1_lambda

float dirac::EncoderParams::m_L1_lambda
private

Referenced by L1Lambda().

◆ m_L1_me_lambda

float dirac::EncoderParams::m_L1_me_lambda
private

Referenced by L1MELambda().

◆ m_L1_sep

int dirac::EncoderParams::m_L1_sep
private

Referenced by L1Sep(), and SetL1Sep().

◆ m_L2_lambda

float dirac::EncoderParams::m_L2_lambda
private

Referenced by L2Lambda().

◆ m_L2_me_lambda

float dirac::EncoderParams::m_L2_me_lambda
private

Referenced by L2MELambda().

◆ m_loc_decode

bool dirac::EncoderParams::m_loc_decode
private

Referenced by LocalDecode(), and SetLocalDecode().

◆ m_lossless

bool dirac::EncoderParams::m_lossless
private

Referenced by Lossless(), and SetLossless().

◆ m_num_L1

int dirac::EncoderParams::m_num_L1
private

Referenced by NumL1(), and SetNumL1().

◆ m_output_path

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

Referenced by OutputPath(), and SetOutputPath().

◆ m_prefilter

PrefilterType dirac::EncoderParams::m_prefilter
private

Referenced by Prefilter(), and SetPrefilter().

◆ m_prefilter_strength

int dirac::EncoderParams::m_prefilter_strength
private

Referenced by PrefilterStrength(), and SetPrefilter().

◆ m_qf

float dirac::EncoderParams::m_qf
private

Referenced by Qf(), and SetQf().

◆ m_target_rate

int dirac::EncoderParams::m_target_rate
private

Referenced by SetTargetRate(), and TargetRate().

◆ m_ufactor

float dirac::EncoderParams::m_ufactor
private

Referenced by SetUFactor(), and UFactor().

◆ m_using_ac

bool dirac::EncoderParams::m_using_ac
private

Referenced by SetUsingAC(), and UsingAC().

◆ m_verbose

bool dirac::EncoderParams::m_verbose
private

Referenced by SetVerbose(), and Verbose().

◆ m_vfactor

float dirac::EncoderParams::m_vfactor
private

Referenced by SetVFactor(), and VFactor().

◆ m_x_range_me

int dirac::EncoderParams::m_x_range_me
private

Referenced by SetXRangeME(), and XRangeME().

◆ m_y_range_me

int dirac::EncoderParams::m_y_range_me
private

Referenced by SetYRangeME(), and YRangeME().


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

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