Commit 5501afbf authored by Taoran Lu's avatar Taoran Lu
Browse files

fix of reshaper implementation when lumaDQP is on for HDR

parent 692487e8
......@@ -2257,6 +2257,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;
......
......@@ -4702,7 +4702,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 && (tempCS->slice->getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag()))
{
const CompArea &area = cu.blocks[COMPONENT_Y];
CompArea tmpArea(COMPONENT_Y, area.chromaFormat, Position(0, 0), area.size());
......
......@@ -186,8 +186,10 @@ void EncGOP::init ( EncLib* pcEncLib )
}
else if (m_pcCfg->getLumaLevelToDeltaQPMapping().mode)
{
pcEncLib->getRdCost()->initLumaLevelToWeightTableReshape();
#else
pcEncLib->getRdCost()->initLumaLevelToWeightTable();
#endif
pcEncLib->getRdCost()->initLumaLevelToWeightTable();
#if JVET_M0427_INLOOP_RESHAPER
}
pcEncLib->getALF()->getLumaLevelWeightTable() = pcEncLib->getRdCost()->getLumaLevelWeightTable();
......
......@@ -1964,7 +1964,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 && slice.getReshapeInfo().getUseSliceReshaper() && (m_pcReshape->getCTUFlag() || (isChroma(compID) && m_pcEncCfg->getReshapeIntraCMD())))
{
CompArea tmpArea1(COMPONENT_Y, area.chromaFormat, Position(0, 0), area.size());
PelBuf tmpRecLuma = m_tmpStorageLCU.getBuf(tmpArea1);
......
Supports Markdown
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