[x265] [PATCH 3 of 3 RFC] common: move remaining x265_ functions into private namespace

Steve Borho steve at borho.org
Sat Jun 6 04:40:59 CEST 2015


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1433557587 18000
#      Fri Jun 05 21:26:27 2015 -0500
# Node ID 23a4157ffc4a35dbc3c4d521b80387a99d6a6a20
# Parent  cbbb69f3c124cae348883414cb3ab5aaf0fbd995
common: move remaining x265_ functions into private namespace

diff -r cbbb69f3c124 -r 23a4157ffc4a source/common/common.cpp
--- a/source/common/common.cpp	Fri Jun 05 21:14:14 2015 -0500
+++ b/source/common/common.cpp	Fri Jun 05 21:26:27 2015 -0500
@@ -37,6 +37,8 @@
 int g_checkFailures;
 #endif
 
+namespace X265_NS {
+
 int64_t x265_mdate(void)
 {
 #if _WIN32
@@ -50,8 +52,6 @@
 #endif
 }
 
-using namespace X265_NS;
-
 #define X265_ALIGNBYTES 32
 
 #if _WIN32
@@ -215,3 +215,5 @@
     fclose(fh);
     return NULL;
 }
+
+}
diff -r cbbb69f3c124 -r 23a4157ffc4a source/common/common.h
--- a/source/common/common.h	Fri Jun 05 21:14:14 2015 -0500
+++ b/source/common/common.h	Fri Jun 05 21:26:27 2015 -0500
@@ -409,8 +409,6 @@
 /* located in pixel.cpp */
 void extendPicBorder(pixel* recon, intptr_t stride, int width, int height, int marginX, int marginY);
 
-}
-
 /* outside x265 namespace, but prefixed. defined in common.cpp */
 int64_t  x265_mdate(void);
 #define  x265_log(param, ...) general_log(param, "x265", __VA_ARGS__)
@@ -427,6 +425,7 @@
 char*    x265_slurp_file(const char *filename);
 
 void     x265_setup_primitives(x265_param* param, int cpu); /* primitives.cpp */
+}
 
 #include "constants.h"
 
diff -r cbbb69f3c124 -r 23a4157ffc4a source/common/primitives.cpp
--- a/source/common/primitives.cpp	Fri Jun 05 21:14:14 2015 -0500
+++ b/source/common/primitives.cpp	Fri Jun 05 21:26:27 2015 -0500
@@ -187,8 +187,6 @@
 
     p.chroma[X265_CSP_I422].cu[BLOCK_422_2x4].sse_pp = NULL;
 }
-}
-using namespace X265_NS;
 
 /* cpuid >= 0 - force CPU type
  * cpuid < 0  - auto-detect if uninitialized */
@@ -250,6 +248,7 @@
         x265_log(param, X265_LOG_INFO, "%s\n", buf);
     }
 }
+}
 
 #if ENABLE_ASSEMBLY
 /* these functions are implemented in assembly. When assembly is not being
diff -r cbbb69f3c124 -r 23a4157ffc4a source/filters/filters.cpp
--- a/source/filters/filters.cpp	Fri Jun 05 21:14:14 2015 -0500
+++ b/source/filters/filters.cpp	Fri Jun 05 21:26:27 2015 -0500
@@ -24,6 +24,8 @@
 #include "filters.h"
 #include "common.h"
 
+using namespace X265_NS;
+
 /* The dithering algorithm is based on Sierra-2-4A error diffusion. */
 void ditherPlane(pixel *dst, int dstStride, uint16_t *src, int srcStride,
                  int width, int height, int16_t *errors, int bitDepth)


More information about the x265-devel mailing list