Commit 3d96daca authored by Loren Merritt's avatar Loren Merritt Committed by Fiona Glaser

Add numeric names for the presets (0==ultrafast ... 9==placebo)

This mapping will of course change if new presets are added in between, but will always be ordered from fastest to slowest.
parent b9461a15
......@@ -169,6 +169,11 @@ void x264_param_default( x264_param_t *param )
static int x264_param_apply_preset( x264_param_t *param, const char *preset )
{
char *end;
int i = strtol( preset, &end, 10 );
if( *end == 0 && i >= 0 && i < sizeof(x264_preset_names)/sizeof(*x264_preset_names)-1 )
preset = x264_preset_names[i];
if( !strcasecmp( preset, "ultrafast" ) )
{
param->i_frame_reference = 1;
......
......@@ -526,7 +526,13 @@ int x264_param_parse( x264_param_t *, const char *name, const char *value );
* Currently available presets are, ordered from fastest to slowest: */
static const char * const x264_preset_names[] = { "ultrafast", "superfast", "veryfast", "faster", "fast", "medium", "slow", "slower", "veryslow", "placebo", 0 };
/* Warning: the speed of these presets scales dramatically. Ultrafast is a full
/* The presets can also be indexed numerically, as in:
* x264_param_default_preset( &param, "3", ... )
* with ultrafast mapping to "0" and placebo mapping to "9". This mapping may
* of course change if new presets are added in between, but will always be
* ordered from fastest to slowest.
*
* Warning: the speed of these presets scales dramatically. Ultrafast is a full
* 100 times faster than placebo!
*
* Currently available tunings are: */
......
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