From 5fb629f91fc9691dbb632ebd8a989e478c6a8c7b Mon Sep 17 00:00:00 2001
From: Chia-Ming Tsai <chia-ming.tsai@mediatek.com>
Date: Wed, 21 Nov 2018 13:40:01 +0800
Subject: [PATCH] Fix ticket #117 on redundant memory copy in predInterSearch()

---
 source/Lib/EncoderLib/InterSearch.cpp | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/source/Lib/EncoderLib/InterSearch.cpp b/source/Lib/EncoderLib/InterSearch.cpp
index 9c2d399019..dfdc0687fa 100644
--- a/source/Lib/EncoderLib/InterSearch.cpp
+++ b/source/Lib/EncoderLib/InterSearch.cpp
@@ -1783,14 +1783,13 @@ void InterSearch::predInterSearch(CodingUnit& cu, Partitioner& partitioner)
 
       if (cu.Y().width > 8 && cu.Y().height > 8 && cu.partSize == SIZE_2Nx2N && cu.slice->getSPS()->getSpsNext().getUseAffine() 
         && cu.imv == 0
+#if JVET_L0646_GBI
+        && (gbiIdx == GBI_DEFAULT || m_affineModeSelected || !m_pcEncCfg->getUseGBiFast())
+#endif
         )
       {
         ::memcpy( cMvHevcTemp, cMvTemp, sizeof( cMvTemp ) );
       }
-      if ( cu.Y().width > 8 && cu.Y().height > 8 && cu.partSize == SIZE_2Nx2N && cu.slice->getSPS()->getSpsNext().getUseAffine() )
-      {
-        ::memcpy( cMvHevcTemp, cMvTemp, sizeof( cMvTemp ) );
-      }
       //  Bi-predictive Motion estimation
       if( ( cs.slice->isInterB() ) && ( PU::isBipredRestriction( pu ) == false ) 
 #if JVET_L0646_GBI
-- 
GitLab