[MPlayer-dev-eng] [PATCH] add support for all current and future x264 options
Loren Merritt
lorenm at u.washington.edu
Wed Oct 4 09:39:03 CEST 2006
On Mon, 2 Oct 2006, Guillaume POIRIER wrote:
> On 10/2/06, Loren Merritt <lorenm at u.washington.edu> wrote:
>>
>> libx264 already contains code to parse options
>> symbolically, no need to duplicate it in mencoder.
>> However, some of the older options didn't use the same names between
>> mencoder and x264cli, so they would have to change.
>
> Didn't you add synonym support to x264 a few minutes ago?
>
> Maybe it's a stupid proposition, but could mencoder's options be added
> to x264's parser as synonyms of x264 options?
Ok, with this patch most of the option names are the same. The ones that
couldn't be fixed with synonyms are:
deblockalpha, deblockbeta -> deblock
a command that was "deblockalpha=$A:deblockbeta=$B" becomes "deblock=$A,$B".
"nodeblock" still disables it, and "deblock" still enables it without
changing the parameters.
4x4mv, 8x8mv, b8x8mv, i4x4, i8x8 -> partitions
what was "4x4mv:8x8mv:b8x8mv:i4x4:i8x8" becomes "partitions=all" or
"partitions=p4x4,p8x8,b8x8,i4x4,i8x8".
what was "no4x4mv:no8x8mv:nob8x8mv:noi4x4:noi8x8" becomes
"partitions=none" or "partitions=".
direct_pred and me now take names instead of numbers.
direct_pred: 0,1,2,3 -> none, spatial, temporal, auto.
me: 1,2,3,4 -> dia, hex, umh, esa.
global
I could have synonized this, but it needs renaming anyway. "global_header"
is better.
--Loren Merritt
-------------- next part --------------
Index: x264/common/common.c
===================================================================
--- x264/common/common.c (revision 577)
+++ x264/common/common.c (working copy)
@@ -245,7 +245,7 @@
else
p->i_threads = atoi(value);
}
- OPT("level")
+ OPT2("level", "level-idc")
{
if( atof(value) < 6 )
p->i_level_idc = (int)(10*atof(value)+.5);
@@ -285,7 +285,7 @@
p->i_fps_den = 1000;
}
}
- OPT("ref")
+ OPT2("ref", "frameref")
p->i_frame_reference = atoi(value);
OPT("keyint")
{
@@ -293,7 +293,7 @@
if( 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);
if( p->i_keyint_max < p->i_keyint_min )
@@ -310,7 +310,7 @@
OPT("b-pyramid")
p->b_bframe_pyramid = atobool(value);
OPT("nf")
- p->b_deblocking_filter = 0;
+ p->b_deblocking_filter = !atobool(value);
OPT2("filter", "deblock")
{
int count;
@@ -337,7 +337,7 @@
else if( strstr( value, "jvt" ) )
p->i_cqm_preset = X264_CQM_JVT;
else
- b_error = 1;
+ p->psz_cqm_file = strdup(value);
}
OPT("cqmfile")
p->psz_cqm_file = strdup(value);
@@ -417,9 +417,9 @@
}
OPT("8x8dct")
p->analyse.b_transform_8x8 = atobool(value);
- OPT("weightb")
+ OPT2("weightb", "weight-b")
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 );
OPT("direct-8x8")
p->analyse.i_direct_8x8_inference = atoi(value);
@@ -431,13 +431,13 @@
p->analyse.i_me_range = atoi(value);
OPT("mvrange")
p->analyse.i_mv_range = atoi(value);
- OPT("subme")
+ OPT2("subme", "subq")
p->analyse.i_subpel_refine = atoi(value);
OPT("bime")
p->analyse.b_bidir_me = atobool(value);
OPT("chroma-me")
p->analyse.b_chroma_me = atobool(value);
- OPT("b-rdo")
+ OPT2("b-rdo", "brdo")
p->analyse.b_bframe_rdo = atobool(value);
OPT("mixed-refs")
p->analyse.b_mixed_references = atobool(value);
@@ -458,7 +458,7 @@
p->rc.i_bitrate = atoi(value);
p->rc.i_rc_method = X264_RC_ABR;
}
- OPT("qp")
+ OPT2("qp", "qp_constant")
{
p->rc.i_qp_constant = atoi(value);
p->rc.i_rc_method = X264_RC_CQP;
@@ -468,11 +468,11 @@
p->rc.i_rf_constant = atoi(value);
p->rc.i_rc_method = X264_RC_CRF;
}
- OPT("qpmin")
+ OPT2("qpmin", "qp-min")
p->rc.i_qp_min = atoi(value);
- OPT("qpmax")
+ OPT2("qpmax", "qp-max")
p->rc.i_qp_max = atoi(value);
- OPT("qpstep")
+ OPT2("qpstep", "qp-step")
p->rc.i_qp_step = atoi(value);
OPT("ratetol")
p->rc.f_rate_tolerance = !strncmp("inf", value, 3) ? 1e9 : atof(value);
@@ -482,9 +482,9 @@
p->rc.i_vbv_buffer_size = atoi(value);
OPT("vbv-init")
p->rc.f_vbv_buffer_init = atof(value);
- OPT("ipratio")
+ OPT2("ipratio", "ip-factor")
p->rc.f_ip_factor = atof(value);
- OPT("pbratio")
+ OPT2("pbratio", "pb-factor")
p->rc.f_pb_factor = atof(value);
OPT("pass")
{
@@ -503,7 +503,7 @@
p->rc.f_qcompress = atof(value);
OPT("qblur")
p->rc.f_qblur = atof(value);
- OPT("cplxblur")
+ OPT2("cplxblur", "cplx-blur")
p->rc.f_complexity_blur = atof(value);
OPT("zones")
p->rc.psz_zones = strdup(value);
@@ -515,6 +515,8 @@
p->b_aud = atobool(value);
OPT("sps-id")
p->i_sps_id = atoi(value);
+ OPT("global-header")
+ p->b_repeat_headers = !atobool(value);
OPT("repeat-headers")
p->b_repeat_headers = atobool(value);
else
More information about the MPlayer-dev-eng
mailing list