...
 
Commits (39)
ColorTransform : 1
Log2MaxTbSize : 5
DualITree: 0
\ No newline at end of file
DualITree: 0
LMCSEnable : 0
\ No newline at end of file
......@@ -105,6 +105,42 @@ void BitstreamExtractorApp::xReadPicHeader(InputNALUnit &nalu)
}
#if JVET_R0107_BITSTREAM_EXTACTION
Slice BitstreamExtractorApp::xParseSliceHeader(InputNALUnit &nalu)
{
m_hlSynaxReader.setBitstream(&nalu.getBitstream());
Slice slice;
slice.initSlice();
slice.setNalUnitType(nalu.m_nalUnitType);
slice.setNalUnitLayerId(nalu.m_nuhLayerId);
slice.setTLayer(nalu.m_temporalId);
m_hlSynaxReader.parseSliceHeader(&slice, &m_picHeader, &m_parameterSetManager, m_prevTid0Poc, m_prevPicPOC);
return slice;
}
bool BitstreamExtractorApp::xCheckSliceSubpicture(Slice &slice, int targetSubPicId)
{
PPS *pps = m_parameterSetManager.getPPS(m_picHeader.getPPSId());
CHECK(nullptr == pps, "referenced PPS not found");
SPS *sps = m_parameterSetManager.getSPS(pps->getSPSId());
CHECK(nullptr == sps, "referenced SPS not found");
if (sps->getSubPicInfoPresentFlag())
{
// subpic ID is explicitly indicated
msg(VERBOSE, "found slice subpic id %d\n", slice.getSliceSubPicId());
return (targetSubPicId == slice.getSliceSubPicId());
}
else
{
THROW("Subpicture signalling disbled, cannot extract.");
}
return true;
}
#else
bool BitstreamExtractorApp::xCheckSliceSubpicture(InputNALUnit &nalu, int targetSubPicId)
{
m_hlSynaxReader.setBitstream(&nalu.getBitstream());
......@@ -134,6 +170,7 @@ bool BitstreamExtractorApp::xCheckSliceSubpicture(InputNALUnit &nalu, int target
return true;
}
#endif
void BitstreamExtractorApp::xRewriteSPS (SPS &targetSPS, const SPS &sourceSPS, SubPic &subPic)
{
......@@ -353,7 +390,14 @@ void BitstreamExtractorApp::xWritePPS(PPS *pps, std::ostream& out, int layerId,
// returns true, if the NAL unit is to be discarded
bool BitstreamExtractorApp::xCheckNumSubLayers(InputNALUnit &nalu, VPS *vps)
{
#if JVET_R0107_BITSTREAM_EXTACTION
bool retval = (nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR_N_LP)
&& (nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR_W_RADL)
&& (nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_CRA)
&& !( (nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_GDR) && (m_picHeader.getRecoveryPocCnt() == 0) );
#else
bool retval = (nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR_N_LP) && (nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR_W_RADL) && (nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_CRA);
#endif
retval &= nalu.m_temporalId >= vps->getNumSubLayersInLayerInOLS(m_targetOlsIdx, vps->getGeneralLayerIdx(nalu.m_nuhLayerId));
......@@ -624,12 +668,23 @@ uint32_t BitstreamExtractorApp::decode()
delete vps;
}
}
#if JVET_R0107_BITSTREAM_EXTACTION
Slice slice;
if (nalu.isSlice())
{
slice = xParseSliceHeader(nalu);
}
#endif
if (m_subPicId>=0)
{
if ( nalu.isSlice() )
{
// check for subpicture ID
#if JVET_R0107_BITSTREAM_EXTACTION
writeInpuNalUnitToStream = xCheckSliceSubpicture(slice, m_subPicId);
#else
writeInpuNalUnitToStream = xCheckSliceSubpicture(nalu, m_subPicId);
#endif
}
if (nalu.m_nalUnitType == NAL_UNIT_FD)
{
......
......@@ -66,7 +66,12 @@ protected:
void xRewriteSPS (SPS &targetSPS, const SPS &sourceSPS, SubPic &subPic);
void xRewritePPS (PPS &targetPPS, const PPS &sourcePPS, SubPic &subPic);
#if JVET_R0107_BITSTREAM_EXTACTION
Slice xParseSliceHeader(InputNALUnit &nalu);
bool xCheckSliceSubpicture(Slice &slice, int subPicId);
#else
bool xCheckSliceSubpicture(InputNALUnit &nalu, int subPicId);
#endif
void xReadPicHeader(InputNALUnit &nalu);
void xSetSPSUpdated(int spsId) { return m_updatedSPSList.push_back(spsId); }
......
......@@ -286,10 +286,12 @@ uint32_t DecApp::decode()
{
m_cDecLib.CheckNoOutputPriorPicFlagsInAccessUnit();
m_cDecLib.resetAccessUnitNoOutputPriorPicFlags();
m_cDecLib.checkLayerIdIncludedInCvss();
m_cDecLib.resetAccessUnitEos();
m_cDecLib.resetAudIrapOrGdrAuFlag();
}
if(bNewAccessUnit)
{
m_cDecLib.isCvsStart();
m_cDecLib.checkTidLayerIdInAccessUnit();
m_cDecLib.resetAccessUnitSeiTids();
m_cDecLib.checkSEIInAccessUnit();
......@@ -369,6 +371,12 @@ void DecApp::xCreateDecLib()
std::ostream &os=m_seiMessageFileStream.is_open() ? m_seiMessageFileStream : std::cout;
m_cDecLib.setDecodedSEIMessageOutputStream(&os);
}
#if JVET_S0257_DUMP_360SEI_MESSAGE
if (!m_outputDecoded360SEIMessagesFilename.empty())
{
m_cDecLib.setDecoded360SEIMessageFileName(m_outputDecoded360SEIMessagesFilename);
}
#endif
m_cDecLib.m_targetSubPicIdx = this->m_targetSubPicIdx;
m_cDecLib.initScalingList();
}
......
......@@ -97,6 +97,9 @@ bool DecAppCfg::parseCfg( int argc, char* argv[] )
("TarDecLayerIdSetFile,l", cfg_TargetDecLayerIdSetFile, string(""), "targetDecLayerIdSet file name. The file should include white space separated LayerId values to be decoded. Omitting the option or a value of -1 in the file decodes all layers.")
("SEIColourRemappingInfoFilename", m_colourRemapSEIFileName, string(""), "Colour Remapping YUV output file name. If empty, no remapping is applied (ignore SEI message)\n")
("OutputDecodedSEIMessagesFilename", m_outputDecodedSEIMessagesFilename, string(""), "When non empty, output decoded SEI messages to the indicated file. If file is '-', then output to stdout\n")
#if JVET_S0257_DUMP_360SEI_MESSAGE
("360DumpFile", m_outputDecoded360SEIMessagesFilename, string(""), "When non empty, output decoded 360 SEI messages to the indicated file.\n")
#endif
("ClipOutputVideoToRec709Range", m_bClipOutputVideoToRec709Range, false, "If true then clip output video to the Rec. 709 Range on saving")
("PYUV", m_packedYUVMode, false, "If true then output 10-bit and 12-bit YUV data as 5-byte and 3-byte (respectively) packed YUV data. Ignored for interlaced output.")
#if ENABLE_TRACING
......@@ -235,6 +238,9 @@ DecAppCfg::DecAppCfg()
, m_colourRemapSEIFileName()
, m_targetDecLayerIdSet()
, m_outputDecodedSEIMessagesFilename()
#if JVET_S0257_DUMP_360SEI_MESSAGE
, m_outputDecoded360SEIMessagesFilename()
#endif
, m_bClipOutputVideoToRec709Range(false)
, m_packedYUVMode(false)
, m_statMode(0)
......
......@@ -72,6 +72,9 @@ protected:
std::string m_colourRemapSEIFileName; ///< output Colour Remapping file name
std::vector<int> m_targetDecLayerIdSet; ///< set of LayerIds to be included in the sub-bitstream extraction process.
std::string m_outputDecodedSEIMessagesFilename; ///< filename to output decoded SEI messages to. If '-', then use stdout. If empty, do not output details.
#if JVET_S0257_DUMP_360SEI_MESSAGE
std::string m_outputDecoded360SEIMessagesFilename; ///< filename to output decoded 360 SEI messages to.
#endif
bool m_bClipOutputVideoToRec709Range; ///< If true, clip the output video to the Rec 709 range on saving.
......
......@@ -252,6 +252,9 @@ void EncApp::xInitLibCfg()
m_cEncLib.setAvoidIntraInDepLayer ( m_avoidIntraInDepLayer );
//====== SPS constraint flags =======
#if JVET_S0179_CONDITIONAL_SIGNAL_GCI
m_cEncLib.setGciPresentFlag (true);
#endif
m_cEncLib.setOnePictureOnlyConstraintFlag ( m_onePictureOnlyConstraintFlag );
m_cEncLib.setIntraOnlyConstraintFlag ( m_intraConstraintFlag ); // NOTE: This setting is not used, and is confused with setIntraConstraintFlag
m_cEncLib.setMaxBitDepthConstraintIdc ( m_bitDepthConstraint - 8 );
......
......@@ -81,6 +81,9 @@ EncAppCfg::EncAppCfg()
, m_snrInternalColourSpace(false)
, m_outputInternalColourSpace(false)
, m_packedYUVMode(false)
#if JVET_S0179_CONDITIONAL_SIGNAL_GCI
, m_gciPresentFlag(true)
#endif
, m_bIntraOnlyConstraintFlag(false)
, m_maxBitDepthConstraintIdc(0)
, m_maxChromaFormatConstraintIdc(CHROMA_420)
......@@ -1615,6 +1618,17 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
CHECK(m_resChangeInClvsEnabled, "resolution change in CLVS and subpictures cannot be enabled together");
}
#if JVET_S0221_NUM_VB_CHECK
if (m_virtualBoundariesPresentFlag)
{
if (m_iSourceWidth <= 8)
CHECK(m_numVerVirtualBoundaries != 0, "The number of vertical virtual boundaries shall be 0 when the picture width is less than or equal to 8");
if (m_iSourceHeight <= 8)
CHECK(m_numHorVirtualBoundaries != 0, "The number of horizontal virtual boundaries shall be 0 when the picture height is less than or equal to 8");
}
#endif
if (m_cfgSubpictureLevelInfoSEI.m_enabled)
{
CHECK (m_numSubPics != m_cfgSubpictureLevelInfoSEI.m_numSubpictures, "NumSubPics must be equal to SEISubpicLevelInfoNumSubpics" );
......
......@@ -131,6 +131,9 @@ protected:
bool m_bClipOutputVideoToRec709Range;
bool m_packedYUVMode; ///< If true, output 10-bit and 12-bit YUV data as 5-byte and 3-byte (respectively) packed YUV data
#if JVET_S0179_CONDITIONAL_SIGNAL_GCI
bool m_gciPresentFlag;
#endif
bool m_bIntraOnlyConstraintFlag;
uint32_t m_maxBitDepthConstraintIdc;
uint32_t m_maxChromaFormatConstraintIdc;
......
......@@ -388,7 +388,7 @@ void IntraPrediction::initPredIntraParams(const PredictionUnit & pu, const CompA
const int signAng = intraPredAngleMode < 0 ? -1 : 1;
absAng = angTable [absAngMode];
m_ipaParam.invAngle = invAngTable[absAngMode];
m_ipaParam.absInvAngle = invAngTable[absAngMode];
m_ipaParam.intraPredAngle = signAng * absAng;
if (intraPredAngleMode < 0)
{
......@@ -399,7 +399,7 @@ void IntraPrediction::initPredIntraParams(const PredictionUnit & pu, const CompA
const int sideSize = m_ipaParam.isModeVer ? puSize.height : puSize.width;
const int maxScale = 2;
m_ipaParam.angularScale = std::min(maxScale, floorLog2(sideSize) - (floorLog2(3 * m_ipaParam.invAngle - 2) - 8));
m_ipaParam.angularScale = std::min(maxScale, floorLog2(sideSize) - (floorLog2(3 * m_ipaParam.absInvAngle - 2) - 8));
m_ipaParam.applyPDPC &= m_ipaParam.angularScale >= 0;
}
}
......@@ -464,7 +464,7 @@ void IntraPrediction::xPredIntraAng( const CPelBuf &pSrc, PelBuf &pDst, const Ch
const bool bIsModeVer = m_ipaParam.isModeVer;
const int multiRefIdx = m_ipaParam.multiRefIndex;
const int intraPredAngle = m_ipaParam.intraPredAngle;
const int invAngle = m_ipaParam.invAngle;
const int absInvAngle = m_ipaParam.absInvAngle;
Pel* refMain;
Pel* refSide;
......@@ -490,7 +490,7 @@ void IntraPrediction::xPredIntraAng( const CPelBuf &pSrc, PelBuf &pDst, const Ch
int sizeSide = bIsModeVer ? height : width;
for (int k = -sizeSide; k <= -1; k++)
{
refMain[k] = refSide[std::min((-k * invAngle + 256) >> 9, sizeSide)];
refMain[k] = refSide[std::min((-k * absInvAngle + 256) >> 9, sizeSide)];
}
}
else
......@@ -618,7 +618,7 @@ void IntraPrediction::xPredIntraAng( const CPelBuf &pSrc, PelBuf &pDst, const Ch
for (int x = 0; x < std::min(3 << scale, width); x++)
{
invAngleSum += invAngle;
invAngleSum += absInvAngle;
int wL = 32 >> (2 * x >> scale);
Pel left = refSide[y + (invAngleSum >> 9) + 1];
......
......@@ -83,7 +83,7 @@ private:
bool isModeVer;
int multiRefIndex;
int intraPredAngle;
int invAngle;
int absInvAngle;
bool interpolationFlag;
int angularScale;
......@@ -94,7 +94,7 @@ private:
, isModeVer(false)
, multiRefIndex(-1)
, intraPredAngle(std::numeric_limits<int>::max())
, invAngle(std::numeric_limits<int>::max())
, absInvAngle(std::numeric_limits<int>::max())
, interpolationFlag(false)
, angularScale(-1)
// clang-format on
......
......@@ -57,7 +57,9 @@ Slice::Slice()
, m_prevIRAPSubpicType ( NAL_UNIT_INVALID )
, m_rpl0Idx ( -1 )
, m_rpl1Idx ( -1 )
#if !JVET_S0052_RM_SEPARATE_COLOUR_PLANE
, m_colourPlaneId ( 0 )
#endif
, m_eNalUnitType ( NAL_UNIT_CODED_SLICE_IDR_W_RADL )
, m_pictureHeaderInSliceHeader ( false )
, m_eSliceType ( I_SLICE )
......@@ -161,7 +163,9 @@ void Slice::initSlice()
m_aiNumRefIdx[i] = 0;
}
m_colFromL0Flag = true;
#if !JVET_S0052_RM_SEPARATE_COLOUR_PLANE
m_colourPlaneId = 0;
#endif
m_colRefIdx = 0;
m_lmcsEnabledFlag = 0;
m_explicitScalingListUsed = 0;
......@@ -2691,7 +2695,9 @@ SPS::SPS()
, m_SBT ( false )
, m_ISP ( false )
, m_chromaFormatIdc (CHROMA_420)
#if !JVET_S0052_RM_SEPARATE_COLOUR_PLANE
, m_separateColourPlaneFlag ( 0 )
#endif
, m_uiMaxTLayers ( 1)
, m_ptlDpbHrdParamsPresentFlag (1)
, m_SubLayerDpbParamsFlag (0)
......
......@@ -235,6 +235,9 @@ private:
class ConstraintInfo
{
#if JVET_S0179_CONDITIONAL_SIGNAL_GCI
bool m_gciPresentFlag;
#endif
bool m_nonPackedConstraintFlag;
bool m_nonProjectedConstraintFlag;
bool m_noResChangeInClvsConstraintFlag;
......@@ -300,7 +303,12 @@ class ConstraintInfo
public:
ConstraintInfo()
#if JVET_S0179_CONDITIONAL_SIGNAL_GCI
: m_gciPresentFlag(true)
, m_nonPackedConstraintFlag(false)
#else
: m_nonPackedConstraintFlag (false)
#endif
, m_nonProjectedConstraintFlag(false)
, m_noResChangeInClvsConstraintFlag(false)
, m_oneTilePerPicConstraintFlag(false)
......@@ -365,6 +373,11 @@ public:
{}
#if JVET_S0179_CONDITIONAL_SIGNAL_GCI
bool getGciPresentFlag() const { return m_gciPresentFlag; }
void setGciPresentFlag(bool b) { m_gciPresentFlag = b; }
#endif
bool getNonPackedConstraintFlag() const { return m_nonPackedConstraintFlag; }
void setNonPackedConstraintFlag(bool b) { m_nonPackedConstraintFlag = b; }
......@@ -1274,7 +1287,9 @@ private:
bool m_SBT;
bool m_ISP;
ChromaFormat m_chromaFormatIdc;
#if !JVET_S0052_RM_SEPARATE_COLOUR_PLANE
bool m_separateColourPlaneFlag; //!< separate colour plane flag
#endif
uint32_t m_uiMaxTLayers; // maximum number of temporal layers
......@@ -1451,8 +1466,10 @@ public:
int getLayerId() const { return m_layerId; }
ChromaFormat getChromaFormatIdc () const { return m_chromaFormatIdc; }
void setChromaFormatIdc (ChromaFormat i) { m_chromaFormatIdc = i; }
#if !JVET_S0052_RM_SEPARATE_COLOUR_PLANE
void setSeparateColourPlaneFlag ( bool b ) { m_separateColourPlaneFlag = b; }
bool getSeparateColourPlaneFlag () const { return m_separateColourPlaneFlag; }
#endif
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]; }
......@@ -2528,7 +2545,9 @@ private:
ReferencePictureList m_localRPL1; //< RPL for L1 when present in slice header
int m_rpl0Idx; //< index of used RPL in the SPS or -1 for local RPL in the slice header
int m_rpl1Idx; //< index of used RPL in the SPS or -1 for local RPL in the slice header
#if !JVET_S0052_RM_SEPARATE_COLOUR_PLANE
int m_colourPlaneId; //!< 4:4:4 colour plane ID
#endif
NalUnitType m_eNalUnitType; ///< Nal unit type for the slice
bool m_pictureHeaderInSliceHeader;
uint32_t m_nuhLayerId; ///< Nal unit layer id
......@@ -2777,8 +2796,10 @@ public:
bool isPocRestrictedByDRAP( int poc, bool precedingDRAPinDecodingOrder );
bool isPOCInRefPicList( const ReferencePictureList *rpl, int poc );
void checkConformanceForDRAP( uint32_t temporalId );
#if !JVET_S0052_RM_SEPARATE_COLOUR_PLANE
void setColourPlaneId( int id ) { m_colourPlaneId = id; }
int getColourPlaneId() const { return m_colourPlaneId; }
#endif
void setLambdas( const double lambdas[MAX_NUM_COMPONENT] ) { for (int component = 0; component < MAX_NUM_COMPONENT; component++) m_lambdas[component] = lambdas[component]; }
const double* getLambdas() const { return m_lambdas; }
......
......@@ -50,12 +50,20 @@
#include <assert.h>
#include <cassert>
//########### place macros to be removed in next cycle below this line ###############
#define JVET_S0179_CONDITIONAL_SIGNAL_GCI 1 // JVET-S0179: Conditional signalling of GCI fields
#define JVET_S0074_SPS_REORDER 1 // JVET-S0074: aspect 1, rearrange some syntax elements in SPS
#define JVET_S0132_HLS_REORDER 1 // Rearrange syntax elements in SPS and PPS
#define JVET_S0221_NUM_VB_CHECK 1 // JVET_S0221: Constraints on the number of virtual boundaries
#define JVET_S0052_RM_SEPARATE_COLOUR_PLANE 1 // JVET-S0052: Remove separate colour plane coding from VVC version 1
//########### place macros to be be kept below this line ###############
#define JVET_S0257_DUMP_360SEI_MESSAGE 1 // Software support of 360 SEI messages
#define JVET_R0351_HIGH_BIT_DEPTH_SUPPORT 1 // JVET-R0351: high bit depth coding support (syntax changes, no mathematical differences for CTCs)
#define JVET_R0351_HIGH_BIT_DEPTH_ENABLED 0 // JVET-R0351: high bit depth coding enabled (increases accuracies of some calculations, e.g. transforms)
......@@ -63,6 +71,8 @@
#define JVET_M0497_MATRIX_MULT 0 // 0: Fast method; 1: Matrix multiplication
#define JVET_R0107_BITSTREAM_EXTACTION 1 // JVET-R0107 Proposal 3:Bitsteam extraction modifications
#define APPLY_SBT_SL_ON_MTS 1 // apply save & load fast algorithm on inter MTS when SBT is on
typedef std::pair<int, bool> TrMode;
......
......@@ -922,6 +922,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
const CodingStructure &cs = *pu.cs;
const Slice &slice = *pu.cs->slice;
const uint32_t maxNumMergeCand = pu.cs->sps->getMaxNumMergeCand();
CHECK (maxNumMergeCand > MRG_MAX_NUM_CANDS, "selected maximum number of merge candidate exceeds global limit");
for (uint32_t ui = 0; ui < maxNumMergeCand; ++ui)
{
mrgCtx.BcwIdx[ui] = BCW_DEFAULT;
......
......@@ -427,6 +427,7 @@ DecLib::DecLib()
, m_bFirstSliceInPicture(true)
, m_firstSliceInSequence{ true }
, m_firstSliceInBitstream(true)
, m_isFirstAuInCvs( true )
, m_prevSliceSkipped(false)
, m_skippedPOC(0)
, m_lastPOCNoOutputPriorPics(-1)
......@@ -434,6 +435,10 @@ DecLib::DecLib()
, m_lastNoOutputBeforeRecoveryFlag{ false }
, m_sliceLmcsApsId(-1)
, m_pDecodedSEIOutputStream(NULL)
, m_audIrapOrGdrAuFlag( false )
#if JVET_S0257_DUMP_360SEI_MESSAGE
, m_decoded360SeiDumpFileName()
#endif
, m_decodedPictureHashSEIEnabled(false)
, m_numberOfChecksumErrorsDetected(0)
, m_warningMessageSkipPicture(false)
......@@ -451,6 +456,7 @@ DecLib::DecLib()
#if ENABLE_SIMD_OPT_BUFFER
g_pelBufOP.initPelBufOpsX86();
#endif
memset(m_accessUnitEos, false, sizeof(m_accessUnitEos));
for (int i = 0; i < MAX_VPS_LAYERS; i++)
{
m_associatedIRAPType[i] = NAL_UNIT_INVALID;
......@@ -886,37 +892,47 @@ void DecLib::xCreateUnavailablePicture(int iUnavailablePoc, bool longTermFlag, c
{
m_pocRandomAccess = iUnavailablePoc;
}
}
void DecLib::isCvsStart()
void DecLib::checkLayerIdIncludedInCvss()
{
for (auto pic = m_accessUnitPicInfo.begin(); pic != m_accessUnitPicInfo.end(); pic++)
if (getVPS() == nullptr || getVPS()->getMaxLayers() == 1)
{
return;
}
if (m_audIrapOrGdrAuFlag &&
(m_isFirstAuInCvs || m_accessUnitPicInfo.begin()->m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP || m_accessUnitPicInfo.begin()->m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL))
{
// store layerIDs in the first AU
m_firstAccessUnitPicInfo.assign(m_accessUnitPicInfo.begin(), m_accessUnitPicInfo.end());
}
else
{
if (pic->m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR_N_LP && pic->m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR_W_RADL)
// check whether the layerIDs in an AU are included in the layerIDs of the first AU
for (auto pic = m_accessUnitPicInfo.begin(); pic != m_accessUnitPicInfo.end(); pic++)
{
checkIncludedInFirstAu();
return;
bool layerIdFind;
for (auto picFirst = m_firstAccessUnitPicInfo.begin(); picFirst != m_firstAccessUnitPicInfo.end(); picFirst++)
{
layerIdFind = pic->m_nuhLayerId == picFirst->m_nuhLayerId ? true : false;
if (layerIdFind)
{
break;
}
}
CHECK(!layerIdFind, "each picture in an AU in a CVS shall have nuh_layer_id equal to the nuh_layer_id of one of the pictures present in the first AU of the CVS");
}
}
//save the first AU info for a CVS start
m_firstAccessUnitPicInfo.assign(m_accessUnitPicInfo.begin(), m_accessUnitPicInfo.end());
}
void DecLib::checkIncludedInFirstAu()
{
// update the value of m_isFirstAuInCvs for the next AU according to NAL_UNIT_EOS in each layer
for (auto pic = m_accessUnitPicInfo.begin(); pic != m_accessUnitPicInfo.end(); pic++)
{
bool isFind = 0;
for (auto picFirst = m_firstAccessUnitPicInfo.begin(); picFirst != m_firstAccessUnitPicInfo.end(); picFirst++)
m_isFirstAuInCvs = m_accessUnitEos[pic->m_nuhLayerId] ? true : false;
if(!m_isFirstAuInCvs)
{
if (pic->m_nuhLayerId == picFirst->m_nuhLayerId)
{
isFind = 1;
break;
}
break;
}
CHECK(!isFind, "each picture in an AU in a CVS shall have nuh_layer_id equal to the nuh_layer_id of one of the pictures present in the first AU of the CVS");
}
}
......@@ -1767,6 +1783,9 @@ void DecLib::xParsePrefixSEImessages()
const SPS *sps = m_parameterSetManager.getActiveSPS();
const VPS *vps = m_parameterSetManager.getVPS(sps->getVPSId());
m_seiReader.parseSEImessage( &(nalu.getBitstream()), m_SEIs, nalu.m_nalUnitType, nalu.m_nuhLayerId, nalu.m_temporalId, vps, sps, m_HRD, m_pDecodedSEIOutputStream );
#if JVET_S0257_DUMP_360SEI_MESSAGE
m_seiCfgDump.write360SeiDump( m_decoded360SeiDumpFileName, m_SEIs, sps );
#endif
m_accessUnitSeiPayLoadTypes.push_back(std::tuple<NalUnitType, int, SEI::PayloadType>(nalu.m_nalUnitType, nalu.m_nuhLayerId, m_SEIs.back()->payloadType()));
delete m_prefixSEINALUs.front();
m_prefixSEINALUs.pop_front();
......@@ -2680,6 +2699,9 @@ bool DecLib::decode(InputNALUnit& nalu, int& iSkipFrame, int& iPOCLastDisplay, i
const SPS *sps = m_parameterSetManager.getActiveSPS();
const VPS *vps = m_parameterSetManager.getVPS(sps->getVPSId());
m_seiReader.parseSEImessage( &(nalu.getBitstream()), m_pcPic->SEIs, nalu.m_nalUnitType, nalu.m_nuhLayerId, nalu.m_temporalId, vps, sps, m_HRD, m_pDecodedSEIOutputStream );
#if JVET_S0257_DUMP_360SEI_MESSAGE
m_seiCfgDump.write360SeiDump(m_decoded360SeiDumpFileName, m_pcPic->SEIs, sps);
#endif
m_accessUnitSeiPayLoadTypes.push_back(std::tuple<NalUnitType, int, SEI::PayloadType>(nalu.m_nalUnitType, nalu.m_nuhLayerId, m_pcPic->SEIs.back()->payloadType()));
}
else
......@@ -2712,14 +2734,14 @@ bool DecLib::decode(InputNALUnit& nalu, int& iSkipFrame, int& iPOCLastDisplay, i
m_prevPOC = MAX_INT;
m_prevSliceSkipped = false;
m_skippedPOC = 0;
m_accessUnitEos[nalu.m_nuhLayerId] = true;
return false;
case NAL_UNIT_ACCESS_UNIT_DELIMITER:
{
AUDReader audReader;
uint32_t picType;
uint32_t audIrapOrGdrAuFlag;
audReader.parseAccessUnitDelimiter(&(nalu.getBitstream()), audIrapOrGdrAuFlag, picType);
audReader.parseAccessUnitDelimiter(&(nalu.getBitstream()), m_audIrapOrGdrAuFlag, picType);
return !m_bFirstSliceInPicture;
}
......
......@@ -105,6 +105,9 @@ private:
HLSyntaxReader m_HLSReader;
CABACDecoder m_CABACDecoder;
SEIReader m_seiReader;
#if JVET_S0257_DUMP_360SEI_MESSAGE
SeiCfgFileDump m_seiCfgDump;
#endif
LoopFilter m_cLoopFilter;
SampleAdaptiveOffset m_cSAO;
AdaptiveLoopFilter m_cALF;
......@@ -125,6 +128,8 @@ private:
bool m_bFirstSliceInPicture;
bool m_firstSliceInSequence[MAX_VPS_LAYERS];
bool m_firstSliceInBitstream;
bool m_isFirstAuInCvs;
bool m_accessUnitEos[MAX_VPS_LAYERS];
bool m_prevSliceSkipped;
int m_skippedPOC;
int m_lastPOCNoOutputPriorPics;
......@@ -132,6 +137,10 @@ private:
bool m_lastNoOutputBeforeRecoveryFlag[MAX_VPS_LAYERS]; //value of variable NoOutputBeforeRecoveryFlag of the assocated CRA/GDR pic
int m_sliceLmcsApsId; //value of LmcsApsId, constraint is same id for all slices in one picture
std::ostream *m_pDecodedSEIOutputStream;
uint32_t m_audIrapOrGdrAuFlag;
#if JVET_S0257_DUMP_360SEI_MESSAGE
std::string m_decoded360SeiDumpFileName;
#endif
int m_decodedPictureHashSEIEnabled; ///< Checksum(3)/CRC(2)/MD5(1)/disable(0) acting on decoded picture hash SEI message
uint32_t m_numberOfChecksumErrorsDetected;
......@@ -219,6 +228,9 @@ public:
bool getFirstSliceInSequence(int layerId) const { return m_firstSliceInSequence[layerId]; }
void setFirstSliceInSequence(bool val, int layerId) { m_firstSliceInSequence[layerId] = val; }
void setDecodedSEIMessageOutputStream(std::ostream *pOpStream) { m_pDecodedSEIOutputStream = pOpStream; }
#if JVET_S0257_DUMP_360SEI_MESSAGE
void setDecoded360SEIMessageFileName(std::string &Dump360SeiFileName) { m_decoded360SeiDumpFileName = Dump360SeiFileName; }
#endif
uint32_t getNumberOfChecksumErrorsDetected() const { return m_numberOfChecksumErrorsDetected; }
int getDebugCTU( ) const { return m_debugCTU; }
......@@ -229,11 +241,12 @@ public:
void resetAccessUnitPicInfo() { m_accessUnitPicInfo.clear(); }
void resetAccessUnitApsNals() { m_accessUnitApsNals.clear(); }
void resetAccessUnitSeiTids() { m_accessUnitSeiTids.clear(); }
void resetAudIrapOrGdrAuFlag() { m_audIrapOrGdrAuFlag = false; }
void resetAccessUnitEos() { memset(m_accessUnitEos, false, sizeof(m_accessUnitEos)); }
void checkTidLayerIdInAccessUnit();
void resetAccessUnitSeiPayLoadTypes() { m_accessUnitSeiPayLoadTypes.clear(); }
void checkSEIInAccessUnit();
void isCvsStart();
void checkIncludedInFirstAu();
void checkLayerIdIncludedInCvss();
void CheckNoOutputPriorPicFlagsInAccessUnit();
void resetAccessUnitNoOutputPriorPicFlags() { m_accessUnitNoOutputPriorPicFlags.clear(); }
void checkSeiInPictureUnit();
......@@ -254,6 +267,7 @@ public:
void setAPSMapEnc( ParameterSetMap<APS>* apsMap ) { m_apsMapEnc = apsMap; }
bool isNewPicture( std::ifstream *bitstreamFile, class InputByteStream *bytestream );
bool isNewAccessUnit( bool newPicture, std::ifstream *bitstreamFile, class InputByteStream *bytestream );
protected:
void xUpdateRasInit(Slice* slice);
......
......@@ -1390,6 +1390,146 @@ void SEIReader::xParseSEISampleAspectRatioInfo(SEISampleAspectRatioInfo& sei, ui
}
}
#if JVET_S0257_DUMP_360SEI_MESSAGE
void SeiCfgFileDump::write360SeiDump (std::string decoded360MessageFileName, SEIMessages& seis, const SPS* sps)
{
if (m_360SEIMessageDumped)
{
return;
}
SEIMessages equirectangularProjectionSEIs = getSeisByType(seis, SEI::EQUIRECTANGULAR_PROJECTION);
if (!equirectangularProjectionSEIs.empty())
{
SEIEquirectangularProjection* sei = (SEIEquirectangularProjection*)equirectangularProjectionSEIs.front();
xDumpSEIEquirectangularProjection(*sei, sps, decoded360MessageFileName);
m_360SEIMessageDumped = true;
}
else
{
SEIMessages generalizedCubemapProjectionSEIs = getSeisByType(seis, SEI::GENERALIZED_CUBEMAP_PROJECTION);
if (!generalizedCubemapProjectionSEIs.empty())
{
SEIGeneralizedCubemapProjection* sei = (SEIGeneralizedCubemapProjection*)generalizedCubemapProjectionSEIs.front();
xDumpSEIGeneralizedCubemapProjection(*sei, sps, decoded360MessageFileName);
m_360SEIMessageDumped = true;
}
}
}
void SeiCfgFileDump::xDumpSEIEquirectangularProjection (SEIEquirectangularProjection &sei, const SPS* sps, std::string decoded360MessageFileName)
{
if (!decoded360MessageFileName.empty())
{
FILE *fp = fopen(decoded360MessageFileName.c_str(), "w");
if (fp)
{
int chromaFormatTable[4] = {400, 420, 422, 444};
fprintf(fp, "InputBitDepth : %d # Input bitdepth\n", sps->getBitDepth(CHANNEL_TYPE_LUMA));
fprintf(fp, "InputChromaFormat : %d # Ratio of luminance to chrominance samples\n", chromaFormatTable[sps->getChromaFormatIdc()]);
fprintf(fp, "SourceWidth : %d # Input frame width\n", sps->getMaxPicWidthInLumaSamples());
fprintf(fp, "SourceHeight : %d # Input frame height\n\n", sps->getMaxPicHeightInLumaSamples());
fprintf(fp, "InputGeometryType : 0 # 0: equirectangular; 1: cubemap; 2: equalarea; this should be in the cfg of per sequence.\n");
if (sei.m_erpGuardBandFlag == 1)
{
fprintf(fp, "InputPERP : 1 # 0: original ERP input; 1: padded ERP input\n");
fprintf(fp, "CodingPERP : 0 # 0: coding with original ERP size; 1: coding with padded ERP\n");
}
fclose(fp);
m_360SEIMessageDumped = true;
}
else
{
msg( ERROR, "File %s could not be opened.\n", decoded360MessageFileName.c_str() );
}
}
}
void SeiCfgFileDump::xDumpSEIGeneralizedCubemapProjection (SEIGeneralizedCubemapProjection &sei, const SPS* sps, std::string decoded360MessageFileName)
{
if (!sei.m_gcmpCancelFlag)
{
int numFace = sei.m_gcmpPackingType == 4 || sei.m_gcmpPackingType == 5 ? 5 : 6;
int packingTypeTable[6][2] = {{6, 1}, {3, 2}, {2, 3}, {1, 6}, {1, 5}, {5, 1}};
int rotationTable[4] = {0, 90, 180, 270};
std::string packingTypeStr = "";
std::string gcmpsettingsStr = "";
std::ostringstream oss;
packingTypeStr += "SourceFPStructure : " + std::to_string(packingTypeTable[sei.m_gcmpPackingType][0]) + " " + std::to_string(packingTypeTable[sei.m_gcmpPackingType][1]);
gcmpsettingsStr += "InputGCMPSettings : ";
for (int i = 0; i < numFace; i++)
{
int rotation = rotationTable[sei.m_gcmpFaceRotation[i]];
if (sei.m_gcmpFaceIndex[i] == 1)
{
rotation = (rotation + 270) % 360 + 360;
}
else if (sei.m_gcmpFaceIndex[i] == 2)
{
rotation = (rotation + 180) % 360 + 360;
}
else
{
rotation += 360;
}
if (i % packingTypeTable[sei.m_gcmpPackingType][1] == 0)
{
packingTypeStr += " ";
}
packingTypeStr += std::to_string(sei.m_gcmpFaceIndex[i]) + " " + std::to_string(rotation) + " ";
if (sei.m_gcmpMappingFunctionType == 2)
{
double a = ((int)sei.m_gcmpFunctionCoeffU[i] + 1) / 128.0;
double b = ((int)sei.m_gcmpFunctionCoeffV[i] + 1) / 128.0;
oss.str("");
oss<<a;
std::string a_str = oss.str();
oss.str("");
oss<<b;
std::string b_str = oss.str();
gcmpsettingsStr += a_str + " " + std::to_string(sei.m_gcmpFunctionUAffectedByVFlag[i]) + " " + b_str + " " + std::to_string(sei.m_gcmpFunctionVAffectedByUFlag[i]) + " ";
}
}
if (!decoded360MessageFileName.empty())
{
FILE *fp = fopen(decoded360MessageFileName.c_str(), "w");
if (fp)
{
int chromaFormatTable[4] = {400, 420, 422, 444};
fprintf(fp, "InputBitDepth : %d # Input bitdepth\n", sps->getBitDepth(CHANNEL_TYPE_LUMA));
fprintf(fp, "InputChromaFormat : %d # Ratio of luminance to chrominance samples\n", chromaFormatTable[sps->getChromaFormatIdc()]);
fprintf(fp, "SourceWidth : %d # Input frame width\n", sps->getMaxPicWidthInLumaSamples());
fprintf(fp, "SourceHeight : %d # Input frame height\n\n", sps->getMaxPicHeightInLumaSamples());
fprintf(fp, "InputGeometryType : 15 # 0: equirectangular; 1: cubemap; 2: equalarea; this should be in the cfg of per sequence.\n");
packingTypeStr += " # frame packing order: numRows numCols Row0Idx0 ROT Row0Idx1 ROT ... Row1...";
gcmpsettingsStr += " # mapping function parameters for each face: u coefficient, u affected by v flag, v coefficient, v affected by u flag";
fprintf(fp, "%s\n", packingTypeStr.c_str());
fprintf(fp, "InputGCMPMappingType : %d # 0: CMP; 1: EAC; 2: parameterized CMP\n", (int)sei.m_gcmpMappingFunctionType);
if ((int)sei.m_gcmpMappingFunctionType == 2)
fprintf(fp, "%s\n", gcmpsettingsStr.c_str());
fprintf(fp, "InputGCMPPaddingFlag : %d # 0: input without guard bands; 1: input with guard bands\n", sei.m_gcmpGuardBandFlag);
if (sei.m_gcmpGuardBandFlag)
{
fprintf(fp, "InputGCMPPaddingType : %d # 0: unspecified(repetitive padding is used); 1: repetitive padding; 2: copy from neighboring face; 3: geometry padding\n", (int)sei.m_gcmpGuardBandType);
fprintf(fp, "InputGCMPPaddingExteriorFlag : %d # 0: guard bands only on discontinuous edges; 1: guard bands on both discontinuous edges and frame boundaries\n", sei.m_gcmpGuardBandBoundaryExteriorFlag);
fprintf(fp, "InputGCMPPaddingSize : %d # guard band size for input GCMP\n", (int)sei.m_gcmpGuardBandSamplesMinus1 + 1);
}
fclose(fp);
m_360SEIMessageDumped = true;
}
else
{
msg( ERROR, "File %s could not be opened.\n", decoded360MessageFileName.c_str() );
}
}
}
}
#endif
//! \}
......@@ -96,6 +96,27 @@ protected:
HRD m_nestedHrd;
};
#if JVET_S0257_DUMP_360SEI_MESSAGE
class SeiCfgFileDump
{
public:
SeiCfgFileDump()
: m_360SEIMessageDumped(false)
{};
virtual ~SeiCfgFileDump() {};
void write360SeiDump (std::string decoded360MessageFileName, SEIMessages& seis, const SPS* sps);
protected:
void xDumpSEIEquirectangularProjection (SEIEquirectangularProjection &sei, const SPS* sps, std::string decoded360MessageFileName);
void xDumpSEIGeneralizedCubemapProjection (SEIGeneralizedCubemapProjection &sei, const SPS* sps, std::string decoded360MessageFileName);
bool m_360SEIMessageDumped;
};
#endif
//! \}
......
......@@ -683,7 +683,22 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS )
READ_FLAG(uiCode, "rpl1_idx_present_flag");
pcPPS->setRpl1IdxPresentFlag(uiCode);
#if JVET_S0132_HLS_REORDER
READ_FLAG( uiCode, "weighted_pred_flag" ); // Use of Weighting Prediction (P_SLICE)
pcPPS->setUseWP( uiCode==1 );
READ_FLAG( uiCode, "weighted_bipred_flag" ); // Use of Bi-Directional Weighting Prediction (B_SLICE)
pcPPS->setWPBiPred( uiCode==1 );
READ_FLAG(uiCode, "pps_ref_wraparound_enabled_flag"); pcPPS->setWrapAroundEnabledFlag( uiCode ? true : false );
if (pcPPS->getWrapAroundEnabledFlag())
{
READ_UVLC(uiCode, "pps_ref_wraparound_offset");
pcPPS->setPicWidthMinusWrapAroundOffset(uiCode);
}
else
{
pcPPS->setPicWidthMinusWrapAroundOffset(0);
}
#endif
READ_SVLC(iCode, "init_qp_minus26" ); pcPPS->setPicInitQPMinus26(iCode);
READ_FLAG( uiCode, "cu_qp_delta_enabled_flag" ); pcPPS->setUseDQP( uiCode ? true : false );
......@@ -765,12 +780,12 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS )
pcPPS->setSliceChromaQpFlag(0);
pcPPS->clearChromaQpOffsetList();
}
#if !JVET_S0132_HLS_REORDER
READ_FLAG( uiCode, "weighted_pred_flag" ); // Use of Weighting Prediction (P_SLICE)
pcPPS->setUseWP( uiCode==1 );
READ_FLAG( uiCode, "weighted_bipred_flag" ); // Use of Bi-Directional Weighting Prediction (B_SLICE)
pcPPS->setWPBiPred( uiCode==1 );
#endif
READ_FLAG( uiCode, "deblocking_filter_control_present_flag" ); pcPPS->setDeblockingFilterControlPresentFlag( uiCode ? true : false );
if(pcPPS->getDeblockingFilterControlPresentFlag())
{
......@@ -852,6 +867,7 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS )
pcPPS->setQpDeltaInfoInPhFlag(false);
}
#if !JVET_S0132_HLS_REORDER
READ_FLAG(uiCode, "pps_ref_wraparound_enabled_flag"); pcPPS->setWrapAroundEnabledFlag( uiCode ? true : false );
if (pcPPS->getWrapAroundEnabledFlag())
{
......@@ -862,7 +878,7 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS )
{
pcPPS->setPicWidthMinusWrapAroundOffset(0);
}
#endif
READ_FLAG( uiCode, "picture_header_extension_present_flag");
pcPPS->setPictureHeaderExtensionPresentFlag(uiCode);
READ_FLAG( uiCode, "slice_header_extension_present_flag");
......@@ -1306,11 +1322,13 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
pcSPS->setGDREnabledFlag(uiCode);
READ_CODE(2, uiCode, "chroma_format_idc"); pcSPS->setChromaFormatIdc( ChromaFormat(uiCode) );
#if !JVET_S0052_RM_SEPARATE_COLOUR_PLANE
if( pcSPS->getChromaFormatIdc() == CHROMA_444 )
{
READ_FLAG( uiCode, "separate_colour_plane_flag"); CHECK(uiCode != 0, "separate_colour_plane_flag shall be equal to 0");
pcSPS->setSeparateColourPlaneFlag( uiCode != 0 );
}
#endif
READ_FLAG(uiCode, "ref_pic_resampling_enabled_flag"); pcSPS->setRprEnabledFlag(uiCode);
if (uiCode)
......@@ -1338,7 +1356,9 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
READ_UVLC(uiCode, "sps_conf_win_top_offset"); conf.setWindowTopOffset(uiCode);
READ_UVLC(uiCode, "sps_conf_win_bottom_offset"); conf.setWindowBottomOffset(uiCode);
}
#if !JVET_S0052_RM_SEPARATE_COLOUR_PLANE
const uint32_t chromaArrayType = (int) pcSPS->getSeparateColourPlaneFlag() ? 0 : pcSPS->getChromaFormatIdc();
#endif
READ_CODE(2, uiCode, "sps_log2_ctu_size_minus5"); pcSPS->setCTUSize(1 << (uiCode + 5));
CHECK(uiCode > 2, "sps_log2_ctu_size_minus5 must be less than or equal to 2");
......@@ -1493,6 +1513,7 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
unsigned maxBTSize[3] = { 0, 0, 0 };
unsigned maxTTSize[3] = { 0, 0, 0 };
#if !JVET_S0132_HLS_REORDER
if( pcSPS->getChromaFormatIdc() != CHROMA_400 )
{
READ_FLAG(uiCode, "qtbtt_dual_tree_intra_flag"); pcSPS->setUseDualITree(uiCode);
......@@ -1501,7 +1522,7 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
{
pcSPS->setUseDualITree(0);
}
#endif
READ_UVLC(uiCode, "log2_min_luma_coding_block_size_minus2");
int log2MinCUSize = uiCode + 2;
pcSPS->setLog2MinCodingBlockSize(log2MinCUSize);
......@@ -1530,6 +1551,30 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
CHECK(uiCode > ctbLog2SizeY - minQtLog2SizeIntraY, "The value of sps_log2_diff_max_tt_min_qt_intra_slice_luma shall be in the range of 0 to CtbLog2SizeY - MinQtLog2SizeIntraY");
CHECK(maxTTSize[0] > 64, "The value of sps_log2_diff_max_tt_min_qt_intra_slice_luma shall be in the range of 0 to min(6,CtbLog2SizeY) - MinQtLog2SizeIntraY");
}
#if JVET_S0132_HLS_REORDER
if( pcSPS->getChromaFormatIdc() != CHROMA_400 )
{
READ_FLAG(uiCode, "qtbtt_dual_tree_intra_flag"); pcSPS->setUseDualITree(uiCode);
}
else
{
pcSPS->setUseDualITree(0);
}
if (pcSPS->getUseDualITree())
{
READ_UVLC(uiCode, "sps_log2_diff_min_qt_min_cb_intra_slice_chroma"); minQT[2] = 1 << (uiCode + pcSPS->getLog2MinCodingBlockSize());
READ_UVLC(uiCode, "sps_max_mtt_hierarchy_depth_intra_slice_chroma"); maxBTD[2] = uiCode;
CHECK(uiCode > 2 * (ctbLog2SizeY - log2MinCUSize), "sps_max_mtt_hierarchy_depth_intra_slice_chroma shall be in the range 0 to 2*(ctbLog2SizeY - log2MinCUSize)");
maxTTSize[2] = maxBTSize[2] = minQT[2];
if (maxBTD[2] != 0)
{
READ_UVLC(uiCode, "sps_log2_diff_max_bt_min_qt_intra_slice_chroma"); maxBTSize[2] <<= uiCode;
READ_UVLC(uiCode, "sps_log2_diff_max_tt_min_qt_intra_slice_chroma"); maxTTSize[2] <<= uiCode;
CHECK(maxTTSize[2] > 64, "The value of sps_log2_diff_max_tt_min_qt_intra_slice_chroma shall be in the range of 0 to min(6,CtbLog2SizeY) - MinQtLog2SizeIntraChroma");
CHECK(maxBTSize[2] > 64, "The value of sps_log2_diff_max_bt_min_qt_intra_slice_chroma shall be in the range of 0 to min(6,CtbLog2SizeY) - MinQtLog2SizeIntraChroma");
}
}
#endif
READ_UVLC(uiCode, "sps_log2_diff_min_qt_min_cb_inter_slice");
unsigned minQtLog2SizeInterY = uiCode + pcSPS->getLog2MinCodingBlockSize();
minQT[1] = 1 << minQtLog2SizeInterY;
......@@ -1544,6 +1589,7 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
CHECK(uiCode > ctbLog2SizeY - minQtLog2SizeInterY, "The value of sps_log2_diff_max_tt_min_qt_inter_slice shall be in the range of 0 to CtbLog2SizeY - MinQtLog2SizeInterY");
CHECK(maxTTSize[1] > 64, "The value of sps_log2_diff_max_tt_min_qt_inter_slice shall be in the range of 0 to min(6,CtbLog2SizeY) - MinQtLog2SizeInterY");
}
#if !JVET_S0132_HLS_REORDER
if (pcSPS->getUseDualITree())
{
READ_UVLC(uiCode, "sps_log2_diff_min_qt_min_cb_intra_slice_chroma"); minQT[2] = 1 << (uiCode + pcSPS->getLog2MinCodingBlockSize());
......@@ -1558,6 +1604,7 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
CHECK(maxBTSize[2] > 64, "The value of sps_log2_diff_max_bt_min_qt_intra_slice_chroma shall be in the range of 0 to min(6,CtbLog2SizeY) - MinQtLog2SizeIntraChroma");
}
}
#endif
pcSPS->setMinQTSizes(minQT);
pcSPS->setMaxMTTHierarchyDepth(maxBTD[1], maxBTD[0], maxBTD[2]);
......@@ -1572,7 +1619,28 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
pcSPS->setLog2MaxTbSize(5);
}
#if JVET_S0074_SPS_REORDER
READ_FLAG(uiCode, "sps_transform_skip_enabled_flag"); pcSPS->setTransformSkipEnabledFlag(uiCode ? true : false);
if (pcSPS->getTransformSkipEnabledFlag())
{
READ_UVLC(uiCode, "log2_transform_skip_max_size_minus2");
pcSPS->setLog2MaxTransformSkipBlockSize(uiCode + 2);
READ_FLAG(uiCode, "sps_bdpcm_enabled_flag"); pcSPS->setBDPCMEnabledFlag(uiCode ? true : false);
}
READ_FLAG(uiCode, "sps_mts_enabled_flag"); pcSPS->setUseMTS(uiCode != 0);
if (pcSPS->getUseMTS())
{
READ_FLAG(uiCode, "sps_explicit_mts_intra_enabled_flag"); pcSPS->setUseIntraMTS(uiCode != 0);
READ_FLAG(uiCode, "sps_explicit_mts_inter_enabled_flag"); pcSPS->setUseInterMTS(uiCode != 0);
}
READ_FLAG(uiCode, "sps_lfnst_enabled_flag"); pcSPS->setUseLFNST(uiCode != 0);
#endif
#if JVET_S0052_RM_SEPARATE_COLOUR_PLANE
if (pcSPS->getChromaFormatIdc() != CHROMA_400)
#else
if (chromaArrayType != CHROMA_400)
#endif
{
READ_FLAG(uiCode, "sps_joint_cbcr_enabled_flag"); pcSPS->setJointCbCrEnabledFlag(uiCode ? true : false);
ChromaQpMappingTableParams chromaQpMappingTableParams;
......@@ -1611,6 +1679,9 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
pcSPS->setCCALFEnabledFlag(false);
}
#if JVET_S0074_SPS_REORDER
READ_FLAG(uiCode, "sps_lmcs_enable_flag"); pcSPS->setUseLmcs(uiCode == 1);
#else
READ_FLAG(uiCode, "sps_transform_skip_enabled_flag"); pcSPS->setTransformSkipEnabledFlag(uiCode ? true : false);
if (pcSPS->getTransformSkipEnabledFlag())
{
......@@ -1618,6 +1689,7 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
pcSPS->setLog2MaxTransformSkipBlockSize(uiCode + 2);
READ_FLAG(uiCode, "sps_bdpcm_enabled_flag"); pcSPS->setBDPCMEnabledFlag(uiCode ? true : false);
}
#endif
READ_FLAG( uiCode, "sps_weighted_pred_flag" ); pcSPS->setUseWP( uiCode ? true : false );
READ_FLAG( uiCode, "sps_weighted_bipred_flag" ); pcSPS->setUseWPBiPred( uiCode ? true : false );
......@@ -1795,15 +1867,20 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
pcSPS->setHorCollocatedChromaFlag(true);
pcSPS->setVerCollocatedChromaFlag(true);
}
#if !JVET_S0074_SPS_REORDER
READ_FLAG( uiCode, "sps_mts_enabled_flag" ); pcSPS->setUseMTS ( uiCode != 0 );
if ( pcSPS->getUseMTS() )
{
READ_FLAG( uiCode, "sps_explicit_mts_intra_enabled_flag" ); pcSPS->setUseIntraMTS ( uiCode != 0 );
READ_FLAG( uiCode, "sps_explicit_mts_inter_enabled_flag" ); pcSPS->setUseInterMTS ( uiCode != 0 );
}
#endif
READ_FLAG( uiCode, "sps_palette_enabled_flag"); pcSPS->setPLTMode ( uiCode != 0 );
#if JVET_S0052_RM_SEPARATE_COLOUR_PLANE
if (pcSPS->getChromaFormatIdc() == CHROMA_444 && pcSPS->getLog2MaxTbSize() != 6)
#else
if (chromaArrayType == CHROMA_444 && pcSPS->getLog2MaxTbSize() != 6)
#endif
{
READ_FLAG(uiCode, "sps_act_enabled_flag"); pcSPS->setUseColorTrans(uiCode != 0);
}
......@@ -1827,8 +1904,11 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
}
else
pcSPS->setMaxNumIBCMergeCand(0);
#if !JVET_S0074_SPS_REORDER
READ_FLAG(uiCode, "sps_lmcs_enable_flag"); pcSPS->setUseLmcs(uiCode == 1);
READ_FLAG( uiCode, "sps_lfnst_enabled_flag" ); pcSPS->setUseLFNST( uiCode != 0 );
#endif
#if LUMA_ADAPTIVE_DEBLOCKING_FILTER_QP_OFFSET
READ_FLAG( uiCode, "sps_ladf_enabled_flag" ); pcSPS->setLadfEnabled( uiCode != 0 );
......@@ -1870,11 +1950,23 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
if( pcSPS->getVirtualBoundariesPresentFlag() )
{
READ_CODE( 2, uiCode, "sps_num_ver_virtual_boundaries"); pcSPS->setNumVerVirtualBoundaries( uiCode );
#if JVET_S0221_NUM_VB_CHECK
if (pcSPS->getMaxPicWidthInLumaSamples() <= 8)
{
CHECK(pcSPS->getNumVerVirtualBoundaries() != 0, "SPS: When picture width is less than or equal to 8, the number of vertical virtual boundaries shall be equal to 0");
}
#endif
for( unsigned i = 0; i < pcSPS->getNumVerVirtualBoundaries(); i++ )
{
READ_UVLC(uiCode, "sps_virtual_boundaries_pos_x"); pcSPS->setVirtualBoundariesPosX(uiCode << 3, i);
}
READ_CODE( 2, uiCode, "sps_num_hor_virtual_boundaries"); pcSPS->setNumHorVirtualBoundaries( uiCode );
#if JVET_S0221_NUM_VB_CHECK
if (pcSPS->getMaxPicHeightInLumaSamples() <= 8)
{
CHECK(pcSPS->getNumHorVirtualBoundaries() != 0, "SPS: When picture width is less than or equal to 8, the number of vertical virtual boundaries shall be equal to 0");
}
#endif
for( unsigned i = 0; i < pcSPS->getNumHorVirtualBoundaries(); i++ )
{
READ_UVLC(uiCode, "sps_virtual_boundaries_pos_y"); pcSPS->setVirtualBoundariesPosY(uiCode << 3, i);
......@@ -2579,11 +2671,23 @@ void HLSyntaxReader::parsePictureHeader( PicHeader* picHeader, ParameterSetManag
if( picHeader->getVirtualBoundariesPresentFlag() )
{
READ_CODE( 2, uiCode, "ph_num_ver_virtual_boundaries"); picHeader->setNumVerVirtualBoundaries( uiCode );
#if JVET_S0221_NUM_VB_CHECK
if (pps->getPicWidthInLumaSamples() <= 8)
{
CHECK(picHeader->getNumVerVirtualBoundaries() != 0, "PH: When picture width is less than or equal to 8, the number of vertical virtual boundaries shall be equal to 0");
}
#endif
for( unsigned i = 0; i < picHeader->getNumVerVirtualBoundaries(); i++ )
{
READ_UVLC(uiCode, "ph_virtual_boundaries_pos_x"); picHeader->setVirtualBoundariesPosX(uiCode << 3, i);
}
READ_CODE( 2, uiCode, "ph_num_hor_virtual_boundaries"); picHeader->setNumHorVirtualBoundaries( uiCode );
#if JVET_S0221_NUM_VB_CHECK
if (pps->getPicHeightInLumaSamples() <= 8)
{
CHECK(picHeader->getNumHorVirtualBoundaries() != 0, "PH: When picture width is less than or equal to 8, the number of horizontal virtual boundaries shall be equal to 0");
}
#endif
for( unsigned i = 0; i < picHeader->getNumHorVirtualBoundaries(); i++ )
{
READ_UVLC(uiCode, "ph_virtual_boundaries_pos_y"); picHeader->setVirtualBoundariesPosY(uiCode << 3, i);
......@@ -3247,7 +3351,9 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, PicHeader* picHeader, Par
CHECK(pcSlice->getPictureHeaderInSliceHeader() && pps->getWpInfoInPhFlag() == 1, "When sh_picture_header_in_slice_header_flag is equal to 1, wp_info_in_ph_flag shall be equal to 0");
CHECK(pcSlice->getPictureHeaderInSliceHeader() && pps->getQpDeltaInfoInPhFlag() == 1, "When sh_picture_header_in_slice_header_flag is equal to 1, qp_delta_info_in_ph_flag shall be equal to 0");
CHECK(pcSlice->getPictureHeaderInSliceHeader() && sps->getSubPicInfoPresentFlag() == 1, "When sps_subpic_info_present_flag is equal to 1, the value of sh_picture_header_in_slice_header_flag shall be equal to 0");
#if !JVET_S0052_RM_SEPARATE_COLOUR_PLANE
CHECK(pcSlice->getPictureHeaderInSliceHeader() && sps->getSeparateColourPlaneFlag() == 1, "when separate_colour_plane_flag is equal to 1, the value of picture_header_in_slice_header_flag shall be equal to 0");
#endif
const ChromaFormat chFmt = sps->getChromaFormatIdc();
const uint32_t numValidComp=getNumberValidComponents(chFmt);
......@@ -3510,6 +3616,7 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, PicHeader* picHeader, Par
pcSlice->setExplicitScalingListUsed(pcSlice->getPictureHeaderInSliceHeader() ? picHeader->getExplicitScalingListEnabledFlag() : false);
}
#if !JVET_S0052_RM_SEPARATE_COLOUR_PLANE
// 4:4:4 colour plane ID
if( sps->getSeparateColourPlaneFlag() )
{
......@@ -3520,8 +3627,7 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, PicHeader* picHeader, Par
{
pcSlice->setColourPlaneId( 0 );
}
#endif
if( pps->getRplInfoInPhFlag() )
{
pcSlice->setRPL0(picHeader->getRPL0());
......@@ -4211,143 +4317,160 @@ void HLSyntaxReader::getSlicePoc(Slice* pcSlice, PicHeader* picHeader, Parameter
void HLSyntaxReader::parseConstraintInfo(ConstraintInfo *cinfo)
{
uint32_t symbol;
READ_FLAG(symbol, "general_non_packed_constraint_flag" ); cinfo->setNonPackedConstraintFlag(symbol ? true : false);
READ_FLAG(symbol, "general_frame_only_constraint_flag" ); cinfo->setFrameOnlyConstraintFlag(symbol ? true : false);
READ_FLAG(symbol, "general_non_projected_constraint_flag" ); cinfo->setNonProjectedConstraintFlag(symbol ? true : false);
READ_FLAG(symbol, "general_one_picture_only_constraint_flag" ); cinfo->setOnePictureOnlyConstraintFlag(symbol ? true : false);
READ_FLAG(symbol, "intra_only_constraint_flag" ); cinfo->setIntraOnlyConstraintFlag(symbol ? true : false);
READ_CODE(4, symbol, "max_bitdepth_constraint_idc" ); cinfo->setMaxBitDepthConstraintIdc(symbol);
READ_CODE(2, symbol, "max_chroma_format_constraint_idc" ); cinfo->setMaxChromaFormatConstraintIdc((ChromaFormat)symbol);
READ_FLAG(symbol, "single_layer_constraint_flag"); cinfo->setSingleLayerConstraintFlag(symbol ? true : false);
READ_FLAG(symbol, "all_layers_independent_constraint_flag"); cinfo->setAllLayersIndependentConstraintFlag(symbol ? true : false);
if (cinfo->getSingleLayerConstraintFlag())
{
CHECK(symbol == 0, "When single_layer_constraint_flag is equal to 1, the value of all_layers_independent_ constraint_flag shall be equal to 1");
}
READ_FLAG(symbol, "no_res_change_in_clvs_constraint_flag" ); cinfo->setNoResChangeInClvsConstraintFlag(symbol ? true : false);
READ_FLAG(symbol, "one_tile_per_pic_constraint_flag" ); cinfo->setOneTilePerPicConstraintFlag(symbol ? true : false);
READ_FLAG(symbol, "pic_header_in_slice_header_constraint_flag"); cinfo->setPicHeaderInSliceHeaderConstraintFlag(symbol ? true : false);
READ_FLAG(symbol, "one_slice_per_pic_constraint_flag" ); cinfo->setOneSlicePerPicConstraintFlag(symbol ? true : false);
READ_FLAG(symbol, "one_subpic_per_pic_constraint_flag" ); cinfo->setOneSubpicPerPicConstraintFlag(symbol ? true : false);
if (cinfo->getOneSlicePerPicConstraintFlag())
#if JVET_S0179_CONDITIONAL_SIGNAL_GCI
READ_FLAG(symbol, "gci_present_flag"); cinfo->setGciPresentFlag(symbol ? true : false);
if (cinfo->getGciPresentFlag())
{
CHECK(symbol == 0, "When one_slice_per_pic_constraint_flag is equal to 1, the value of one_subpic_per_pic_constraint_flag shall be equal to 1");
}
#endif
READ_FLAG(symbol, "general_non_packed_constraint_flag" ); cinfo->setNonPackedConstraintFlag(symbol ? true : false);
READ_FLAG(symbol, "general_frame_only_constraint_flag" ); cinfo->setFrameOnlyConstraintFlag(symbol ? true : false);
READ_FLAG(symbol, "general_non_projected_constraint_flag" ); cinfo->setNonProjectedConstraintFlag(symbol ? true : false);
READ_FLAG(symbol, "general_one_picture_only_constraint_flag" ); cinfo->setOnePictureOnlyConstraintFlag(symbol ? true : false);
READ_FLAG(symbol, "intra_only_constraint_flag" ); cinfo->setIntraOnlyConstraintFlag(symbol ? true : false);
READ_FLAG(symbol, "no_qtbtt_dual_tree_intra_constraint_flag" ); cinfo->setNoQtbttDualTreeIntraConstraintFlag(symbol > 0 ? true : false);
if (cinfo->getMaxChromaFormatConstraintIdc() == 0)
{
CHECK(symbol == 0, "When max_chroma_format_constraint_idc is equal to 0, the value of no_qtbtt_dual_tree_intra_constraint_flag shall be equal to 1");
}
READ_FLAG(symbol, "no_partition_constraints_override_constraint_flag"); cinfo->setNoPartitionConstraintsOverrideConstraintFlag(symbol > 0 ? true : false);
READ_FLAG(symbol, "no_sao_constraint_flag"); cinfo->setNoSaoConstraintFlag(symbol > 0 ? true : false);
READ_FLAG(symbol, "no_alf_constraint_flag"); cinfo->setNoAlfConstraintFlag(symbol > 0 ? true : false);
READ_FLAG(symbol, "no_ccalf_constraint_flag"); cinfo->setNoCCAlfConstraintFlag(symbol > 0 ? true : false);
if (cinfo->getMaxChromaFormatConstraintIdc() == 0)
{
CHECK(symbol == 0, "When max_chroma_format_constraint_idc is equal to 0, the value of no_ccalf_constraint_flag shall be equal to 1");
}
READ_FLAG(symbol, "no_joint_cbcr_constraint_flag"); cinfo->setNoJointCbCrConstraintFlag(symbol > 0 ? true : false);
if (cinfo->getMaxChromaFormatConstraintIdc() == 0)
{
CHECK(symbol == 0, "When max_chroma_format_constraint_idc is equal to 0, the value of no_joint_cbcr_constraint_flag shall be equal to 1");
}
READ_FLAG(symbol, "no_mrl_constraint_flag"); cinfo->setNoMrlConstraintFlag(symbol > 0 ? true : false);
READ_FLAG(symbol, "no_isp_constraint_flag"); cinfo->setNoIspConstraintFlag(symbol > 0 ? true : false);
READ_FLAG(symbol, "no_mip_constraint_flag"); cinfo->setNoMipConstraintFlag(symbol > 0 ? true : false);
READ_FLAG(symbol, "no_ref_wraparound_constraint_flag"); cinfo->setNoRefWraparoundConstraintFlag(symbol > 0 ? true : false);
if (cinfo->getIntraOnlyConstraintFlag() == 1)
{
CHECK(symbol == 0, "When intra_only_constraint_flag is equal to 1, the value of no_ref_wraparound_constraint_flag shall be equal to 1");
}
READ_FLAG(symbol, "no_temporal_mvp_constraint_flag"); cinfo->setNoTemporalMvpConstraintFlag(symbol > 0 ? true : false);
if (cinfo->getIntraOnlyConstraintFlag() == 1)
{
CHECK(symbol == 0, "When intra_only_constraint_flag is equal to 1, the value of no_temporal_mvp_constraint_flag shall be equal to 1");
}
READ_FLAG(symbol, "no_sbtmvp_constraint_flag"); cinfo->setNoSbtmvpConstraintFlag(symbol > 0 ? true : false);
if (cinfo->getIntraOnlyConstraintFlag() == 1)
{
CHECK(symbol == 0, "When intra_only_constraint_flag is equal to 1, the value of no_sbtmvp_constraint_flag shall be equal to 1");
}
READ_FLAG(symbol, "no_amvr_constraint_flag"); cinfo->setNoAmvrConstraintFlag(symbol > 0 ? true : false);
if (cinfo->getIntraOnlyConstraintFlag() == 1)
{
CHECK(symbol == 0, "When intra_only_constraint_flag is equal to 1, the value of no_amvr_constraint_flag shall be equal to 1");
}
READ_FLAG(symbol, "no_bdof_constraint_flag"); cinfo->setNoBdofConstraintFlag(symbol > 0 ? true : false);
if (cinfo->getIntraOnlyConstraintFlag() == 1)
{
CHECK(symbol == 0, "When intra_only_constraint_flag is equal to 1, the value of no_bdof_constraint_flag shall be equal to 1");
}
READ_FLAG(symbol, "no_dmvr_constraint_flag"); cinfo->setNoDmvrConstraintFlag(symbol > 0 ? true : false);
if (cinfo->getIntraOnlyConstraintFlag() == 1)
{
CHECK(symbol == 0, "When intra_only_constraint_flag is equal to 1, the value of no_dmvr_constraint_flag shall be equal to 1");
}
READ_FLAG(symbol, "no_cclm_constraint_flag"); cinfo->setNoCclmConstraintFlag(symbol > 0 ? true : false);
if (cinfo->getMaxChromaFormatConstraintIdc() == 0)
{
CHECK(symbol == 0, "When max_chroma_format_constraint_idc is equal to 0, the value of no_cclm_constraint_flag shall be equal to 1");
}
READ_FLAG(symbol, "no_mts_constraint_flag"); cinfo->setNoMtsConstraintFlag(symbol > 0 ? true : false);
READ_FLAG(symbol, "no_sbt_constraint_flag"); cinfo->setNoSbtConstraintFlag(symbol > 0 ? true : false);
READ_FLAG(symbol, "no_lfnst_constraint_flag"); cinfo->setNoLfnstConstraintFlag(symbol > 0 ? true : false);
READ_FLAG(symbol, "no_affine_motion_constraint_flag"); cinfo->setNoAffineMotionConstraintFlag(symbol > 0 ? true : false);
if (cinfo->getIntraOnlyConstraintFlag() == 1)
{
CHECK(symbol == 0, "When intra_only_constraint_flag is equal to 1, the value of no_affine_motion_constraint_flag shall be equal to 1");
}
READ_FLAG(symbol, "no_mmvd_constraint_flag"); cinfo->setNoMmvdConstraintFlag(symbol > 0 ? true : false);
if (cinfo->getIntraOnlyConstraintFlag() == 1)
{
CHECK(symbol == 0, "When intra_only_constraint_flag is equal to 1, the value of no_mmvd_constraint_flag shall be equal to 1");
}
READ_FLAG(symbol, "no_smvd_constraint_flag"); cinfo->setNoSmvdConstraintFlag(symbol > 0 ? true : false);
if (cinfo->getIntraOnlyConstraintFlag() == 1)
{
CHECK(symbol == 0, "When intra_only_constraint_flag is equal to 1, the value of no_smvd_constraint_flag shall be equal to 1");
}
READ_FLAG(symbol, "no_prof_constraint_flag"); cinfo->setNoProfConstraintFlag(symbol > 0 ? true : false);
if (cinfo->getIntraOnlyConstraintFlag() == 1)
{
CHECK(symbol == 0, "When intra_only_constraint_flag is equal to 1, the value of no_prof_constraint_flag shall be equal to 1");
}
READ_FLAG(symbol, "no_bcw_constraint_flag"); cinfo->setNoBcwConstraintFlag(symbol > 0 ? true : false);
if (cinfo->getIntraOnlyConstraintFlag() == 1)
{
CHECK(symbol == 0, "When intra_only_constraint_flag is equal to 1, the value of no_bcw_constraint_flag shall be equal to 1");
}
READ_FLAG(symbol, "no_ibc_constraint_flag"); cinfo->setNoIbcConstraintFlag(symbol > 0 ? true : false);
READ_FLAG(symbol, "no_ciip_constraint_flag"); cinfo->setNoCiipConstraintFlag(symbol > 0 ? true : false);
if (cinfo->getIntraOnlyConstraintFlag() == 1)
{
CHECK(symbol == 0, "When intra_only_constraint_flag is equal to 1, the value of no_ciip_constraint_flag shall be equal to 1");
READ_CODE(4, symbol, "max_bitdepth_constraint_idc" ); cinfo->setMaxBitDepthConstraintIdc(symbol);
READ_CODE(2, symbol, "max_chroma_format_constraint_idc" ); cinfo->setMaxChromaFormatConstraintIdc((ChromaFormat)symbol);
READ_FLAG(symbol, "single_layer_constraint_flag"); cinfo->setSingleLayerConstraintFlag(symbol ? true : false);
READ_FLAG(symbol, "all_layers_independent_constraint_flag"); cinfo->setAllLayersIndependentConstraintFlag(symbol ? true : false);
if (cinfo->getSingleLayerConstraintFlag())
{
CHECK(symbol == 0, "When single_layer_constraint_flag is equal to 1, the value of all_layers_independent_ constraint_flag shall be equal to 1");
}
READ_FLAG(symbol, "no_res_change_in_clvs_constraint_flag" ); cinfo->setNoResChangeInClvsConstraintFlag(symbol ? true : false);
READ_FLAG(symbol, "one_tile_per_pic_constraint_flag" ); cinfo->setOneTilePerPicConstraintFlag(symbol ? true : false);
READ_FLAG(symbol, "pic_header_in_slice_header_constraint_flag"); cinfo->setPicHeaderInSliceHeaderConstraintFlag(symbol ? true : false);
READ_FLAG(symbol, "one_slice_per_pic_constraint_flag" ); cinfo->setOneSlicePerPicConstraintFlag(symbol ? true : false);
READ_FLAG(symbol, "one_subpic_per_pic_constraint_flag" ); cinfo->setOneSubpicPerPicConstraintFlag(symbol ? true : false);
if (cinfo->getOneSlicePerPicConstraintFlag())
{
CHECK(symbol == 0, "When one_slice_per_pic_constraint_flag is equal to 1, the value of one_subpic_per_pic_constraint_flag shall be equal to 1");
}
READ_FLAG(symbol, "no_qtbtt_dual_tree_intra_constraint_flag" ); cinfo->setNoQtbttDualTreeIntraConstraintFlag(symbol > 0 ? true : false);
if (cinfo->getMaxChromaFormatConstraintIdc() == 0)
{
CHECK(symbol == 0, "When max_chroma_format_constraint_idc is equal to 0, the value of no_qtbtt_dual_tree_intra_constraint_flag shall be equal to 1");
}
READ_FLAG(symbol, "no_partition_constraints_override_constraint_flag"); cinfo->setNoPartitionConstraintsOverrideConstraintFlag(symbol > 0 ? true : false);
READ_FLAG(symbol, "no_sao_constraint_flag"); cinfo->setNoSaoConstraintFlag(symbol > 0 ? true : false);
READ_FLAG(symbol, "no_alf_constraint_flag"); cinfo->setNoAlfConstraintFlag(symbol > 0 ? true : false);
READ_FLAG(symbol, "no_ccalf_constraint_flag"); cinfo->setNoCCAlfConstraintFlag(symbol > 0 ? true : false);
if (cinfo->getMaxChromaFormatConstraintIdc() == 0)
{
CHECK(symbol == 0, "When max_chroma_format_constraint_idc is equal to 0, the value of no_ccalf_constraint_flag shall be equal to 1");
}
READ_FLAG(symbol, "no_joint_cbcr_constraint_flag"); cinfo->setNoJointCbCrConstraintFlag(symbol > 0 ? true : false);
if (cinfo->getMaxChromaFormatConstraintIdc() == 0)
{
CHECK(symbol == 0, "When max_chroma_format_constraint_idc is equal to 0, the value of no_joint_cbcr_constraint_flag shall be equal to 1");
}
READ_FLAG(symbol, "no_mrl_constraint_flag"); cinfo->setNoMrlConstraintFlag(symbol > 0 ? true : false);
READ_FLAG(symbol, "no_isp_constraint_flag"); cinfo->setNoIspConstraintFlag(symbol > 0 ? true : false);
READ_FLAG(symbol, "no_mip_constraint_flag"); cinfo->setNoMipConstraintFlag(symbol > 0 ? true : false);
READ_FLAG(symbol, "no_ref_wraparound_constraint_flag"); cinfo->setNoRefWraparoundConstraintFlag(symbol > 0 ? true : false);
if (cinfo->getIntraOnlyConstraintFlag() == 1)
{
CHECK(symbol == 0, "When intra_only_constraint_flag is equal to 1, the value of no_ref_wraparound_constraint_flag shall be equal to 1");
}
READ_FLAG(symbol, "no_temporal_mvp_constraint_flag"); cinfo->setNoTemporalMvpConstraintFlag(symbol > 0 ? true : false);
if (cinfo->getIntraOnlyConstraintFlag() == 1)
{
CHECK(symbol == 0, "When intra_only_constraint_flag is equal to 1, the value of no_temporal_mvp_constraint_flag shall be equal to 1");
}
READ_FLAG(symbol, "no_sbtmvp_constraint_flag"); cinfo->setNoSbtmvpConstraintFlag(symbol > 0 ? true : false);
if (cinfo->getIntraOnlyConstraintFlag() == 1)
{
CHECK(symbol == 0, "When intra_only_constraint_flag is equal to 1, the value of no_sbtmvp_constraint_flag shall be equal to 1");
}
READ_FLAG(symbol, "no_amvr_constraint_flag"); cinfo->setNoAmvrConstraintFlag(symbol > 0 ? true : false);
if (cinfo->getIntraOnlyConstraintFlag() == 1)
{
CHECK(symbol == 0, "When intra_only_constraint_flag is equal to 1, the value of no_amvr_constraint_flag shall be equal to 1");
}
READ_FLAG(symbol, "no_bdof_constraint_flag"); cinfo->setNoBdofConstraintFlag(symbol > 0 ? true : false);
if (cinfo->getIntraOnlyConstraintFlag() == 1)
{
CHECK(symbol == 0, "When intra_only_constraint_flag is equal to 1, the value of no_bdof_constraint_flag shall be equal to 1");
}
READ_FLAG(symbol, "no_dmvr_constraint_flag"); cinfo->setNoDmvrConstraintFlag(symbol > 0 ? true : false);
if (cinfo->getIntraOnlyConstraintFlag() == 1)
{
CHECK(symbol == 0, "When intra_only_constraint_flag is equal to 1, the value of no_dmvr_constraint_flag shall be equal to 1");
}
READ_FLAG(symbol, "no_cclm_constraint_flag"); cinfo->setNoCclmConstraintFlag(symbol > 0 ? true : false);
if (cinfo->getMaxChromaFormatConstraintIdc() == 0)
{
CHECK(symbol == 0, "When max_chroma_format_constraint_idc is equal to 0, the value of no_cclm_constraint_flag shall be equal to 1");
}
READ_FLAG(symbol, "no_mts_constraint_flag"); cinfo->setNoMtsConstraintFlag(symbol > 0 ? true : false);
READ_FLAG(symbol, "no_sbt_constraint_flag"); cinfo->setNoSbtConstraintFlag(symbol > 0