staros
4th January 2013, 04:08
On pass 1 of a 2-pass encode x264 automatically modifies the user's settings to use faster options unless the user specifies the --slow-firstpass switch. One of its modifications is to use the diamond motion search algorithm (--me dia). This targets encode speed at the expense of quality.
I was surprised to find that x264 apparently uses the analysis from the first pass to determine frame type decisions on the second pass, even if you use a different motion search algorithm for the second pass. That is, if the first pass outputs 100 I frames, 5000 P frames and 20000 B frames, you'll get the exact frame type counts for the second pass.
So say you do three 2-pass encodes: (1) uses the defaults and (2) uses --me tesa and (3) uses --slow-firstpass. This means (1) will use dia on pass 1 and hex on pass 2, (2) will use dia on pass 1 and tesa on pass 2 and (3) will use hex on both passes.
The typical result is that (1) and (2) will have the same allocation of I, P and B frames, not (1) and (3).
Is this expected? It seems sub-optimal to this layperson. Furthermore if this behavior is by design then why not instead use hex for pass 1? dia is probably not fast enough over hex to justify the quality loss.
I was surprised to find that x264 apparently uses the analysis from the first pass to determine frame type decisions on the second pass, even if you use a different motion search algorithm for the second pass. That is, if the first pass outputs 100 I frames, 5000 P frames and 20000 B frames, you'll get the exact frame type counts for the second pass.
So say you do three 2-pass encodes: (1) uses the defaults and (2) uses --me tesa and (3) uses --slow-firstpass. This means (1) will use dia on pass 1 and hex on pass 2, (2) will use dia on pass 1 and tesa on pass 2 and (3) will use hex on both passes.
The typical result is that (1) and (2) will have the same allocation of I, P and B frames, not (1) and (3).
Is this expected? It seems sub-optimal to this layperson. Furthermore if this behavior is by design then why not instead use hex for pass 1? dia is probably not fast enough over hex to justify the quality loss.