[x265] [PATCH 4 of 4] cli: allow the CLI to be bit-depth independent on non-Windows platforms

Steve Borho steve at borho.org
Wed Jan 21 16:29:44 CET 2015


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1421854167 21600
#      Wed Jan 21 09:29:27 2015 -0600
# Node ID 5f426d9b4b6793377f8173ede8a44ba5c6a7dc0e
# Parent  bf1726a155cd33106233ab98e7bc92a0c09be29d
cli: allow the CLI to be bit-depth independent on non-Windows platforms

This allows one to do something like this:
LD_LIBRARY_PATH=/usr/local/x265_16bpp ./x265 in.y4m out-main10.hevc
LD_LIBRARY_PATH=/usr/local/x265_8bpp ./x265 in.y4m out-main8.hevc

Without this change, the CLI "remembers" the bit depth it was compiled with
for no particularly good reason.

On Windows, the CLI must link with the static library and this point is moot.

closes (#98)

diff -r bf1726a155cd -r 5f426d9b4b67 source/x265.cpp
--- a/source/x265.cpp	Wed Jan 21 09:19:46 2015 -0600
+++ b/source/x265.cpp	Wed Jan 21 09:29:27 2015 -0600
@@ -311,19 +311,11 @@
         return true;
     }
 
-#if HIGH_BIT_DEPTH
-    if (param->internalBitDepth != 10)
+    if (param->internalBitDepth != x265_max_bit_depth)
     {
-        x265_log(param, X265_LOG_ERROR, "Only bit depths of 10 are supported in this build\n");
+        x265_log(param, X265_LOG_ERROR, "Only bit depths of %d are supported in this build\n", x265_max_bit_depth);
         return true;
     }
-#else
-    if (param->internalBitDepth != 8)
-    {
-        x265_log(param, X265_LOG_ERROR, "Only bit depths of 8 are supported in this build\n");
-        return true;
-    }
-#endif // if HIGH_BIT_DEPTH
 
     InputFileInfo info;
     info.filename = inputfn;


More information about the x265-devel mailing list