From 6c266d9d2a2bb7793062aeb23966bdc89840eef0 Mon Sep 17 00:00:00 2001
From: Karsten Suehring <karsten.suehring@hhi.fraunhofer.de>
Date: Mon, 6 Jul 2020 15:14:08 +0200
Subject: [PATCH] remove macro JVET_R0330_CRS_CLIP_REM

---
 source/Lib/CommonLib/Reshape.cpp | 17 -----------------
 source/Lib/CommonLib/TypeDef.h   |  1 -
 2 files changed, 18 deletions(-)

diff --git a/source/Lib/CommonLib/Reshape.cpp b/source/Lib/CommonLib/Reshape.cpp
index 06b777cae..21371171a 100644
--- a/source/Lib/CommonLib/Reshape.cpp
+++ b/source/Lib/CommonLib/Reshape.cpp
@@ -95,12 +95,7 @@ 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);
 }
 
@@ -185,28 +180,16 @@ 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);
diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h
index b18128382..87e0eec2d 100644
--- a/source/Lib/CommonLib/TypeDef.h
+++ b/source/Lib/CommonLib/TypeDef.h
@@ -111,7 +111,6 @@
 
 
 
-#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 ].
 
-- 
GitLab