[x265] CLI: simplify error message for '--frame-threads' option

Mateusz mateuszb at poczta.onet.pl
Thu May 19 01:36:02 CEST 2016


Another fail with Thunderbird & inline patch, sorry.

# HG changeset patch
# User Ma0 <mateuszb at poczta.onet.pl>
# Date 1463613567 -7200
#      Thu May 19 01:19:27 2016 +0200
# Node ID 15086a8cfed77c0b9ca327e55062f834127a08f6
# Parent  7241944b3893cc7ee6df67ebceec06fa0916319a
CLI: simplify error message for '--frame-threads' option

diff -r 7241944b3893 -r 15086a8cfed7 source/common/param.cpp
--- a/source/common/param.cpp	Wed May 18 19:25:34 2016 +0000
+++ b/source/common/param.cpp	Thu May 19 01:19:27 2016 +0200
@@ -1031,6 +1031,8 @@
 int x265_check_params(x265_param* param)
 {
 #define CHECK(expr, msg) check_failed |= _confirm(param, expr, msg)
+#define STR1(x) #x
+#define STR(x) STR1(x)
     int check_failed = 0; /* abort if there is a fatal configuration problem */
     CHECK(param->uhdBluray == 1 && (X265_DEPTH != 10 || param->internalCsp != 1 || param->interlaceMode != 0),
         "uhd-bd: bit depth, chroma subsample, source picture type must be 10, 4:2:0, progressive");
@@ -1070,7 +1072,7 @@
     CHECK(param->limitModes > 1,
           "limitRectAmp must be 0, 1");
     CHECK(param->frameNumThreads < 0 || param->frameNumThreads > X265_MAX_FRAME_THREADS,
-          "frameNumThreads (--frame-threads) must be [0 .. X265_MAX_FRAME_THREADS)");
+          "frameNumThreads (--frame-threads) must be from 0 to " STR(X265_MAX_FRAME_THREADS));
     CHECK(param->cbQpOffset < -12, "Min. Chroma Cb QP Offset is -12");
     CHECK(param->cbQpOffset >  12, "Max. Chroma Cb QP Offset is  12");
     CHECK(param->crQpOffset < -12, "Min. Chroma Cr QP Offset is -12");
@@ -1211,6 +1213,8 @@
     CHECK(param->analysisMode && (param->analysisMode < X265_ANALYSIS_OFF || param->analysisMode > X265_ANALYSIS_LOAD),
         "Invalid analysis mode. Analysis mode 0: OFF 1: SAVE : 2 LOAD");
     return check_failed;
+#undef STR
+#undef STR1
 }

 void x265_param_apply_fastfirstpass(x265_param* param)



More information about the x265-devel mailing list