From d447c2d3db71e0b422ed9330ac26410ba9f90622 Mon Sep 17 00:00:00 2001 From: Loren Merritt Date: Sun, 6 Nov 2005 00:26:43 +0000 Subject: [PATCH] allow --level to understand names in addition to idc git-svn-id: svn://svn.videolan.org/x264/trunk@363 df754926-b1dd-0310-bc7b-ec298dee348c --- encoder/set.c | 2 +- x264.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/encoder/set.c b/encoder/set.c index 7d905edb..ae8f8c74 100644 --- a/encoder/set.c +++ b/encoder/set.c @@ -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 091545df..95573936 100644 --- a/x264.c +++ b/x264.c @@ -298,7 +298,7 @@ static void Help( x264_param_t *defaults ) "\n" "Input/Output:\n" "\n" - " --level Specify level (as defined by Annex A)\n" + " --level Specify level (as defined by Annex A)\n" " --fps Specify framerate\n" " --seek First frame to encode\n" " --frames 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); -- 2.47.3