diff --git a/source/Lib/DecoderLib/CABACReader.cpp b/source/Lib/DecoderLib/CABACReader.cpp index f6e5ba3ba8e85d48c676e3112b27dec861f76e62..4e4999decd796053795170deedb7bd2039294e77 100644 --- a/source/Lib/DecoderLib/CABACReader.cpp +++ b/source/Lib/DecoderLib/CABACReader.cpp @@ -3705,6 +3705,9 @@ void CABACReader::residual_lfnst_mode( CodingUnit& cu, CUCtx& cuCtx ) void CABACReader::residual_lfnst_mode( CodingUnit& cu ) #endif { +#if JVET_O0213_RESTRICT_LFNST_TO_MAX_TB_SIZE + int chIdx = CS::isDualITree( *cu.cs ) && cu.chType == CHANNEL_TYPE_CHROMA ? 1 : 0; +#endif if( cu.ispMode != NOT_INTRA_SUBPARTITIONS || #if JVET_O0925_MIP_SIMPLIFICATIONS (cu.cs->sps->getUseLFNST() && CU::isIntra(cu) && cu.mipFlag && !allowLfnstWithMip(cu.firstPU->lumaSize())) || @@ -3718,9 +3721,9 @@ void CABACReader::residual_lfnst_mode( CodingUnit& cu ) #endif #if JVET_O0213_RESTRICT_LFNST_TO_MAX_TB_SIZE #if JVET_O0545_MAX_TB_SIGNALLING - || ( cu.blocks[ 0 ].width > cu.cs->sps->getMaxTbSize() || cu.blocks[ 0 ].height > cu.cs->sps->getMaxTbSize() ) + || ( cu.blocks[ chIdx ].lumaSize().width > cu.cs->sps->getMaxTbSize() || cu.blocks[ chIdx ].lumaSize().height > cu.cs->sps->getMaxTbSize() ) #else - || ( cu.blocks[ 0 ].width > MAX_TB_SIZEY || cu.blocks[ 0 ].height > MAX_TB_SIZEY ) + || ( cu.blocks[ chIdx ].lumaSize().width > MAX_TB_SIZEY || cu.blocks[ chIdx ].lumaSize().height > MAX_TB_SIZEY ) #endif #endif ) diff --git a/source/Lib/EncoderLib/CABACWriter.cpp b/source/Lib/EncoderLib/CABACWriter.cpp index efc7af601db3773b439d3e3dd7ad94cadbbbfa3c..7e3df06ac1ff8044cfe98d53d3c8e95701d0a75e 100644 --- a/source/Lib/EncoderLib/CABACWriter.cpp +++ b/source/Lib/EncoderLib/CABACWriter.cpp @@ -3523,6 +3523,9 @@ void CABACWriter::explicit_rdpcm_mode( const TransformUnit& tu, ComponentID comp void CABACWriter::residual_lfnst_mode( const CodingUnit& cu, CUCtx& cuCtx ) { +#if JVET_O0213_RESTRICT_LFNST_TO_MAX_TB_SIZE + int chIdx = CS::isDualITree( *cu.cs ) && cu.chType == CHANNEL_TYPE_CHROMA ? 1 : 0; +#endif if( cu.ispMode != NOT_INTRA_SUBPARTITIONS || #if JVET_O0925_MIP_SIMPLIFICATIONS (cu.cs->sps->getUseLFNST() && CU::isIntra(cu) && cu.mipFlag && !allowLfnstWithMip(cu.firstPU->lumaSize())) || @@ -3536,9 +3539,9 @@ void CABACWriter::residual_lfnst_mode( const CodingUnit& cu, CUCtx& cuCtx ) #endif #if JVET_O0213_RESTRICT_LFNST_TO_MAX_TB_SIZE #if JVET_O0545_MAX_TB_SIGNALLING - || ( cu.blocks[ 0 ].width > cu.cs->sps->getMaxTbSize() || cu.blocks[ 0 ].height > cu.cs->sps->getMaxTbSize() ) + || ( cu.blocks[ chIdx ].lumaSize().width > cu.cs->sps->getMaxTbSize() || cu.blocks[ chIdx ].lumaSize().height > cu.cs->sps->getMaxTbSize() ) #else - || ( cu.blocks[ 0 ].width > MAX_TB_SIZEY || cu.blocks[ 0 ].height > MAX_TB_SIZEY ) + || ( cu.blocks[ chIdx ].lumaSize().width > MAX_TB_SIZEY || cu.blocks[ chIdx ].lumaSize().height > MAX_TB_SIZEY ) #endif #endif )