[x265] [PATCH] cli: we can no longer use compiled bit-depth for dither

Steve Borho steve at borho.org
Tue May 12 16:57:28 CEST 2015


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1431442610 18000
#      Tue May 12 09:56:50 2015 -0500
# Branch stable
# Node ID 37abdd8805b145efbbb1d607eb98bdcc5455b97c
# Parent  cfbcac74d1c6796bc28e52434690506ef8d6c1b3
cli: we can no longer use compiled bit-depth for dither

Now that the CLI can use a libx265 with a different bit depth than what it was
compiled against, dither logic needs to use param->internalBitDepth.

diff -r cfbcac74d1c6 -r 37abdd8805b1 source/x265.cpp
--- a/source/x265.cpp	Mon May 11 18:47:37 2015 -0500
+++ b/source/x265.cpp	Tue May 12 09:56:50 2015 -0500
@@ -579,10 +579,10 @@
 
         if (pic_in)
         {
-            if (pic_in->bitDepth > X265_DEPTH && cliopt.bDither)
+            if (pic_in->bitDepth > param->internalBitDepth && cliopt.bDither)
             {
-                ditherImage(*pic_in, param->sourceWidth, param->sourceHeight, errorBuf, X265_DEPTH);
-                pic_in->bitDepth = X265_DEPTH;
+                ditherImage(*pic_in, param->sourceWidth, param->sourceHeight, errorBuf, param->internalBitDepth);
+                pic_in->bitDepth = param->internalBitDepth;
             }
             /* Overwrite PTS */
             pic_in->pts = pic_in->poc;


More information about the x265-devel mailing list