Commit 90a92195 authored by Loren Merritt's avatar Loren Merritt

accept mencoder's option names as synonyms (api only, not in x264cli)


git-svn-id: svn://svn.videolan.org/x264/trunk@579 df754926-b1dd-0310-bc7b-ec298dee348c
parent cb8b5dad
...@@ -245,7 +245,7 @@ int x264_param_parse( x264_param_t *p, const char *name, const char *value ) ...@@ -245,7 +245,7 @@ int x264_param_parse( x264_param_t *p, const char *name, const char *value )
else else
p->i_threads = atoi(value); p->i_threads = atoi(value);
} }
OPT("level") OPT2("level", "level-idc")
{ {
if( atof(value) < 6 ) if( atof(value) < 6 )
p->i_level_idc = (int)(10*atof(value)+.5); p->i_level_idc = (int)(10*atof(value)+.5);
...@@ -285,7 +285,7 @@ int x264_param_parse( x264_param_t *p, const char *name, const char *value ) ...@@ -285,7 +285,7 @@ int x264_param_parse( x264_param_t *p, const char *name, const char *value )
p->i_fps_den = 1000; p->i_fps_den = 1000;
} }
} }
OPT("ref") OPT2("ref", "frameref")
p->i_frame_reference = atoi(value); p->i_frame_reference = atoi(value);
OPT("keyint") OPT("keyint")
{ {
...@@ -293,7 +293,7 @@ int x264_param_parse( x264_param_t *p, const char *name, const char *value ) ...@@ -293,7 +293,7 @@ int x264_param_parse( x264_param_t *p, const char *name, const char *value )
if( p->i_keyint_min > p->i_keyint_max ) if( p->i_keyint_min > p->i_keyint_max )
p->i_keyint_min = p->i_keyint_max; p->i_keyint_min = p->i_keyint_max;
} }
OPT("min-keyint") OPT2("min-keyint", "keyint-min")
{ {
p->i_keyint_min = atoi(value); p->i_keyint_min = atoi(value);
if( p->i_keyint_max < p->i_keyint_min ) if( p->i_keyint_max < p->i_keyint_min )
...@@ -310,7 +310,7 @@ int x264_param_parse( x264_param_t *p, const char *name, const char *value ) ...@@ -310,7 +310,7 @@ int x264_param_parse( x264_param_t *p, const char *name, const char *value )
OPT("b-pyramid") OPT("b-pyramid")
p->b_bframe_pyramid = atobool(value); p->b_bframe_pyramid = atobool(value);
OPT("nf") OPT("nf")
p->b_deblocking_filter = 0; p->b_deblocking_filter = !atobool(value);
OPT2("filter", "deblock") OPT2("filter", "deblock")
{ {
int count; int count;
...@@ -337,7 +337,7 @@ int x264_param_parse( x264_param_t *p, const char *name, const char *value ) ...@@ -337,7 +337,7 @@ int x264_param_parse( x264_param_t *p, const char *name, const char *value )
else if( strstr( value, "jvt" ) ) else if( strstr( value, "jvt" ) )
p->i_cqm_preset = X264_CQM_JVT; p->i_cqm_preset = X264_CQM_JVT;
else else
b_error = 1; p->psz_cqm_file = strdup(value);
} }
OPT("cqmfile") OPT("cqmfile")
p->psz_cqm_file = strdup(value); p->psz_cqm_file = strdup(value);
...@@ -417,9 +417,9 @@ int x264_param_parse( x264_param_t *p, const char *name, const char *value ) ...@@ -417,9 +417,9 @@ int x264_param_parse( x264_param_t *p, const char *name, const char *value )
} }
OPT("8x8dct") OPT("8x8dct")
p->analyse.b_transform_8x8 = atobool(value); p->analyse.b_transform_8x8 = atobool(value);
OPT("weightb") OPT2("weightb", "weight-b")
p->analyse.b_weighted_bipred = atobool(value); p->analyse.b_weighted_bipred = atobool(value);
OPT("direct") OPT2("direct", "direct-pred")
b_error |= parse_enum( value, x264_direct_pred_names, &p->analyse.i_direct_mv_pred ); b_error |= parse_enum( value, x264_direct_pred_names, &p->analyse.i_direct_mv_pred );
OPT("direct-8x8") OPT("direct-8x8")
p->analyse.i_direct_8x8_inference = atoi(value); p->analyse.i_direct_8x8_inference = atoi(value);
...@@ -427,17 +427,17 @@ int x264_param_parse( x264_param_t *p, const char *name, const char *value ) ...@@ -427,17 +427,17 @@ int x264_param_parse( x264_param_t *p, const char *name, const char *value )
p->analyse.i_chroma_qp_offset = atoi(value); p->analyse.i_chroma_qp_offset = atoi(value);
OPT("me") OPT("me")
b_error |= parse_enum( value, x264_motion_est_names, &p->analyse.i_me_method ); b_error |= parse_enum( value, x264_motion_est_names, &p->analyse.i_me_method );
OPT("merange") OPT2("merange", "me-range")
p->analyse.i_me_range = atoi(value); p->analyse.i_me_range = atoi(value);
OPT("mvrange") OPT("mvrange")
p->analyse.i_mv_range = atoi(value); p->analyse.i_mv_range = atoi(value);
OPT("subme") OPT2("subme", "subq")
p->analyse.i_subpel_refine = atoi(value); p->analyse.i_subpel_refine = atoi(value);
OPT("bime") OPT("bime")
p->analyse.b_bidir_me = atobool(value); p->analyse.b_bidir_me = atobool(value);
OPT("chroma-me") OPT("chroma-me")
p->analyse.b_chroma_me = atobool(value); p->analyse.b_chroma_me = atobool(value);
OPT("b-rdo") OPT2("b-rdo", "brdo")
p->analyse.b_bframe_rdo = atobool(value); p->analyse.b_bframe_rdo = atobool(value);
OPT("mixed-refs") OPT("mixed-refs")
p->analyse.b_mixed_references = atobool(value); p->analyse.b_mixed_references = atobool(value);
...@@ -458,7 +458,7 @@ int x264_param_parse( x264_param_t *p, const char *name, const char *value ) ...@@ -458,7 +458,7 @@ int x264_param_parse( x264_param_t *p, const char *name, const char *value )
p->rc.i_bitrate = atoi(value); p->rc.i_bitrate = atoi(value);
p->rc.i_rc_method = X264_RC_ABR; p->rc.i_rc_method = X264_RC_ABR;
} }
OPT("qp") OPT2("qp", "qp_constant")
{ {
p->rc.i_qp_constant = atoi(value); p->rc.i_qp_constant = atoi(value);
p->rc.i_rc_method = X264_RC_CQP; p->rc.i_rc_method = X264_RC_CQP;
...@@ -468,11 +468,11 @@ int x264_param_parse( x264_param_t *p, const char *name, const char *value ) ...@@ -468,11 +468,11 @@ int x264_param_parse( x264_param_t *p, const char *name, const char *value )
p->rc.i_rf_constant = atoi(value); p->rc.i_rf_constant = atoi(value);
p->rc.i_rc_method = X264_RC_CRF; p->rc.i_rc_method = X264_RC_CRF;
} }
OPT("qpmin") OPT2("qpmin", "qp-min")
p->rc.i_qp_min = atoi(value); p->rc.i_qp_min = atoi(value);
OPT("qpmax") OPT2("qpmax", "qp-max")
p->rc.i_qp_max = atoi(value); p->rc.i_qp_max = atoi(value);
OPT("qpstep") OPT2("qpstep", "qp-step")
p->rc.i_qp_step = atoi(value); p->rc.i_qp_step = atoi(value);
OPT("ratetol") OPT("ratetol")
p->rc.f_rate_tolerance = !strncmp("inf", value, 3) ? 1e9 : atof(value); p->rc.f_rate_tolerance = !strncmp("inf", value, 3) ? 1e9 : atof(value);
...@@ -482,9 +482,9 @@ int x264_param_parse( x264_param_t *p, const char *name, const char *value ) ...@@ -482,9 +482,9 @@ int x264_param_parse( x264_param_t *p, const char *name, const char *value )
p->rc.i_vbv_buffer_size = atoi(value); p->rc.i_vbv_buffer_size = atoi(value);
OPT("vbv-init") OPT("vbv-init")
p->rc.f_vbv_buffer_init = atof(value); p->rc.f_vbv_buffer_init = atof(value);
OPT("ipratio") OPT2("ipratio", "ip-factor")
p->rc.f_ip_factor = atof(value); p->rc.f_ip_factor = atof(value);
OPT("pbratio") OPT2("pbratio", "pb-factor")
p->rc.f_pb_factor = atof(value); p->rc.f_pb_factor = atof(value);
OPT("pass") OPT("pass")
{ {
...@@ -503,7 +503,7 @@ int x264_param_parse( x264_param_t *p, const char *name, const char *value ) ...@@ -503,7 +503,7 @@ int x264_param_parse( x264_param_t *p, const char *name, const char *value )
p->rc.f_qcompress = atof(value); p->rc.f_qcompress = atof(value);
OPT("qblur") OPT("qblur")
p->rc.f_qblur = atof(value); p->rc.f_qblur = atof(value);
OPT("cplxblur") OPT2("cplxblur", "cplx-blur")
p->rc.f_complexity_blur = atof(value); p->rc.f_complexity_blur = atof(value);
OPT("zones") OPT("zones")
p->rc.psz_zones = strdup(value); p->rc.psz_zones = strdup(value);
...@@ -515,6 +515,8 @@ int x264_param_parse( x264_param_t *p, const char *name, const char *value ) ...@@ -515,6 +515,8 @@ int x264_param_parse( x264_param_t *p, const char *name, const char *value )
p->b_aud = atobool(value); p->b_aud = atobool(value);
OPT("sps-id") OPT("sps-id")
p->i_sps_id = atoi(value); p->i_sps_id = atoi(value);
OPT("global-header")
p->b_repeat_headers = !atobool(value);
OPT("repeat-headers") OPT("repeat-headers")
p->b_repeat_headers = atobool(value); p->b_repeat_headers = atobool(value);
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment