Dirac - A Video Codec
Created by the British Broadcasting Corporation.
Go to the documentation of this file.
47 #define _CRT_SECURE_NO_DEPRECATE
72 #if !defined(HAVE_MMX)
293 bool set_defaults=
true);
544 unsigned int luma_depth,
unsigned int chroma_depth);
645 void SetXl(
int xlen);
648 void SetYl(
int ylen);
805 CompSort c,
int est_bits,
int actual_bits);
835 OLBParams(
const int xblen,
const int yblen,
836 const int xbsep,
const int ybsep);
1036 TESTM((p >=0 && p <=3),
"Motion precision value in range 0..3");
1043 TESTM((p >=0 && p <=3),
"Motion precision value in range 0..3");
1105 unsigned int num_refs = 0,
1106 bool set_defaults=
true);
1216 void SetCodeBlocks(
unsigned int level,
unsigned int hblocks,
unsigned int vblocks);
1287 unsigned int num_refs = 2,
1288 bool set_defaults=
true);
1576 if(num < 0)
return 0;
1577 else if(num >= max)
return max-1;
void SetXRangeME(const int xr)
Set the horizontal search range for full-search motion estimation.
Definition: common.h:1405
float ILambda() const
Return the Lagrangian parameter to be used for I pictures.
Definition: common.h:1349
int m_prefilter_strength
Prefiltering strength.
Definition: common.h:1507
float m_vfactor
factor for weighting V component quantisation errors
Definition: common.h:1498
void SetMajorVersion(unsigned int major_ver)
Set the major version.
Definition: common.h:913
TransferFunction TransferFunctionIndex() const
Return the transfer function index.
Definition: common.h:368
bool m_loc_decode
Flag indicating we're doing local decoding.
Definition: common.h:1468
unsigned int ChromaDepth() const
Returns the chroma depth.
Definition: common.h:583
int Xblen() const
Returns the horizontal block length.
Definition: common.h:841
@ MV_FBIN3_CTX
Definition: common.h:146
int Ref1Weight() const
Return the Ref1 weight.
Definition: common.h:981
ChromaFormat IntToChromaFormat(int chroma_format)
Function to convert an integer to a valid VideoFormat.
MVPrecisionType m_mv_precision
The precision of motion vectors (number of accuracy bits eg 1=half-pel accuracy)
Definition: common.h:1078
unsigned int m_chroma_offset
Chroma offset.
Definition: common.h:513
A class for picture component data.
Definition: common.h:718
void SetCodeBlockMode(unsigned int cb_mode)
Set the multiple quantisers flag usedto picture (de)coding.
@ MV_FBIN4_CTX
Definition: common.h:147
Parameters common to coder and decoder operation.
Definition: common.h:1098
float L2MELambda() const
Return the Lagrangian ME parameter to be used for L2 pictures.
Definition: common.h:1361
bool m_using_ac
arithmetic coding flag
Definition: common.h:710
Class defining a rational number.
Definition: common.h:218
int Xbsep() const
Returns the horizontal block separation.
Definition: common.h:847
@ TOTAL_COEFF_CTXS
Definition: common.h:126
void SetCodeBlocks(unsigned int level, unsigned int hblocks, unsigned int vblocks)
Set the number of code blocks for a particular level.
void Init()
Initialises the correction factors.
void SetHorizontalCodeBlocks(unsigned int hblocks)
Set the number of horizontal code blocks.
Definition: common.h:956
@ SIGN0_CTX
Definition: common.h:98
Parameters relating to the complexity of encoder/decoder.
Definition: common.h:890
void SetCFormat(ChromaFormat cf)
Sets the chroma format (Y only, 420, 422 etc)
Definition: common.h:379
ColourPrimaries m_col_primary
Colour Primaries Index.
Definition: common.h:521
void SetLevel(unsigned int level)
Set the Level.
Definition: common.h:922
int ChromaHeight() const
Returns the chroma height.
void SetIntra()
Definition: common.h:233
unsigned char fs
Definition: common.h:284
CtxAliases
Contexts used for coefficient coding.
Definition: common.h:96
Direction
Forward or backward.
Definition: common.h:93
unsigned int ChromaExcursion() const
Return the chroma excursion.
Definition: common.h:358
WltFilter IntraTransformFilter()
Return the Wavelet filter to be used for intra pictures.
Definition: common.h:1376
PixelAspectRatioType IntToPixelAspectRatioType(int pix_asr_idx)
Function to convert an integer to a valid PixelAspectRatio type.
bool IsInterRef() const
Definition: common.h:251
int CoeffType
Type of wavelet coefficient data (should be larger than ValueType)
Definition: common.h:74
SignalRangeType IntToSignalRangeType(int signal_range_idx)
Function to convert an integer to a valid SignalRange type.
void SetYNumBlocks(const int yn)
Set how many blocks there are vertically.
Definition: common.h:1024
@ NZ_FBIN5_CTX
Definition: common.h:116
EntropyCorrector * m_ent_correct
Correction factors for quantiser selection.
Definition: common.h:1525
void SetLumaExcursion(unsigned int luma_exc)
Set the luma excursion.
Definition: common.h:443
void SetXNumBlocks(const int xn)
Set how many blocks there are horizontally.
Definition: common.h:1021
int MaxQuantIndex() const
Returns the maximum quantiser index supported.
Definition: common.h:1597
friend std::istream & operator>>(std::istream &, OLBParams &)
unsigned int m_source_sampling
Source sampling field : 0 - progressive, 1 - interlaced.
Definition: common.h:472
OLBParams()
Default constructor does nothing.
Definition: common.h:823
ColourMatrix
Definition: common_types.h:133
@ Z_FBIN4_CTX
Definition: common.h:107
const EntropyCorrector & EntropyFactors() const
Return a reference to the entropy factors.
Definition: common.h:1370
int m_cyl
Picture chroma height.
Definition: common.h:701
WltFilter m_intra_wltfilter
Wavelet filter for Intra pictures.
Definition: common.h:1531
void SetChromaDepth(unsigned int chroma_depth)
Set Chroma Depth.
Definition: common.h:654
@ MV_SIGN_CTX
Definition: common.h:152
DecoderParams(const VideoFormat &video_format=VIDEO_FORMAT_CIF, PictureType ftype=INTRA_PICTURE, unsigned int num_refs=0, bool set_defaults=false)
Default constructor.
unsigned int MinorVersion() const
Get the minor version.
Definition: common.h:902
unsigned int m_yl
Height of video.
Definition: common.h:466
PictureType m_picture_type
Picture type.
Definition: common.h:680
Rational m_pixel_aspect_ratio
Pixel Aspect Ratio.
Definition: common.h:487
Definition of class SequenceHeaderByteIO.
Definition: accessunit_byteio.h:51
unsigned int m_max_qindex
Definition: common.h:1601
void SetChromaOffset(unsigned int chroma_off)
Set the chroma offset.
Definition: common.h:445
unsigned int TransformDepth() const
Return the transform depth being used for picture (de)coding.
Definition: common.h:1152
A class used for correcting estimates of entropy.
Definition: common.h:773
PicArray()
Default constructor.
Definition: common.h:725
unsigned int m_vblocks
Number of Vertical code blocks.
Definition: common.h:963
ChromaFormat CFormat() const
Returns the chroma format of the sequence (420, 422, 444)
Definition: common.h:310
int m_yoffset
Definition: common.h:886
@ REF1AND2
Definition: common.h:84
unsigned int Level() const
Get the Level.
Definition: common.h:908
int ChromaXl() const
Returns the chroma width of the picture.
Definition: common.h:574
int m_ref1_weight
picture predicion parameters - reference picture 1 weight
Definition: common.h:1084
unsigned int m_denom
Denominator.
Definition: common.h:224
TransferFunction m_transfer_func
Definition: common.h:527
void SetCPD(const float cpd)
Set the number of cycles per degree at the nominal viewing distance.
Definition: common.h:1426
float UFactor() const
Return the amount we're weighting noise in the U component.
Definition: common.h:1334
Parameters for initialising picture class objects.
Definition: common.h:532
@ SB_SPLIT_INFO_CTX
Definition: common.h:166
@ PMODE_BIT0_CTX
Definition: common.h:157
@ V_COMP
Definition: common.h:87
const OLBParams & LumaBParams(int n) const
Return the Luma block parameters for each macroblock splitting level.
Definition: common.h:1006
void SetPrefilter(const PrefilterType pf, const int str)
Set denoising value - true or false.
Definition: common.h:1429
A template class for two-dimensional arrays.
Definition: arrays.h:284
@ REF1_ONLY
Definition: common.h:84
int YRangeME() const
Get the vertical search range for full-search motion estimation.
Definition: common.h:1314
unsigned int m_profile
Profile.
Definition: common.h:930
void SetCombinedME(const bool cme)
Set whether we're doing combined component motion estimation.
Definition: common.h:1402
@ SUBTRACT
Definition: common.h:90
@ INTRA_PICTURE
Definition: common_types.h:87
void SetYbsep(int ybsep)
Sets the block vertical separation.
Definition: common.h:870
float L1MELambda() const
Return the Lagrangian ME parameter to be used for L1 pictures.
Definition: common.h:1358
SignalRangeType SignalRangeIndex() const
Return the type from the signal range table.
Definition: common.h:349
static PictureSort IntraRefPictureSort()
Definition: common.h:255
void Clear()
Definition: common.h:253
int m_fnum
The picture number, in temporal order.
Definition: common.h:677
const PictureSort & PicSort() const
Returns the type of the picture.
Definition: common.h:586
int m_ybsep
Definition: common.h:884
bool Lossless() const
Get whether we're doing lossless coding.
Definition: common.h:1305
PicturePredParams m_picpredparams
The picture prediction parameters.
Definition: common.h:1227
void SetPixelAspectRatio(const Rational &pix_asr)
Set the pixel aspect ratio.
Definition: common.h:409
void SetChromaExcursion(unsigned int chroma_exc)
Set the chroma excursion.
Definition: common.h:447
void SetCleanWidth(unsigned int clean_width)
Set the Clean area width.
Definition: common.h:428
@ REF2_ONLY
Definition: common.h:84
OneDArray< int > m_intra_offset4
Definition: common.h:1603
void SetXblen(int xblen)
Sets the block width.
Definition: common.h:861
void SetVideoFormat(VideoFormat vf)
Sets the video format.
Definition: common.h:389
double ENTROPY
The entropy in bits per symbol.
Definition: common.h:760
void SetChromaYl(const int y)
Set the frame/field chroma height.
Definition: common.h:1189
WltFilter InterTransformFilter()
Return the Wavelet filter to be used for Inter pictures.
Definition: common.h:1379
OneDArray< CodeBlocks > m_cb
Code block array. Number of entries is m_wlt_depth+1.
Definition: common.h:1272
void SetPictureType(const PictureType ftype)
Sets the picture to be Intra/Inter.
~PicArray()
Destructor.
Definition: common.h:738
ChromaFormat
Definition: common_types.h:58
Rational PixelAspectRatio() const
Return the pixel aspect ratio.
Definition: common.h:331
WltFilter TransformFilter() const
Return the wavelet filter currently being used for picture (de)coding.
Definition: common.h:1149
EntropyCorrector & EntropyFactors()
Return a reference to the entropy factors - we need to be able to change the values of the entropy fa...
Definition: common.h:1373
int m_y_range_me
The vertical range for full-search block matching.
Definition: common.h:1483
@ DC_INFO_CTX
Definition: common.h:137
unsigned int NumRefs() const
Return the number of reference pictures.
Definition: common.h:610
void SetFrameRate(unsigned int fr_num, unsigned int fr_denom)
Set the frame rate.
Definition: common.h:398
bool UsingAC() const
Returns true is entropy coding using Arithmetic coding.
Definition: common.h:619
EntropyCorrector(int depth)
Constructor.
unsigned int m_chroma_depth
chroma depth - number of bits required for luma
Definition: common.h:1251
int m_yl
The frame/field luma height.
Definition: common.h:1239
@ SIGN_NEG_CTX
Definition: common.h:100
void SetExpiryTime(const int expt)
Sets how long the picture will stay in the buffer (encoder only)
Definition: common.h:636
void SetXl(int xlen)
Sets the picture width.
bool IsRef() const
Definition: common.h:240
int ChromaYl() const
Returns the chroma height of the picture.
Definition: common.h:577
VideoFormat m_video_format
Video-format.
Definition: common.h:460
PredMode
Prediction modes for blocks.
Definition: common.h:84
void SetNumL1(const int nl)
Set the nominal number of L1 pictures between I pictures.
Definition: common.h:1414
CompSort m_csort
Definition: common.h:748
CodeBlockMode
Definition: common_types.h:198
void SetSignalRange(SignalRangeType sr)
Set the Signal Range parameters.
void SetRetiredPictureNum(int retd_fnum)
Sets the retired reference picture number.
Definition: common.h:657
@ NZ_FBIN1z_CTX
Definition: common.h:111
void SetUsingGlobalMotion(bool gm)
Set the wavelet filter used for picture (de)coding.
Definition: common.h:1048
bool m_topfieldfirst
True if interlaced and top field is first in temporal order.
Definition: common.h:1233
float m_cpd
Cycles per degree assumed for viewing the video.
Definition: common.h:1501
void SetColourPrimariesIndex(unsigned int cp)
Set the colour primaries index.
void SetIntraTransformFilter(WltFilter wf)
Set the Wavelet filter to be used for intra pictures.
Definition: common.h:1444
@ PMODE_BIT1_CTX
Definition: common.h:158
@ MV_FBIN5plus_CTX
Definition: common.h:148
PicArray(int height, int width, CompSort cs=Y_COMP)
Constructor.
Definition: common.h:732
bool TopFieldFirst() const
Returns true if the topmost field comes first in time when coding.
Definition: common.h:1125
void SetInterTransformFilter(WltFilter wf)
Set the Wavelet filter to be used for inter pictures.
Definition: common.h:1450
int m_num_L1
Number of L1 pictures before next I picture.
Definition: common.h:1489
void SetPixelAspectRatio(unsigned int pix_as_num, unsigned int pix_as_denom)
Set the pixel aspect ratio.
Definition: common.h:416
const std::vector< int > & Refs() const
Returns a const C++ reference to the set of reference picture numbers (will be empty if the picture i...
Definition: common.h:604
PrefilterType Prefilter() const
Return what prefiltering is in place.
Definition: common.h:1343
void SetLumaDepth(unsigned int luma_depth)
Set Luma Depth.
Definition: common.h:1192
TransferFunction
Definition: common_types.h:141
float Factor(const int bandnum, const PictureParams &pp, const CompSort c) const
Returns the correction factor.
PixelAspectRatioType m_pix_asr_idx
Index into pixel aspect ratio table.
Definition: common.h:484
void SetYl(unsigned int ylen)
Sets the picture height.
Definition: common.h:376
@ VIDEO_FORMAT_CUSTOM
Definition: common_types.h:99
unsigned int m_clean_width
Clean area width.
Definition: common.h:492
void SetXNumSB(const int xn)
Set how many SBs there are horizontally.
Definition: common.h:1015
float m_qf
Quality factor.
Definition: common.h:1486
unsigned int m_left_offset
Clean area left offset.
Definition: common.h:498
float VFactor() const
Return the amount we're weighting noise in the V component.
Definition: common.h:1337
void SetRef1Weight(int wt)
Set the ref 1 picture weight.
Definition: common.h:1054
WltFilter
Definition: common_types.h:61
void SetLumaBlockParams(const OLBParams &olbparams)
Set block level luma params.
Definition: common.h:1030
int PictureCodingMode() const
Returns the picture coding mode (independent of source format)
Definition: common.h:1119
bool UsingGlobalMotion() const
Return the global motion flag used for encoding/decoding.
Definition: common.h:975
OneDArray< OLBParams > m_lbparams
Definition: common.h:1073
SignalRangeType
Definition: common_types.h:179
int m_y_num_blocks
The number of blocks vertically.
Definition: common.h:1071
void SetRef2Weight(int wt)
Set the ref 2 picture weight.
Definition: common.h:1057
unsigned int m_wlt_depth
Wavelet depth.
Definition: common.h:1263
int IntraQuantOffset4(const int index) const
Returns the intra Picture quantisation offset for non-zero values.
Definition: common.h:1592
int CalcValueType
Type for performing calculations on ValueType and CoeffType. Should be >ValueType,...
Definition: common.h:81
bool m_full_search
A flag indicating whether we're doing full-search block matching.
Definition: common.h:1474
VideoFormat GetVideoFormat() const
Return the video format currently being used for picture (de)coding.
Definition: common.h:1164
@ SB_SPLIT_BIN1_CTX
Definition: common.h:163
ColourMatrix m_col_matrix
Definition: common.h:524
@ UNDEFINED
Definition: common.h:84
float Qf() const
Get the quality factor.
Definition: common.h:1320
PrefilterType
Definition: common_types.h:75
bool m_use_global_motion
Global motion fields.
Definition: common.h:1090
void SetZeroTransform(bool zero_transform)
Set the zero transform flag being used for picture (de)coding.
Definition: common.h:1198
void SetTopOffset(unsigned int top_offset)
Set the Clean area top offset.
Definition: common.h:434
unsigned int CleanWidth() const
Return the Clean area width.
Definition: common.h:338
int m_xbsep
Definition: common.h:883
@ MV_FBIN2_CTX
Definition: common.h:145
unsigned int m_chroma_depth
chroma depth - number of bits required for luma
Definition: common.h:707
void SetTransferFunctionIndex(unsigned int tf)
Set the transfer function index.
MVPrecisionType IntToMVPrecisionType(int mv_prec)
Function to convert an integer to a valid motion-vector precision type.
const ChromaFormat & CFormat() const
Returns the chroma format of the picture.
Definition: common.h:565
void SetMVPrecision(const MVPrecisionType p) const
Definition: common.h:1040
bool m_lossless
A flag indicating we're doing lossless coding.
Definition: common.h:1471
unsigned int m_hblocks
Number of Horizontal code blocks.
Definition: common.h:961
int m_ref2_weight
picture predicion parameters - reference picture 2 weight
Definition: common.h:1087
PictureSort m_psort
The picture sort.
Definition: common.h:668
PictureType
Definition: common_types.h:86
int QuantFactor4(const int index) const
Returns 4 times the quantisation factor.
Definition: common.h:1589
void SetInterTransformFilter(unsigned int wf_idx)
Set the Wavelet filter to be used for inter pictures.
VideoFormat GetVideoFormat() const
Returns video-format.
Definition: common.h:301
int m_x_num_blocks
The number of blocks horizontally.
Definition: common.h:1068
unsigned int VerticalCodeBlocks() const
Return the number of vertical code blocks.
Definition: common.h:953
int m_xl
Picture luma width.
Definition: common.h:692
void SetFrameRate(const Rational &frate)
Set the frame rate.
Definition: common.h:392
VideoFormat m_video_format
The video format being used.
Definition: common.h:1254
void SetInter()
Definition: common.h:234
void SetInterRef()
Definition: common.h:246
TwoDArray< float > m_Ufctrs
Definition: common.h:812
int m_cxl
The frame/field chroma width.
Definition: common.h:1242
void SetUsualCodeBlocks(const PictureType &ftype)
Set the number of code blocks for all levels.
void SetColourMatrixIndex(unsigned int cm)
Set the colour matrix index.
static PictureSort IntraNonRefPictureSort()
Definition: common.h:269
friend std::ostream & operator<<(std::ostream &, OLBParams &)
void SetYblen(int yblen)
Sets the block height.
Definition: common.h:864
@ MV_FBIN1_CTX
Definition: common.h:144
bool m_combined_me
A flag indicating whether we're doing combined component motion estimation.
Definition: common.h:1477
void SetNonRef()
Definition: common.h:235
static PictureSort InterRefPictureSort()
Definition: common.h:262
ParseParams()
Default constructor.
Picture type Class.
Definition: common.h:228
unsigned int m_major_ver
Major Version.
Definition: common.h:926
FrameRateType FrameRateIndex() const
Return the type from the frame rate table.
Definition: common.h:328
Rational m_framerate
Frame Rate i.e number of frames per second.
Definition: common.h:481
void SetLossless(const bool l)
Set whether we're doing lossless coding.
Definition: common.h:1396
void SetIntraTransformFilter(unsigned int wf_idx)
Set the Wavelet filter to be used for intra pictures.
OneDArray< OLBParams > m_cbparams
Definition: common.h:1075
@ BACKWARD
Definition: common.h:93
ValueType BChk(const ValueType &num, const ValueType &max)
A simple bounds checking function, very useful in a number of places.
Definition: common.h:1574
unsigned int ChromaDepth() const
Returns the chroma depth.
Definition: common.h:1143
QuantiserLists()
Default constructor.
int YNumBlocks() const
Returns the number of blocks vertically.
Definition: common.h:1003
bool CombinedME() const
Get whether we're doing combined component motion estimation.
Definition: common.h:1317
double Error
The error (MSE or 4th power)
Definition: common.h:757
@ NZ_FBIN3_CTX
Definition: common.h:114
void SetInterNonRef()
Definition: common.h:245
void SetLocalDecode(const bool decode)
Sets a flag indicating that we're producing a locally decoded o/p.
Definition: common.h:1393
unsigned int ColourSpecificationIndex() const
Return the index into the colour specification table.
Definition: common.h:361
int Xoffset() const
The offset in the horizontal start of the block caused by overlap,=(XBLEN-XBSEP)/2.
Definition: common.h:853
char * OutputPath() const
Return the output path to be used for storing diagnositic data.
Definition: common.h:1367
PictureType GetPictureType() const
Returns type of picture (see enum)
Definition: common.h:613
void SetXl(const int x)
Set the picture/field luma width.
Definition: common.h:1180
@ INTRA
Definition: common.h:84
void SetYNumSB(const int yn)
Set how many SBs there are vertically.
Definition: common.h:1018
bool UsingAC() const
Return true if using Arithmetic coding.
Definition: common.h:1385
float m_L1_lambda
Lagrangian parameter for L1 picture coding.
Definition: common.h:1513
void SetReferenceType(const ReferenceType rtype)
Sets the picture to be a reference or not.
unsigned int m_clean_height
Clean area height.
Definition: common.h:495
VideoFormat IntToVideoFormat(int video_format)
Function to convert an integer to a valid VideoFormat.
void SetProfile(unsigned int profile)
Set the Profile.
Definition: common.h:919
@ Q_OFFSET_SIGN_CTX
Definition: common.h:125
float L1Lambda() const
Return the Lagrangian parameter to be used for L1 pictures.
Definition: common.h:1352
@ Z_FBIN2_CTX
Definition: common.h:105
int m_expiry_time
The number of pictures, after the current picture number, after the (de)coding of which the picture c...
Definition: common.h:674
unsigned int LeftOffset() const
Return the Clean area left offset.
Definition: common.h:342
int Ref2Weight() const
Return the Ref2 weight.
Definition: common.h:984
void Update(int bandnum, const PictureParams &pp, CompSort c, int est_bits, int actual_bits)
Update the correction factors.
@ MV_INFO_CTX
Definition: common.h:150
void SetYl(const int y)
Set the picture/field luma height.
Definition: common.h:1183
unsigned int m_cs_idx
Index into colour spec table.
Definition: common.h:518
bool m_zero_transform
Zero transform flag.
Definition: common.h:1257
bool Verbose() const
Returns true if we're operating verbosely, false otherwise.
Definition: common.h:1555
bool IsInterNonRef() const
Definition: common.h:250
float m_I_lambda
Lagrangian parameter for Intra picture coding.
Definition: common.h:1510
bool IsInter() const
Definition: common.h:238
bool SpatialPartition() const
Return the spatial partitioning flag being used for picture (de)coding.
Definition: common.h:1158
Parameters for the encoding process.
Definition: common.h:1279
@ NZ_FBIN4_CTX
Definition: common.h:115
@ Z_FBIN5_CTX
Definition: common.h:108
bool m_verbose
Code/decode with commentary if true.
Definition: common.h:1465
void SetColourSpecification(unsigned int cs_idx)
Set the Colour specification.
void SetL1Sep(const int lsep)
Set the separation between L1 pictures.
Definition: common.h:1417
bool IsIntra() const
Definition: common.h:239
int m_cyl
The frame/field chroma height.
Definition: common.h:1245
void SetLumaDepth(unsigned int luma_depth)
Set Luma Depth.
Definition: common.h:651
int InterQuantOffset4(const int index) const
Returns the inter Picture quantisation offset for non-zero values.
Definition: common.h:1594
ReferenceType GetReferenceType() const
Returns reference picture type (see enum)
Definition: common.h:616
void SetCSort(const CompSort cs)
Set the type of component being stored.
Definition: common.h:744
double TOTAL
The Lagrangian combination of MSE+lambda*entropy.
Definition: common.h:763
float m_ufactor
factor for weighting U component quantisation errors
Definition: common.h:1495
@ PIXEL_ASPECT_RATIO_CUSTOM
Definition: common_types.h:167
int m_pic_coding_mode
The picture coding mode.
Definition: common.h:1230
int PrefilterStrength() const
Return the prefiltering strength.
Definition: common.h:1346
void SetTopFieldFirst(bool tff)
Set Topfield first. True if top field comes first in time.
Definition: common.h:386
MvCtxAliases
Contexts used for MV data coding.
Definition: common.h:130
void SetPicSort(const PictureSort &ps)
Sets the type of picture.
ReferenceType
Definition: common_types.h:92
TwoDArray< float > m_Vfctrs
Definition: common.h:813
const CompSort & CSort() const
Return which component is stored.
Definition: common.h:741
@ Z_FBIN6plus_CTX
Definition: common.h:109
@ NZ_FBIN6plus_CTX
Definition: common.h:117
PrefilterType m_prefilter
Indicator for prefiltering.
Definition: common.h:1504
void SetSpatialPartition(bool spatial_partition)
Set the spatial partition flag usedto picture (de)coding.
Definition: common.h:1213
void SetIntraNonRef()
Definition: common.h:243
int ChromaXl() const
Return the picture/field chroma width.
Definition: common.h:1134
@ SB_SPLIT_BIN2_CTX
Definition: common.h:164
void SetLeftOffset(unsigned int left_offset)
Set the Clean area left offset.
Definition: common.h:432
void SetYRangeME(const int yr)
Set the vertical search range for full-search motion estimation.
Definition: common.h:1408
Structure to hold motion parameters when motion comp is used.
Definition: common.h:967
unsigned int m_num
Numerator.
Definition: common.h:222
void SetUFactor(const float uf)
Set the amount to weight noise in the U component.
Definition: common.h:1420
ReferenceType m_reference_type
Reference type.
Definition: common.h:683
int NumL1() const
Return the nominal number of L1 pictures before the next I picture.
Definition: common.h:1328
MVPrecisionType MVPrecision() const
Return the number of accuracy bits used for motion vectors.
Definition: common.h:1012
MVPrecisionType
Definition: common_types.h:189
@ DC_SIGN_CTX
Definition: common.h:138
ChromaFormat m_cformat
Presence of chroma and/or chroma sampling structure.
Definition: common.h:469
void SetVFactor(const float vf)
Set the amount to weight noise in the V component.
Definition: common.h:1423
void SetLumaOffset(unsigned int luma_offset)
Set the luma offset.
Definition: common.h:441
@ VIDEO_FORMAT_CIF
Definition: common_types.h:103
WltFilter m_inter_wltfilter
Wavelet filter for Inter pictures.
Definition: common.h:1534
unsigned int LumaExcursion() const
Return the luma excursion.
Definition: common.h:354
Parameters for overlapped block motion compensation.
Definition: common.h:817
A template class for one-dimensional arrays.
Definition: arrays.h:89
CodeBlockMode GetCodeBlockMode() const
Return multiple quantisers flag being used for picture (de)coding.
Definition: common.h:1155
CodeBlockMode m_cb_mode
Code block mode.
Definition: common.h:1266
int m_xl
The frame/field luma width.
Definition: common.h:1236
short ValueType
Type of picture data (including motion compensated residuals)
Definition: common.h:70
int m_x_num_sb
The number of superblocks horizontally.
Definition: common.h:1062
std::vector< int > m_refs
The set of picture numbers of reference pictures.
Definition: common.h:671
unsigned int LumaOffset() const
Return the luma offset.
Definition: common.h:352
int RetiredPictureNum() const
Returns the retired reference picture number.
Definition: common.h:592
bool IsBPicture() const
Returns whether the picture is bi-directionally predicted by checking references.
float m_L2_lambda
Lagrangian parameter for L2 picture coding.
Definition: common.h:1516
FrameRateType m_fr_idx
Index into frame rate table.
Definition: common.h:478
PixelAspectRatioType
Definition: common_types.h:166
Rational FrameRate() const
Return the number for frames per second.
Definition: common.h:325
void SetMVPrecision(const MVPrecisionType p)
Set the number of accuracy bits for motion vectors.
Definition: common.h:1033
bool Output() const
Returns an indication of whether the picture has been output yet.
Definition: common.h:601
@ INFO_CTX
Definition: common.h:120
void SetChromaXl(const int x)
Set the frame/field chroma width.
Definition: common.h:1186
unsigned int LumaDepth() const
Returns the luma depth.
Definition: common.h:580
@ SIGN_POS_CTX
Definition: common.h:99
int m_L1_sep
Separation between L1 pictures.
Definition: common.h:1492
int Yl() const
Returns the picture height.
Definition: common.h:571
unsigned int CleanHeight() const
Return the Clean area height.
Definition: common.h:340
@ TOTAL_MV_CTXS
Definition: common.h:168
unsigned int m_xl
Width of video.
Definition: common.h:463
unsigned int PictureWeightsBits() const
Return the number of picture weight precision bits.
Definition: common.h:978
unsigned int m_luma_depth
Luma depth - number of bits required for lumz.
Definition: common.h:704
void SetVerticalCodeBlocks(unsigned int vblocks)
Set the number of vertical code blocks.
Definition: common.h:958
ColourPrimaries ColourPrimariesIndex() const
Return the colour primaries index.
Definition: common.h:364
unsigned int m_level
Level.
Definition: common.h:932
A structure for recording costs, particularly in quantisation.
Definition: common.h:753
bool LocalDecode() const
Returns a flag indicating that we're doing local decoding.
Definition: common.h:1302
unsigned int LumaDepth() const
Returns the luma depth.
Definition: common.h:1140
unsigned int m_picture_weights_bits
picture predicion parameters - precision
Definition: common.h:1081
AddOrSub
Addition or subtraction.
Definition: common.h:90
float m_L1_me_lambda
Lagrangian param for L1 motion estimation.
Definition: common.h:1519
@ Z_FBIN3_CTX
Definition: common.h:106
OneDArray< int > m_inter_offset4
Definition: common.h:1604
unsigned int m_minor_ver
Minor Version.
Definition: common.h:928
int Yblen() const
Returns the vertical block length.
Definition: common.h:844
void SetTransformDepth(unsigned int wd)
Set the transform depth used for picture (de)coding and allocate for the code blocks array.
unsigned int m_luma_offset
Luma offset.
Definition: common.h:509
unsigned int ChromaOffset() const
Return the chroma offset.
Definition: common.h:356
PicturePredParams & GetPicPredParams()
Return the picture prediction params.
Definition: common.h:1167
@ FORWARD
Definition: common.h:93
int Yoffset() const
The offset in the vertical start of the block caused by overlap,=(YBLEN-YBSEP)/2.
Definition: common.h:856
Parameters relating to the source material being encoded/decoded.
Definition: common.h:288
int ExpiryTime() const
Returns the number of pictures after the current picture number after which the picture can be discar...
Definition: common.h:598
const CodeBlocks & GetCodeBlocks(unsigned int level) const
Return the code blocks for a particular level.
void CalcLambdas(const float qf)
Calculate the Lagrangian parameters from the quality factor.
void SetQf(const float qfac)
Set the quality factor.
Definition: common.h:1411
int L1Sep() const
Return the separation between L1 pictures (and between L1 and I pictures)
Definition: common.h:1331
void SetAsOutput()
Sets a flag to indicate that the picture has been output.
Definition: common.h:639
unsigned int HorizontalCodeBlocks() const
Return the number of horizontal code blocks.
Definition: common.h:951
int m_x_range_me
The horizontal range for full-search block matching.
Definition: common.h:1480
@ DC_FBIN1_CTX
Definition: common.h:135
unsigned int m_luma_depth
Luma depth - number of bits required for lumz.
Definition: common.h:1248
unsigned int TopOffset() const
Return the Clean area top offset.
Definition: common.h:344
void SetYl(int ylen)
Sets the picture height.
@ NZ_FBIN1nz_CTX
Definition: common.h:112
bool m_spatial_partition
Spatial partitioning flag.
Definition: common.h:1269
void SetPictureWeightsPrecision(unsigned int wt_prec)
Set the picture weight precision bits used for (de)coding.
Definition: common.h:1051
int TargetRate()
Return the Target Bit Rate in kbps.
Definition: common.h:1382
int m_retd_fnum
The picture number of the retired picture.
Definition: common.h:689
bool ZeroTransform() const
Return zero transform flag being used for picture (de)coding.
Definition: common.h:1146
SourceParams(const VideoFormat &vf=VIDEO_FORMAT_CUSTOM, bool set_defaults=true)
default constructor
bool m_topfieldfirst
If m_source_sampling=1, true if the top field is first in temporal order.
Definition: common.h:475
@ NZ_FBIN2_CTX
Definition: common.h:113
int XNumSB() const
Return the number of superblocks horizontally.
Definition: common.h:994
int m_yblen
Definition: common.h:882
TwoDArray< float > m_Yfctrs
Definition: common.h:811
int YNumSB() const
Return the number of superblocks vertically.
Definition: common.h:997
@ SIGNAL_RANGE_CUSTOM
Definition: common_types.h:180
void SetIntraRef()
Definition: common.h:244
@ Z_FBIN1z_CTX
Definition: common.h:103
static PictureSort InterNonRefPictureSort()
Definition: common.h:276
CodeBlocks(unsigned int hblocks, unsigned int vblocks)
Constructor.
Definition: common.h:944
void SetBlockSizes(const OLBParams &olbparams, const ChromaFormat cformat)
Set the block sizes for all SB splitting levels given these prototype block sizes for level=2.
int ChromaYl() const
Return the picture/field chroma height.
Definition: common.h:1137
int XNumBlocks() const
Return the number of blocks horizontally.
Definition: common.h:1000
bool m_using_ac
Arithmetic coding flag.
Definition: common.h:1540
@ BLOCK_SKIP_CTX
Definition: common.h:122
CompSort
Types of picture component.
Definition: common.h:87
bool m_verbose
Code/decode with commentary if true.
Definition: common.h:1569
PictureSort()
Definition: common.h:231
Class for encapsulating quantiser data.
Definition: common.h:1582
unsigned int MajorVersion() const
Get the major version.
Definition: common.h:899
void SetRef()
Definition: common.h:236
unsigned int m_chroma_excursion
Chroma excursion.
Definition: common.h:515
int m_y_num_sb
The number of superblocks verticaly.
Definition: common.h:1065
void SetTargetRate(const int rate)
Set the target bit rate.
Definition: common.h:1453
bool FullSearch() const
Get whether we're doing full-search motion estimation.
Definition: common.h:1308
void SetUsingAC(bool using_ac)
Set the arithmetic coding flag.
Definition: common.h:1456
void SetTransformFilter(const WltFilter wf)
Set the wavelet filter used for picture (de)coding.
Definition: common.h:1201
bool TopFieldFirst() const
Returns true if top field comes first in time.
Definition: common.h:322
bool FieldCoding() const
Returns true if the pictures are being coded as fields (mode 1 or 3)
Definition: common.h:1122
unsigned int Xl() const
Returns the picture width.
Definition: common.h:304
void SetPictureNum(const int fn)
Sets the picture number.
Definition: common.h:633
void SetXl(unsigned int xlen)
Sets the picture width.
Definition: common.h:373
EncoderParams(const VideoFormat &video_format, PictureType ftype=INTER_PICTURE, unsigned int num_refs=2, bool set_defaults=true)
Default constructor.
int m_yl
Picture luma height.
Definition: common.h:695
void SetUsingAC(bool using_ac)
Sets the arithmetic coding flag.
Definition: common.h:660
void SetCleanHeight(unsigned int clean_height)
Set the Clean area height.
Definition: common.h:430
void SetVerbose(bool v)
Sets verbosity on or off.
Definition: common.h:1390
int XRangeME() const
Get the horizontal search range for full-search motion estimation.
Definition: common.h:1311
CodeBlocks()
Default Constructor.
Definition: common.h:940
int ChromaWidth() const
Returns the chroma width.
float m_L2_me_lambda
Lagrangian param for L2 motion estimation.
Definition: common.h:1522
void SetVerbose(bool v)
Sets verbosity on or off.
Definition: common.h:1558
OneDArray< int > m_qflist4
Definition: common.h:1602
void SetTopFieldFirst(bool topf)
Sets whether the topmost field comes first in time [NB: TBD since this duplicates metadata in the seq...
Definition: common.h:1177
void SetOutputPath(const char *op)
Set the output path to be used for diagnostic data.
Definition: common.h:1433
bool IsIntraRef() const
Definition: common.h:249
@ ADD
Definition: common.h:90
const OLBParams & ChromaBParams(int n) const
Return the Chroma block parameters for each macroblock splitting level.
Definition: common.h:1009
@ Y_COMP
Definition: common.h:87
PicturePredParams()
Definition: common.h:970
unsigned int m_top_offset
Clean area top offset.
Definition: common.h:501
FrameRateType IntToFrameRateType(int frame_rate_idx)
Function to convert an integer to a valid FrameRate type.
unsigned int Profile() const
Get the Profile.
Definition: common.h:905
VideoFormat
Definition: common_types.h:98
int Xl() const
Returns the picture width.
Definition: common.h:568
@ Q_OFFSET_INFO_CTX
Definition: common.h:124
bool Verbose() const
Returns true if we're operating verbosely, false otherwise.
Definition: common.h:1299
int m_xoffset
Definition: common.h:885
ColourMatrix ColourMatrixIndex() const
Return the colour matrix index.
Definition: common.h:366
bool operator==(const OLBParams bparams) const
@ U_COMP
Definition: common.h:87
bool IsIntraNonRef() const
Definition: common.h:248
void SetChromaDepth(unsigned int chroma_depth)
Set Chroma Depth.
Definition: common.h:1195
void SetFullSearch(const bool fs)
Set whether we're doing full-search motion estimation.
Definition: common.h:1399
unsigned int SourceSampling() const
Returns the source sampling field of the source scan format.
Definition: common.h:319
FrameRateType
Definition: common_types.h:150
void SetEntropyFactors(EntropyCorrector *entcorrect)
Sets the entropy factors - TBD: set this up in a constructor and pass encoder params around entirely ...
Definition: common.h:1436
std::vector< int > & Refs()
Returns non-const C++ referece to the vector of reference pictures, to allow them to be set.
Definition: common.h:607
Structure to hold code block sizes when spatial partitioning is used.
Definition: common.h:936
CodecParams(const VideoFormat &video_format=VIDEO_FORMAT_CUSTOM, PictureType ftype=INTRA_PICTURE, unsigned int num_refs=0, bool set_defaults=true)
Default constructor.
PictureParams()
Default constructor.
int PictureNum() const
Returns the number of the picture (in time order)
Definition: common.h:589
@ Q_OFFSET_FOLLOW_CTX
Definition: common.h:123
ChromaFormat m_cformat
The chroma format.
Definition: common.h:665
int m_target_rate
Target bit rate.
Definition: common.h:1537
@ INTER_PICTURE
Definition: common_types.h:88
int Yl() const
Return the picture/field luma height.
Definition: common.h:1131
void SetPictureCodingMode(int pic_coding)
Sets whether input is coded as fields or quincunxially.
Definition: common.h:1174
int Xl() const
Return the picture/field luma width.
Definition: common.h:1128
unsigned int m_luma_excursion
Luma excursion.
Definition: common.h:511
@ FRAMERATE_CUSTOM
Definition: common_types.h:151
int m_xblen
Definition: common.h:881
float L2Lambda() const
Return the Lagrangian parameter to be used for L2 pictures.
Definition: common.h:1355
int GOPLength() const
Return the size of the GOP.
void SetVideoFormat(const VideoFormat vd)
Set the video format used for picture (de)coding.
Definition: common.h:1219
@ DC_FBIN2plus_CTX
Definition: common.h:136
const PicturePredParams & GetPicPredParams() const
Return the picture prediction params.
Definition: common.h:1170
PixelAspectRatioType PixelAspectRatioIndex() const
Return the type from the pixel aspect ratio table.
Definition: common.h:334
WltFilter m_wlt_filter
The wavelet filter being used.
Definition: common.h:1260
void SetXbsep(int xbsep)
Sets the block horizontal separation.
Definition: common.h:867
bool IsNonRef() const
Definition: common.h:241
unsigned int Yl() const
Returns the picture height.
Definition: common.h:307
@ Z_FBIN1nz_CTX
Definition: common.h:104
SignalRangeType m_sr_idx
Index into signal range table.
Definition: common.h:506
bool CustomRefWeights()
Definition: common.h:986
void SetCFormat(ChromaFormat cf)
Sets the chroma format.
Definition: common.h:642
Parameters for the decoding process.
Definition: common.h:1548
float CPD() const
Return the number of cycles per degree at the nominal viewing distance for the raster.
Definition: common.h:1340
void SetSourceSampling(unsigned int source_sampling)
Set if the source sampling field of the scan format.
Definition: common.h:382
int m_cxl
Picture chroma width.
Definition: common.h:698
bool m_output
True if the picture has been output, false if not.
Definition: common.h:686
ColourPrimaries
Definition: common_types.h:124
void SetMinorVersion(unsigned int minor_ver)
Set the minor version.
Definition: common.h:916
#define TESTM(exp, text)
Definition: dirac_assertions.h:66
std::string m_output_path
Output file path.
Definition: common.h:1528
int Ybsep() const
Returns the vertical block separation.
Definition: common.h:850
© 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.