diff --git a/source/Lib/CommonLib/CommonDef.h b/source/Lib/CommonLib/CommonDef.h index e047a0c52aa609b4c011c2f2e1d5103d165146ae..66d4b611c92bbbf1e082aa11e416472c60f3c4e0 100644 --- a/source/Lib/CommonLib/CommonDef.h +++ b/source/Lib/CommonLib/CommonDef.h @@ -359,7 +359,10 @@ static const int MIN_BT_SIZE_C = 4; ///< static const int MAX_TT_SIZE_INTER = 64; ///< for initialization, [1<<MIN_CU_LOG2, 64] static const int MIN_TT_SIZE_INTER = 4; ///< - +#if JVET_N0137_DUALTREE_CHROMA_SIZE +static const int MIN_DUALTREE_CHROMA_WIDTH = 4; +static const int MIN_DUALTREE_CHROMA_SIZE = 16; +#endif static const SplitSeries SPLIT_BITS = 5; static const SplitSeries SPLIT_DMULT = 5; static const SplitSeries SPLIT_MASK = 31; ///< = (1 << SPLIT_BITS) - 1 diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index 7042b2e94d57f3d863329acf33dff478a53c5140..091512fb3071b513381657a8906ebed70fe74d70 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -50,6 +50,8 @@ #include <assert.h> #include <cassert> +#define JVET_N0137_DUALTREE_CHROMA_SIZE 1 + #define JVET_N0335_N0085_MV_ROUNDING 1 // MV rounding unification #define JVET_N0332_LTRP_MMVD_FIX 1 // MMVD scaling considering LTRPs from N0332 diff --git a/source/Lib/CommonLib/UnitPartitioner.cpp b/source/Lib/CommonLib/UnitPartitioner.cpp index 36c65850bbee50ca31c0d0974a9c94f984ee8f53..fdde796433e671b6cb21c8728d70305206cb7794 100644 --- a/source/Lib/CommonLib/UnitPartitioner.cpp +++ b/source/Lib/CommonLib/UnitPartitioner.cpp @@ -351,6 +351,9 @@ void QTBTPartitioner::canSplit( const CodingStructure &cs, bool& canNo, bool& ca // the minimal and maximal sizes are given in luma samples const CompArea& area = currArea().Y(); +#if JVET_N0137_DUALTREE_CHROMA_SIZE + const CompArea& areaC = currArea().Cb(); +#endif PartLevel& level = m_partStack.back(); const PartSplit lastSplit = level.split; @@ -359,7 +362,9 @@ void QTBTPartitioner::canSplit( const CodingStructure &cs, bool& canNo, bool& ca // don't allow QT-splitting below a BT split if( lastSplit != CTU_LEVEL && lastSplit != CU_QUAD_SPLIT ) canQt = false; if( area.width <= minQtSize ) canQt = false; - +#if JVET_N0137_DUALTREE_CHROMA_SIZE + if( chType == CHANNEL_TYPE_CHROMA && areaC.width <= MIN_DUALTREE_CHROMA_WIDTH ) canQt = false; +#endif if( implicitSplit != CU_DONT_SPLIT ) { canNo = canTh = canTv = false; @@ -397,17 +402,26 @@ void QTBTPartitioner::canSplit( const CodingStructure &cs, bool& canNo, bool& ca // specific check for BT splits if( area.height <= minBtSize || area.height > maxBtSize ) canBh = false; if( area.width > MAX_TB_SIZEY && area.height <= MAX_TB_SIZEY ) canBh = false; - +#if JVET_N0137_DUALTREE_CHROMA_SIZE + if( chType == CHANNEL_TYPE_CHROMA && areaC.width * areaC.height <= MIN_DUALTREE_CHROMA_SIZE ) canBh = false; +#endif if( area.width <= minBtSize || area.width > maxBtSize ) canBv = false; if( area.width <= MAX_TB_SIZEY && area.height > MAX_TB_SIZEY ) canBv = false; - +#if JVET_N0137_DUALTREE_CHROMA_SIZE + if( chType == CHANNEL_TYPE_CHROMA && areaC.width * areaC.height <= MIN_DUALTREE_CHROMA_SIZE ) canBv = false; +#endif if( area.height <= 2 * minTtSize || area.height > maxTtSize || area.width > maxTtSize ) canTh = false; if( area.width > MAX_TB_SIZEY || area.height > MAX_TB_SIZEY ) canTh = false; - +#if JVET_N0137_DUALTREE_CHROMA_SIZE + if( chType == CHANNEL_TYPE_CHROMA && areaC.width * areaC.height <= MIN_DUALTREE_CHROMA_SIZE*2 ) canTh = false; +#endif if( area.width <= 2 * minTtSize || area.width > maxTtSize || area.height > maxTtSize ) canTv = false; if( area.width > MAX_TB_SIZEY || area.height > MAX_TB_SIZEY ) canTv = false; +#if JVET_N0137_DUALTREE_CHROMA_SIZE + if( chType == CHANNEL_TYPE_CHROMA && areaC.width * areaC.height <= MIN_DUALTREE_CHROMA_SIZE*2 ) canTv = false; +#endif } bool QTBTPartitioner::canSplit( const PartSplit split, const CodingStructure &cs )