Skip to content
Snippets Groups Projects
Commit 837b236e authored by Xiang Li's avatar Xiang Li
Browse files

Merge branch 'AnandMeher/VVCSoftware_VTM-DBF_Avmbkj/JVET-P1001'

parents 072b0bb4 61761ebd
No related branches found
No related tags found
No related merge requests found
......@@ -1232,11 +1232,31 @@ void LoopFilter::xEdgeFilterChroma(const CodingUnit& cu, const DeblockEdgeDir ed
if ((bS[chromaIdx] == 2) || (largeBoundary && (bS[chromaIdx] == 1)))
{
const ClpRng& clpRng( cu.cs->slice->clpRng( ComponentID( chromaIdx + 1 )) );
#if !JVET_P1001_DEBLOCKING_CHROMAQP_FIX
const int chromaQPOffset = pps.getQpOffset( ComponentID( chromaIdx + 1 ) );
#endif
Pel* piTmpSrcChroma = (chromaIdx == 0) ? piTmpSrcCb : piTmpSrcCr;
#if JVET_P1001_DEBLOCKING_CHROMAQP_FIX
int shiftHor = cu.Y().valid() ? 0 : ::getComponentScaleX(COMPONENT_Cb, cu.firstPU->chromaFormat);
int shiftVer = cu.Y().valid() ? 0 : ::getComponentScaleY(COMPONENT_Cb, cu.firstPU->chromaFormat);
const Position& posQ = Position{ pos.x >> shiftHor, pos.y >> shiftVer };
const Position posP = (edgeDir == EDGE_VER) ? posQ.offset(-1, 0) : posQ.offset(0, -1);
const TransformUnit& tuQ = *cuQ.cs->getTU(posQ, cuQ.chType);
const TransformUnit& tuP = *cuP.cs->getTU(posP, cuQ.chType); //based on chType of the current cu, because cuQ.chType and cuP.chType are not the same when local dual-tree is applied
const QpParam cQP(tuP, ComponentID(chromaIdx + 1));
const QpParam cQQ(tuQ, ComponentID(chromaIdx + 1));
const int qpBdOffset = tuP.cs->sps->getQpBDOffset(toChannelType(ComponentID(chromaIdx + 1)));
int baseQp_P = cQP.Qp(0) - qpBdOffset;
int baseQp_Q = cQQ.Qp(0) - qpBdOffset;
int iQP = ((baseQp_Q + baseQp_P + 1) >> 1);
#else
int iQP = sps.getMappedChromaQpValue(ComponentID(chromaIdx + 1), ((cuP.qp + cuQ.qp + 1) >> 1));
iQP = Clip3(0, MAX_QP, iQP + chromaQPOffset);
#endif
const int iIndexTC = Clip3<int>(0, MAX_QP + DEFAULT_INTRA_TC_OFFSET, iQP + DEFAULT_INTRA_TC_OFFSET * (bS[chromaIdx] - 1) + (tcOffsetDiv2 << 1));
const int iTc = sps.getBitDepth(CHANNEL_TYPE_CHROMA) < 10 ? ((sm_tcTable[iIndexTC] + 2) >> (10 - sps.getBitDepth(CHANNEL_TYPE_CHROMA))) : ((sm_tcTable[iIndexTC]) << (sps.getBitDepth(CHANNEL_TYPE_CHROMA) - 10));
......
......@@ -50,6 +50,8 @@
#include <assert.h>
#include <cassert>
#define JVET_P1001_DEBLOCKING_CHROMAQP_FIX 1 //JVET-P1001/P1002: Align Chroma QP used in deblocking with the one used in Transform/invTransform
#define JVET_P0043_DEBLOCKING_CLEANUP 1 // JVET-P0043: Fix deblocking design inconsistency in the affine and TPM mode
#define JVET_P0273_MTSIntraMaxCand 1 // JVET-P0273: Use MTSIntraMaxCand if LFNST is used
......
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