Skip to content

Commit bc46fcf

Browse files
committed
Fix slice chroma QP adjust MinCuSize error.
Signed-off-by: Falei LUO <[email protected]>
1 parent 632dea7 commit bc46fcf

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

source/Lib/EncoderLib/EncCu.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -666,15 +666,13 @@ void EncCu::xCompressCU( CodingStructure*& tempCS, CodingStructure*& bestCS, Par
666666

667667
m_cuChromaQpOffsetIdxPlus1 = 0;
668668

669-
if( slice.chromaQpAdjEnabled )
669+
if( slice.chromaQpAdjEnabled && partitioner.currQgChromaEnable() )
670670
{
671671
// TODO M0133 : double check encoder decisions with respect to chroma QG detection and actual encode
672+
int cuChromaQpOffsetSubdiv = slice.isIntra() ? slice.picHeader->cuChromaQpOffsetSubdivIntra : slice.picHeader->cuChromaQpOffsetSubdivInter;
672673
int lgMinCuSize = sps.log2MinCodingBlockSize +
673-
std::max<int>(0, floorLog2(sps.CTUSize - sps.log2MinCodingBlockSize - int((slice.isIntra() ? slice.picHeader->cuChromaQpOffsetSubdivIntra : slice.picHeader->cuChromaQpOffsetSubdivInter) / 2)));
674-
if( partitioner.currQgChromaEnable() )
675-
{
676-
m_cuChromaQpOffsetIdxPlus1 = ( ( uiLPelX >> lgMinCuSize ) + ( uiTPelY >> lgMinCuSize ) ) % ( pps.chromaQpOffsetListLen + 1 );
677-
}
674+
std::max<int>(0, floorLog2(sps.CTUSize) - sps.log2MinCodingBlockSize - int((cuChromaQpOffsetSubdiv + 1) / 2));
675+
m_cuChromaQpOffsetIdxPlus1 = ( ( uiLPelX >> lgMinCuSize ) + ( uiTPelY >> lgMinCuSize ) ) % ( pps.chromaQpOffsetListLen + 1 );
678676
}
679677

680678
DTRACE_UPDATE( g_trace_ctx, std::make_pair( "cux", uiLPelX ) );

0 commit comments

Comments
 (0)