[MEncoder-users] CRF vs. 2-pass (was: Tuning hqdn3d)

Andrew Berg bahamutzero8825 at gmail.com
Wed May 20 06:11:18 CEST 2009


James Hastings-Trew wrote:
> However, you have to know that this isn't optimal - you certainly will 
> be spending bits you don't need to on scenes that don't need them, and 
> not spending bits on scenes that do. The only way to have the bits 
> distributed optimally, all other things being equal, is a 2-pass encode 
> because the encoder needs knowledge of the whole movie to be able to 
> make those decisions.
How exactly does x264 use the information gathered in the first pass to
distribute bits in a manner that is more optimal than CRF? As far as I
can tell, that information is used for little, if anything at all, more
than to ensure an average bitrate. And wouldn't it use a calculated rate
factor to achieve constant quality anyway? If any of this is wrong,
correct me, but I don't think I'm far off.
> > Target bitrate is definitely not the way to go: you can whine all you want
> > that it is not possible to predict the size of a constant-quality encoding,
> > but the reverse is also true: you can not predict the quality of a
> > target-bitrate encoding either. That makes 1-1, ball to the center.
> >   
> Not really. The encoder is not going to spend bits it doesn't need to. I 
> can ask for a bitrate of 12000 but if the movie only needs 6000 to get 
> the job done with the encoder features I've requested, then that's all 
> that is going to get used. And a two pass encode ensures that exactly 
> only the bits I need to spend for the quality I want are going to get 
> used up.
Even if 2-pass really is more efficient at distributing bits, there is
still no way to accurately predict quality without doing at least the
first pass. You didn't rebut the statement; you just repeated yourself.
> Everything is a trade-off - surely you understand that you are 
> trading speed for something - filesize or quality, or both, right? 
> Nothing is free. You can have Quality, Speed, and Small File Size 
> (Compression) - but you can only pick two.
>   
The trade-off is this:

With 2-pass, you can specify the average bitrate, but not the quality.
With CRF, you can specify the quality, but not the average bitrate.


More information about the MEncoder-users mailing list