[x265] [PATCH STABLE] cli: allow --no-psy-rd or --no-psy-rdoq

Steve Borho steve at borho.org
Wed Feb 4 22:01:08 CET 2015


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1423083631 21600
#      Wed Feb 04 15:00:31 2015 -0600
# Branch stable
# Node ID 18cb1eef8cd500c6db074fac838844d5c3f0f531
# Parent  2fb7f322c6d4e81b814aee7e3c48fd3d036e02d2
cli: allow --no-psy-rd or --no-psy-rdoq

diff -r 2fb7f322c6d4 -r 18cb1eef8cd5 source/common/param.cpp
--- a/source/common/param.cpp	Sat Jan 31 14:57:06 2015 -0600
+++ b/source/common/param.cpp	Wed Feb 04 15:00:31 2015 -0600
@@ -458,12 +458,8 @@
 static int parseName(const char *arg, const char * const * names, bool& bError)
 {
     for (int i = 0; names[i]; i++)
-    {
         if (!strcmp(arg, names[i]))
-        {
             return i;
-        }
-    }
 
     return x265_atoi(arg, bError);
 }
@@ -496,9 +492,7 @@
         char *c;
         strcpy(nameBuf, name);
         while ((c = strchr(nameBuf, '_')) != 0)
-        {
             *c = '-';
-        }
 
         name = nameBuf;
     }
@@ -634,8 +628,28 @@
     OPT("cbqpoffs") p->cbQpOffset = atoi(value);
     OPT("crqpoffs") p->crQpOffset = atoi(value);
     OPT("rd") p->rdLevel = atoi(value);
-    OPT("psy-rd") p->psyRd = atof(value);
-    OPT("psy-rdoq") p->psyRdoq = atof(value);
+    OPT("psy-rd")
+    {
+        int bval = atobool(value);
+        if (bError || bval)
+        {
+            bError = false;
+            p->psyRd = atof(value);
+        }
+        else
+            p->psyRd = 0.0;
+    }
+    OPT("psy-rdoq")
+    {
+        int bval = atobool(value);
+        if (bError || bval)
+        {
+            bError = false;
+            p->psyRdoq = atof(value);
+        }
+        else
+            p->psyRdoq = 0.0;
+    }
     OPT("signhide") p->bEnableSignHiding = atobool(value);
     OPT("b-intra") p->bIntraInBFrames = atobool(value);
     OPT("lft") p->bEnableLoopFilter = atobool(value); /* DEPRECATED */
diff -r 2fb7f322c6d4 -r 18cb1eef8cd5 source/x265cli.h
--- a/source/x265cli.h	Sat Jan 31 14:57:06 2015 -0600
+++ b/source/x265cli.h	Wed Feb 04 15:00:31 2015 -0600
@@ -138,6 +138,8 @@
     { "rd",             required_argument, NULL, 0 },
     { "psy-rd",         required_argument, NULL, 0 },
     { "psy-rdoq",       required_argument, NULL, 0 },
+    { "no-psy-rd",            no_argument, NULL, 0 },
+    { "no-psy-rdoq",          no_argument, NULL, 0 },
     { "scaling-list",   required_argument, NULL, 0 },
     { "lossless",             no_argument, NULL, 0 },
     { "no-lossless",          no_argument, NULL, 0 },


More information about the x265-devel mailing list