diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp index 9fb7f20d0f9bee18762ad6c371882a46da0f280d..c6d253efa311374f19d82f051e31e45ca9a94ba2 100644 --- a/source/App/EncoderApp/EncAppCfg.cpp +++ b/source/App/EncoderApp/EncAppCfg.cpp @@ -2245,6 +2245,11 @@ bool EncAppCfg::xCheckParameter() xConfirmPara( m_lumaLevelToDeltaQPMapping.mode && m_uiDeltaQpRD > 0, "Luma-level-based Delta QP cannot be used together with slice level multiple-QP optimization\n" ); #endif #if JVET_M0427_INLOOP_RESHAPER + if (m_lumaLevelToDeltaQPMapping.mode && m_lumaReshapeEnable) + { + msg(WARNING, "For HDR-PQ, reshaper should be used mutual-exclusively with Luma-level-based Delta QP. If use luma DQP, turn reshaper off.\n"); + m_lumaReshapeEnable = false; + } if (!m_lumaReshapeEnable) { m_reshapeSignalType = RESHAPE_SIGNAL_NULL; diff --git a/source/Lib/EncoderLib/EncCu.cpp b/source/Lib/EncoderLib/EncCu.cpp index a5828fc76f1309352453c2e94fcb3435edfa4477..380bee281754b4b3b35ffc4d02225b8d8b97cd6d 100644 --- a/source/Lib/EncoderLib/EncCu.cpp +++ b/source/Lib/EncoderLib/EncCu.cpp @@ -4705,7 +4705,7 @@ void EncCu::xReuseCachedResult( CodingStructure *&tempCS, CodingStructure *&best { const CPelBuf orgLuma = tempCS->getOrgBuf(tempCS->area.blocks[COMPONENT_Y]); #if JVET_M0427_INLOOP_RESHAPER - if (compID == COMPONENT_Y) + if (compID == COMPONENT_Y && !(m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled())) { const CompArea &area = cu.blocks[COMPONENT_Y]; CompArea tmpArea(COMPONENT_Y, area.chromaFormat, Position(0, 0), area.size()); diff --git a/source/Lib/EncoderLib/EncGOP.cpp b/source/Lib/EncoderLib/EncGOP.cpp index 02fa3258d76d21fb0d62741f8a664b80572e49c5..bb69a09e7a75523ca29d7e5186bbd9eff6cea1d2 100644 --- a/source/Lib/EncoderLib/EncGOP.cpp +++ b/source/Lib/EncoderLib/EncGOP.cpp @@ -186,8 +186,11 @@ void EncGOP::init ( EncLib* pcEncLib ) } else if (m_pcCfg->getLumaLevelToDeltaQPMapping().mode) { + pcEncLib->getRdCost()->setReshapeInfo(RESHAPE_SIGNAL_PQ, m_pcCfg->getBitDepth(CHANNEL_TYPE_LUMA)); + pcEncLib->getRdCost()->initLumaLevelToWeightTableReshape(); +#else + pcEncLib->getRdCost()->initLumaLevelToWeightTable(); #endif - pcEncLib->getRdCost()->initLumaLevelToWeightTable(); #if JVET_M0427_INLOOP_RESHAPER } pcEncLib->getALF()->getLumaLevelWeightTable() = pcEncLib->getRdCost()->getLumaLevelWeightTable(); diff --git a/source/Lib/EncoderLib/InterSearch.cpp b/source/Lib/EncoderLib/InterSearch.cpp index da48f75e042bc2c0f523e394664399a8f6ca5c12..55313548e31852f8edbd4c81e11d547728ea273e 100644 --- a/source/Lib/EncoderLib/InterSearch.cpp +++ b/source/Lib/EncoderLib/InterSearch.cpp @@ -6959,7 +6959,7 @@ void InterSearch::encodeResAndCalcRdInterCU(CodingStructure &cs, Partitioner &pa { const CPelBuf orgLuma = cs.getOrgBuf( cs.area.blocks[COMPONENT_Y] ); #if JVET_M0427_INLOOP_RESHAPER - if (compID == COMPONENT_Y) + if (compID == COMPONENT_Y && !(m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled())) { const CompArea &areaY = cu.Y(); CompArea tmpArea1(COMPONENT_Y, areaY.chromaFormat, Position(0, 0), areaY.size()); @@ -7190,7 +7190,7 @@ void InterSearch::encodeResAndCalcRdInterCU(CodingStructure &cs, Partitioner &pa { const CPelBuf orgLuma = cs.getOrgBuf( cs.area.blocks[COMPONENT_Y] ); #if JVET_M0427_INLOOP_RESHAPER - if (compID == COMPONENT_Y) + if (compID == COMPONENT_Y && !(m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled()) ) { const CompArea &areaY = cu.Y(); CompArea tmpArea1(COMPONENT_Y, areaY.chromaFormat, Position(0, 0), areaY.size()); diff --git a/source/Lib/EncoderLib/IntraSearch.cpp b/source/Lib/EncoderLib/IntraSearch.cpp index 64bdafea669deb9623196d329f40ccf8e528d5b3..96086c36051b905ddb8fde082ce677782571f34e 100644 --- a/source/Lib/EncoderLib/IntraSearch.cpp +++ b/source/Lib/EncoderLib/IntraSearch.cpp @@ -1968,7 +1968,7 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp { const CPelBuf orgLuma = cs.getOrgBuf( cs.area.blocks[COMPONENT_Y] ); #if JVET_M0427_INLOOP_RESHAPER - if (compID == COMPONENT_Y) + if (compID == COMPONENT_Y && !(m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled())) { CompArea tmpArea1(COMPONENT_Y, area.chromaFormat, Position(0, 0), area.size()); PelBuf tmpRecLuma = m_tmpStorageLCU.getBuf(tmpArea1);