]> granicus.if.org Git - libx264/commitdiff
allow --level to understand names in addition to idc
authorLoren Merritt <pengvado@videolan.org>
Sun, 6 Nov 2005 00:26:43 +0000 (00:26 +0000)
committerLoren Merritt <pengvado@videolan.org>
Sun, 6 Nov 2005 00:26:43 +0000 (00:26 +0000)
git-svn-id: svn://svn.videolan.org/x264/trunk@363 df754926-b1dd-0310-bc7b-ec298dee348c

encoder/set.c
x264.c

index 7d905edb7cc130f410be712013bae98ecea57344..ae8f8c743e01e284132defd3c8599baf6f87b37b 100644 (file)
@@ -477,7 +477,7 @@ void x264_sei_version_write( bs_t *s )
 const x264_level_t x264_levels[] =
 {
     { 10,   1485,    99,   152064,     64,    175,  64, 64,  0, 0, 0, 1 },
-    {  9,   1485,    99,   152064,    128,    350,  64, 64,  0, 0, 0, 1 },
+//  {"1b",  1485,    99,   152064,    128,    350,  64, 64,  0, 0, 0, 1 },
     { 11,   3000,   396,   345600,    192,    500, 128, 64,  0, 0, 0, 1 },
     { 12,   6000,   396,   912384,    384,   1000, 128, 64,  0, 0, 0, 1 },
     { 13,  11880,   396,   912384,    768,   2000, 128, 64,  0, 0, 0, 1 },
diff --git a/x264.c b/x264.c
index 091545dfa50a51c7966d3aca9431484757a25806..95573936a5e21543ea2ae3d35ca949c70fd96148 100644 (file)
--- a/x264.c
+++ b/x264.c
@@ -298,7 +298,7 @@ static void Help( x264_param_t *defaults )
              "\n"
              "Input/Output:\n"
              "\n"
-             "      --level <integer>       Specify level (as defined by Annex A)\n"
+             "      --level <string>        Specify level (as defined by Annex A)\n"
              "      --fps <float|rational>  Specify framerate\n"
              "      --seek <integer>        First frame to encode\n"
              "      --frames <integer>      Maximum number of frames to encode\n"
@@ -743,7 +743,10 @@ static int  Parse( int argc, char **argv,
                 param->analyse.i_trellis = atoi(optarg);
                 break;
             case OPT_LEVEL:
-                param->i_level_idc = atoi(optarg);
+                if( atof(optarg) < 6 )
+                    param->i_level_idc = (int)(10*atof(optarg)+.5);
+                else
+                    param->i_level_idc = atoi(optarg);
                 break;
             case OPT_RATETOL:
                 param->rc.f_rate_tolerance = !strncmp("inf", optarg, 3) ? 1e9 : atof(optarg);