Commit e113bbe6 authored by Karsten Suehring's avatar Karsten Suehring

remove macro JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT

parent f9a70483
......@@ -212,9 +212,7 @@ void EncApp::xInitLibCfg()
#endif
m_cEncLib.setRDpenalty ( m_rdPenalty );
m_cEncLib.setCTUSize ( m_uiCTUSize );
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
m_cEncLib.setUseSplitConsOverride ( m_SplitConsOverrideEnabledFlag );
#endif
m_cEncLib.setMinQTSizes ( m_uiMinQT );
m_cEncLib.setMaxBTDepth ( m_uiMaxBTDepth, m_uiMaxBTDepthI, m_uiMaxBTDepthIChroma );
m_cEncLib.setDualITree ( m_dualTree );
......
......@@ -801,9 +801,7 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
("FrameOnly", m_frameOnlyConstraintFlag, false, "Indicate that the bitstream contains only frames")
("MTT", m_MTT, 0u, "Multi type tree type (0: off, 1:QTBT + triple split) [default: 0]")
("CTUSize", m_uiCTUSize, 128u, "CTUSize (specifies the CTU size if QTBT is on) [default: 128]")
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
("EnablePartitionConstraintsOverride", m_SplitConsOverrideEnabledFlag, true, "Enable partition constraints override")
#endif
("MinQTISlice", m_uiMinQT[0], 8u, "MinQTISlice")
("MinQTLumaISlice", m_uiMinQT[0], 8u, "MinQTLumaISlice")
("MinQTChromaISlice", m_uiMinQT[2], 4u, "MinQTChromaISlice")
......@@ -1862,9 +1860,6 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
m_uiLog2DiffMaxMinCodingBlockSize = m_uiMaxCodingDepth;
m_uiMaxCUWidth = m_uiMaxCUHeight = m_uiCTUSize;
m_uiMaxCUDepth = m_uiMaxCodingDepth;
#if !JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
m_uiLog2DiffMaxMinCodingBlockSize = m_uiMaxCUDepth - 1;
#endif
// check validity of input parameters
if( xCheckParameter() )
......@@ -1999,9 +1994,7 @@ bool EncAppCfg::xCheckParameter()
#endif
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
xConfirmPara( m_useAMaxBT && !m_SplitConsOverrideEnabledFlag, "AMaxBt can only be used with PartitionConstriantsOverride enabled" );
#endif
xConfirmPara(m_bitstreamFileName.empty(), "A bitstream file name must be specified (BitstreamFile)");
......
......@@ -197,9 +197,7 @@ protected:
// coding unit (CU) definition
unsigned m_uiCTUSize;
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
bool m_SplitConsOverrideEnabledFlag;
#endif
unsigned m_uiMinQT[3]; // 0: I slice luma; 1: P/B slice; 2: I slice chroma
unsigned m_uiMaxBTDepth;
unsigned m_uiMaxBTDepthI;
......
......@@ -128,7 +128,6 @@ Slice::Slice()
, m_encCABACTableIdx (I_SLICE)
, m_iProcessingStartTime ( 0 )
, m_dProcessingTime ( 0 )
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
, m_splitConsOverrideFlag ( false )
, m_uiMinQTSize ( 0 )
, m_uiMaxBTDepth ( 0 )
......@@ -137,7 +136,6 @@ Slice::Slice()
, m_uiMaxBTDepthIChroma ( 0 )
, m_uiMaxBTSizeIChroma ( 0 )
, m_uiMaxTTSizeIChroma ( 0 )
#endif
, m_uiMaxBTSize ( 0 )
, m_MotionCandLut (NULL)
{
......@@ -860,7 +858,6 @@ void Slice::copySliceInfo(Slice *pSrc, bool cpyAlmostAll)
m_maxNumMergeCand = pSrc->m_maxNumMergeCand;
m_maxNumAffineMergeCand = pSrc->m_maxNumAffineMergeCand;
if( cpyAlmostAll ) m_encCABACTableIdx = pSrc->m_encCABACTableIdx;
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
m_splitConsOverrideFlag = pSrc->m_splitConsOverrideFlag;
m_uiMinQTSize = pSrc->m_uiMinQTSize;
m_uiMaxBTDepth = pSrc->m_uiMaxBTDepth;
......@@ -869,7 +866,6 @@ void Slice::copySliceInfo(Slice *pSrc, bool cpyAlmostAll)
m_uiMaxBTDepthIChroma = pSrc->m_uiMaxBTDepthIChroma;
m_uiMaxBTSizeIChroma = pSrc->m_uiMaxBTSizeIChroma;
m_uiMaxTTSizeIChroma = pSrc->m_uiMaxTTSizeIChroma;
#endif
m_uiMaxBTSize = pSrc->m_uiMaxBTSize;
}
......@@ -1774,17 +1770,11 @@ SPSNext::SPSNext( SPS& sps )
// default values for additional parameters
#if !JVET_L0217_L0678_SPS_CLEANUP
, m_CTUSize ( 0 )
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
, m_minQT { 0, 0, 0 }
#else
, m_minQT { 0, 0 }
#endif
, m_maxBTDepth { MAX_BT_DEPTH, MAX_BT_DEPTH_INTER, MAX_BT_DEPTH_C }
, m_maxBTSize { MAX_BT_SIZE, MAX_BT_SIZE_INTER, MAX_BT_SIZE_C }
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
, m_maxTTSize { MAX_TT_SIZE, MAX_TT_SIZE_INTER, MAX_TT_SIZE_C }
#endif
#endif
#if !JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
, m_subPuLog2Size ( 0 )
#endif
......@@ -1831,17 +1821,11 @@ SPS::SPS()
, m_log2DiffMaxMinCodingBlockSize(0)
#if JVET_L0217_L0678_SPS_CLEANUP
, m_CTUSize(0)
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
, m_minQT{ 0, 0, 0 }
#else
, m_minQT{ 0, 0 }
#endif
, m_maxBTDepth{ MAX_BT_DEPTH, MAX_BT_DEPTH_INTER, MAX_BT_DEPTH_C }
, m_maxBTSize{ MAX_BT_SIZE, MAX_BT_SIZE_INTER, MAX_BT_SIZE_C }
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
, m_maxTTSize{ MAX_TT_SIZE, MAX_TT_SIZE_INTER, MAX_TT_SIZE_C }
#endif
#endif
, m_uiMaxCUWidth ( 32)
, m_uiMaxCUHeight ( 32)
, m_uiMaxCodingDepth ( 3)
......@@ -2618,11 +2602,9 @@ uint32_t PreCalcValues::getValIdx( const Slice &slice, const ChannelType chType
uint32_t PreCalcValues::getMaxBtDepth( const Slice &slice, const ChannelType chType ) const
{
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
if ( slice.getSplitConsOverrideFlag() )
return (!slice.isIRAP() || isLuma(chType) || ISingleTree) ? slice.getMaxBTDepth() : slice.getMaxBTDepthIChroma();
else
#endif
return maxBtDepth[getValIdx( slice, chType )];
}
......@@ -2633,14 +2615,10 @@ uint32_t PreCalcValues::getMinBtSize( const Slice &slice, const ChannelType chTy
uint32_t PreCalcValues::getMaxBtSize( const Slice &slice, const ChannelType chType ) const
{
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
if (slice.getSplitConsOverrideFlag())
return (!slice.isIRAP() || isLuma(chType) || ISingleTree) ? slice.getMaxBTSize() : slice.getMaxBTSizeIChroma();
else
return maxBtSize[getValIdx(slice, chType)];
#else
return ( !slice.isIRAP() || isLuma( chType ) || ISingleTree ) ? slice.getMaxBTSize() : MAX_BT_SIZE_C;
#endif
}
uint32_t PreCalcValues::getMinTtSize( const Slice &slice, const ChannelType chType ) const
......@@ -2650,20 +2628,16 @@ uint32_t PreCalcValues::getMinTtSize( const Slice &slice, const ChannelType chTy
uint32_t PreCalcValues::getMaxTtSize( const Slice &slice, const ChannelType chType ) const
{
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
if ( slice.getSplitConsOverrideFlag() )
return (!slice.isIRAP() || isLuma(chType) || ISingleTree) ? slice.getMaxTTSize() : slice.getMaxTTSizeIChroma();
else
#endif
return maxTtSize[getValIdx( slice, chType )];
}
uint32_t PreCalcValues::getMinQtSize( const Slice &slice, const ChannelType chType ) const
{
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
if ( slice.getSplitConsOverrideFlag() )
return (!slice.isIRAP() || isLuma(chType) || ISingleTree) ? slice.getMinQTSize() : slice.getMinQTSizeIChroma();
else
#endif
return minQtSize[getValIdx( slice, chType )];
}
......
......@@ -830,15 +830,11 @@ private:
// qtbt
#if !JVET_L0217_L0678_SPS_CLEANUP
unsigned m_CTUSize;
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
unsigned m_partitionOverrideEnalbed; // enable partition constraints override function
#endif
unsigned m_minQT[3]; // 0: I slice luma; 1: P/B slice; 2: I slice chroma
unsigned m_maxBTDepth[3];
unsigned m_maxBTSize[3];
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
unsigned m_maxTTSize[3];
#endif
unsigned m_dualITree;
#endif
// sub-pu merging
......@@ -909,10 +905,8 @@ public:
#if !JVET_L0217_L0678_SPS_CLEANUP
void setCTUSize ( unsigned ctuSize ) { m_CTUSize = ctuSize; }
unsigned getCTUSize () const { return m_CTUSize; }
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
void setSplitConsOverrideEnabledFlag(bool b) { m_partitionOverrideEnalbed = b; }
bool getSplitConsOverrideEnabledFlag() const { return m_partitionOverrideEnalbed; }
#endif
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 )
......@@ -929,14 +923,12 @@ public:
unsigned getMaxBTSize () const { return m_maxBTSize[1]; }
unsigned getMaxBTSizeI () const { return m_maxBTSize[0]; }
unsigned getMaxBTSizeIChroma () const { return m_maxBTSize[2]; }
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
void setMaxTTSize (unsigned maxTTSize,
unsigned maxTTSizeI,
unsigned maxTTSizeC) { m_maxTTSize[1] = maxTTSize; m_maxTTSize[0] = maxTTSizeI; m_maxTTSize[2] = maxTTSizeC; }
unsigned getMaxTTSize() const { return m_maxTTSize[1]; }
unsigned getMaxTTSizeI() const { return m_maxTTSize[0]; }
unsigned getMaxTTSizeIChroma() const { return m_maxTTSize[2]; }
#endif
void setUseDualITree ( bool b ) { m_dualITree = b; }
bool getUseDualITree () const { return m_dualITree; }
......@@ -1009,15 +1001,11 @@ private:
int m_log2DiffMaxMinCodingBlockSize;
#if JVET_L0217_L0678_SPS_CLEANUP
unsigned m_CTUSize;
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
unsigned m_partitionOverrideEnalbed; // enable partition constraints override function
#endif
unsigned m_minQT[3]; // 0: I slice luma; 1: P/B slice; 2: I slice chroma
unsigned m_maxBTDepth[3];
unsigned m_maxBTSize[3];
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
unsigned m_maxTTSize[3];
#endif
unsigned m_dualITree;
#endif
uint32_t m_uiMaxCUWidth;
......@@ -1164,10 +1152,8 @@ public:
#if JVET_L0217_L0678_SPS_CLEANUP
void setCTUSize(unsigned ctuSize) { m_CTUSize = ctuSize; }
unsigned getCTUSize() const { return m_CTUSize; }
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
void setSplitConsOverrideEnabledFlag(bool b) { m_partitionOverrideEnalbed = b; }
bool getSplitConsOverrideEnabledFlag() const { return m_partitionOverrideEnalbed; }
#endif
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)
......@@ -1186,7 +1172,6 @@ public:
unsigned getMaxBTSize() const { return m_maxBTSize[1]; }
unsigned getMaxBTSizeI() const { return m_maxBTSize[0]; }
unsigned getMaxBTSizeIChroma() const { return m_maxBTSize[2]; }
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
void setMaxTTSize(unsigned maxTTSize,
unsigned maxTTSizeI,
unsigned maxTTSizeC)
......@@ -1194,7 +1179,6 @@ public:
unsigned getMaxTTSize() const { return m_maxTTSize[1]; }
unsigned getMaxTTSizeI() const { return m_maxTTSize[0]; }
unsigned getMaxTTSizeIChroma() const { return m_maxTTSize[2]; }
#endif
void setUseDualITree(bool b) { m_dualITree = b; }
bool getUseDualITree() const { return m_dualITree; }
......@@ -1711,7 +1695,6 @@ private:
clock_t m_iProcessingStartTime;
double m_dProcessingTime;
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
bool m_splitConsOverrideFlag;
uint32_t m_uiMinQTSize;
uint32_t m_uiMaxBTDepth;
......@@ -1721,7 +1704,6 @@ private:
uint32_t m_uiMaxBTDepthIChroma;
uint32_t m_uiMaxBTSizeIChroma;
uint32_t m_uiMaxTTSizeIChroma;
#endif
uint32_t m_uiMaxBTSize;
AlfSliceParam m_alfSliceParam;
......@@ -1833,7 +1815,6 @@ public:
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; }
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
void setSplitConsOverrideFlag(bool b) { m_splitConsOverrideFlag = b; }
bool getSplitConsOverrideFlag() const { return m_splitConsOverrideFlag; }
void setMinQTSize(int i) { m_uiMinQTSize = i; }
......@@ -1851,7 +1832,6 @@ public:
uint32_t getMaxBTSizeIChroma() const { return m_uiMaxBTSizeIChroma; }
void setMaxTTSizeIChroma(int i) { m_uiMaxTTSizeIChroma = i; }
uint32_t getMaxTTSizeIChroma() const { return m_uiMaxTTSizeIChroma; }
#endif
void setMaxBTSize(int i) { m_uiMaxBTSize = i; }
uint32_t getMaxBTSize() const { return m_uiMaxBTSize; }
......@@ -2262,11 +2242,7 @@ public:
, minBtSize { MIN_BT_SIZE, MIN_BT_SIZE_INTER, MIN_BT_SIZE_C }
, maxBtSize { sps.getMaxBTSizeI(), sps.getMaxBTSize(), sps.getMaxBTSizeIChroma() }
, minTtSize { MIN_TT_SIZE, MIN_TT_SIZE_INTER, MIN_TT_SIZE_C }
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
, maxTtSize { sps.getMaxTTSizeI(), sps.getMaxTTSize(), sps.getMaxTTSizeIChroma() }
#else
, maxTtSize { MAX_TT_SIZE, MAX_TT_SIZE_INTER, MAX_TT_SIZE_C }
#endif
, minQtSize { sps.getMinQTSize(I_SLICE, CHANNEL_TYPE_LUMA), sps.getMinQTSize(B_SLICE, CHANNEL_TYPE_LUMA), sps.getMinQTSize(I_SLICE, CHANNEL_TYPE_CHROMA) }
#else
, ISingleTree ( !sps.getSpsNext().getUseDualITree() )
......@@ -2274,11 +2250,7 @@ public:
, minBtSize { MIN_BT_SIZE, MIN_BT_SIZE_INTER, MIN_BT_SIZE_C }
, maxBtSize { sps.getSpsNext().getMaxBTSizeI(), sps.getSpsNext().getMaxBTSize(), sps.getSpsNext().getMaxBTSizeIChroma() }
, minTtSize { MIN_TT_SIZE, MIN_TT_SIZE_INTER, MIN_TT_SIZE_C }
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
, maxTtSize { sps.getSpsNext().getMaxTTSizeI(), sps.getSpsNext().getMaxTTSize(), sps.getSpsNext().getMaxTTSizeIChroma() }
#else
, maxTtSize { MAX_TT_SIZE, MAX_TT_SIZE_INTER, MAX_TT_SIZE_C }
#endif
, minQtSize { sps.getSpsNext().getMinQTSize( I_SLICE, CHANNEL_TYPE_LUMA ), sps.getSpsNext().getMinQTSize( B_SLICE, CHANNEL_TYPE_LUMA ), sps.getSpsNext().getMinQTSize( I_SLICE, CHANNEL_TYPE_CHROMA ) }
#endif
{}
......
......@@ -129,7 +129,6 @@
#define NUM_SPLIT_THREADS_IF_MSVC 4
#endif
#define JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT 1
#define JVET_L0217_L0678_SPS_CLEANUP 1 // move the QT/BT/TT related high level syntax element from SPSNext to SPS, delete HEVC RQT in SPS
......
......@@ -821,29 +821,19 @@ void HLSyntaxReader::parseSPSNext( SPSNext& spsNext, const bool usePCM )
unsigned minQT [3] = { 0, 0, 0 };
unsigned maxBTD[3] = { 0, 0, 0 };
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
unsigned maxBTSize[3] = { 0, 0, 0 };
unsigned maxTTSize[3] = { 0, 0, 0 };
#endif
READ_FLAG( symbol, "qtbt_dual_intra_tree" ); spsNext.setUseDualITree( symbol );
READ_UVLC( symbol, "log2_CTU_size_minus2" ); spsNext.setCTUSize( 1 << ( symbol + MIN_CU_LOG2 ) );
spsNext.getSPS().setMaxCodingDepth( symbol ); // overwrite original value
spsNext.getSPS().setMaxCUWidth ( spsNext.getCTUSize() ); // overwrite original value
spsNext.getSPS().setMaxCUHeight ( spsNext.getCTUSize() ); // overwrite original value
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
READ_FLAG( symbol, "sps_override_partition_constraints_enable_flag"); spsNext.setSplitConsOverrideEnabledFlag( symbol );
READ_UVLC( symbol, "sps_log2_diff_min_qt_min_cb_intra_slice"); minQT[0] = 1 << (symbol + spsNext.getSPS().getLog2MinCodingBlockSize());
READ_UVLC( symbol, "sps_log2_diff_min_qt_min_cb_inter_slice"); minQT[1] = 1 << (symbol + spsNext.getSPS().getLog2MinCodingBlockSize());
READ_UVLC( symbol, "sps_max_mtt_hierarchy_depth_inter_slices"); maxBTD[1] = symbol;
READ_UVLC( symbol, "sps_max_mtt_hierarchy_depth_intra_slices"); maxBTD[0] = symbol;
#else
READ_UVLC( symbol, "log2_minQT_ISlice_minus2" ); minQT [0] = 1 << ( symbol + MIN_CU_LOG2 );
READ_UVLC( symbol, "log2_minQT_PBSlice_minus2" ); minQT [1] = 1 << ( symbol + MIN_CU_LOG2 );
READ_UVLC( symbol, "max_bt_depth" ); maxBTD[0] = symbol;
READ_UVLC( symbol, "max_bt_depth_i_slice" ); maxBTD[1] = symbol;
#endif
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
maxTTSize[0] = maxBTSize[0] = minQT[0];
if (maxBTD[0] != 0)
{
......@@ -856,10 +846,8 @@ void HLSyntaxReader::parseSPSNext( SPSNext& spsNext, const bool usePCM )
READ_UVLC(symbol, "sps_log2_diff_max_bt_min_qt_inter_slice"); maxBTSize[1] <<= symbol;
READ_UVLC(symbol, "sps_log2_diff_max_tt_min_qt_inter_slice"); maxTTSize[1] <<= symbol;
}
#endif
if( spsNext.getUseDualITree() )
{
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
READ_UVLC( symbol, "sps_log2_diff_min_qt_min_cb_intra_slice_chroma" ); minQT [2] = 1 << ( symbol + spsNext.getSPS().getLog2MinCodingBlockSize());
READ_UVLC( symbol, "sps_max_mtt_hierarchy_depth_intra_slices_chroma"); maxBTD[2] = symbol;
maxTTSize[2] = maxBTSize[2] = minQT[2];
......@@ -868,20 +856,12 @@ void HLSyntaxReader::parseSPSNext( SPSNext& spsNext, const bool usePCM )
READ_UVLC(symbol, "sps_log2_diff_max_bt_min_qt_intra_slice_chroma"); maxBTSize[2] <<= symbol;
READ_UVLC(symbol, "sps_log2_diff_max_tt_min_qt_intra_slice_chroma"); maxTTSize[2] <<= symbol;
}
#else
READ_UVLC( symbol, "log2_minQT_ISliceChroma_minus2" ); minQT [2] = 1 << ( symbol + MIN_CU_LOG2 );
READ_UVLC( symbol, "max_bt_depth_i_slice_chroma" ); maxBTD[2] = symbol;
#endif
}
spsNext.setMinQTSizes( minQT );
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
spsNext.setMaxBTDepth( maxBTD[1], maxBTD[0], maxBTD[2] );
spsNext.setMaxBTSize( maxBTSize[1], maxBTSize[0], maxBTSize[2] );
spsNext.setMaxTTSize( maxTTSize[1], maxTTSize[0], maxTTSize[2] );
#else
spsNext.setMaxBTDepth( maxBTD[0], maxBTD[1], maxBTD[2] );
#endif
#endif
if( spsNext.getUseSubPuMvp() )
{
......@@ -1028,13 +1008,8 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
}
#if !JVET_L0217_L0678_SPS_CLEANUP
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
READ_UVLC( uiCode, "log2_min_luma_coding_block_size_minus2");
int log2MinCUSize = uiCode + 2;
#else
READ_UVLC( uiCode, "log2_min_luma_coding_block_size_minus3" );
int log2MinCUSize = uiCode + 3;
#endif
pcSPS->setLog2MinCodingBlockSize(log2MinCUSize);
READ_UVLC( uiCode, "log2_diff_max_min_luma_coding_block_size" );
pcSPS->setLog2DiffMaxMinCodingBlockSize(uiCode);
......@@ -1043,10 +1018,8 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
unsigned minQT[3] = { 0, 0, 0 };
unsigned maxBTD[3] = { 0, 0, 0 };
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
unsigned maxBTSize[3] = { 0, 0, 0 };
unsigned maxTTSize[3] = { 0, 0, 0 };
#endif
READ_FLAG(uiCode, "qtbt_dual_intra_tree"); pcSPS->setUseDualITree(uiCode);
READ_UVLC(uiCode, "log2_CTU_size_minus2"); pcSPS->setCTUSize(1 << (uiCode + 2));
pcSPS->setMaxCodingDepth(uiCode);
......@@ -1054,28 +1027,15 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
pcSPS->setMaxCUWidth(pcSPS->getCTUSize());
pcSPS->setMaxCUHeight(pcSPS->getCTUSize());
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
READ_UVLC(uiCode, "log2_min_luma_coding_block_size_minus2");
int log2MinCUSize = uiCode + 2;
#else
READ_UVLC(uiCode, "log2_min_luma_coding_block_size_minus3");
int log2MinCUSize = uiCode + 3;
#endif
pcSPS->setLog2MinCodingBlockSize(log2MinCUSize);
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
READ_FLAG(uiCode, "sps_override_partition_constraints_enable_flag"); pcSPS->setSplitConsOverrideEnabledFlag(uiCode);
READ_UVLC(uiCode, "sps_log2_diff_min_qt_min_cb_intra_slice"); minQT[0] = 1 << (uiCode + pcSPS->getLog2MinCodingBlockSize());
READ_UVLC(uiCode, "sps_log2_diff_min_qt_min_cb_inter_slice"); minQT[1] = 1 << (uiCode + pcSPS->getLog2MinCodingBlockSize());
READ_UVLC(uiCode, "sps_max_mtt_hierarchy_depth_inter_slices"); maxBTD[1] = uiCode;
READ_UVLC(uiCode, "sps_max_mtt_hierarchy_depth_intra_slices"); maxBTD[0] = uiCode;
#else
READ_UVLC(uiCode, "log2_minQT_ISlice_minus2"); minQT[0] = 1 << (uiCode + MIN_CU_LOG2);
READ_UVLC(uiCode, "log2_minQT_PBSlice_minus2"); minQT[1] = 1 << (uiCode + MIN_CU_LOG2);
READ_UVLC(uiCode, "max_bt_depth"); maxBTD[0] = uiCode;
READ_UVLC(uiCode, "max_bt_depth_i_slice"); maxBTD[1] = uiCode;
#endif
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
maxTTSize[0] = maxBTSize[0] = minQT[0];
if (maxBTD[0] != 0)
{
......@@ -1088,10 +1048,8 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
READ_UVLC(uiCode, "sps_log2_diff_max_bt_min_qt_inter_slice"); maxBTSize[1] <<= uiCode;
READ_UVLC(uiCode, "sps_log2_diff_max_tt_min_qt_inter_slice"); maxTTSize[1] <<= uiCode;
}
#endif
if (pcSPS->getUseDualITree())
{
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
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_slices_chroma"); maxBTD[2] = uiCode;
maxTTSize[2] = maxBTSize[2] = minQT[2];
......@@ -1100,20 +1058,12 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
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;
}
#else
READ_UVLC(uiCode, "log2_minQT_ISliceChroma_minus2"); minQT[2] = 1 << (uiCode + MIN_CU_LOG2);
READ_UVLC(uiCode, "max_bt_depth_i_slice_chroma"); maxBTD[2] = uiCode;
#endif
}
pcSPS->setMinQTSizes(minQT);
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
pcSPS->setMaxBTDepth(maxBTD[1], maxBTD[0], maxBTD[2]);
pcSPS->setMaxBTSize(maxBTSize[1], maxBTSize[0], maxBTSize[2]);
pcSPS->setMaxTTSize(maxTTSize[1], maxTTSize[0], maxTTSize[2]);
#else
pcSPS->setMaxBTDepth(maxBTD[0], maxBTD[1], maxBTD[2]);
#endif
#endif
if (pcSPS->getPTL()->getGeneralPTL()->getLevelIdc() >= Level::LEVEL5)
......@@ -1820,7 +1770,6 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
pcSlice->setSignDataHidingEnabledFlag( uiCode != 0 );
}
#endif
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
if (
#if JVET_L0217_L0678_SPS_CLEANUP
sps->getSplitConsOverrideEnabledFlag()
......@@ -1867,18 +1816,6 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
}
}
}
#else
if (!pcSlice->isIntra())
{
READ_UVLC(uiCode, "max_binary_tree_unit_size");
uint32_t maxCU = sps->getSpsNext().getCTUSize();
pcSlice->setMaxBTSize(maxCU >> uiCode);
}
else
{
pcSlice->setMaxBTSize(MAX_BT_SIZE);
}
#endif
if (!pcSlice->isIntra())
{
READ_UVLC(uiCode, "six_minus_max_num_merge_cand");
......
......@@ -192,9 +192,7 @@ protected:
int m_maxTempLayer; ///< Max temporal layer
bool m_useAMP;
unsigned m_CTUSize;
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
bool m_useSplitConsOverride;
#endif
unsigned m_uiMinQT[3]; //0: I slice; 1: P/B slice, 2: I slice chroma
unsigned m_uiMaxBTDepth;
unsigned m_uiMaxBTDepthI;
......@@ -673,10 +671,8 @@ public:
unsigned getMaxBTDepthI () const { return m_uiMaxBTDepthI; }
unsigned getMaxBTDepthIChroma () const { return m_uiMaxBTDepthIChroma; }
int getCTUSize () const { return m_CTUSize; }
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
void setUseSplitConsOverride (bool n) { m_useSplitConsOverride = n; }
bool getUseSplitConsOverride () const { return m_useSplitConsOverride; }
#endif
void setDualITree ( bool b ) { m_dualITree = b; }
bool getDualITree () const { return m_dualITree; }
......
......@@ -1659,9 +1659,7 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
if( refLayer >= 0 && m_uiNumBlk[refLayer] != 0 )
{
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
pcSlice->setSplitConsOverrideFlag(true);
#endif
double dBlkSize = sqrt( ( double ) m_uiBlkSize[refLayer] / m_uiNumBlk[refLayer] );
if( dBlkSize < AMAXBT_TH32 )
{
......
......@@ -845,18 +845,14 @@ void EncLib::xInitSPS(SPS &sps)
sps.getSpsNext().setNextToolsEnabled ( m_profile == Profile::NEXT );
#if JVET_L0217_L0678_SPS_CLEANUP
sps.setCTUSize ( m_CTUSize );
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
sps.setSplitConsOverrideEnabledFlag ( m_useSplitConsOverride );
#endif
sps.setMinQTSizes ( m_uiMinQT );
sps.getSpsNext().setUseLargeCTU ( m_LargeCTU );
sps.setMaxBTDepth ( m_uiMaxBTDepth, m_uiMaxBTDepthI, m_uiMaxBTDepthIChroma );
sps.setUseDualITree ( m_dualITree );
#else
sps.getSpsNext().setCTUSize (m_CTUSize);
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
sps.getSpsNext().setSplitConsOverrideEnabledFlag(m_useSplitConsOverride);
#endif
sps.getSpsNext().setMinQTSizes ( m_uiMinQT );
sps.getSpsNext().setUseLargeCTU ( m_LargeCTU );
sps.getSpsNext().setMaxBTDepth ( m_uiMaxBTDepth, m_uiMaxBTDepthI, m_uiMaxBTDepthIChroma );
......
......@@ -673,7 +673,6 @@ void EncSlice::initEncSlice(Picture* pcPic, const int pocLast, const int pocCurr
#endif
rpcSlice->setMaxNumMergeCand ( m_pcCfg->getMaxNumMergeCand() );
rpcSlice->setMaxNumAffineMergeCand( m_pcCfg->getMaxNumAffineMergeCand() );
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
#if JVET_L0217_L0678_SPS_CLEANUP
rpcSlice->setSplitConsOverrideFlag(false);
rpcSlice->setMinQTSize( rpcSlice->getSPS()->getMinQTSize(eSliceType));
......@@ -701,9 +700,6 @@ void EncSlice::initEncSlice(Picture* pcPic, const int pocLast, const int pocCurr
rpcSlice->setMaxTTSizeIChroma(rpcSlice->getSPS()->getSpsNext().getMaxTTSizeIChroma());
}
#endif
#else
rpcSlice->setMaxBTSize ( rpcSlice->isIntra() ? MAX_BT_SIZE : MAX_BT_SIZE_INTER );
#endif
}
......
......@@ -561,7 +561,6 @@ void HLSWriter::codeSPSNext( const SPSNext& spsNext, const bool usePCM )
#if !JVET_L0217_L0678_SPS_CLEANUP
WRITE_FLAG( spsNext.getUseDualITree(), "qtbt_dual_intra_tree" );
WRITE_UVLC( g_aucLog2[spsNext.getCTUSize()] - MIN_CU_LOG2, "log2_CTU_size_minus2" );
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
WRITE_FLAG (spsNext.getSplitConsOverrideEnabledFlag(), "sps_override_partition_constraints_enable_flag");
WRITE_UVLC( g_aucLog2[spsNext.getMinQTSize(I_SLICE)] - spsNext.getSPS().getLog2MinCodingBlockSize(), "sps_log2_diff_min_qt_min_cb_intra_slice");
WRITE_UVLC( g_aucLog2[spsNext.getMinQTSize(B_SLICE)] - spsNext.getSPS().getLog2MinCodingBlockSize(), "sps_log2_diff_min_qt_min_cb_inter_slice");
......@@ -577,15 +576,8 @@ void HLSWriter::codeSPSNext( const SPSNext& spsNext, const bool usePCM )
WRITE_UVLC(g_aucLog2[spsNext.getMaxBTSize()] - g_aucLog2[spsNext.getMinQTSize(B_SLICE)], "sps_log2_diff_max_bt_min_qt_inter_slice");
WRITE_UVLC(g_aucLog2[spsNext.getMaxTTSize()] - g_aucLog2[spsNext.getMinQTSize(B_SLICE)], "sps_log2_diff_max_tt_min_qt_inter_slice");
}
#else
WRITE_UVLC( g_aucLog2[spsNext.getMinQTSize( I_SLICE ) ] - MIN_CU_LOG2, "log2_minQT_ISlice_minus2" );
WRITE_UVLC( g_aucLog2[spsNext.getMinQTSize( B_SLICE ) ] - MIN_CU_LOG2, "log2_minQT_PBSlice_minus2" );
WRITE_UVLC( spsNext.getMaxBTDepth(), "max_bt_depth" );
WRITE_UVLC( spsNext.getMaxBTDepthI(), "max_bt_depth_i_slice" );
#endif
if( spsNext.getUseDualITree() )
{
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
WRITE_UVLC( g_aucLog2[spsNext.getMinQTSize( I_SLICE, CHANNEL_TYPE_CHROMA )] - spsNext.getSPS().getLog2MinCodingBlockSize(), "sps_log2_diff_min_qt_min_cb_intra_slice_chroma");
WRITE_UVLC( spsNext.getMaxBTDepthIChroma(), "sps_max_mtt_hierarchy_depth_intra_slices_chroma");
if (spsNext.getMaxBTDepthIChroma() != 0)
......@@ -593,10 +585,6 @@ void HLSWriter::codeSPSNext( const SPSNext& spsNext, const bool usePCM )
WRITE_UVLC(g_aucLog2[spsNext.getMaxBTSizeIChroma()] - g_aucLog2[spsNext.getMinQTSize(I_SLICE, CHANNEL_TYPE_CHROMA)], "sps_log2_diff_max_bt_min_qt_intra_slice_chroma");
WRITE_UVLC(g_aucLog2[spsNext.getMaxTTSizeIChroma()] - g_aucLog2[spsNext.getMinQTSize(I_SLICE, CHANNEL_TYPE_CHROMA)], "sps_log2_diff_max_tt_min_qt_intra_slice_chroma");
}
#else
WRITE_UVLC( g_aucLog2[spsNext.getMinQTSize( I_SLICE, CHANNEL_TYPE_CHROMA )] - MIN_CU_LOG2, "log2_minQT_ISliceChroma_minus2" );
WRITE_UVLC( spsNext.getMaxBTDepthIChroma(), "max_bt_depth_i_slice_chroma" );
#endif
}
#endif
#if !JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
......@@ -704,22 +692,13 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
}
CHECK( pcSPS->getMaxCUWidth() != pcSPS->getMaxCUHeight(), "Rectangular CTUs not supported" );
#if !JVET_L0217_L0678_SPS_CLEANUP
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
WRITE_UVLC( pcSPS->getLog2MinCodingBlockSize() - 2, "log2_min_luma_coding_block_size_minus2");
#else
WRITE_UVLC( pcSPS->getLog2MinCodingBlockSize() - 3, "log2_min_luma_coding_block_size_minus3" );
#endif
WRITE_UVLC( pcSPS->getLog2DiffMaxMinCodingBlockSize(), "log2_diff_max_min_luma_coding_block_size" );
#endif
#if JVET_L0217_L0678_SPS_CLEANUP
WRITE_FLAG(pcSPS->getUseDualITree(), "qtbt_dual_intra_tree");
WRITE_UVLC(g_aucLog2[pcSPS->getCTUSize()] - MIN_CU_LOG2, "log2_CTU_size_minus2");
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
WRITE_UVLC(pcSPS->getLog2MinCodingBlockSize() - 2, "log2_min_luma_coding_block_size_minus2");
#else
WRITE_UVLC(pcSPS->getLog2MinCodingBlockSize() - 3, "log2_min_luma_coding_block_size_minus3");
#endif
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
WRITE_FLAG(pcSPS->getSplitConsOverrideEnabledFlag(), "sps_override_partition_constraints_enable_flag");
WRITE_UVLC(g_aucLog2[pcSPS->getMinQTSize(I_SLICE)] - pcSPS->getLog2MinCodingBlockSize(), "sps_log2_diff_min_qt_min_cb_intra_slice");
WRITE_UVLC(g_aucLog2[pcSPS->getMinQTSize(B_SLICE)] - pcSPS->getLog2MinCodingBlockSize(), "sps_log2_diff_min_qt_min_cb_inter_slice");
......@@ -735,15 +714,8 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
WRITE_UVLC(g_aucLog2[pcSPS->getMaxBTSize()] - g_aucLog2[pcSPS->getMinQTSize(B_SLICE)], "sps_log2_diff_max_bt_min_qt_inter_slice");
WRITE_UVLC(g_aucLog2[pcSPS->getMaxTTSize()] - g_aucLog2[pcSPS->getMinQTSize(B_SLICE)], "sps_log2_diff_max_tt_min_qt_inter_slice");
}
#else
WRITE_UVLC(g_aucLog2[pcSPS->getMinQTSize(I_SLICE)] - MIN_CU_LOG2, "log2_minQT_ISlice_minus2");
WRITE_UVLC(g_aucLog2[pcSPS->getMinQTSize(B_SLICE)] - MIN_CU_LOG2, "log2_minQT_PBSlice_minus2");
WRITE_UVLC(pcSPS->getMaxBTDepth(), "max_bt_depth");
WRITE_UVLC(pcSPS->getMaxBTDepthI(), "max_bt_depth_i_slice");
#endif
if (pcSPS->getUseDualITree())
{
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
WRITE_UVLC(g_aucLog2[pcSPS->getMinQTSize(I_SLICE, CHANNEL_TYPE_CHROMA)] - pcSPS->getLog2MinCodingBlockSize(), "sps_log2_diff_min_qt_min_cb_intra_slice_chroma");
WRITE_UVLC(pcSPS->getMaxBTDepthIChroma(), "sps_max_mtt_hierarchy_depth_intra_slices_chroma");
if (pcSPS->getMaxBTDepthIChroma() != 0)
......@@ -751,10 +723,6 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
WRITE_UVLC(g_aucLog2[pcSPS->getMaxBTSizeIChroma()] - g_aucLog2[pcSPS->getMinQTSize(I_SLICE, CHANNEL_TYPE_CHROMA)], "sps_log2_diff_max_bt_min_qt_intra_slice_chroma");
WRITE_UVLC(g_aucLog2[pcSPS->getMaxTTSizeIChroma()] - g_aucLog2[pcSPS->getMinQTSize(I_SLICE, CHANNEL_TYPE_CHROMA)], "sps_log2_diff_max_tt_min_qt_intra_slice_chroma");
}
#else
WRITE_UVLC(g_aucLog2[pcSPS->getMinQTSize(I_SLICE, CHANNEL_TYPE_CHROMA)] - MIN_CU_LOG2, "log2_minQT_ISliceChroma_minus2");
WRITE_UVLC(pcSPS->getMaxBTDepthIChroma(), "max_bt_depth_i_slice_chroma");
#endif
}
#endif
WRITE_UVLC( pcSPS->getQuadtreeTULog2MinSize() - 2, "log2_min_luma_transform_block_size_minus2" );
......@@ -1294,7 +1262,6 @@ void HLSWriter::codeSliceHeader ( Slice* pcSlice )
CHECK( pcSlice->getSignDataHidingEnabledFlag(), "sign data hiding not supported when dependent quantization is enabled" );
}
#endif
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
if (
#if JVET_L0217_L0678_SPS_CLEANUP
pcSlice->getSPS()->getSplitConsOverrideEnabledFlag()
......@@ -1335,19 +1302,6 @@ void HLSWriter::codeSliceHeader ( Slice* pcSlice )
}
}
}
#else
if( !pcSlice->isIntra() )
{
if( pcSlice->getSPS()->getSpsNext().getCTUSize() > pcSlice->getMaxBTSize() )
{
WRITE_UVLC( g_aucLog2[pcSlice->getSPS()->getSpsNext().getCTUSize()] - g_aucLog2[pcSlice->getMaxBTSize()], "max_binary_tree_unit_size" );
}
else
{
WRITE_UVLC( 0, "max_binary_tree_unit_size" );
}
}
#endif
if( !pcSlice->isIntra() )
{
CHECK( pcSlice->getMaxNumMergeCand() > MRG_MAX_NUM_CANDS, "More merge candidates signalled than supported" );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment