Commit bb3f9a6d authored by Xiaoyu Xiu's avatar Xiaoyu Xiu

JVET_R0330: Remove redundant clipping in chroma residual scaling factor derivation

parent 05aa4452
Pipeline #4717 passed with stage
in 13 minutes and 13 seconds
......@@ -95,8 +95,12 @@ void Reshape::destroy()
*/
int Reshape::calculateChromaAdj(Pel avgLuma)
{
#if JVET_R0330_CRS_CLIP_REM
int iAdj = m_chromaAdjHelpLUT[getPWLIdxInv(avgLuma)];
#else
int lumaIdx = Clip3<int>(0, (1<<m_lumaBD) - 1, avgLuma);
int iAdj = m_chromaAdjHelpLUT[getPWLIdxInv(lumaIdx)];
#endif
return(iAdj);
}
......@@ -181,16 +185,28 @@ int Reshape::calculateChromaAdjVpduNei(TransformUnit &tu, const CompArea &areaY
}
if (pelnum == numNeighbor)
{
#if JVET_R0330_CRS_CLIP_REM
lumaValue = (recLuma + (1 << (numNeighborLog - 1))) >> numNeighborLog;
#else
lumaValue = ClipPel((recLuma + (1 << (numNeighborLog - 1))) >> numNeighborLog, tu.cs->slice->clpRng(COMPONENT_Y));
#endif
}
else if (pelnum == (numNeighbor << 1))
{
#if JVET_R0330_CRS_CLIP_REM
lumaValue = (recLuma + (1 << numNeighborLog)) >> (numNeighborLog + 1);
#else
lumaValue = ClipPel((recLuma + (1 << numNeighborLog)) >> (numNeighborLog + 1), tu.cs->slice->clpRng(COMPONENT_Y));
#endif
}
else
{
CHECK(pelnum != 0, "");
#if JVET_R0330_CRS_CLIP_REM
lumaValue = valueDC;
#else
lumaValue = ClipPel(valueDC, tu.cs->slice->clpRng(COMPONENT_Y));
#endif
}
chromaScale = calculateChromaAdj(lumaValue);
setChromaScale(chromaScale);
......
......@@ -51,6 +51,8 @@
#include <cassert>
//########### place macros to be removed in next cycle below this line ###############
#define JVET_R0330_CRS_CLIP_REM 1 // JVET-R0330: Remove redundant clipping in chroma residual scaling factor derivation
#define JVET_R0059_RPL_CLEANUP 1 // JVET-R0059 aspect 2: Condition the signalling of ltrp_in_header_flag[ listIdx ][ rplsIdx ].
#define JVET_R0202_WHEN_PH_IN_SH_INFO_FLAGS_EQUAL_0 1 // JVET-R0202 When sh_picture_header_in_slice_header_flag is equal to 1, rpl_info_in_ph_flag, dbf_info_in_ph_flag, sao_info_in_ph_flag, wp_info_in_ph_flag, qp_delta_info_in_ph_flag shall be be equal to 0
......
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