From 893e9ca47c2f4c3af58a9a285c6a4c3af41f752b Mon Sep 17 00:00:00 2001
From: Pohan Lin <PohanLin@fginnov.com>
Date: Wed, 10 Apr 2019 14:58:23 +0800
Subject: [PATCH] N0435 on the re-based code

---
 source/Lib/CommonLib/IntraPrediction.cpp | 4 ++++
 source/Lib/CommonLib/IntraPrediction.h   | 4 ++++
 source/Lib/CommonLib/TypeDef.h           | 2 ++
 3 files changed, 10 insertions(+)

diff --git a/source/Lib/CommonLib/IntraPrediction.cpp b/source/Lib/CommonLib/IntraPrediction.cpp
index 3f50ba73f5..70573e01ca 100644
--- a/source/Lib/CommonLib/IntraPrediction.cpp
+++ b/source/Lib/CommonLib/IntraPrediction.cpp
@@ -603,7 +603,11 @@ void IntraPrediction::initPredIntraParams(const PredictionUnit & pu, const CompA
     if (filterFlag)
     {
       const bool isRefFilter       =  isIntegerSlope(absAng); 
+#if JVET_N0435_WAIP_HARMONIZATION
+      m_ipaParam.refFilterFlag = isRefFilter && puSize.width * puSize.height > 32;
+#else
       m_ipaParam.refFilterFlag     =  isRefFilter;
+#endif
       m_ipaParam.interpolationFlag = !isRefFilter;
     }
   }
diff --git a/source/Lib/CommonLib/IntraPrediction.h b/source/Lib/CommonLib/IntraPrediction.h
index f8d1e5fe9d..a2889e3b09 100644
--- a/source/Lib/CommonLib/IntraPrediction.h
+++ b/source/Lib/CommonLib/IntraPrediction.h
@@ -115,7 +115,11 @@ protected:
 
   void initPredIntraParams        ( const PredictionUnit & pu,  const CompArea compArea, const SPS& sps );
 
+#if JVET_N0435_WAIP_HARMONIZATION
+  static bool isIntegerSlope(const int absAng) { return (0 == (absAng & 0x1F)); }
+#else
   static bool isIntegerSlope      ( const int absAng ) { return (0 == (absAng & 0x1F)) && absAng <=32; }  //  integer-slope modes 2, DIA_IDX and VDIA_IDX.  "absAng <=32" restricts wide-angle integer modes 
+#endif
 
   Pel  xGetPredValDc              ( const CPelBuf &pSrc, const Size &dstSize );
 
diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h
index 67b78ab04a..bebbb77a8e 100644
--- a/source/Lib/CommonLib/TypeDef.h
+++ b/source/Lib/CommonLib/TypeDef.h
@@ -50,6 +50,8 @@
 #include <assert.h>
 #include <cassert>
 
+#define JVET_N0435_WAIP_HARMONIZATION                     1
+
 #define JVET_N0103_CGSIZE_HARMONIZATION                   1 // Chroma CG sizes aligned to luma CG sizes
 
 #define JVET_N0146_DMVR_BDOF_CONDITION                    1 // JVET-N146/N0162/N0442/N0153/N0262/N0440/N0086 applicable condition of DMVR and BDOF
-- 
GitLab