Skip to content
Snippets Groups Projects
Commit c5b11864 authored by Chia-Ming Tsai's avatar Chia-Ming Tsai
Browse files

VPDU constraints for binary and ternary partitions

parent 8598dd55
Loading
......@@ -50,6 +50,8 @@
#include <assert.h>
#include <cassert>
#define JVET_L0081_VPDU_SPLIT_CONSTRAINTS 1 // VPDU constraints for binary and ternary partitions
#define JVET_L0147_ALF_SUBSAMPLED_LAPLACIAN 1 // Subsampled Laplacian calculation
#define JVET_L0191_LM_WO_LMS 1 // NO LMS regression. min/max are used instead
......
......@@ -322,7 +322,7 @@ bool QTBTPartitioner::canSplit( const PartSplit split, const CodingStructure &cs
const unsigned minBtSize = cs.pcv->getMinBtSize( *cs.slice, chType );
const unsigned maxTtSize = cs.pcv->getMaxTtSize( *cs.slice, chType );
const unsigned minTtSize = cs.pcv->getMinTtSize( *cs.slice, chType );
#if ENABLE_BMS
#if ENABLE_BMS || JVET_L0081_VPDU_SPLIT_CONSTRAINTS
const unsigned maxTrSize = cs.sps->getMaxTrSize();
#endif
......@@ -412,17 +412,29 @@ bool QTBTPartitioner::canSplit( const PartSplit split, const CodingStructure &cs
{
case CU_HORZ_SPLIT:
if( area.height <= minBtSize || area.height > maxBtSize ) return false;
#if JVET_L0081_VPDU_SPLIT_CONSTRAINTS
if( area.width > maxTrSize && area.height <= maxTrSize ) return false;
#endif
break;
case CU_VERT_SPLIT:
if( area.width <= minBtSize || area.width > maxBtSize ) return false;
#if JVET_L0081_VPDU_SPLIT_CONSTRAINTS
if( area.width <= maxTrSize && area.height > maxTrSize ) return false;
#endif
break;
case CU_TRIH_SPLIT:
if( ( cs.sps->getSpsNext().getMTTMode() & 1 ) != 1 ) return false;
if( area.height <= 2 * minTtSize || area.height > maxTtSize || area.width > maxTtSize) return false;
#if JVET_L0081_VPDU_SPLIT_CONSTRAINTS
if( area.width > maxTrSize || area.height > maxTrSize ) return false;
#endif
break;
case CU_TRIV_SPLIT:
if( ( cs.sps->getSpsNext().getMTTMode() & 1 ) != 1 ) return false;
if( area.width <= 2 * minTtSize || area.width > maxTtSize || area.height > maxTtSize) return false;
#if JVET_L0081_VPDU_SPLIT_CONSTRAINTS
if( area.width > maxTrSize || area.height > maxTrSize ) return false;
#endif
break;
default:
break;
......
......@@ -1398,9 +1398,16 @@ bool EncModeCtrlMTnoRQT::tryMode( const EncTestMode& encTestmode, const CodingSt
{
unsigned maxBTD = cs.pcv->getMaxBtDepth( slice, partitioner.chType );
const CodingUnit *cuBR = bestCS->cus.back();
#if JVET_L0081_VPDU_SPLIT_CONSTRAINTS
unsigned height = partitioner.currArea().lumaSize().height;
unsigned maxTrSize = cs.sps->getMaxTrSize();
#endif
if( bestCU && ( ( bestCU->btDepth == 0 && maxBTD >= ( slice.isIntra() ? 3 : 2 ) )
|| ( bestCU->btDepth == 1 && cuBR && cuBR->btDepth == 1 && maxBTD >= ( slice.isIntra() ? 4 : 3 ) ) )
#if JVET_L0081_VPDU_SPLIT_CONSTRAINTS
&& ( width <= maxTrSize && height <= maxTrSize )
#endif
&& cuECtx.get<bool>( DID_HORZ_SPLIT ) && cuECtx.get<bool>( DID_VERT_SPLIT ) )
{
return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment