[x265] [PATCH 1 of 3] remove reduce code since trHeight always equal to trWidth

Min Chen chenm003 at 163.com
Thu Jun 19 23:57:16 CEST 2014


# HG changeset patch
# User Min Chen <chenm003 at 163.com>
# Date 1403214971 25200
# Node ID 188f12f4b16b26afcdb6f875455a3fb60f16b55d
# Parent  f5be40ace2cc8764fdb913fe7ccf4cdb4e1d5bd4
remove reduce code since trHeight always equal to trWidth

diff -r f5be40ace2cc -r 188f12f4b16b source/Lib/TLibCommon/TComLoopFilter.cpp
--- a/source/Lib/TLibCommon/TComLoopFilter.cpp	Wed Jun 18 13:40:40 2014 -0500
+++ b/source/Lib/TLibCommon/TComLoopFilter.cpp	Thu Jun 19 14:56:11 2014 -0700
@@ -192,20 +192,15 @@
     }
 }
 
-void TComLoopFilter::xSetEdgefilterMultiple(TComDataCU* cu, uint32_t scanIdx, uint32_t depth, int dir, int edgeIdx, bool bValue, bool edgeFilter[], uint32_t widthInBaseUnits, uint32_t heightInBaseUnits)
+void TComLoopFilter::xSetEdgefilterMultiple(TComDataCU* cu, uint32_t scanIdx, uint32_t depth, int dir, int edgeIdx, bool bValue, bool edgeFilter[], uint32_t widthInBaseUnits)
 {
     if (widthInBaseUnits == 0)
     {
         widthInBaseUnits  = cu->getPic()->getNumPartInCUSize() >> depth;
     }
-    if (heightInBaseUnits == 0)
-    {
-        heightInBaseUnits = cu->getPic()->getNumPartInCUSize() >> depth;
-    }
-    const uint32_t numElem = dir == 0 ? heightInBaseUnits : widthInBaseUnits;
+    const uint32_t numElem = widthInBaseUnits;
     X265_CHECK(numElem > 0, "numElem edge filter check\n");
     X265_CHECK(widthInBaseUnits > 0, "widthInBaseUnits edge filter check\n");
-    X265_CHECK(heightInBaseUnits > 0, "heightInBaseUnits edge filter check\n");
     for (uint32_t i = 0; i < numElem; i++)
     {
         const uint32_t bsidx = xCalcBsIdx(cu, scanIdx, dir, edgeIdx, i);
@@ -233,12 +228,10 @@
     }
 
     int trWidth  = cu->getCUSize(absZOrderIdx) >> cu->getTransformIdx(absZOrderIdx);
-    int trHeight = cu->getCUSize(absZOrderIdx) >> cu->getTransformIdx(absZOrderIdx);
 
     uint32_t widthInBaseUnits  = trWidth / (g_maxCUSize >> g_maxCUDepth);
-    uint32_t heightInBaseUnits = trHeight / (g_maxCUSize >> g_maxCUDepth);
 
-    xSetEdgefilterMultiple(cu, absTUPartIdx, depth, dir, 0, true, edgeFilter, widthInBaseUnits, heightInBaseUnits);
+    xSetEdgefilterMultiple(cu, absTUPartIdx, depth, dir, 0, true, edgeFilter, widthInBaseUnits);
 }
 
 void TComLoopFilter::xSetEdgefilterPU(TComDataCU* cu, uint32_t absZOrderIdx, int dir, LFCUParam *lfcuParam, bool edgeFilter[])
@@ -263,7 +256,7 @@
         const int realDir = (mode == SIZE_2NxN ? EDGE_HOR : EDGE_VER);
 
         if (realDir == dir)
-            xSetEdgefilterMultiple(cu, absZOrderIdx, depth, realDir, hWidthInBaseUnits, true, edgeFilter);
+            xSetEdgefilterMultiple(cu, absZOrderIdx, depth, dir, hWidthInBaseUnits, true, edgeFilter);
         break;
     }
     case SIZE_NxN:
diff -r f5be40ace2cc -r 188f12f4b16b source/Lib/TLibCommon/TComLoopFilter.h
--- a/source/Lib/TLibCommon/TComLoopFilter.h	Wed Jun 18 13:40:40 2014 -0500
+++ b/source/Lib/TLibCommon/TComLoopFilter.h	Thu Jun 19 14:56:11 2014 -0700
@@ -98,7 +98,7 @@
         }
     }
 
-    void xSetEdgefilterMultiple(TComDataCU* cu, uint32_t absZOrderIdx, uint32_t depth, int dir, int edgeIdx, bool bValue, bool edgeFilter[], uint32_t widthInBaseUnits = 0, uint32_t heightInBaseUnits = 0);
+    void xSetEdgefilterMultiple(TComDataCU* cu, uint32_t absZOrderIdx, uint32_t depth, int dir, int edgeIdx, bool bValue, bool edgeFilter[], uint32_t widthInBaseUnits = 0);
 
     void xEdgeFilterLuma(TComDataCU* cu, uint32_t absZOrderIdx, uint32_t depth, int dir, int edge);
     void xEdgeFilterChroma(TComDataCU* cu, uint32_t absZOrderIdx, uint32_t depth, int dir, int edge);



More information about the x265-devel mailing list