Commit 57d15cf2 authored by Karsten Suehring's avatar Karsten Suehring

Merge branch 'JVET-M0685' into 'master'

JVET-M0685: QP parameter predictor derivation

See merge request !366
parents b262c86e 1e8ce4f9
Pipeline #1089 passed with stage
......@@ -174,6 +174,8 @@ typedef std::pair<int, int> TrCost;
#define JVET_M0446_M0888_M0905_VPDU_AT_PIC_BOUNDARY 1
#define JVET_M0685 1
// clang-format off
#define JVET_M0453_CABAC_ENGINE 1
#define JVET_M0512_MOTION_BUFFER_COMPRESSION 1
......
......@@ -189,11 +189,25 @@ int CU::predictQP( const CodingUnit& cu, const int prevQP )
{
const CodingStructure &cs = *cu.cs;
#ifdef JVET_M0685
if ( !cu.blocks[cu.chType].x && !( cu.blocks[cu.chType].y & ( cs.pcv->maxCUHeightMask >> getChannelTypeScaleY( cu.chType, cu.chromaFormat ) ) ) && ( cs.getCU( cu.blocks[cu.chType].pos().offset( 0, -1 ), cu.chType) != NULL ) )
{
return ( ( cs.getCU( cu.blocks[cu.chType].pos().offset( 0, -1 ), cu.chType ) )->qp );
}
else
{
const int a = ( cu.blocks[cu.chType].y & ( cs.pcv->maxCUHeightMask >> getChannelTypeScaleY( cu.chType, cu.chromaFormat ) ) ) ? ( cs.getCU(cu.blocks[cu.chType].pos().offset( 0, -1 ), cu.chType))->qp : prevQP;
const int b = ( cu.blocks[cu.chType].x & ( cs.pcv->maxCUWidthMask >> getChannelTypeScaleX( cu.chType, cu.chromaFormat ) ) ) ? ( cs.getCU(cu.blocks[cu.chType].pos().offset( -1, 0 ), cu.chType))->qp : prevQP;
return ( a + b + 1 ) >> 1;
}
#else
// only predict within the same CTU, use HEVC's above+left prediction
const int a = ( cu.blocks[cu.chType].y & ( cs.pcv->maxCUHeightMask >> getChannelTypeScaleY( cu.chType, cu.chromaFormat ) ) ) ? ( cs.getCU( cu.blocks[cu.chType].pos().offset( 0, -1 ), cu.chType ) )->qp : prevQP;
const int b = ( cu.blocks[cu.chType].x & ( cs.pcv->maxCUWidthMask >> getChannelTypeScaleX( cu.chType, cu.chromaFormat ) ) ) ? ( cs.getCU( cu.blocks[cu.chType].pos().offset( -1, 0 ), cu.chType ) )->qp : prevQP;
return ( a + b + 1 ) >> 1;
#endif
}
#if !JVET_M0113_M0188_QG_SIZE
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment