Skip to content

Commit

Permalink
Fix slice chroma QP adjust MinCuSize error.
Browse files Browse the repository at this point in the history
Signed-off-by: Falei LUO <[email protected]>
  • Loading branch information
luofalei committed Nov 29, 2023
1 parent 632dea7 commit bc46fcf
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions source/Lib/EncoderLib/EncCu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -666,15 +666,13 @@ void EncCu::xCompressCU( CodingStructure*& tempCS, CodingStructure*& bestCS, Par

m_cuChromaQpOffsetIdxPlus1 = 0;

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

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

0 comments on commit bc46fcf

Please sign in to comment.