From 371ff39b6e2068bd853b6c8fe85303839ef27d5d Mon Sep 17 00:00:00 2001
From: Li Zhang <lizhang.idm@bytedance.com>
Date: Fri, 26 Oct 2018 10:15:50 -0700
Subject: [PATCH] revised variable names and indentation fixed

---
 source/Lib/CommonLib/Slice.cpp     |  2 +-
 source/Lib/CommonLib/UnitTools.cpp |  4 ++--
 source/Lib/EncoderLib/EncCu.cpp    | 36 +++++++++++++++---------------
 source/Lib/EncoderLib/EncCu.h      |  4 ++--
 4 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/source/Lib/CommonLib/Slice.cpp b/source/Lib/CommonLib/Slice.cpp
index 778b83c7..0d95b6d2 100644
--- a/source/Lib/CommonLib/Slice.cpp
+++ b/source/Lib/CommonLib/Slice.cpp
@@ -1581,7 +1581,7 @@ void Slice::destroyMotionLUTs()
 }
 void Slice::resetMotionLUTs()
 {
-   m_MotionCandLut->currCnt = 0;
+  m_MotionCandLut->currCnt = 0;
 }
 
 MotionInfo Slice::getMotionInfoFromLUTs(int MotCandIdx) const
diff --git a/source/Lib/CommonLib/UnitTools.cpp b/source/Lib/CommonLib/UnitTools.cpp
index 056f3ff0..ae231f63 100644
--- a/source/Lib/CommonLib/UnitTools.cpp
+++ b/source/Lib/CommonLib/UnitTools.cpp
@@ -503,7 +503,7 @@ bool PU::xCheckSimilarMotion(const int mergeCandIndex, const int prevCnt, const
     {
       continue;
     }
-    if ( (mergeCandList.interDirNeighbours[ui] == mergeCandList.interDirNeighbours[mergeCandIndex]))
+    if (mergeCandList.interDirNeighbours[ui] == mergeCandList.interDirNeighbours[mergeCandIndex])
     {
       if (mergeCandList.interDirNeighbours[ui] == 3)
       {
@@ -524,7 +524,7 @@ bool PU::xCheckSimilarMotion(const int mergeCandIndex, const int prevCnt, const
         int offset0 = (ui * 2) + mergeCandList.interDirNeighbours[ui] - 1;
         int offset1 = (mergeCandIndex * 2) + mergeCandList.interDirNeighbours[ui] - 1;
         if (mergeCandList.mvFieldNeighbours[offset0].refIdx == mergeCandList.mvFieldNeighbours[offset1].refIdx &&
-          mergeCandList.mvFieldNeighbours[offset0].mv == mergeCandList.mvFieldNeighbours[offset1].mv
+            mergeCandList.mvFieldNeighbours[offset0].mv == mergeCandList.mvFieldNeighbours[offset1].mv
           )
         {
           hasPruned[ui] = true;
diff --git a/source/Lib/EncoderLib/EncCu.cpp b/source/Lib/EncoderLib/EncCu.cpp
index 3cfcd864..8b34407f 100644
--- a/source/Lib/EncoderLib/EncCu.cpp
+++ b/source/Lib/EncoderLib/EncCu.cpp
@@ -110,17 +110,17 @@ void EncCu::create( EncCfg* encCfg )
         m_pTempMotLUTs[w][h] = new LutMotionCand ;
         m_pBestMotLUTs[w][h] = new LutMotionCand ;
         m_pSplitTempMotLUTs[w][h] = new LutMotionCand;
-          m_pSplitTempMotLUTs[w][h]->currCnt = 0;
-          m_pSplitTempMotLUTs[w][h]->motionCand = nullptr;
-          m_pSplitTempMotLUTs[w][h]->motionCand = new MotionInfo[MAX_NUM_HMVP_CANDS];
+        m_pSplitTempMotLUTs[w][h]->currCnt = 0;
+        m_pSplitTempMotLUTs[w][h]->motionCand = nullptr;
+        m_pSplitTempMotLUTs[w][h]->motionCand = new MotionInfo[MAX_NUM_HMVP_CANDS];
 
-         m_pTempMotLUTs[w][h]->currCnt = 0;
-          m_pTempMotLUTs[w][h]->motionCand = nullptr;
-          m_pTempMotLUTs[w][h]->motionCand = new MotionInfo[MAX_NUM_HMVP_CANDS];
+        m_pTempMotLUTs[w][h]->currCnt = 0;
+        m_pTempMotLUTs[w][h]->motionCand = nullptr;
+        m_pTempMotLUTs[w][h]->motionCand = new MotionInfo[MAX_NUM_HMVP_CANDS];
 
-          m_pBestMotLUTs[w][h]->currCnt = 0;
-          m_pBestMotLUTs[w][h]->motionCand = nullptr;
-          m_pBestMotLUTs[w][h]->motionCand = new MotionInfo[MAX_NUM_HMVP_CANDS];
+        m_pBestMotLUTs[w][h]->currCnt = 0;
+        m_pBestMotLUTs[w][h]->motionCand = nullptr;
+        m_pBestMotLUTs[w][h]->motionCand = new MotionInfo[MAX_NUM_HMVP_CANDS];
 #endif
       }
       else
@@ -554,7 +554,7 @@ void EncCu::xCheckBestMode( CodingStructure *&tempCS, CodingStructure *&bestCS,
 #endif
 {
 #if JVET_L0266_HMVP
-  bool CSUpdated = false;
+  bool bestCSUpdated = false;
 #endif
 
   if( !tempCS->cus.empty() )
@@ -588,7 +588,7 @@ void EncCu::xCheckBestMode( CodingStructure *&tempCS, CodingStructure *&bestCS,
       // store temp best CI for next CU coding
       m_CurrCtx->best = m_CABACEstimator->getCtx();
 #if JVET_L0266_HMVP
-      CSUpdated = true;
+      bestCSUpdated = true;
 #endif
     }
   }
@@ -596,15 +596,15 @@ void EncCu::xCheckBestMode( CodingStructure *&tempCS, CodingStructure *&bestCS,
   // reset context states
   m_CABACEstimator->getCtx() = m_CurrCtx->start;
 #if JVET_L0266_HMVP
-  return CSUpdated;
+  return bestCSUpdated;
 #endif
 
 }
 
 void EncCu::xCompressCU( CodingStructure *&tempCS, CodingStructure *&bestCS, Partitioner &partitioner
 #if JVET_L0266_HMVP
-  , LutMotionCand* &tempMotCandLUTs
-  , LutMotionCand* &bestMotCandLUTs
+  , LutMotionCand *&tempMotCandLUTs
+  , LutMotionCand *&bestMotCandLUTs
 #endif
 )
 {
@@ -1114,12 +1114,12 @@ void EncCu::xCheckModeSplit(CodingStructure *&tempCS, CodingStructure *&bestCS,
         m_CurrCtx--;
         partitioner.exitCurrSplit();
 #if JVET_L0266_HMVP
-        bool CSUpdated =
+        bool bestCSUpdated =
 #endif
         xCheckBestMode( tempCS, bestCS, partitioner, encTestMode );
 
 #if JVET_L0266_HMVP
-        if (CSUpdated)
+        if (bestCSUpdated)
         {
           std::swap(tempMotCandLUTs, bestMotCandLUTs);
         }
@@ -1236,14 +1236,14 @@ void EncCu::xCheckModeSplit(CodingStructure *&tempCS, CodingStructure *&bestCS,
 
   // RD check for sub partitioned coding structure.
 #if JVET_L0266_HMVP
-  bool CSUpdated =
+  bool bestCSUpdated =
 #endif
   xCheckBestMode( tempCS, bestCS, partitioner, encTestMode );
 
 #if JVET_L0266_HMVP
   if (!slice.isIntra())
   {
-    if (CSUpdated)
+    if (bestCSUpdated)
     {
       std::swap(tempMotCandLUTs, bestMotCandLUTs);
     }
diff --git a/source/Lib/EncoderLib/EncCu.h b/source/Lib/EncoderLib/EncCu.h
index f268d076..22eb1cc4 100644
--- a/source/Lib/EncoderLib/EncCu.h
+++ b/source/Lib/EncoderLib/EncCu.h
@@ -174,8 +174,8 @@ protected:
 
   void xCompressCU            ( CodingStructure *&tempCS, CodingStructure *&bestCS, Partitioner &pm
 #if JVET_L0266_HMVP
-    , LutMotionCand* &tempMotCandLUTs
-    , LutMotionCand* &bestMotCandLUTs
+    , LutMotionCand *&tempMotCandLUTs
+    , LutMotionCand *&bestMotCandLUTs
 #endif
   );
 #if ENABLE_SPLIT_PARALLELISM
-- 
GitLab