[x265] [PATCH] x265 cli: Added default values to the CLI help text

gopu at multicorewareinc.com gopu at multicorewareinc.com
Tue Aug 13 09:38:59 CEST 2013


# HG changeset patch
# User ggopu
# Date 1376379530 -19800
# Node ID c23e48bfb64fa488c98f0f8e155e8d8a908fa9f0
# Parent  f3e7ad1ce8700728d5bf5579e4e1d226b96aee93
x265 cli: Added default values to the CLI help text

diff -r f3e7ad1ce870 -r c23e48bfb64f source/x265.cpp
--- a/source/x265.cpp	Tue Aug 13 01:09:25 2013 -0500
+++ b/source/x265.cpp	Tue Aug 13 13:08:50 2013 +0530
@@ -257,7 +257,13 @@
 
     void do_help(x265_param_t *param)
     {
+        int cpuid = 0, inputBitDepth = 8, outputBitDepth = param->internalBitDepth;
+        char help = 'h';
+        x265_param_t defaults;
+        x265_param_default(&defaults);
+        x265_param_default(param);
         print_version(param);
+
         printf("\nSyntax: x265 [options] infile [-o] outfile\n");
         printf("    infile can be YUV or Y4M\n");
         printf("    outfile is raw HEVC bitstream\n");
@@ -266,8 +272,13 @@
 #define HELP(message) printf("\n%s\n", message);
 #define OPT(longname, var, argreq, flag, helptext) \
     if (flag) printf("-%c/", flag); else printf("   "); \
-    printf("--%-20s\t%s\n", longname, helptext);
-#define STROPT OPT
+    printf("--%-20s\t%s\n", longname, helptext); \
+    if (!argreq && !flag && var ) printf("Default : Enabled \n"); \
+    if (!argreq && !flag && !var ) printf("Default : Disabled \n"); \
+    if (argreq ) printf("Default Value: %d \n", var); 
+#define STROPT(longname, var, argreq, flag, helptext) \
+    if (flag) printf("-%c/", flag); else printf("   "); \
+    printf("--%-20s\t%s\n", longname, helptext); 
 #include "x265opts.h"
 #undef OPT
 #undef STROPT


More information about the x265-devel mailing list