PDA

View Full Version : Weird 2nd pass - totally different results with 1st pass @ Q2 & Q3 (?!?)


HeadBangeR77
6th March 2007, 00:26
This has either happened to me for the first time or I wasn't on place to observe such a weird behaviour before (who would like to sit and stare at XviD statistics window?)...

I was doing some sample encodes at high bitrates using the following codec and software:
XviD 1.1.2 Koepi's build
VirtualDub 1.7.1
CQMs: Didee's SixOfNine, Heini's "SixOfNine"
testing "hybrid" first pass settings (results here (http://forum.doom9.org/showthread.php?p=966131#post966131)).

After I had finished that, I wanted to check how much influence could first pass at Q3 verse Q2 have on the 2nd pass encode. I didn't expect any difference, since final encodes' average quantizer was about 3.40-3.50 for both matrices. For Didee's matrix the results were more or less the same, including quantizers distribution (the main issue here, you'll see!).
With Heini's matrix however I got some very weird results (!):

1) 1st pass at Q2 - average Q 2.48, 8584 kbps;
and the following 2nd pass: average Q 3.45, I-frames 2.93, P-frames 2.89, B-frames 4.06, bitrate 4863 kbps (about 1MB undersize - never an issue with Didee's matrix).

At the beginning was a rather dark scene, where (despite of applied CC) I was getting some P-4s and B-5s & 6es. This had not happened with Didee's CQM - because of high bitrate I had got P-2s and P-3s, and B-3s & 4s accordingly throughout the whole sample (avg. 2nd pass Q 3.34).

2) 1st pass at Q3 - average Q 3.47, bitrate 4837 kbps;
and the following 2nd pass (running again to check twice, I will add more info later) wasn't undersized at all!
Update: final bitrate of 4877 kbps (I lowered it a bit for the repeated 2nd pass to get similar file size as the previous encode, so that I could compare them) hit the target very well. Quantizers: 3.43 average, I 2.70, P 2.99, B 3.93 (doesn't it seem a bit unusual to you?).

As to quantizers distribution: the opening dark scene reminded the distribution from the encodes with Didee's matrix (remember, there was not such a difference in distribution depending on the first pass quantizer there!). I wasn't getting B-5s & 6es any more. May sound cool, but ... I was getting P-4s! (happened in the next samples as well, some B5s were present, but in other scenes, where they didn't harm too much, but there was really not much of them).

I'm going insane, 'cause I can't understand all those issues:

- I never get such an undersize (Ad.1) with other CQMs, even when the 1st pass is done at Q2; seems specific for Heini's matrix (?!?). Shouldn't overflow treatment take control of that however, if it can take control of the 2nd pass in a case where 1st pass bitrate < 2nd pass bitrate (Ad.2)???

- What's so magic about first pass at @3 with Heini's CQM that makes quantizers distribution so much better, while it wasn't the case with Didee's SixOfNine? I didn't change CC or overflow control. All options remained the same.

- I'm really happy I managed to get quantizers so well distributed in the opening dark scene with Heini's, but how on earth can a codec generate P-4s without generating a single B-5 or B-6? (at least in that problematic scene). It may happen with better B-frames settings like 2/1.50/00 or 2/1.00/1.00, but that had never happened before with 2/1.62/00! Is it overflow treatment? Curve compression perhaps? If so, why didn't it work for the previous encode (1st pass at Q2)? Avg. P Q @ 2.99 and Avg. B Q @ 3.93??? Not that I'm not happy with such results, but they stay in contradiction to what I've observed until now (avg. B Q is usually a bit higher than avg. P Q, even at such a high quality level - e.g. with Didee's CQM I got 2.79 for P-frames and 3.96 for B-frames).

If someone, anyone could enlighten me, I would be very much obliged ...

cheers,
HDBR77 banging his 30-year old head against the wall :confused:

PS. Some additional info: CC 15/7, Overflow treatment 0/8/4.

Sharro
9th March 2007, 15:21
Could you tell me what was Bvop sensivity ? I'll try to reproduce your results.

All the best,

Sharro

HeadBangeR77
9th March 2007, 20:02
Hi! 1st pass as in the other thread, 2nd pass with all the goodies on (MSP=6, VHQ=4, VHQ on B-frames, QPEL, Chroma ME etc.). You've got the overflow and curve compression settings, so what is left are B-frames, exactly: 2/1.62/00 (it had been before I started testing different B-frames scenarios ;)), sensitivity 0 (at default).

"B-frames Q < P-frames Q + 1" is typical for better B-frames settings, as you may see in the other thread, and curve compression has also an influence on that (since B-frames are the smallest frames in size, the bits flow from Is and Ps to them). It's valid for both Didee's and Heini's 6of9 (so assume for other matrices as well), yet not with B2/1.62/00. :confused:

Thanks in advance (gracias)