[x265] [PATCH 2 of 4 RFC] version: use X265_NS prefix for build strings and max bit depth

Steve Borho steve at borho.org
Sat Jun 6 19:42:38 CEST 2015


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1433611827 18000
#      Sat Jun 06 12:30:27 2015 -0500
# Node ID 60a0f75943309dea951b913a713d9f1a77da79bd
# Parent  3ea5a868899c87517409e40ade3736453920ad33
version: use X265_NS prefix for build strings and max bit depth

diff -r 3ea5a868899c -r 60a0f7594330 source/common/param.cpp
--- a/source/common/param.cpp	Sat Jun 06 11:52:37 2015 -0500
+++ b/source/common/param.cpp	Sat Jun 06 12:30:27 2015 -0500
@@ -119,7 +119,7 @@
     param->bEnableSsim = 0;
 
     /* Source specifications */
-    param->internalBitDepth = x265_max_bit_depth;
+    param->internalBitDepth = X265_DEPTH;
     param->internalCsp = X265_CSP_I420;
 
     param->levelIdc = 0;
diff -r 3ea5a868899c -r 60a0f7594330 source/common/primitives.h
--- a/source/common/primitives.h	Sat Jun 06 11:52:37 2015 -0500
+++ b/source/common/primitives.h	Sat Jun 06 12:30:27 2015 -0500
@@ -388,4 +388,10 @@
 void setupAliasPrimitives(EncoderPrimitives &p);
 }
 
+#if !EXPORT_C_API
+extern const int   PFX(max_bit_depth);
+extern const char* PFX(version_str);
+extern const char* PFX(build_info_str);
+#endif
+
 #endif // ifndef X265_PRIMITIVES_H
diff -r 3ea5a868899c -r 60a0f7594330 source/common/version.cpp
--- a/source/common/version.cpp	Sat Jun 06 11:52:37 2015 -0500
+++ b/source/common/version.cpp	Sat Jun 06 12:30:27 2015 -0500
@@ -23,6 +23,7 @@
 
 #include "x265.h"
 #include "common.h"
+#include "primitives.h"
 
 #define XSTR(x) STR(x)
 #define STR(x) #x
@@ -83,11 +84,11 @@
 
 #if HIGH_BIT_DEPTH
 #define BITDEPTH "16bpp"
-const int x265_max_bit_depth = 10;
+const int PFX(max_bit_depth) = 10;
 #else
 #define BITDEPTH "8bpp"
-const int x265_max_bit_depth = 8;
+const int PFX(max_bit_depth) = 8;
 #endif
 
-const char *x265_version_str = XSTR(X265_VERSION);
-const char *x265_build_info_str = NVM_ONOS NVM_COMPILEDBY NVM_BITS CHECKED BITDEPTH;
+const char* PFX(version_str) = XSTR(X265_VERSION);
+const char* PFX(build_info_str) = NVM_ONOS NVM_COMPILEDBY NVM_BITS CHECKED BITDEPTH;
diff -r 3ea5a868899c -r 60a0f7594330 source/encoder/api.cpp
--- a/source/encoder/api.cpp	Sat Jun 06 11:52:37 2015 -0500
+++ b/source/encoder/api.cpp	Sat Jun 06 12:30:27 2015 -0500
@@ -56,8 +56,8 @@
         goto fail;
 
     memcpy(param, p, sizeof(x265_param));
-    x265_log(param, X265_LOG_INFO, "HEVC encoder version %s\n", x265_version_str);
-    x265_log(param, X265_LOG_INFO, "build info %s\n", x265_build_info_str);
+    x265_log(param, X265_LOG_INFO, "HEVC encoder version %s\n", PFX(version_str));
+    x265_log(param, X265_LOG_INFO, "build info %s\n", PFX(build_info_str));
 
     x265_setup_primitives(param, param->cpuid);
 
@@ -260,9 +260,9 @@
     sizeof(x265_zone),
     sizeof(x265_stats),
 
-    x265_max_bit_depth,
-    x265_version_str,
-    x265_build_info_str,
+    PFX(max_bit_depth),
+    PFX(version_str),
+    PFX(build_info_str),
 
     &PARAM_NS::x265_param_alloc,
     &PARAM_NS::x265_param_free,
diff -r 3ea5a868899c -r 60a0f7594330 source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp	Sat Jun 06 11:52:37 2015 -0500
+++ b/source/encoder/encoder.cpp	Sat Jun 06 12:30:27 2015 -0500
@@ -1266,7 +1266,7 @@
         fputs(statsCSVString(m_analyzeI, buffer), m_csvfpt);
         fputs(statsCSVString(m_analyzeP, buffer), m_csvfpt);
         fputs(statsCSVString(m_analyzeB, buffer), m_csvfpt);
-        fprintf(m_csvfpt, " %s\n", x265_version_str);
+        fprintf(m_csvfpt, " %s\n", PFX(version_str));
     }
 }
 
@@ -1531,14 +1531,14 @@
         char *opts = x265_param2string(m_param);
         if (opts)
         {
-            char *buffer = X265_MALLOC(char, strlen(opts) + strlen(x265_version_str) +
-                                             strlen(x265_build_info_str) + 200);
+            char *buffer = X265_MALLOC(char, strlen(opts) + strlen(PFX(version_str)) +
+                                             strlen(PFX(build_info_str)) + 200);
             if (buffer)
             {
                 sprintf(buffer, "x265 (build %d) - %s:%s - H.265/HEVC codec - "
                         "Copyright 2013-2015 (c) Multicoreware Inc - "
                         "http://x265.org - options: %s",
-                        X265_BUILD, x265_version_str, x265_build_info_str, opts);
+                        X265_BUILD, PFX(version_str), PFX(build_info_str), opts);
                 
                 bs.resetBits();
                 SEIuserDataUnregistered idsei;


More information about the x265-devel mailing list