Dirac - A Video Codec

Created by the British Broadcasting Corporation.


Public Member Functions | Private Member Functions | Private Attributes | List of all members
dirac::EncoderParams Class Reference

Parameters for the encoding process. More...

#include <common.h>

Inheritance diagram for dirac::EncoderParams:
Inheritance graph
[legend]
Collaboration diagram for dirac::EncoderParams:
Collaboration graph
[legend]

Public Member Functions

 EncoderParams (const VideoFormat &video_format, PictureType ftype=INTER_PICTURE, unsigned int num_refs=2, bool set_defaults=true)
 Default constructor. More...
 
bool Verbose () const
 Returns true if we're operating verbosely, false otherwise. More...
 
bool LocalDecode () const
 Returns a flag indicating that we're doing local decoding. More...
 
bool Lossless () const
 Get whether we're doing lossless coding. More...
 
bool FullSearch () const
 Get whether we're doing full-search motion estimation. More...
 
int XRangeME () const
 Get the horizontal search range for full-search motion estimation. More...
 
int YRangeME () const
 Get the vertical search range for full-search motion estimation. More...
 
bool CombinedME () const
 Get whether we're doing combined component motion estimation. More...
 
float Qf () const
 Get the quality factor. More...
 
int NumL1 () const
 Return the nominal number of L1 pictures before the next I picture. More...
 
int L1Sep () const
 Return the separation between L1 pictures (and between L1 and I pictures) More...
 
float UFactor () const
 Return the amount we're weighting noise in the U component. More...
 
float VFactor () const
 Return the amount we're weighting noise in the V component. More...
 
float CPD () const
 Return the number of cycles per degree at the nominal viewing distance for the raster. More...
 
PrefilterType Prefilter () const
 Return what prefiltering is in place. More...
 
int PrefilterStrength () const
 Return the prefiltering strength. More...
 
float ILambda () const
 Return the Lagrangian parameter to be used for I pictures. More...
 
float L1Lambda () const
 Return the Lagrangian parameter to be used for L1 pictures. More...
 
float L2Lambda () const
 Return the Lagrangian parameter to be used for L2 pictures. More...
 
float L1MELambda () const
 Return the Lagrangian ME parameter to be used for L1 pictures. More...
 
float L2MELambda () const
 Return the Lagrangian ME parameter to be used for L2 pictures. More...
 
int GOPLength () const
 Return the size of the GOP. More...
 
char * OutputPath () const
 Return the output path to be used for storing diagnositic data. More...
 
const EntropyCorrectorEntropyFactors () const
 Return a reference to the entropy factors. More...
 
EntropyCorrectorEntropyFactors ()
 Return a reference to the entropy factors - we need to be able to change the values of the entropy factors in situ. More...
 
WltFilter IntraTransformFilter ()
 Return the Wavelet filter to be used for intra pictures. More...
 
WltFilter InterTransformFilter ()
 Return the Wavelet filter to be used for Inter pictures. More...
 
int TargetRate ()
 Return the Target Bit Rate in kbps. More...
 
bool UsingAC () const
 Return true if using Arithmetic coding. More...
 
void SetVerbose (bool v)
 Sets verbosity on or off. More...
 
void SetLocalDecode (const bool decode)
 Sets a flag indicating that we're producing a locally decoded o/p. More...
 
void SetLossless (const bool l)
 Set whether we're doing lossless coding. More...
 
void SetFullSearch (const bool fs)
 Set whether we're doing full-search motion estimation. More...
 
void SetCombinedME (const bool cme)
 Set whether we're doing combined component motion estimation. More...
 
void SetXRangeME (const int xr)
 Set the horizontal search range for full-search motion estimation. More...
 
void SetYRangeME (const int yr)
 Set the vertical search range for full-search motion estimation. More...
 
void SetQf (const float qfac)
 Set the quality factor. More...
 
void SetNumL1 (const int nl)
 Set the nominal number of L1 pictures between I pictures. More...
 
void SetL1Sep (const int lsep)
 Set the separation between L1 pictures. More...
 
void SetUFactor (const float uf)
 Set the amount to weight noise in the U component. More...
 
void SetVFactor (const float vf)
 Set the amount to weight noise in the V component. More...
 
void SetCPD (const float cpd)
 Set the number of cycles per degree at the nominal viewing distance. More...
 
void SetPrefilter (const PrefilterType pf, const int str)
 Set denoising value - true or false. More...
 
void SetOutputPath (const char *op)
 Set the output path to be used for diagnostic data. More...
 
void SetEntropyFactors (EntropyCorrector *entcorrect)
 Sets the entropy factors - TBD: set this up in a constructor and pass encoder params around entirely by reference. More...
 
void SetIntraTransformFilter (unsigned int wf_idx)
 Set the Wavelet filter to be used for intra pictures. More...
 
void SetInterTransformFilter (unsigned int wf_idx)
 Set the Wavelet filter to be used for inter pictures. More...
 
void SetIntraTransformFilter (WltFilter wf)
 Set the Wavelet filter to be used for intra pictures. More...
 
void SetUsualCodeBlocks (const PictureType &ftype)
 Set the number of code blocks for all levels. More...
 
void SetInterTransformFilter (WltFilter wf)
 Set the Wavelet filter to be used for inter pictures. More...
 
void SetTargetRate (const int rate)
 Set the target bit rate. More...
 
void SetUsingAC (bool using_ac)
 Set the arithmetic coding flag. More...
 
- 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. More...
 
int PictureCodingMode () const
 Returns the picture coding mode (independent of source format) More...
 
bool FieldCoding () const
 Returns true if the pictures are being coded as fields (mode 1 or 3) More...
 
bool TopFieldFirst () const
 Returns true if the topmost field comes first in time when coding. More...
 
int Xl () const
 Return the picture/field luma width. More...
 
int Yl () const
 Return the picture/field luma height. More...
 
int ChromaXl () const
 Return the picture/field chroma width. More...
 
int ChromaYl () const
 Return the picture/field chroma height. More...
 
unsigned int LumaDepth () const
 Returns the luma depth. More...
 
unsigned int ChromaDepth () const
 Returns the chroma depth. More...
 
bool ZeroTransform () const
 Return zero transform flag being used for picture (de)coding. More...
 
WltFilter TransformFilter () const
 Return the wavelet filter currently being used for picture (de)coding. More...
 
unsigned int TransformDepth () const
 Return the transform depth being used for picture (de)coding. More...
 
CodeBlockMode GetCodeBlockMode () const
 Return multiple quantisers flag being used for picture (de)coding. More...
 
bool SpatialPartition () const
 Return the spatial partitioning flag being used for picture (de)coding. More...
 
const CodeBlocksGetCodeBlocks (unsigned int level) const
 Return the code blocks for a particular level. More...
 
VideoFormat GetVideoFormat () const
 Return the video format currently being used for picture (de)coding. More...
 
PicturePredParamsGetPicPredParams ()
 Return the picture prediction params. More...
 
const PicturePredParamsGetPicPredParams () const
 Return the picture prediction params. More...
 
void SetPictureCodingMode (int pic_coding)
 Sets whether input is coded as fields or quincunxially. More...
 
void SetTopFieldFirst (bool topf)
 Sets whether the topmost field comes first in time [NB: TBD since this duplicates metadata in the sequence header]. More...
 
void SetXl (const int x)
 Set the picture/field luma width. More...
 
void SetYl (const int y)
 Set the picture/field luma height. More...
 
void SetChromaXl (const int x)
 Set the frame/field chroma width. More...
 
void SetChromaYl (const int y)
 Set the frame/field chroma height. More...
 
void SetLumaDepth (unsigned int luma_depth)
 Set Luma Depth. More...
 
void SetChromaDepth (unsigned int chroma_depth)
 Set Chroma Depth. More...
 
void SetZeroTransform (bool zero_transform)
 Set the zero transform flag being used for picture (de)coding. More...
 
void SetTransformFilter (const WltFilter wf)
 Set the wavelet filter used for picture (de)coding. More...
 
void SetTransformFilter (unsigned int wf_idx)
 Set the wavelet filter used for picture (de)coding. More...
 
void SetTransformDepth (unsigned int wd)
 Set the transform depth used for picture (de)coding and allocate for the code blocks array. More...
 
void SetCodeBlockMode (unsigned int cb_mode)
 Set the multiple quantisers flag usedto picture (de)coding. More...
 
void SetSpatialPartition (bool spatial_partition)
 Set the spatial partition flag usedto picture (de)coding. More...
 
void SetCodeBlocks (unsigned int level, unsigned int hblocks, unsigned int vblocks)
 Set the number of code blocks for a particular level. More...
 
void SetVideoFormat (const VideoFormat vd)
 Set the video format used for picture (de)coding. More...
 

Private Member Functions

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

Private Attributes

bool m_verbose
 Code/decode with commentary if true. More...
 
bool m_loc_decode
 Flag indicating we're doing local decoding. More...
 
bool m_lossless
 A flag indicating we're doing lossless coding. More...
 
bool m_full_search
 A flag indicating whether we're doing full-search block matching. More...
 
bool m_combined_me
 A flag indicating whether we're doing combined component motion estimation. More...
 
int m_x_range_me
 The horizontal range for full-search block matching. More...
 
int m_y_range_me
 The vertical range for full-search block matching. More...
 
float m_qf
 Quality factor. More...
 
int m_num_L1
 Number of L1 pictures before next I picture. More...
 
int m_L1_sep
 Separation between L1 pictures. More...
 
float m_ufactor
 factor for weighting U component quantisation errors More...
 
float m_vfactor
 factor for weighting V component quantisation errors More...
 
float m_cpd
 Cycles per degree assumed for viewing the video. More...
 
PrefilterType m_prefilter
 Indicator for prefiltering. More...
 
int m_prefilter_strength
 Prefiltering strength. More...
 
float m_I_lambda
 Lagrangian parameter for Intra picture coding. More...
 
float m_L1_lambda
 Lagrangian parameter for L1 picture coding. More...
 
float m_L2_lambda
 Lagrangian parameter for L2 picture coding. More...
 
float m_L1_me_lambda
 Lagrangian param for L1 motion estimation. More...
 
float m_L2_me_lambda
 Lagrangian param for L2 motion estimation. More...
 
EntropyCorrectorm_ent_correct
 Correction factors for quantiser selection. More...
 
std::string m_output_path
 Output file path. More...
 
WltFilter m_intra_wltfilter
 Wavelet filter for Intra pictures. More...
 
WltFilter m_inter_wltfilter
 Wavelet filter for Inter pictures. More...
 
int m_target_rate
 Target bit rate. More...
 
bool m_using_ac
 Arithmetic coding flag. More...
 

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

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 
)

Member Function Documentation

◆ CalcLambdas()

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

◆ CombinedME()

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

◆ CPD()

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

◆ EntropyFactors() [1/2]

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

◆ EntropyFactors() [2/2]

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

◆ FullSearch()

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

◆ GOPLength()

int dirac::EncoderParams::GOPLength ( ) const

◆ ILambda()

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

◆ InterTransformFilter()

WltFilter dirac::EncoderParams::InterTransformFilter ( )
inline

◆ IntraTransformFilter()

WltFilter dirac::EncoderParams::IntraTransformFilter ( )
inline

◆ L1Lambda()

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

◆ L1MELambda()

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

◆ L1Sep()

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

◆ L2Lambda()

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

◆ L2MELambda()

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

◆ LocalDecode()

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

◆ Lossless()

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

◆ 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

◆ OutputPath()

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

◆ Prefilter()

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

◆ PrefilterStrength()

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

◆ Qf()

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

◆ SetCombinedME()

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

◆ SetCPD()

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

◆ SetEntropyFactors()

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

◆ SetFullSearch()

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

◆ SetInterTransformFilter() [1/2]

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

◆ SetInterTransformFilter() [2/2]

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

◆ SetIntraTransformFilter() [1/2]

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

◆ SetIntraTransformFilter() [2/2]

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

◆ SetL1Sep()

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

◆ SetLocalDecode()

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

◆ SetLossless()

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

◆ SetNumL1()

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

◆ SetOutputPath()

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

◆ SetPrefilter()

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

◆ SetQf()

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

◆ SetTargetRate()

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

◆ SetUFactor()

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

◆ SetUsingAC()

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

◆ SetUsualCodeBlocks()

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

◆ SetVerbose()

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

◆ SetVFactor()

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

◆ SetXRangeME()

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

◆ SetYRangeME()

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

◆ TargetRate()

int dirac::EncoderParams::TargetRate ( )
inline

◆ UFactor()

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

◆ UsingAC()

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

◆ Verbose()

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

◆ VFactor()

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

◆ XRangeME()

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

◆ YRangeME()

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

Member Data Documentation

◆ m_combined_me

bool dirac::EncoderParams::m_combined_me
private

◆ m_cpd

float dirac::EncoderParams::m_cpd
private

◆ m_ent_correct

EntropyCorrector* dirac::EncoderParams::m_ent_correct
private

◆ m_full_search

bool dirac::EncoderParams::m_full_search
private

◆ m_I_lambda

float dirac::EncoderParams::m_I_lambda
private

◆ 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

◆ m_L1_me_lambda

float dirac::EncoderParams::m_L1_me_lambda
private

◆ m_L1_sep

int dirac::EncoderParams::m_L1_sep
private

◆ m_L2_lambda

float dirac::EncoderParams::m_L2_lambda
private

◆ m_L2_me_lambda

float dirac::EncoderParams::m_L2_me_lambda
private

◆ m_loc_decode

bool dirac::EncoderParams::m_loc_decode
private

◆ m_lossless

bool dirac::EncoderParams::m_lossless
private

◆ m_num_L1

int dirac::EncoderParams::m_num_L1
private

◆ m_output_path

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

◆ m_prefilter

PrefilterType dirac::EncoderParams::m_prefilter
private

◆ m_prefilter_strength

int dirac::EncoderParams::m_prefilter_strength
private

◆ m_qf

float dirac::EncoderParams::m_qf
private

◆ m_target_rate

int dirac::EncoderParams::m_target_rate
private

◆ m_ufactor

float dirac::EncoderParams::m_ufactor
private

◆ m_using_ac

bool dirac::EncoderParams::m_using_ac
private

◆ m_verbose

bool dirac::EncoderParams::m_verbose
private

◆ m_vfactor

float dirac::EncoderParams::m_vfactor
private

◆ m_x_range_me

int dirac::EncoderParams::m_x_range_me
private

◆ m_y_range_me

int dirac::EncoderParams::m_y_range_me
private

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.