[x265] [PATCH 1 of 4] analysis: hoist local function into anonymous namespace (file local)

Steve Borho steve at borho.org
Thu Sep 25 22:09:55 CEST 2014


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1411675452 18000
#      Thu Sep 25 15:04:12 2014 -0500
# Node ID 5f750c3f237fe308111391e95d6926a528765ece
# Parent  f5465a9983accd039e173c8a5faca67b82ba3eaf
analysis: hoist local function into anonymous namespace (file local)

diff -r f5465a9983ac -r 5f750c3f237f source/encoder/analysis.cpp
--- a/source/encoder/analysis.cpp	Thu Sep 25 19:08:00 2014 +0530
+++ b/source/encoder/analysis.cpp	Thu Sep 25 15:04:12 2014 -0500
@@ -30,6 +30,32 @@
 
 using namespace x265;
 
+namespace {
+// TO DO: Remove this function with a table.
+int getDepthScanIdx(int x, int y, int size)
+{
+    if (size == 1)
+        return 0;
+
+    int depth = 0;
+    int h = size >> 1;
+
+    if (x >= h)
+    {
+        x -= h;
+        depth += h * h;
+    }
+
+    if (y >= h)
+    {
+        y -= h;
+        depth += 2 * h * h;
+    }
+
+    return depth + getDepthScanIdx(x, y, h);
+}
+}
+
 Analysis::Analysis()
 {
     m_bestPredYuv     = NULL;
@@ -232,30 +258,6 @@
 #define EARLY_EXIT                  1
 #define TOPSKIP                     1
 
-// TO DO: Remove this function with a table.
-int getDepthScanIdx(int x, int y, int size)
-{
-    if (size == 1)
-        return 0;
-
-    int depth = 0;
-    int h = size >> 1;
-
-    if (x >= h)
-    {
-        x -= h;
-        depth += h * h;
-    }
-
-    if (y >= h)
-    {
-        y -= h;
-        depth += 2 * h * h;
-    }
-
-    return depth + getDepthScanIdx(x, y, h);
-}
-
 void Analysis::loadCTUData(TComDataCU* parentCU)
 {
     uint8_t cuRange[2]= {MIN_LOG2_CU_SIZE, g_log2Size[m_param->maxCUSize]};


More information about the x265-devel mailing list