PDA

View Full Version : Accelerate x264 1st pass?


Marsu42
24th September 2005, 08:43
Since H264 encodes take quite a while, there seems to be the possibility to drop some calculations for the first pass. In combination with a simpified avisynth script for this pass, this should be able to save quite a lot of time. However, I didn't find anything conclusive on this matter, everyone seems to have his/her own opinion on which options are how negligible...

I guess parameters like ratecontrol need to be kept constant throughout the passes. That leaves some of the analysis and one frame type option(s) open for discussion:

--ref
--analyse
--8x8dct
--me/--merange
--no-chroma-me
--subme

What danger is there if I'd e.g. use
--ref 1 --analyse none --me dia --no-chroma-me --subme 1
for the first pass and
--ref 5 --analyse all --8x8dct --me hex --subme 6
for the second=last pass?

Does it have any important impact on the stats file if I use a different --merange w/ --me umh?

I certainly could run all combinations for myself and look at the stats file and encoded video, but maybe someone has tried these out already?

Edit: I am aware that there are the MeGUI "turbo" and VfW "fast first pass" options. But other tools like x264cliGUI let you choose for yourself, and sex264 recommends just dropping p4x4mv and b8x8mv, reducing the # of reference frames only by half and adjusting the subpixel refinement to no lower than 3. I am therefore wondering what difference which switch makes and if e.g. dropping --8x8dct like in the example above is possible, too.

Doom9
24th September 2005, 11:06
what MeGUI picks are all the options that you are certainly not to notice.. mathematically the difference between those and your second pass option is negligible (0.01 in terms of PSNR iirc). I'll let somebody more knowledgeable answer your other questions (megui uses --analyse none, --ref1 and --me dia and --subme 1 so you can consider those safe, and btw --ref 1 is the default so there's no need to specify it). Using --8x8dct in the second pass should also be fine since in the first pass i8x8 is not used (i8x8 needs 8x8dct).

That only leaves merange and no-chroma-me. sex264? you know this board is open to all ages ;) Seriously though what you posted sounds like the "old" turbo, the options initially suggested for turbo, matching what turbo used to be in the VfW (and MeGUI had it to). It was later revised to what MeGUI does now (matching your sample commandlines minus the no-chroma-me)

Manao
24th September 2005, 13:09
Merange doesn't influence speed that much ( except in esa ), so I would leave it to its default value. I'd use no-chroma-me in first pass. For the rest, fastest settings should indeed be used, especially since first pass is used only to know the relative complexity of the different parts of the movie, and for that, you don't need slow stuff like 8x8dct, subme 6 and the like.btw --ref 1 is the default so there's no need to specify itIndeed, there's no need. But defaults can changed between builds, while the user might not want the settings they used to change. Of course, it tends to overbloat command lines, but I'd recommend to specify some of the default settings : not everyone has to know by heart what are the defaults. It's OT, I know, but there's no dedicated thread related to that subject ( it isn't worth a thread either ). My stand is that meaningfull settings should be mentionned, and in his case, ref 1 sure is.

Doom9
24th September 2005, 13:13
I know, but there's no dedicated thread related to that subject there's no need.. call x264.exe without arguments and it gives you all the defaults ;)