Log in

View Full Version : x264 zones for multipass encoding


random asshat
29th January 2009, 17:17
A few questions about best practices for use with the x264 --zones switch.
The threads at http://forum.doom9.org/showthread.php?t=130622 and http://forum.doom9.org/archive/index.php/t-137790.html were helpful, but still left me unsure about exactly how the x264 encoder works with zones.

For a specific example, I am testing out encoder options with a 1080p HD movie Trailer (http://pdl.warnerbros.com/wbmovies/halfbloodprince/teaser/HP6_1080.wmv.zip). Even if the bitrate redistribution is neglible, I always like to deemphasize things like logos and credits, and put the bits somewhere more useful.

My understanding of the correct way to do this is to define the zones to be reduced, for this clip it would be --zones 0,143,b=0.80/2250,2422,b=0.80. Hopefully taking 20% of the bits from the intro/outros and putting them to better use.

Is this the correct way to do this ? Or do I need to also explicitly define the middle zone as the beneficiary for redistribution with something like --zones 0,143,b=0.80/144,2249,b=1.05/2250,2422,b=0.80 ?

I am also wondering if the correct way to use zones for a multi-pass encode to define them only in the first pass, only in the second pass, or if they can be safely defined as zone precentages in every pass.

So, my second question is if zone usage flags are cumulative on subsequest passes, if I also include the zone definitions on the nth pass of a multi-pass encode does it produce a zone multiplier like 0.80 weight * 0.80 weight = for 0.64%, or no ?

Any thoughts appreciated.

akupenguin
30th January 2009, 02:40
Any frame not explicitly part of a zone is assumed to have weight 1. Then the video as a whole is renormalized to fill your target filesize. So you do not want to specify b=1.05, that would increase the credits penalty to 25%.
It is safe to include the same zones on every pass, and it is also safe not to. Only the final pass's zones make it into the final video. But the previous passes affect bitrate prediction, so overall quality should be very slightly higher if all the passes get approximately the same zones.

random asshat
30th January 2009, 04:40
Perfect. Thanks for the informative explanations & superb encoder, too, akupenguin.