[x265-commits] [x265] common: prevent 8bit encodes with HIGH_BIT_DEPTH builds

Steve Borho steve at borho.org
Mon Jan 27 21:30:04 CET 2014


details:   http://hg.videolan.org/x265/rev/773b87c2855c
branches:  stable
changeset: 5917:773b87c2855c
user:      Steve Borho <steve at borho.org>
date:      Mon Jan 27 14:28:27 2014 -0600
description:
common: prevent 8bit encodes with HIGH_BIT_DEPTH builds

Some of the interpolation 16bpp assembly routines make assumptions that the
encode depth is 10bits, so HIGH_BIT_DEPTH builds will generally cause decoder
hash mismatches if they encode 8bpp streams.  Prevent this until we have a
proper long term solution.

diffstat:

 source/common/common.cpp |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (23 lines):

diff -r 26a5e720f290 -r 773b87c2855c source/common/common.cpp
--- a/source/common/common.cpp	Mon Jan 27 14:14:59 2014 -0600
+++ b/source/common/common.cpp	Mon Jan 27 14:28:27 2014 -0600
@@ -436,11 +436,16 @@ int x265_check_params(x265_param *param)
     uint32_t tuQTMaxLog2Size = maxCUDepth + 2 - 1;
     uint32_t tuQTMinLog2Size = 2; //log2(4)
 
+    /* These checks might be temporary */
+    CHECK(param->internalCsp != X265_CSP_I420,
+          "Only 4:2:0 color space is supported at this time");
+#if HIGH_BIT_DEPTH
+    CHECK(param->inputBitDepth != 10,
+          "x265 was compiled for 10bit encodes, only 10bit inputs supported");
+#endif
+
     CHECK(param->inputBitDepth > x265_max_bit_depth,
           "inputBitDepth must be <= x265_max_bit_depth");
-    CHECK(param->internalCsp != X265_CSP_I420,
-          "Only 4:2:0 color space is supported at this time");
-
     CHECK(param->rc.qp < -6 * (param->inputBitDepth - 8) || param->rc.qp > 51,
           "QP exceeds supported range (-QpBDOffsety to 51)");
     CHECK(param->frameRate <= 0,


More information about the x265-commits mailing list