View Single Post
Old 2nd July 2009, 04:56   #1  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
x264 presets, profiles, and tuning system

Presets will be used as follows:

--preset name

and apply before all other options. In other words, they override the x264 defaults, which, with the default changes, will be:

--subme 7 --bframes 3 --weightb --8x8dct --ref 3 --mixed-refs --trellis 1 --crf 23 --threads auto

As such, all options that you set will act on top of the preset you choose, regardless of the option order.

ultrafast:

--ref 1 --scenecut 0 --nf --no-cabac --bframes 0 --partitions none --no-8x8dct --me dia --subme 0 --aq-mode 0

veryfast:

--partitions i8x8,i4x4 --subme 1 --me dia --ref 1 --trellis 0

fast:

--mixed-refs 0 --ref 2 --subme 5

medium:

<defaults>

slow:

--me umh --subme 8 --ref 5 --b-adapt 2 --direct auto

slower:

--me umh --subme 9 --ref 8 --b-adapt 2 --direct auto --partitions all --trellis 2

placebo:

--me tesa --subme 9 --merange 24 --ref 16 --b-adapt 2 --direct auto --partitions all --no-fast-pskip --trellis 2 --bframes 16

For all encodes, regardless of preset or not, using --pass 1 will automatically trigger "turbo" settings, which are as follows and override all commandline options:

--trellis 0 --no-8x8dct --partitions none --me dia --ref 1 --subme MIN(2, previous subme)

This can be disabled using --slow-firstpass.

For all encodes, if you don't set your own --ref option and instead use the default or a preset, x264 will automatically lower --ref if the --level you set conflicts with it. If you set --ref explicitly, it will not override what you set.

Profiles will be used as follows:

--profile name

The options will be baseline, main, and high, which do what you think they do. Note that these override all other options no matter what, with two exceptions.. Because interlaced and lossless coding are options with very explicit meanings, the encoder will terminate with an error if you attempt to use them with an incompatible profile.

Tunings will be used as follows:

--tune name

The options will be "film" and "animation", and will tweak AQ strength, psy-rd/trellis strength, deblock, refs, and so forth:

film:

--deblock -1:-1 --psy-rd 1.0:0.15

animation:

--ref (previousref==1?1:MIN(previousref*2,16)) --deblock 1:1 --psy-rd 0.4:0 --aq-strength 0.6 --bframes 5

All of this is subject to change before final release, and suggestions are welcome.

If you don't use any of the new presets, the only changes for you will be the new defaults, and the automatic fast first pass.

Last edited by Dark Shikari; 2nd July 2009 at 06:51.
Dark Shikari is offline   Reply With Quote