Log in

View Full Version : Single pass if target size not important?


dungweaver
3rd June 2005, 23:15
If my target device is a hard drive (HTPC or media player) do I really need two pass mode?

I've looked thru the FAQ and these forums. In the 'Oversized/Undersized explanations' thread it says "In order to achieve maximum quality for a GIVEN FILE SIZE, XviD can use a two-pass encoding." (emphasis mine)

I really don't mind if the file is (say) 10 to 15 % bigger than predicted. So can I halve my encoding time by using single pass?

edurm
4th June 2005, 16:45
You should ALWAYS use 2 pass

If you use 1 pass only you gona have very low quality results on Action (fast) frames


Make the follow test. Rip and Encode the movie "The Incredibles"


first test - use 1 pass and Aim the file size to 1200mb

Second test - use 2 pass and Aim the file size to 1000mb


You'll notice that 2 pass even with less frames/bitrate ratio is a better option.

:)

Harley Quin
4th June 2005, 17:58
Dungweaver, IMHO your emphasis is right.

Roughly speaking there are three approaches:
- 2-pass is for reaching a given file-size - or an average bitrate - which is the same for a given movie.
- single pass constant quantizer is for reaching a given average quality
- single pass at (AFAIK) constant bitrate is for streaming or live-encoding

If I want a specific quality and size doesn't matter, a single pass constant quantizer is my choice, speed- and quality-wise. Note, that a constant quantizer does not mean a constant bitrate, but a constant quality. The size of frames varies much according to their complexity even if encoded at the same quantizer.

But: A frame, may he be encoded during a single pass fixed quantizer of 2 or if second pass decides to encode this specific frame at q2, is identical. 2-pass affects quality distribution, not the quality of the encoded frame.

At least this is it for I- and P-frames (I asked myself the same question once and compared frames of a single pass and a 2-pass encoding). I do not know, if the quality of B-frames increases with 2-pass encoding, as they reference backwards and forwards and codec must know the upcoming frame to decide about the B-frame. Beats me.

Keep in mind:
1) File-size at single pass constant quantizer is difficult to predict and can vary _much_ more than 10-15%, depending on compressibility and length of each movie, so it might not be your first choice.
2) The amount of time you gain depends on your settings. If you used to do HQ encoding (e.g. MSP:6, VHQ:4) 2-pass second pass is much longer than first pass and single pass takes about as long as second pass. In that case you gain time nevertheless, but not 50%.

berrinam
4th June 2005, 23:03
Also keep in mind that in CQ mode, adaptive quantization is not possible, so although PSNR may be the same, visual quality may be reduced for the same bitrate.

dungweaver
5th June 2005, 12:14
Dungweaver, IMHO your emphasis is right.

Roughly speaking there are three approaches:
- 2-pass is for reaching a given file-size - or an average bitrate - which is the same for a given movie.
- single pass constant quantizer is for reaching a given average quality
- single pass at (AFAIK) constant bitrate is for streaming or live-encoding

<snip>



:thanks: for the excellent reply. I've done a number of tests and and very happy with :


Single Pass
Target Quantizer (QF) of 3
Sharktooths eqm_v3ulr_rev3 matrix

Source material is SD Digital TV recorded in "DVD mode"

I hadn't played with QF at all, so it was all new to me - I initally learned XviD via Gordian Knot.

This QF stuff seems to be something like this:

- Quantizer value is key to compression. Larger the QF value, smaller the file, but less quality. So, the larger the QF value, the more 'chunky' the quantization and the more fine detail can be lost. Can result in fringing and blocks; which I saw with QF of 4+

- If target is a fixed size (e.g. 1 CD or 2 CD) then you nominate that SIZE and XviD (1 or 2 pass) adjusts QF values to try and achieve that size. Bitrate is constant (?); QF varies throughout file.

2nd pass better distributes this adjustment via stats obtained in pass 1.

- If target size isn't that important then setting a constant QF and single pass seems to give acceptable results. So QF constant, but Bitrate changes (?)

About right?