Newer
Older

Karsten Suehring
committed
/* The copyright in this software is being made available under the BSD
* License, included below. This software may be subject to other third party
* and contributor rights, including patent rights, and no such rights are
* granted under this license.
*
* Copyright (c) 2010-2019, ITU/ISO/IEC

Karsten Suehring
committed
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * Neither the name of the ITU/ISO/IEC nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
/** \file Slice.h
\brief slice header and SPS class (header)
*/
#ifndef __SLICE__
#define __SLICE__
#include <cstring>
#include <list>
#include <map>
#include <vector>
#include "CommonDef.h"
#include "Rom.h"
#include "ChromaFormat.h"
#include "Common.h"
Yung-Hsuan Chao (Jessie)
committed
#include <unordered_map>
#include "AlfParameters.h"

Karsten Suehring
committed
//! \ingroup CommonLib
//! \{
#include "CommonLib/MotionInfo.h"
struct MotionInfo;

Karsten Suehring
committed
struct Picture;
class Pic;
class TrQuant;
// ====================================================================================================================
// Constants
// ====================================================================================================================
class PreCalcValues;
static const uint32_t REF_PIC_LIST_NUM_IDX=32;
typedef std::list<Picture*> PicList;
// ====================================================================================================================
// Class definition
// ====================================================================================================================
class ReferencePictureList
{
private:
int m_numberOfShorttermPictures;
int m_numberOfLongtermPictures;
int m_isLongtermRefPic[MAX_NUM_REF_PICS];
int m_refPicIdentifier[MAX_NUM_REF_PICS]; //This can be delta POC for STRP or POC LSB for LTRP
int m_POC[MAX_NUM_REF_PICS];
int m_numberOfActivePictures;
bool m_deltaPocMSBPresentFlag[MAX_NUM_REF_PICS];
int m_deltaPOCMSBCycleLT[MAX_NUM_REF_PICS];
Philip Cowan
committed
bool m_ltrp_in_slice_header_flag;
public:
ReferencePictureList();
virtual ~ReferencePictureList();
void setRefPicIdentifier(int idx, int identifier, bool isLongterm);
int getRefPicIdentifier(int idx) const;
bool isRefPicLongterm(int idx) const;
void setNumberOfShorttermPictures(int numberOfStrp);
int getNumberOfShorttermPictures() const;
void setNumberOfLongtermPictures(int numberOfLtrp);
int getNumberOfLongtermPictures() const;
Philip Cowan
committed
void setLtrpInSliceHeaderFlag(bool flag) { m_ltrp_in_slice_header_flag = flag; }
bool getLtrpInSliceHeaderFlag() const { return m_ltrp_in_slice_header_flag; }
int getNumRefEntries() const { return m_numberOfShorttermPictures + m_numberOfLongtermPictures; }
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
void setPOC(int idx, int POC);
int getPOC(int idx) const;
void setNumberOfActivePictures(int numberOfLtrp);
int getNumberOfActivePictures() const;
int getDeltaPocMSBCycleLT(int i) const { return m_deltaPOCMSBCycleLT[i]; }
void setDeltaPocMSBCycleLT(int i, int x) { m_deltaPOCMSBCycleLT[i] = x; }
bool getDeltaPocMSBPresentFlag(int i) const { return m_deltaPocMSBPresentFlag[i]; }
void setDeltaPocMSBPresentFlag(int i, bool x) { m_deltaPocMSBPresentFlag[i] = x; }
void printRefPicInfo() const;
};
/// Reference Picture List set class
class RPLList
{
private:
std::vector<ReferencePictureList> m_referencePictureLists;
public:
RPLList() { }
virtual ~RPLList() { }
void create(int numberOfEntries) { m_referencePictureLists.resize(numberOfEntries); }
void destroy() { }
ReferencePictureList* getReferencePictureList(int referencePictureListIdx) { return &m_referencePictureLists[referencePictureListIdx]; }
const ReferencePictureList* getReferencePictureList(int referencePictureListIdx) const { return &m_referencePictureLists[referencePictureListIdx]; }
int getNumberOfReferencePictureLists() const { return int(m_referencePictureLists.size()); }
};

Karsten Suehring
committed
/// SCALING_LIST class
class ScalingList
{
public:
ScalingList();
virtual ~ScalingList() { }
Chen-Yen Lai
committed
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
#if JVET_P01034_PRED_1D_SCALING_LIST
int* getScalingListAddress(uint32_t scalingListId) { return &(m_scalingListCoef[scalingListId][0]); } //!< get matrix coefficient
const int* getScalingListAddress(uint32_t scalingListId) const { return &(m_scalingListCoef[scalingListId][0]); } //!< get matrix coefficient
void checkPredMode(uint32_t scalingListId);
void setRefMatrixId(uint32_t scalingListId, uint32_t u) { m_refMatrixId[scalingListId] = u; } //!< set reference matrix ID
uint32_t getRefMatrixId(uint32_t scalingListId) const { return m_refMatrixId[scalingListId]; } //!< get reference matrix ID
static const int* getScalingListDefaultAddress(uint32_t scalinListId); //!< get default matrix coefficient
void processDefaultMatrix(uint32_t scalinListId);
void setScalingListDC(uint32_t scalinListId, uint32_t u) { m_scalingListDC[scalinListId] = u; } //!< set DC value
int getScalingListDC(uint32_t scalinListId) const { return m_scalingListDC[scalinListId]; } //!< get DC value
void setScalingListCopyModeFlag(uint32_t scalinListId, bool bIsCopy) { m_scalingListPredModeFlagIsCopy[scalinListId] = bIsCopy; }
bool getScalingListCopyModeFlag(uint32_t scalinListId) const { return m_scalingListPredModeFlagIsCopy[scalinListId]; } //getScalingListPredModeFlag
void processRefMatrix(uint32_t scalingListId, uint32_t refListId);
int lengthUvlc(int uiCode);
int lengthSvlc(int uiCode);
void CheckBestPredScalingList(int scalingListId, int predListIdx, int& BitsCount);
void codePredScalingList(int* scalingList, const int* scalingListPred, int scalingListDC, int scalingListPredDC, int scalinListId, int& bitsCost);
void codeScalingList(int* scalingList, int scalingListDC, int scalinListId, int& bitsCost);
void setScalingListPreditorModeFlag(uint32_t scalingListId, bool bIsPred) { m_scalingListPreditorModeFlag[scalingListId] = bIsPred; }
bool getScalingListPreditorModeFlag(uint32_t scalingListId) const { return m_scalingListPreditorModeFlag[scalingListId]; }
#else
int* getScalingListAddress(uint32_t sizeId, uint32_t listId) { return &(m_scalingListCoef[sizeId][listId][0]); } //!< get matrix coefficient
const int* getScalingListAddress(uint32_t sizeId, uint32_t listId) const { return &(m_scalingListCoef[sizeId][listId][0]); } //!< get matrix coefficient

Karsten Suehring
committed
void checkPredMode(uint32_t sizeId, uint32_t listId);
void setRefMatrixId(uint32_t sizeId, uint32_t listId, uint32_t u) { m_refMatrixId[sizeId][listId] = u; } //!< set reference matrix ID
uint32_t getRefMatrixId(uint32_t sizeId, uint32_t listId) const { return m_refMatrixId[sizeId][listId]; } //!< get reference matrix ID
const int* getScalingListDefaultAddress(uint32_t sizeId, uint32_t listId); //!< get default matrix coefficient
void processDefaultMatrix(uint32_t sizeId, uint32_t listId);
void setScalingListDC(uint32_t sizeId, uint32_t listId, uint32_t u) { m_scalingListDC[sizeId][listId] = u; } //!< set DC value
int getScalingListDC(uint32_t sizeId, uint32_t listId) const { return m_scalingListDC[sizeId][listId]; } //!< get DC value
void setScalingListPredModeFlag(uint32_t sizeId, uint32_t listId, bool bIsDPCM) { m_scalingListPredModeFlagIsDPCM[sizeId][listId] = bIsDPCM; }
bool getScalingListPredModeFlag(uint32_t sizeId, uint32_t listId) const { return m_scalingListPredModeFlagIsDPCM[sizeId][listId]; }
Chen-Yen Lai
committed
void processRefMatrix(uint32_t sizeId, uint32_t listId , uint32_t refListId );
#endif

Karsten Suehring
committed
void checkDcOfMatrix();
bool xParseScalingList(const std::string &fileName);
void setDefaultScalingList();

Karsten Suehring
committed
Vadim Seregin
committed
{
Chen-Yen Lai
committed
#if JVET_P01034_PRED_1D_SCALING_LIST
if (memcmp(m_scalingListPredModeFlagIsCopy, other.m_scalingListPredModeFlagIsCopy, sizeof(m_scalingListPredModeFlagIsCopy)))
#else
Vadim Seregin
committed
if( memcmp( m_scalingListPredModeFlagIsDPCM, other.m_scalingListPredModeFlagIsDPCM, sizeof( m_scalingListPredModeFlagIsDPCM ) ) )
Chen-Yen Lai
committed
#endif
Vadim Seregin
committed
{
return false;
}
if( memcmp( m_scalingListDC, other.m_scalingListDC, sizeof( m_scalingListDC ) ) )
{
return false;
}
if( memcmp( m_refMatrixId, other.m_refMatrixId, sizeof( m_refMatrixId ) ) )
{
return false;
}
if( memcmp( m_scalingListCoef, other.m_scalingListCoef, sizeof( m_scalingListCoef ) ) )
{
return false;
Vadim Seregin
committed
return true;
}
Vadim Seregin
committed
{
return !( *this == other );
}

Karsten Suehring
committed
private:
Vadim Seregin
committed
void outputScalingLists(std::ostream &os) const;
Chen-Yen Lai
committed
#if JVET_P01034_PRED_1D_SCALING_LIST
bool m_scalingListPredModeFlagIsCopy [30]; //!< reference list index
int m_scalingListDC [30]; //!< the DC value of the matrix coefficient for 16x16
uint32_t m_refMatrixId [30]; //!< RefMatrixID
bool m_scalingListPreditorModeFlag [30]; //!< reference list index
std::vector<int> m_scalingListCoef [30]; //!< quantization matrix
#else

Karsten Suehring
committed
bool m_scalingListPredModeFlagIsDPCM [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< reference list index
int m_scalingListDC [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< the DC value of the matrix coefficient for 16x16
Vadim Seregin
committed
uint32_t m_refMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< RefMatrixID

Karsten Suehring
committed
std::vector<int> m_scalingListCoef [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< quantization matrix
Chen-Yen Lai
committed
#endif

Karsten Suehring
committed
};
class ConstraintInfo
{
bool m_progressiveSourceFlag;
bool m_interlacedSourceFlag;
bool m_nonPackedConstraintFlag;
bool m_frameOnlyConstraintFlag;
bool m_intraOnlyConstraintFlag;
uint32_t m_maxBitDepthConstraintIdc;
ChromaFormat m_maxChromaFormatConstraintIdc;
bool m_onePictureOnlyConstraintFlag;
bool m_lowerBitRateConstraintFlag;
bool m_noQtbttDualTreeIntraConstraintFlag;
bool m_noPartitionConstraintsOverrideConstraintFlag;
bool m_noSaoConstraintFlag;
bool m_noAlfConstraintFlag;
bool m_noRefWraparoundConstraintFlag;
bool m_noTemporalMvpConstraintFlag;
bool m_noSbtmvpConstraintFlag;
bool m_noAmvrConstraintFlag;
bool m_noBdofConstraintFlag;
bool m_noCclmConstraintFlag;
bool m_noMtsConstraintFlag;
bool m_noAffineMotionConstraintFlag;
bool m_noGbiConstraintFlag;
bool m_noTriangleConstraintFlag;
bool m_noLadfConstraintFlag;
bool m_noBDPCMConstraintFlag;
bool m_noJointCbCrConstraintFlag;
bool m_noQpDeltaConstraintFlag;
bool m_noDepQuantConstraintFlag;
bool m_noSignDataHidingConstraintFlag;
public:
ConstraintInfo()
: m_progressiveSourceFlag (false)
, m_interlacedSourceFlag (false)
, m_nonPackedConstraintFlag (false)
, m_frameOnlyConstraintFlag (false)
, m_intraOnlyConstraintFlag (false)
, m_maxBitDepthConstraintIdc ( 0)
, m_maxChromaFormatConstraintIdc(CHROMA_420)
, m_noQtbttDualTreeIntraConstraintFlag(false)
, m_noPartitionConstraintsOverrideConstraintFlag(false)
, m_noSaoConstraintFlag (false)
, m_noAlfConstraintFlag (false)
, m_noRefWraparoundConstraintFlag(false)
, m_noTemporalMvpConstraintFlag(false)
, m_noSbtmvpConstraintFlag (false)
, m_noAmvrConstraintFlag (false)
, m_noBdofConstraintFlag (false)
, m_noCclmConstraintFlag (false)
, m_noMtsConstraintFlag (false)
, m_noAffineMotionConstraintFlag(false)
, m_noGbiConstraintFlag (false)
, m_noMhIntraConstraintFlag (false)
, m_noTriangleConstraintFlag (false)
, m_noLadfConstraintFlag (false)
, m_noTransformSkipConstraintFlag(false)
, m_noBDPCMConstraintFlag (false)
, m_noJointCbCrConstraintFlag (false)
, m_noQpDeltaConstraintFlag (false)
, m_noDepQuantConstraintFlag (false)
, m_noSignDataHidingConstraintFlag(false)
{}
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
bool getProgressiveSourceFlag() const { return m_progressiveSourceFlag; }
void setProgressiveSourceFlag(bool b) { m_progressiveSourceFlag = b; }
bool getInterlacedSourceFlag() const { return m_interlacedSourceFlag; }
void setInterlacedSourceFlag(bool b) { m_interlacedSourceFlag = b; }
bool getNonPackedConstraintFlag() const { return m_nonPackedConstraintFlag; }
void setNonPackedConstraintFlag(bool b) { m_nonPackedConstraintFlag = b; }
bool getFrameOnlyConstraintFlag() const { return m_frameOnlyConstraintFlag; }
void setFrameOnlyConstraintFlag(bool b) { m_frameOnlyConstraintFlag = b; }
uint32_t getMaxBitDepthConstraintIdc() const { return m_maxBitDepthConstraintIdc; }
void setMaxBitDepthConstraintIdc(uint32_t bitDepth) { m_maxBitDepthConstraintIdc = bitDepth; }
ChromaFormat getMaxChromaFormatConstraintIdc() const { return m_maxChromaFormatConstraintIdc; }
void setMaxChromaFormatConstraintIdc(ChromaFormat fmt) { m_maxChromaFormatConstraintIdc = fmt; }
bool getIntraOnlyConstraintFlag() const { return m_intraOnlyConstraintFlag; }
void setIntraOnlyConstraintFlag(bool b) { m_intraOnlyConstraintFlag = b; }
bool getOnePictureOnlyConstraintFlag() const { return m_onePictureOnlyConstraintFlag; }
void setOnePictureOnlyConstraintFlag(bool b) { m_onePictureOnlyConstraintFlag = b; }
bool getLowerBitRateConstraintFlag() const { return m_lowerBitRateConstraintFlag; }
void setLowerBitRateConstraintFlag(bool b) { m_lowerBitRateConstraintFlag = b; }
bool getNoQtbttDualTreeIntraConstraintFlag() const { return m_noQtbttDualTreeIntraConstraintFlag; }
void setNoQtbttDualTreeIntraConstraintFlag(bool bVal) { m_noQtbttDualTreeIntraConstraintFlag = bVal; }
bool getNoPartitionConstraintsOverrideConstraintFlag() const { return m_noPartitionConstraintsOverrideConstraintFlag; }
void setNoPartitionConstraintsOverrideConstraintFlag(bool bVal) { m_noPartitionConstraintsOverrideConstraintFlag = bVal; }
bool getNoSaoConstraintFlag() const { return m_noSaoConstraintFlag; }
void setNoSaoConstraintFlag(bool bVal) { m_noSaoConstraintFlag = bVal; }
bool getNoAlfConstraintFlag() const { return m_noAlfConstraintFlag; }
void setNoAlfConstraintFlag(bool bVal) { m_noAlfConstraintFlag = bVal; }
bool getNoJointCbCrConstraintFlag() const { return m_noJointCbCrConstraintFlag; }
void setNoJointCbCrConstraintFlag(bool bVal) { m_noJointCbCrConstraintFlag = bVal; }
bool getNoRefWraparoundConstraintFlag() const { return m_noRefWraparoundConstraintFlag; }
void setNoRefWraparoundConstraintFlag(bool bVal) { m_noRefWraparoundConstraintFlag = bVal; }
bool getNoTemporalMvpConstraintFlag() const { return m_noTemporalMvpConstraintFlag; }
void setNoTemporalMvpConstraintFlag(bool bVal) { m_noTemporalMvpConstraintFlag = bVal; }
bool getNoSbtmvpConstraintFlag() const { return m_noSbtmvpConstraintFlag; }
void setNoSbtmvpConstraintFlag(bool bVal) { m_noSbtmvpConstraintFlag = bVal; }
bool getNoAmvrConstraintFlag() const { return m_noAmvrConstraintFlag; }
void setNoAmvrConstraintFlag(bool bVal) { m_noAmvrConstraintFlag = bVal; }
bool getNoBdofConstraintFlag() const { return m_noBdofConstraintFlag; }
void setNoBdofConstraintFlag(bool bVal) { m_noBdofConstraintFlag = bVal; }
bool getNoDmvrConstraintFlag() const { return m_noDmvrConstraintFlag; }
void setNoDmvrConstraintFlag(bool bVal) { m_noDmvrConstraintFlag = bVal; }
bool getNoCclmConstraintFlag() const { return m_noCclmConstraintFlag; }
void setNoCclmConstraintFlag(bool bVal) { m_noCclmConstraintFlag = bVal; }
bool getNoMtsConstraintFlag() const { return m_noMtsConstraintFlag; }
void setNoMtsConstraintFlag(bool bVal) { m_noMtsConstraintFlag = bVal; }
bool getNoSbtConstraintFlag() const { return m_noSbtConstraintFlag; }
void setNoSbtConstraintFlag(bool bVal) { m_noSbtConstraintFlag = bVal; }
bool getNoAffineMotionConstraintFlag() const { return m_noAffineMotionConstraintFlag; }
void setNoAffineMotionConstraintFlag(bool bVal) { m_noAffineMotionConstraintFlag = bVal; }
bool getNoGbiConstraintFlag() const { return m_noGbiConstraintFlag; }
void setNoGbiConstraintFlag(bool bVal) { m_noGbiConstraintFlag = bVal; }
bool getNoIbcConstraintFlag() const { return m_noIbcConstraintFlag; }
void setNoIbcConstraintFlag(bool bVal) { m_noIbcConstraintFlag = bVal; }
bool getNoMhIntraConstraintFlag() const { return m_noMhIntraConstraintFlag; }
void setNoMhIntraConstraintFlag(bool bVal) { m_noMhIntraConstraintFlag = bVal; }
bool getNoFPelMmvdConstraintFlag() const { return m_noFPelMmvdConstraintFlag; }
void setNoFPelMmvdConstraintFlag(bool bVal) { m_noFPelMmvdConstraintFlag = bVal; }
bool getNoTriangleConstraintFlag() const { return m_noTriangleConstraintFlag; }
void setNoTriangleConstraintFlag(bool bVal) { m_noTriangleConstraintFlag = bVal; }
bool getNoLadfConstraintFlag() const { return m_noLadfConstraintFlag; }
void setNoLadfConstraintFlag(bool bVal) { m_noLadfConstraintFlag = bVal; }
bool getNoTransformSkipConstraintFlag() const { return m_noTransformSkipConstraintFlag; }
void setNoTransformSkipConstraintFlag(bool bVal) { m_noTransformSkipConstraintFlag = bVal; }
bool getNoBDPCMConstraintFlag() const { return m_noBDPCMConstraintFlag; }
void setNoBDPCMConstraintFlag(bool bVal) { m_noBDPCMConstraintFlag = bVal; }
bool getNoQpDeltaConstraintFlag() const { return m_noQpDeltaConstraintFlag; }
void setNoQpDeltaConstraintFlag(bool bVal) { m_noQpDeltaConstraintFlag = bVal; }
bool getNoDepQuantConstraintFlag() const { return m_noDepQuantConstraintFlag; }
void setNoDepQuantConstraintFlag(bool bVal) { m_noDepQuantConstraintFlag = bVal; }
bool getNoSignDataHidingConstraintFlag() const { return m_noSignDataHidingConstraintFlag; }
void setNoSignDataHidingConstraintFlag(bool bVal) { m_noSignDataHidingConstraintFlag = bVal; }
};

Karsten Suehring
committed
class ProfileTierLevel
{
Level::Tier m_tierFlag;
Profile::Name m_profileIdc;
uint8_t m_numSubProfile;
std::vector<uint32_t> m_subProfileIdc;

Karsten Suehring
committed
Level::Name m_levelIdc;
ConstraintInfo m_constraintInfo;
bool m_subLayerLevelPresentFlag[MAX_TLAYER - 1];
Level::Name m_subLayerLevelIdc[MAX_TLAYER - 1];

Karsten Suehring
committed
public:
ProfileTierLevel();
Level::Tier getTierFlag() const { return m_tierFlag; }
void setTierFlag(Level::Tier x) { m_tierFlag = x; }
Profile::Name getProfileIdc() const { return m_profileIdc; }
void setProfileIdc(Profile::Name x) { m_profileIdc = x; }
uint32_t getSubProfileIdc(int i) const { return m_subProfileIdc[i]; }
void setSubProfileIdc(int i, uint32_t x) { m_subProfileIdc[i] = x; }
uint8_t getNumSubProfile() const { return m_numSubProfile; }
void setNumSubProfile(uint8_t x) { m_numSubProfile = x; m_subProfileIdc.resize(m_numSubProfile); }

Karsten Suehring
committed
Level::Name getLevelIdc() const { return m_levelIdc; }
void setLevelIdc(Level::Name x) { m_levelIdc = x; }
ConstraintInfo* getConstraintInfo() { return &m_constraintInfo; }
const ConstraintInfo* getConstraintInfo() const { return &m_constraintInfo; }
bool getSubLayerLevelPresentFlag(int i) const { return m_subLayerLevelPresentFlag[i]; }
void setSubLayerLevelPresentFlag(int i, bool x) { m_subLayerLevelPresentFlag[i] = x; }
Level::Name getSubLayerLevelIdc(int i) const { return m_subLayerLevelIdc[i]; }
void setSubLayerLevelIdc(int i, Level::Name x) { m_subLayerLevelIdc[i] = x; }

Karsten Suehring
committed
};
bool sliceReshaperEnableFlag;
bool sliceReshaperModelPresentFlag;
unsigned enableChromaAdj;
uint32_t reshaperModelMinBinIdx;
uint32_t reshaperModelMaxBinIdx;
int reshaperModelBinCWDelta[PIC_CODE_CW_BINS];
#if JVET_P0371_CHROMA_SCALING_OFFSET
int chrResScalingOffset;
#endif
void setUseSliceReshaper(bool b) { sliceReshaperEnableFlag = b; }
bool getUseSliceReshaper() const { return sliceReshaperEnableFlag; }
void setSliceReshapeModelPresentFlag(bool b) { sliceReshaperModelPresentFlag = b; }
bool getSliceReshapeModelPresentFlag() const { return sliceReshaperModelPresentFlag; }
void setSliceReshapeChromaAdj(unsigned adj) { enableChromaAdj = adj; }
unsigned getSliceReshapeChromaAdj() const { return enableChromaAdj; }
Vadim Seregin
committed
bool operator==( const SliceReshapeInfo& other )
Vadim Seregin
committed
{
if( sliceReshaperEnableFlag != other.sliceReshaperEnableFlag )
{
return false;
}
if( sliceReshaperModelPresentFlag != other.sliceReshaperModelPresentFlag )
{
return false;
}
if( enableChromaAdj != other.enableChromaAdj )
{
return false;
}
if( reshaperModelMinBinIdx != other.reshaperModelMinBinIdx )
{
return false;
}
if( reshaperModelMaxBinIdx != other.reshaperModelMaxBinIdx )
{
return false;
}
if( maxNbitsNeededDeltaCW != other.maxNbitsNeededDeltaCW )
{
return false;
}
#if JVET_P0371_CHROMA_SCALING_OFFSET
if (chrResScalingOffset != other.chrResScalingOffset)
{
return false;
}
#endif
Vadim Seregin
committed
if( memcmp( reshaperModelBinCWDelta, other.reshaperModelBinCWDelta, sizeof( reshaperModelBinCWDelta ) ) )
{
return false;
Vadim Seregin
committed
return true;
}
bool operator!=( const SliceReshapeInfo& other )
Vadim Seregin
committed
{
return !( *this == other );
}
int updateCtrl;
int adpOption;
uint32_t initialCW;
int rspPicSize;
int rspFps;
int rspBaseQP;
int rspTid;
int rspSliceQP;
int rspFpsToIp;

Karsten Suehring
committed
struct ChromaQpAdj
{
union
{
struct {
int CbOffset;
int CrOffset;

Karsten Suehring
committed
} comp;

Karsten Suehring
committed
} u;
};
struct ChromaQpMappingTableParams {
int m_qpBdOffset;
bool m_sameCQPTableForAllChromaFlag;
#if JVET_P0667_QP_OFFSET_TABLE_SIGNALING_JCCR
int m_numQpTables;
#endif
int m_numPtsInCQPTableMinus1[MAX_NUM_CQP_MAPPING_TABLES];
std::vector<int> m_deltaQpInValMinus1[MAX_NUM_CQP_MAPPING_TABLES];
std::vector<int> m_deltaQpOutVal[MAX_NUM_CQP_MAPPING_TABLES];

Karsten Suehring
committed
ChromaQpMappingTableParams()
{
m_qpBdOffset = 12;
m_sameCQPTableForAllChromaFlag = true;
#if JVET_P0667_QP_OFFSET_TABLE_SIGNALING_JCCR
m_numQpTables = 1;
#endif
m_numPtsInCQPTableMinus1[0] = 0;
m_deltaQpInValMinus1[0] = { 0 };
m_deltaQpOutVal[0] = { 0 };
}

Karsten Suehring
committed
void setSameCQPTableForAllChromaFlag(bool b) { m_sameCQPTableForAllChromaFlag = b; }
bool getSameCQPTableForAllChromaFlag() const { return m_sameCQPTableForAllChromaFlag; }
#if JVET_P0667_QP_OFFSET_TABLE_SIGNALING_JCCR
void setNumQpTables(int n) { m_numQpTables = n; }
int getNumQpTables() const { return m_numQpTables; }
#endif
void setNumPtsInCQPTableMinus1(int tableIdx, int n) { m_numPtsInCQPTableMinus1[tableIdx] = n; }
int getNumPtsInCQPTableMinus1(int tableIdx) const { return m_numPtsInCQPTableMinus1[tableIdx]; }
void setDeltaQpInValMinus1(int tableIdx, std::vector<int> &inVals) { m_deltaQpInValMinus1[tableIdx] = inVals; }
void setDeltaQpInValMinus1(int tableIdx, int idx, int n) { m_deltaQpInValMinus1[tableIdx][idx] = n; }
int getDeltaQpInValMinus1(int tableIdx, int idx) const { return m_deltaQpInValMinus1[tableIdx][idx]; }
void setDeltaQpOutVal(int tableIdx, std::vector<int> &outVals) { m_deltaQpOutVal[tableIdx] = outVals; }
void setDeltaQpOutVal(int tableIdx, int idx, int n) { m_deltaQpOutVal[tableIdx][idx] = n; }
int getDeltaQpOutVal(int tableIdx, int idx) const { return m_deltaQpOutVal[tableIdx][idx]; }
};
struct ChromaQpMappingTable : ChromaQpMappingTableParams
{
std::map<int, int> m_chromaQpMappingTables[MAX_NUM_CQP_MAPPING_TABLES];
int getMappedChromaQpValue(ComponentID compID, const int qpVal) const { return m_chromaQpMappingTables[m_sameCQPTableForAllChromaFlag ? 0 : (int)compID - 1].at(qpVal); }
void derivedChromaQPMappingTables();
void setParams(const ChromaQpMappingTableParams ¶ms, const int qpBdOffset);
};
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
class DPS
{
private:
int m_decodingParameterSetId;
int m_maxSubLayersMinus1;
ProfileTierLevel m_profileTierLevel;
public:
DPS()
: m_decodingParameterSetId(-1)
, m_maxSubLayersMinus1 (0)
{};
virtual ~DPS() {};
int getDecodingParameterSetId() const { return m_decodingParameterSetId; }
void setDecodingParameterSetId(int val) { m_decodingParameterSetId = val; }
int getMaxSubLayersMinus1() const { return m_maxSubLayersMinus1; }
void setMaxSubLayersMinus1(int val) { m_maxSubLayersMinus1 = val; }
void setProfileTierLevel(const ProfileTierLevel &val) { m_profileTierLevel = val; }
const ProfileTierLevel& getProfileTierLevel() const { return m_profileTierLevel; }
};
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
class VPS
{
private:
int m_VPSId;
uint32_t m_uiMaxLayers;
uint32_t m_vpsIncludedLayerId[MAX_VPS_LAYERS];
bool m_vpsExtensionFlag;
public:
VPS();
virtual ~VPS();
int getVPSId() const { return m_VPSId; }
void setVPSId(int i) { m_VPSId = i; }
uint32_t getMaxLayers() const { return m_uiMaxLayers; }
void setMaxLayers(uint32_t l) { m_uiMaxLayers = l; }
bool getVPSExtensionFlag() const { return m_vpsExtensionFlag; }
void setVPSExtensionFlag(bool t) { m_vpsExtensionFlag = t; }
void setVPSIncludedLayerId(uint32_t v, uint32_t Layer) { m_vpsIncludedLayerId[Layer] = v; }
uint32_t getVPSIncludedLayerId(uint32_t Layer) const { return m_vpsIncludedLayerId[Layer]; }
};

Karsten Suehring
committed
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
class Window
{
private:
bool m_enabledFlag;
int m_winLeftOffset;
int m_winRightOffset;
int m_winTopOffset;
int m_winBottomOffset;
public:
Window()
: m_enabledFlag (false)
, m_winLeftOffset (0)
, m_winRightOffset (0)
, m_winTopOffset (0)
, m_winBottomOffset(0)
{ }
bool getWindowEnabledFlag() const { return m_enabledFlag; }
int getWindowLeftOffset() const { return m_enabledFlag ? m_winLeftOffset : 0; }
void setWindowLeftOffset(int val) { m_winLeftOffset = val; m_enabledFlag = true; }
int getWindowRightOffset() const { return m_enabledFlag ? m_winRightOffset : 0; }
void setWindowRightOffset(int val) { m_winRightOffset = val; m_enabledFlag = true; }
int getWindowTopOffset() const { return m_enabledFlag ? m_winTopOffset : 0; }
void setWindowTopOffset(int val) { m_winTopOffset = val; m_enabledFlag = true; }
int getWindowBottomOffset() const { return m_enabledFlag ? m_winBottomOffset: 0; }
void setWindowBottomOffset(int val) { m_winBottomOffset = val; m_enabledFlag = true; }
void setWindow(int offsetLeft, int offsetLRight, int offsetLTop, int offsetLBottom)
{
m_enabledFlag = true;
m_winLeftOffset = offsetLeft;
m_winRightOffset = offsetLRight;
m_winTopOffset = offsetLTop;
m_winBottomOffset = offsetLBottom;
}
};
class VUI
{
private:
bool m_aspectRatioInfoPresentFlag;
int m_aspectRatioIdc;
int m_sarWidth;
int m_sarHeight;
bool m_colourDescriptionPresentFlag;
int m_colourPrimaries;
int m_transferCharacteristics;
int m_matrixCoefficients;
bool m_fieldSeqFlag;
bool m_chromaLocInfoPresentFlag;
int m_chromaSampleLocTypeTopField;
int m_chromaSampleLocTypeBottomField;
int m_chromaSampleLocType;
bool m_overscanInfoPresentFlag;
bool m_overscanAppropriateFlag;
bool m_videoSignalTypePresentFlag;
bool m_videoFullRangeFlag;

Karsten Suehring
committed
public:
VUI()
: m_aspectRatioInfoPresentFlag (false) //TODO: This initialiser list contains magic numbers
, m_aspectRatioIdc (0)
, m_sarWidth (0)
, m_sarHeight (0)
, m_colourDescriptionPresentFlag (false)
, m_colourPrimaries (2)
, m_transferCharacteristics (2)
, m_matrixCoefficients (2)
, m_fieldSeqFlag (false)
, m_chromaLocInfoPresentFlag (false)
, m_chromaSampleLocTypeTopField (0)
, m_chromaSampleLocTypeBottomField (0)
, m_chromaSampleLocType (0)
, m_overscanInfoPresentFlag (false)
, m_overscanAppropriateFlag (false)
, m_videoSignalTypePresentFlag (false)
, m_videoFullRangeFlag (false)
{}

Karsten Suehring
committed
virtual ~VUI() {}
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
bool getAspectRatioInfoPresentFlag() const { return m_aspectRatioInfoPresentFlag; }
void setAspectRatioInfoPresentFlag(bool i) { m_aspectRatioInfoPresentFlag = i; }
int getAspectRatioIdc() const { return m_aspectRatioIdc; }
void setAspectRatioIdc(int i) { m_aspectRatioIdc = i; }
int getSarWidth() const { return m_sarWidth; }
void setSarWidth(int i) { m_sarWidth = i; }
int getSarHeight() const { return m_sarHeight; }
void setSarHeight(int i) { m_sarHeight = i; }
bool getColourDescriptionPresentFlag() const { return m_colourDescriptionPresentFlag; }
void setColourDescriptionPresentFlag(bool i) { m_colourDescriptionPresentFlag = i; }
int getColourPrimaries() const { return m_colourPrimaries; }
void setColourPrimaries(int i) { m_colourPrimaries = i; }
int getTransferCharacteristics() const { return m_transferCharacteristics; }
void setTransferCharacteristics(int i) { m_transferCharacteristics = i; }
int getMatrixCoefficients() const { return m_matrixCoefficients; }
void setMatrixCoefficients(int i) { m_matrixCoefficients = i; }
bool getFieldSeqFlag() const { return m_fieldSeqFlag; }
void setFieldSeqFlag(bool i) { m_fieldSeqFlag = i; }
bool getChromaLocInfoPresentFlag() const { return m_chromaLocInfoPresentFlag; }
void setChromaLocInfoPresentFlag(bool i) { m_chromaLocInfoPresentFlag = i; }
int getChromaSampleLocTypeTopField() const { return m_chromaSampleLocTypeTopField; }
void setChromaSampleLocTypeTopField(int i) { m_chromaSampleLocTypeTopField = i; }
int getChromaSampleLocTypeBottomField() const { return m_chromaSampleLocTypeBottomField; }
void setChromaSampleLocTypeBottomField(int i) { m_chromaSampleLocTypeBottomField = i; }
int getChromaSampleLocType() const { return m_chromaSampleLocType; }
void setChromaSampleLocType(int i) { m_chromaSampleLocType = i; }
bool getOverscanInfoPresentFlag() const { return m_overscanInfoPresentFlag; }
void setOverscanInfoPresentFlag(bool i) { m_overscanInfoPresentFlag = i; }
bool getOverscanAppropriateFlag() const { return m_overscanAppropriateFlag; }
void setOverscanAppropriateFlag(bool i) { m_overscanAppropriateFlag = i; }
bool getVideoSignalTypePresentFlag() const { return m_videoSignalTypePresentFlag; }
void setVideoSignalTypePresentFlag(bool i) { m_videoSignalTypePresentFlag = i; }
bool getVideoFullRangeFlag() const { return m_videoFullRangeFlag; }
void setVideoFullRangeFlag(bool i) { m_videoFullRangeFlag = i; }

Karsten Suehring
committed
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
};
/// SPS RExt class
class SPSRExt // Names aligned to text specification
{
private:
bool m_transformSkipRotationEnabledFlag;
bool m_transformSkipContextEnabledFlag;
bool m_rdpcmEnabledFlag[NUMBER_OF_RDPCM_SIGNALLING_MODES];
bool m_extendedPrecisionProcessingFlag;
bool m_intraSmoothingDisabledFlag;
bool m_highPrecisionOffsetsEnabledFlag;
bool m_persistentRiceAdaptationEnabledFlag;
bool m_cabacBypassAlignmentEnabledFlag;
public:
SPSRExt();
bool settingsDifferFromDefaults() const
{
return getTransformSkipRotationEnabledFlag()
|| getTransformSkipContextEnabledFlag()
|| getRdpcmEnabledFlag(RDPCM_SIGNAL_IMPLICIT)
|| getRdpcmEnabledFlag(RDPCM_SIGNAL_EXPLICIT)
|| getExtendedPrecisionProcessingFlag()
|| getIntraSmoothingDisabledFlag()
|| getHighPrecisionOffsetsEnabledFlag()
|| getPersistentRiceAdaptationEnabledFlag()
|| getCabacBypassAlignmentEnabledFlag();
}
bool getTransformSkipRotationEnabledFlag() const { return m_transformSkipRotationEnabledFlag; }
void setTransformSkipRotationEnabledFlag(const bool value) { m_transformSkipRotationEnabledFlag = value; }
bool getTransformSkipContextEnabledFlag() const { return m_transformSkipContextEnabledFlag; }
void setTransformSkipContextEnabledFlag(const bool value) { m_transformSkipContextEnabledFlag = value; }
bool getRdpcmEnabledFlag(const RDPCMSignallingMode signallingMode) const { return m_rdpcmEnabledFlag[signallingMode]; }
void setRdpcmEnabledFlag(const RDPCMSignallingMode signallingMode, const bool value) { m_rdpcmEnabledFlag[signallingMode] = value; }
bool getExtendedPrecisionProcessingFlag() const { return m_extendedPrecisionProcessingFlag; }
void setExtendedPrecisionProcessingFlag(bool value) { m_extendedPrecisionProcessingFlag = value; }
bool getIntraSmoothingDisabledFlag() const { return m_intraSmoothingDisabledFlag; }
void setIntraSmoothingDisabledFlag(bool bValue) { m_intraSmoothingDisabledFlag=bValue; }
bool getHighPrecisionOffsetsEnabledFlag() const { return m_highPrecisionOffsetsEnabledFlag; }
void setHighPrecisionOffsetsEnabledFlag(bool value) { m_highPrecisionOffsetsEnabledFlag = value; }
bool getPersistentRiceAdaptationEnabledFlag() const { return m_persistentRiceAdaptationEnabledFlag; }
void setPersistentRiceAdaptationEnabledFlag(const bool value) { m_persistentRiceAdaptationEnabledFlag = value; }
bool getCabacBypassAlignmentEnabledFlag() const { return m_cabacBypassAlignmentEnabledFlag; }
void setCabacBypassAlignmentEnabledFlag(const bool value) { m_cabacBypassAlignmentEnabledFlag = value; }
};
/// SPS class
class SPS
{
private:
int m_SPSId;
int m_decodingParameterSetId;
Zhipin Deng
committed
bool m_affineAmvrEnabledFlag;
Yin Zhao
committed
bool m_SBT;
Mohammed Golam Sarwer
committed
#if !JVET_P0983_REMOVE_SPS_SBT_MAX_SIZE_FLAG
Yin Zhao
committed
uint8_t m_MaxSbtSize;
Mohammed Golam Sarwer
committed
#endif

Karsten Suehring
committed
ChromaFormat m_chromaFormatIdc;
uint32_t m_uiMaxTLayers; // maximum number of temporal layers
// Structure
uint32_t m_maxWidthInLumaSamples;
uint32_t m_maxHeightInLumaSamples;

Karsten Suehring
committed
int m_log2MinCodingBlockSize;
int m_log2DiffMaxMinCodingBlockSize;
unsigned m_CTUSize;
unsigned m_partitionOverrideEnalbed; // enable partition constraints override function
unsigned m_minQT[3]; // 0: I slice luma; 1: P/B slice; 2: I slice chroma
unsigned m_maxBTSize[3];
unsigned m_maxTTSize[3];

Karsten Suehring
committed
uint32_t m_uiMaxCUWidth;
uint32_t m_uiMaxCUHeight;
uint32_t m_uiMaxCodingDepth; ///< Total CU depth, relative to the smallest possible transform block size.
RPLList m_RPLList0;
RPLList m_RPLList1;
uint32_t m_numRPL0;
uint32_t m_numRPL1;
bool m_rpl1CopyFromRpl0Flag;
bool m_rpl1IdxPresentFlag;
bool m_allRplEntriesHasSameSignFlag;

Karsten Suehring
committed
bool m_bLongTermRefsPresent;
bool m_SPSTemporalMVPEnabledFlag;
int m_numReorderPics[MAX_TLAYER];
// Tool list
bool m_transformSkipEnabledFlag;
#if JVET_P0059_CHROMA_BDPCM
int m_BDPCMEnabled;
#else
bool m_BDPCMEnabledFlag;

Karsten Suehring
committed
// Parameter
BitDepths m_bitDepths;
int m_qpBDOffset[MAX_NUM_CHANNEL_TYPE];
int m_minQpMinus4[MAX_NUM_CHANNEL_TYPE]; // QP_internal - QP_input;

Karsten Suehring
committed
bool m_sbtmvpEnabledFlag;
bool m_bdofEnabledFlag;
bool m_fpelMmvdEnabledFlag;
bool m_BdofDmvrSlicePresentFlag;

Karsten Suehring
committed
uint32_t m_uiBitsForPOC;
uint32_t m_numLongTermRefPicSPS;
uint32_t m_ltRefPicPocLsbSps[MAX_NUM_LONG_TERM_REF_PICS];
bool m_usedByCurrPicLtSPSFlag[MAX_NUM_LONG_TERM_REF_PICS];
uint32_t m_log2MaxTbSize;
bool m_useWeightPred; //!< Use of Weighting Prediction (P_SLICE)
bool m_useWeightedBiPred; //!< Use of Weighting Bi-Prediction (B_SLICE)

Karsten Suehring
committed

Karsten Suehring
committed
bool m_bTemporalIdNestingFlag; // temporal_id_nesting_flag
bool m_scalingListEnabledFlag;
uint32_t m_uiMaxDecPicBuffering[MAX_TLAYER];
uint32_t m_uiMaxLatencyIncreasePlus1[MAX_TLAYER];
TimingInfo m_timingInfo;
bool m_hrdParametersPresentFlag;
HRDParameters m_hrdParameters;

Karsten Suehring
committed
bool m_vuiParametersPresentFlag;
VUI m_vuiParameters;
SPSRExt m_spsRangeExtension;
static const int m_winUnitX[NUM_CHROMA_FORMAT];
static const int m_winUnitY[NUM_CHROMA_FORMAT];
ProfileTierLevel m_profileTierLevel;

Karsten Suehring
committed

Karsten Suehring
committed
unsigned m_wrapAroundOffset;
unsigned m_PLTMode;
bool m_cclmCollocatedChromaFlag;
bool m_MTS;
bool m_IntraMTS; // 18
bool m_InterMTS; // 19
bool m_Affine;
bool m_AffineType;
bool m_PROF;
bool m_GBi; //
bool m_MHIntra;
bool m_Triangle;
#if LUMA_ADAPTIVE_DEBLOCKING_FILTER_QP_OFFSET
bool m_LadfEnabled;
int m_LadfNumIntervals;
int m_LadfQpOffset[MAX_LADF_INTERVALS];
int m_LadfIntervalLowerBound[MAX_LADF_INTERVALS];
#endif
ChromaQpMappingTable m_chromaQpMappingTable;

Karsten Suehring
committed
public:
SPS();
virtual ~SPS();
int getSPSId() const { return m_SPSId; }
void setSPSId(int i) { m_SPSId = i; }
void setDecodingParameterSetId(int val) { m_decodingParameterSetId = val; }
int getDecodingParameterSetId() const { return m_decodingParameterSetId; }

Karsten Suehring
committed
ChromaFormat getChromaFormatIdc () const { return m_chromaFormatIdc; }
void setChromaFormatIdc (ChromaFormat i) { m_chromaFormatIdc = i; }
static int getWinUnitX (int chromaFormatIdc) { CHECK(chromaFormatIdc < 0 || chromaFormatIdc >= NUM_CHROMA_FORMAT, "Invalid chroma format parameter"); return m_winUnitX[chromaFormatIdc]; }
static int getWinUnitY (int chromaFormatIdc) { CHECK(chromaFormatIdc < 0 || chromaFormatIdc >= NUM_CHROMA_FORMAT, "Invalid chroma format parameter"); return m_winUnitY[chromaFormatIdc]; }
// structure
void setMaxPicWidthInLumaSamples( uint32_t u ) { m_maxWidthInLumaSamples = u; }
uint32_t getMaxPicWidthInLumaSamples() const { return m_maxWidthInLumaSamples; }
void setMaxPicHeightInLumaSamples( uint32_t u ) { m_maxHeightInLumaSamples = u; }
uint32_t getMaxPicHeightInLumaSamples() const { return m_maxHeightInLumaSamples; }

Karsten Suehring
committed
uint32_t getNumLongTermRefPicSPS() const { return m_numLongTermRefPicSPS; }
void setNumLongTermRefPicSPS(uint32_t val) { m_numLongTermRefPicSPS = val; }
uint32_t getLtRefPicPocLsbSps(uint32_t index) const { CHECK( index >= MAX_NUM_LONG_TERM_REF_PICS, "Index exceeds boundary" ); return m_ltRefPicPocLsbSps[index]; }
void setLtRefPicPocLsbSps(uint32_t index, uint32_t val) { CHECK( index >= MAX_NUM_LONG_TERM_REF_PICS, "Index exceeds boundary" ); m_ltRefPicPocLsbSps[index] = val; }
bool getUsedByCurrPicLtSPSFlag(int i) const { CHECK( i >= MAX_NUM_LONG_TERM_REF_PICS, "Index exceeds boundary" ); return m_usedByCurrPicLtSPSFlag[i]; }
void setUsedByCurrPicLtSPSFlag(int i, bool x) { CHECK( i >= MAX_NUM_LONG_TERM_REF_PICS, "Index exceeds boundary" ); m_usedByCurrPicLtSPSFlag[i] = x; }
int getLog2MinCodingBlockSize() const { return m_log2MinCodingBlockSize; }
void setLog2MinCodingBlockSize(int val) { m_log2MinCodingBlockSize = val; }
int getLog2DiffMaxMinCodingBlockSize() const { return m_log2DiffMaxMinCodingBlockSize; }
void setLog2DiffMaxMinCodingBlockSize(int val) { m_log2DiffMaxMinCodingBlockSize = val; }
void setCTUSize(unsigned ctuSize) { m_CTUSize = ctuSize; }
unsigned getCTUSize() const { return m_CTUSize; }
void setSplitConsOverrideEnabledFlag(bool b) { m_partitionOverrideEnalbed = b; }
bool getSplitConsOverrideEnabledFlag() const { return m_partitionOverrideEnalbed; }
void setMinQTSizes(unsigned* minQT) { m_minQT[0] = minQT[0]; m_minQT[1] = minQT[1]; m_minQT[2] = minQT[2]; }
unsigned getMinQTSize(SliceType slicetype,
ChannelType chType = CHANNEL_TYPE_LUMA)
const { return slicetype == I_SLICE ? (chType == CHANNEL_TYPE_LUMA ? m_minQT[0] : m_minQT[2]) : m_minQT[1]; }
void setMaxMTTHierarchyDepth(unsigned maxMTTHierarchyDepth,
unsigned maxMTTHierarchyDepthI,
unsigned maxMTTHierarchyDepthIChroma)
{ m_maxMTTHierarchyDepth[1] = maxMTTHierarchyDepth; m_maxMTTHierarchyDepth[0] = maxMTTHierarchyDepthI; m_maxMTTHierarchyDepth[2] = maxMTTHierarchyDepthIChroma; }