Skip to content
Snippets Groups Projects
Commit 64440ecc authored by Frank Bossen's avatar Frank Bossen
Browse files

Merge branch 'JVET_R0330_CRS_CLIP_REMOVAL' into 'master'

JVET_R0330: Remove redundant clipping in chroma residual scaling factor derivation

See merge request jvet/VVCSoftware_VTM!1561
parents 05aa4452 bb3f9a6d
No related branches found
No related tags found
1 merge request!1561JVET_R0330: Remove redundant clipping in chroma residual scaling factor derivation
Pipeline #4718 passed
......@@ -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
......
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