]> granicus.if.org Git - handbrake/commitdiff
encx264: make hb_x264_encopt_synonyms two-dimensional instead of faking it.
authorRodeo <tdskywalker@gmail.com>
Sun, 9 Sep 2012 01:17:10 +0000 (01:17 +0000)
committerRodeo <tdskywalker@gmail.com>
Sun, 9 Sep 2012 01:17:10 +0000 (01:17 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4946 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/encx264.c
libhb/encx264.h

index 88966938173da303c87db76b6c06ce9c312d558c..2d29168ab553973a8199e1d0b7c0175b02bffc2d 100644 (file)
@@ -877,8 +877,8 @@ const char * const * hb_h264_levels()
 const char * hb_x264_encopt_name(const char *name)
 {
     int i;
-    for (i = 0; hb_x264_encopt_synonyms[i] && hb_x264_encopt_synonyms[i+1]; i += 2)
-        if (!strcmp(name, hb_x264_encopt_synonyms[i+1]))
-            return hb_x264_encopt_synonyms[i];
+    for (i = 0; hb_x264_encopt_synonyms[i][0] != NULL; i++)
+        if (!strcmp(name, hb_x264_encopt_synonyms[i][1]))
+            return hb_x264_encopt_synonyms[i][0];
     return name;
 }
index e7c4b08f6de3f5baeb4a9d9e148313ca722a1db3..427ea28618374a7261abd6b7312112b8d5201101 100644 (file)
@@ -15,29 +15,29 @@ static const int    const hb_h264_level_values[] = {    10,    9,    11,    12,
 /* x264 preferred option names (left) and synonyms (right).
  * The "preferred" names match names used in x264's param2string function more
  * closely than their corresponding synonyms, or are just shorter. */
-static const char * const hb_x264_encopt_synonyms[] =
+static const char * const hb_x264_encopt_synonyms[][2] =
 {
-    "deterministic",  "n-deterministic",
-    "level",          "level-idc",
-    "ref",            "frameref",
-    "keyint-min",     "min-keyint",
-    "deblock",        "filter",
-    "analyse",        "partitions",
-    "weightb",        "weight-b",
-    "direct",         "direct-pred",
-    "merange",        "me-range",
-    "mvrange",        "mv-range",
-    "mvrange-thread", "mv-range-thread",
-    "subme",          "subq",
-    "qp",             "qp_constant",
-    "qpmin",          "qp-min",
-    "qpmax",          "qp-max",
-    "qpstep",         "qp-step",
-    "ipratio",        "ip-factor",
-    "pbratio",        "pb-factor",
-    "cplxblur",       "cplx-blur",
-    "cqm",            "cqmfile",
-    0
+    { "deterministic",  "n-deterministic", },
+    { "level",          "level-idc",       },
+    { "ref",            "frameref",        },
+    { "keyint-min",     "min-keyint",      },
+    { "deblock",        "filter",          },
+    { "analyse",        "partitions",      },
+    { "weightb",        "weight-b",        },
+    { "direct",         "direct-pred",     },
+    { "merange",        "me-range",        },
+    { "mvrange",        "mv-range",        },
+    { "mvrange-thread", "mv-range-thread", },
+    { "subme",          "subq",            },
+    { "qp",             "qp_constant",     },
+    { "qpmin",          "qp-min",          },
+    { "qpmax",          "qp-max",          },
+    { "qpstep",         "qp-step",         },
+    { "ipratio",        "ip-factor",       },
+    { "pbratio",        "pb-factor",       },
+    { "cplxblur",       "cplx-blur",       },
+    { "cqm",            "cqmfile",         },
+    { NULL,             NULL,              },
 };
 
 int hb_apply_h264_level(x264_param_t *param,