[x265] [PATCH] SAO: remove resetSaoUnit()

ashok at multicorewareinc.com ashok at multicorewareinc.com
Thu Nov 19 13:16:49 CET 2015


# HG changeset patch
# User Ashok Kumar Mishra<ashok at multicorewareinc.com>
# Date 1445505834 -19800
#      Thu Oct 22 14:53:54 2015 +0530
# Node ID 2a4498a21d4e383e59fe5c67993867eccff33817
# Parent  c1575815b250fb02c1fdae803aead10a4997c835
SAO: remove resetSaoUnit()

diff -r c1575815b250 -r 2a4498a21d4e source/encoder/sao.cpp
--- a/source/encoder/sao.cpp	Thu Oct 29 17:15:15 2015 +0530
+++ b/source/encoder/sao.cpp	Thu Oct 22 14:53:54 2015 +0530
@@ -704,16 +704,6 @@
     std::swap(m_tmpU1[plane], m_tmpU2[plane]);
 }
 
-void SAO::resetSaoUnit(SaoCtuParam* saoUnit)
-{
-    saoUnit->mergeMode  = SAO_MERGE_NONE;
-    saoUnit->typeIdx    = -1;
-    saoUnit->bandPos    = 0;
-
-    for (int i = 0; i < SAO_NUM_OFFSET; i++)
-        saoUnit->offset[i] = 0;
-}
-
 void SAO::copySaoUnit(SaoCtuParam* saoUnitDst, const SaoCtuParam* saoUnitSrc)
 {
     saoUnitDst->mergeMode   = saoUnitSrc->mergeMode;
@@ -1172,9 +1162,10 @@
                 }
             }
 
-            saoParam->ctuParam[plane][addr].mergeMode = SAO_MERGE_NONE;
-            saoParam->ctuParam[plane][addr].typeIdx   = -1;
-            saoParam->ctuParam[plane][addr].bandPos   = 0;
+            saoParam->ctuParam[plane][addr].reset();
+
+            mergeSaoParam[plane][0].reset();
+            mergeSaoParam[plane][1].reset();
             if (saoParam->bSaoFlag[plane > 0])
                 calcSaoStatsCu(addr, plane);
         }
@@ -1326,7 +1317,6 @@
     int    currentDistortionTableBo[MAX_NUM_SAO_CLASS];
     double currentRdCostTableBo[MAX_NUM_SAO_CLASS];
 
-    resetSaoUnit(lclCtuParam);
     m_entropyCoder.load(m_rdContexts.temp);
     m_entropyCoder.resetBits();
     m_entropyCoder.codeSaoOffset(*lclCtuParam, 0);
@@ -1386,7 +1376,6 @@
     m_entropyCoder.store(m_rdContexts.temp);
 
     // merge left or merge up
-
     for (int mergeIdx = 0; mergeIdx < 2; mergeIdx++)
     {
         SaoCtuParam* mergeSrcParam = NULL;
@@ -1413,8 +1402,6 @@
 
             mergeDist[mergeIdx + 1] = ((double)estDist / m_lumaLambda);
         }
-        else
-            resetSaoUnit(&mergeSaoParam[mergeIdx]);
     }
 }
 
@@ -1428,8 +1415,6 @@
     int    bestClassTableBo[2] = { 0, 0 };
     int    currentDistortionTableBo[MAX_NUM_SAO_CLASS];
 
-    resetSaoUnit(lclCtuParam[0]);
-    resetSaoUnit(lclCtuParam[1]);
     m_entropyCoder.load(m_rdContexts.temp);
     m_entropyCoder.resetBits();
     m_entropyCoder.codeSaoOffset(*lclCtuParam[0], 1);
@@ -1507,7 +1492,6 @@
     m_entropyCoder.store(m_rdContexts.temp);
 
     // merge left or merge up
-
     for (int mergeIdx = 0; mergeIdx < 2; mergeIdx++)
     {
         for (int compIdx = 0; compIdx < 2; compIdx++)
@@ -1536,8 +1520,6 @@
                 mergeSaoParam[plane][mergeIdx].mergeMode = mergeIdx ? SAO_MERGE_UP : SAO_MERGE_LEFT;
                 mergeDist[mergeIdx + 1] += ((double)estDist / m_chromaLambda);
             }
-            else
-                resetSaoUnit(&mergeSaoParam[plane][mergeIdx]);
         }
     }
 }


More information about the x265-devel mailing list