Log in

View Full Version : "Hybrid" 1st pass - questions and thoughts concerning its advantages


HeadBangeR77
13th February 2007, 22:39
Hail all the gurus! ;)

I've recently observed many basic questions asked in this forum: for some of them the answer should be "use search", but some are more complicated, and all the guides and FAQs either here on Doom9 or in the web seem to be outdated. Many of them don't go into details, like: "I don't see a reason to touch overflow treatment", or "leave it at default" - yeah, sure, but why? How it works? Using search usually throws hundreds of posts, and some just don't see any sense in scanning all the results for one particular information. Therefore we explain (if we feel like helping) for the nth time, how the B-frames work, how they are limited and calculated in the 2nd pass, or what a curve compression is and how it works. Btw. almost all guides concentrate on 2-pass encodes, and many newbies simply don't understand the difference. I haven't launched this thread to discuss all of this, but just the first pass settings, that might also be confusing, since they are confusing even for me (I consider myself an educated amateur, or a hobbyist ;)).

1) Fast first pass
The fast first pass runs at quantizer 2 (or am I wrong, haven't used it for a long time :P) with some advanced options turned off, since its main goal is to gather statistics for the 2nd pass.
Provided we've set the first pass exactly the same way as the 2nd one, as usually recommended in guides (with fast first pass in mind), then what options are exactly turned off during the 1st run?
Is it Qpel (I think so, but I don't know)? VHQ? Chroma ME? What is the MSP then?

2) Full-quality 1st pass
Full quality first pass runs with all the goodies of the 2nd pass turned on, I assume (never tried, I haven't had such a need), provided we have activated them. Does it aim at some quality level, such as constant quantizer, or does aim at the desired file size/bitrate, already in the 1st run? Since in both cases (1 and 2) the recommended setting is "weight 1.0" (apart from credits & other zones, but that's another story), how do we know?
I really like the straight way some newbies ask questions, provided they're asking for reasons. And sometimes I can't explain those reasons clearly, since I haven't got a clue myself.

3) "Hybrid" first pass
Teegedeck has created some really good presets quality-wise, yet some explanations are lost among various posts in the working thread, or are simply missing, unless I'm blind (or tired, or both). So here are some questions and thoughts (including my experiences) concerning the 1st pass, which I call "hybrid", since it should be a compromise between the fast first pass (1) and the full-quality one (2). Please keep in mind I don't want to modify the current presets, but I would like to share experience and clear some things, if it's possible.

With the current presets we turn off or milden some settings to make the 1st pass faster. How much does it differ from the fast first pass? (we need to know the exact answer to No 1, to answer this). Could it be that the most important difference is the recommended quantizer 3?

I understand the idea, which lies behind this: the smaller the difference between 1st pass bitrate and the average quantizer and the 2nd pass bitrate and its avg. quantizer, the better the quality for the 2nd pass. Doesn't it mean, that the codec doesn't have to make any complicated decisions in the 2nd run then, just cosmetic ones? Imho it depends on the 2nd pass bitrate, if you know how big the difference will be, more or less. I've already encoded 2-passes with Q2 in the 1st one, because Q3 would give me lower bitrate than the one of the 2nd pass. It doesn't happen too often, I'm aware of the fact, but when we near the boarder between two presets and decide to encode with the lower one, then the difference between the 1st and the 2nd pass gets smaller. What statistics does the codec have then? Basing on constant quantizer 3 probably less accurate than those based on quantizer 2.

There's a huge difference for many matrices (the stronger ones, the smaller, but I can see it even with Didee's SixOfNine, yet I'm a freak :p) between Q2 and Q3, and I don't think that gathering statistics with quantizer 3 at the beginning is a good idea in some cases. I would rather trust the codec's capabilities and decisions it makes in the 2nd run. If our first run would be Q 2.5X, and the 2nd > Q4.50/5.00, then it shouldn't matter, and I find Q3 for the first pass a good idea. However, if the 2nd pass ends with an average quantizer within 3.50-4.00 limits, shouldn't the codec have more accurate information (statistics) to deal with? Remember, we change matrices, so average quantizers for each pre-set could be similar (depends on the compressibility).

The last question (hope at least one person will last to the end ;)): Does XviD analyse the source in the 2nd pass with help of the statistics from the 1st, or does it rely on them entirely, and only "thinks" how to compress the material more? The answer to this question is essential imo for the previous one.

Thanks for patience. ;)

cheers,
HDBR77

Blue_MiSfit
14th February 2007, 06:22
I don't think that gathering statistics with quantizer 3 at the beginning is a good idea in some cases


I totally agree - if you aim for transparency. If you're doing a higher compression run where the average P-frame quantizer will be high (by my definition over 4 or so) then doing the first pass at cq3 instead of cq2 should help out.

I usually go for very high bitrates - 1/4 to 1/2 DVD+R per movie with AC3 audio in most instances (and have been using x264 a lot more recently also) so in my case this is usually not needed.

~MiSfit

Teegedeck
14th February 2007, 07:44
Just a short notice that I've read this; unfortunately I'll be away for a couple of hours now.

Just briefly - first pass shouldn't give you (considerably) smaller predictions than the 2nd-pass filesize because 2nd pass is limited to min.quant.=3 except for the 90% preset, isn't it?

HeadBangeR77
14th February 2007, 13:42
Glad someone has read my nightly mumbling. ;)

@ MiSfit
The question still remains, if the codec bases on statistics from the 1st pass entirely or just uses them as some kind of hints. If the latter is true, then setting Q3 in the 1st run wouldn't harm the quality (still talking about high quality rips - like your example: an avg. P-frames-quantizer <4, or like I mentioned an avg. all-frames-quantizer <5). If we knew the answer (and the answer to No 1 from my main post), we could generalize more, and probably add the matter to some kind of guide. Atm everything is based on our experience & intuition.

If I decide to go for high transparency, I even turn on Qpel and VHQ on B-frames in the 1st run, though it makes my first pass nearer to the full quality one (yet it's still a slow hybrid, since the rest remains as in the presets).

HeadBangeR77
14th February 2007, 13:56
Just a short notice that I've read this; unfortunately I'll be away for a couple of hours now.
Glad you've read it. :)

Just briefly - first pass shouldn't give you (considerably) smaller predictions than the 2nd-pass filesize because 2nd pass is limited to min.quant.=3 except for the 90% preset, isn't it?
As I said, I'm not trying to modify the presets, but I use them with modifications for my own needs. ;) When I resize (e.g. to 688x288, 720x304), I'm very often left with compressibility check at about 80-85%. In such cases I set: Q2 for the 1st pass, and the minimum quantizer for all frames at 2, for the 2nd pass. Using some curve compression (not too strong) I often get 2-3-3, 2-3-2-3 and similar patterns in low-motion dark scenes (B-frames 2/1.62/0), and they really look better.

Similar things happen when the comp. check results in about 60-65%, and I decide to use Heini's MR instead of Didee's SixOfNine. Btw. the only thing I would change in the presets, if I may just suggest or open the discussion on the matter, is changing the matrix for the 58% Fast form Didee's to e.g. Soulhunter's V3 or Heini's MR. There's a huge gap, unfortunately, between those two matrices (I would call them middle-high bitrate) and matrices like Didee's SixOfNine or Heini's. I haven't tested any that would fit in between.

To give real examples: 2-2.5 hour film, 16:9 widescreen, resized, 3CD rip => video + mp3 does well with Didee's matrix, video + AC3 does better imho with Heini's MR.

Plz consider the above as some loose thoughts. ;)

cheers,
HDBR77

unskinnyboy
14th February 2007, 17:18
what options are exactly turned off during the 1st run?
Is it Qpel (I think so, but I don't know)? VHQ? Chroma ME? What is the MSP then?

Asked and answered before. http://forum.doom9.org/showthread.php?p=884869#post884869


However, if the 2nd pass ends with an average quantizer within 3.50-4.00 limits, shouldn't the codec have more accurate information (statistics) to deal with? If your average quantizer at the end of the 2nd pass is 3.5-4.0, and if your 1st pass quantizer was 2, then there has been a lot of variations in the quantizer values and whatever adjustments were made in the 2nd pass would probably be less accurate than if the 1st pass quantizer was 3. In this case, it's better that you redo both the passes with the first pass quantizer set to 3. Were you agreeing to this?

And in 2nd pass, AFAIK, no more analysis of the source is done. It is just encoding based on the information gathered by the 1st pass (basically frame types, intra blocks, inter blocks etc). Which is why it's important that you get the 1st pass right.

HeadBangeR77
14th February 2007, 18:39
Asked and answered before. http://forum.doom9.org/showthread.php?p=884869#post884869
Thanks, mate. That's one of the cases I've described above in that sort of introduction at the beginning. No FAQ/guide contains an answer, and searching has given me round 500 results full of junk. Apart from that, Syskin himself was needed to answer the question precisely, since nobody else could at the time.

*** Just talking to myself ;) ***
Ad. 1) Fast first pass
Motion search precision 1-4 (it's all the same) (?!)
VHQ completely off
Chroma motion estimation off
QPEL and GMC (anyone uses it? ;)) both off
Turbo or most of turbo (turbo is several flags put together) on
Trellis off
And high precision AC/DC (I'm on a highway to hell :D) prediction off, something you can't do with VfW GUI (?!)

What's left is the setting of B-frames, and that's all. Now it's clear, apart from the two points I marked with "(?!)".

***

If your average quantizer at the end of the 2nd pass is 3.5-4.0, and if your 1st pass quantizer was 2, then there has been a lot of variations in the quantizer values and whatever adjustments were made in the 2nd pass would probably be less accurate than if the 1st pass quantizer was 3. In this case, it's better that you redo both the passes with the first pass quantizer set to 3. Were you agreeing to this?
Not entirely. :D
1st pass is usually sth about 2.5X, so if the 2nd pass is about 3.50-4.00, then the difference isn't that huge. Just by using very moderate CC (like 15/6) I get P-frames Q2 and B-frames Q3 in the scenes, in which the codec is known to behave the worst. Doing the first pass at Q3 and limiting the minimum for all frames (maybe besides I-frames) to 3, would give me worse results in these places imo.
Isn't the (much) higher precision in the 2nd run meant exactly for such cases? What do we need the higher 2nd pass precision then for?
If 1st pass avg. Q=3.5X, and 2nd pass avg. Q=3.50-4.00, then why is the codec sweating so much in the 2nd pass?

In cases of larger difference between the two passes I agree without questioning, and that's the case usually (since presets must remain some sort of generalization, Q3 for the first pass is entirely proper imo).


And in 2nd pass, AFAIK, no more analysis of the source is done. It is just encoding based on the information gathered by the 1st pass (basically frame types, intra blocks, inter blocks etc). Which is why it's important that you get the 1st pass right.
Thanks very much for clearing that.
I assume, if we leave the first pass quantizer-issue out, that turning on Qpel in the first pass will result in a tad higher precision then? If I were a hypocrite I would say that metrics show better results then, but since I don't trust metrics too much, I'm asking. ;)

cheers,
HDBR77

Teegedeck
14th February 2007, 18:44
Glad you've read it. :)
I understand the idea, which lies behind this: the smaller the difference between 1st pass bitrate and the average quantizer and the 2nd pass bitrate and its avg. quantizer, the better the quality for the 2nd pass. Doesn't it mean, that the codec doesn't have to make any complicated decisions in the 2nd run then, just cosmetic ones?Not at all. Only frame-type and quantizer (2, 3, 4...) is decided based upon first-pass data. That's why activating VHQ=1 is important for the first pass (decision on frame-type) and that's why it is important to use settings in first pass which produce similar filesizes as the the settings used in second pass. But apart from that, the first pass can produce a quality as crappy as it wants to and be as fast as possible. You see, QPel, VHQ=4 etc. in second pass enhances quality in 2nd pass but it hardly influences filesize.

All we need to from the first pass are a reliable prediction upon filesize and a good decision on frame-type (p-frame or b-frame), nothing else.

The last question (hope at least one person will last to the end ): Does XviD analyse the source in the 2nd pass with help of the statistics from the 1st, or does it rely on them entirely, and only "thinks" how to compress the material more? The answer to this question is essential imo for the previous one.As said before, it only uses first pass data to decide on frametype and quantizer.

When I resize (e.g. to 688x288, 720x304), I'm very often left with compressibility check at about 80-85%. In such cases I set: Q2 for the 1st pass, and the minimum quantizer for all frames at 2, for the 2nd pass.
Well, why do you use such ridiculously low resolutions? :) The 'right' thing to do would be to up resolution, not to use quant=2. The difference between SixOfNine at quant=2 and quant=3 is hard to detect, but the difference between an anamorphic and a non-anamorphic encoding is well detectable.

Similar things happen when the comp. check results in about 60-65%, and I decide to use Heini's MR instead of Didee's SixOfNine.
As I said, I'm not trying to modify the presets, but I use them with modifications for my own needs.Heh. You have a liberal interpretation of 'not modifying'. ;)

Btw. the only thing I would change in the presets, if I may just suggest or open the discussion on the matter, is changing the matrix for the 58% Fast form Didee's to e.g. Soulhunter's V3 or Heini's MR. There's a huge gap, unfortunately, between those two matrices (I would call them middle-high bitrate) and matrices like Didee's SixOfNine or Heini's. I haven't tested any that would fit in between. Hm. Could you elaborate a bit more on that? Do you mean a 'huge gap' quality-wise or in filesize?

HeadBangeR77
14th February 2007, 19:13
First of all - thanks very much for clearing things. :)

As to frame types (consider it OT, since it isn't a codec-specific thing), I've marked using some slightly different plug-ins and filters changes B and P quite often, so it's hard to compare still frames. For instance using fft3dgpu and fft3dfilter with almost identical values (apart from block overlapping) changes codec's decision quite often. Only some P-frames are the same, usually all I-frames, and the places when very quick movement makes 2 consecutive B-frames obsolete, we usually get patterns like P-P-P or P-B-P-B.


Well, why do you use such ridiculously low resolutions? :) The 'right' thing to do would be to up resolution, not to use quant=2. The difference between SixOfNine at quant=2 and quant=3 is hard to detect, but the difference between an anamorphic and a non-anamorphic encoding is well detectable.
Mostly for some NTSC 16:9 wide-screen (2.35/2.40:1) sources I have - the difference in the resolution is negligible then, so I prefer a bit higher quantizers to a bit higher resolution. With some favourite films I can sacrifice as much space as I can and usually encode at the width of my full screen (sort of "Soulhunter's style" ;)), while doing backups (like DVD-9 to DVD-5). I can't see much difference with my CRT at 1024x768, but I can with my notebook's wide screen 15.1'.

Heh. You have a liberal interpretation of 'not modifying'. ;)
:D
I didn't express myself precisely. I didn't want that you think it was sort of suggestion to make some changes in your presets, since they are used by many. I feel free to modify some things for my own use. ;)

Hm. Could you elaborate a bit more on that? Do you mean a 'huge gap' quality-wise or in filesize?
Compressibility and quality at constant quantizer. Ever done some 1-pass samples? Imho Soulhunter's V3 and Heini's MR are a bit better quality-wise than Sharktooth's V3 HR, while Didee's SixOfNine or Heini's are way less compressable and deliver much higher quality. Haven't you mark there's a huge choice of different matrices for your lower pre-sets, while a rather limited choice for stronger ones?
There's one difference between Q2 and Q3 with Didee's one: grain. :D All the rest remains almost identical, invisible difference with clean sources, yet grain disappears auto-magically.

cheers,
HDBR77

PS. @ Unskinnyboy: AC/DC comes from "alternating current" /"direct current", without any religious background. It's up to you how you interpret this. :D

unskinnyboy
14th February 2007, 21:20
Motion search precision 1-4 (it's all the same) (?!)1-3 is identical (don't ask). 4 is 1/2/3 plus a sub-pel refine step, and hence better.

And high precision AC/DC (I'm on a highway to hell :D) prediction off, something you can't do with VfW GUI (?!)It's not AC/DC, but just AC and sorry to take away the fun, but it just means "Actual Coefficients" and not "Anti Christ". This is a seldom known or talked about VOP flag (probably because it's not in VfW), but it is a bitrate saving option which reduces the filesize ever so slightly by calculating the actual coefficient costs. Not a lot, but useful. Accessible via encraw though (the -hqacp option).

Sharro
15th February 2007, 14:11
...

There's one difference between Q2 and Q3 with Didee's one: grain. :D All the rest remains almost identical, invisible difference with clean sources, yet grain disappears auto-magically.

cheers,
HDBR77



Hi Guys,

I'll follow this thread closely.

As I've recently got in presets, cqms and first pass after many years using the same CQM and resized encodes and now moving to anamorphic encoding. I did a lot of testing recently as far as high and medium high bitrate is concerned.

No metrics were involved but I have to agree with HDBR77 (ufff glad he made the nick shorter :)). There is more grain retention with Didee's 6o9 at Q2 than Q3 and either my eyes trick me or Heini's 6o9 still does better than Didee's on this.

My eyes also prefer Soulhunter's V3 over HeiniMr and Sharktooth V3 (in order of preference) for the middle bitrates.

My encodes at this moment are being aimed at 2700Mb with AC3 audio included (about 2300Mb for video) with bitrates around 2.300Kbps.

Just my cents.

All the best,

Sharro

Sharro
15th February 2007, 22:43
Guys,

Most of you will have some ideas on how we could test all (well it's still only 1 page but ...who knows where it will end :)) the talk going here (hybrid, presets, quants, cqm's).

Without loosing the aim of QUALITY (yes...I forget the SA compatibility) couldn't we just thrill a little bit testing ideas, I believe and hope something good could come out of this.

I have to confess that everything is too quiet.

Teegedeck :rolleyes: ?

A test ?

Something ?

What should we start testing ?

Min Quant 3 or 2 ? (I have a platonic love for Q2)
The CQM's ?

Teegedeck ? :rolleyes: Would you be into it ?

Can we get Syskin (The Little Rare Bird living in my Antipodes) help in here ? Where is he ?

Uffff...

Something fun ?

After almost 2 years without encoding there isn't anything else to do ?

All the best :),

Sharro

HeadBangeR77
28th February 2007, 02:26
@ Sharro :)

I'm pleasantly surprised by your enthusiasm, but I think this thread is too specific to get busy with all the things you've mentioned (I would still like to hear you opinion on CQMs and SAP-compatibility, since Sagittaire can't /or don't want to see any problem on this field, and I personally think it's the main problem, since we don't want to touch e.g. B-frames in SAP-friendly presets, if they ever come to existence - ufff, OT like hell* :D).

@ Every helpful soul around here:
Since most of my vague assumptions, resulting from too less experience and lack of technical knowledge, have already been cleared (thanks to Teegedeck and unskinnyboy), I've got the most noobish of questions: Is full quality first pass identical in terms of MSP, VHQ, QPEL etc. to the 2nd pass (if both are set identically, as in most guides)? If so, is it also supposed only to gather statistics as to frames type and size? If so, does make any sense to use it for e.g. 1% gain in quality? Or is it done with "weight" parameter and performs totally different to what I think?

thanks in advance & good night
HDBR77


* unskinnyboy - there's no religious background in the "hell" used in this context, and apart from that different conceptions of it had existed long before Christ was born.

Didée
28th February 2007, 21:59
Is full quality first pass identical in terms of MSP, VHQ, QPEL etc. to the 2nd pass (if both are set identically, as in most guides)?
Yes, exactly. Whatever quality settings are specified, they will be used. "Full quality 1st" won't cheat even so slightly.

If so, is it also supposed only to gather statistics as to frames type and size?
The original idea behind "full-Q 1st" was that you can just use it as "final encode", for those cases where the 1st pass happens to be small enough, so that a 2nd pass isn't needed at all.
If a fast 1st pass is small enough, then the quality is worse than it could've been, and/or the file even might be incompliant.

If so, does make any sense to use it for e.g. 1% gain in quality?
Some would kill for 0.01% gain! :D
It's questionable if it's of much practical sense. From the theroretical aspect, I'm not a big friend of the "normal" fast 1st pass, mostly because of the frametype decision. (P/B-frame decision is done during 1st pass, 2nd pass just reuses the frametype of the 1st pass. Depending on the differences in used features between fast/full, the decisions of a fast 1st pass might be worse.)
Also, when the final encode is done with qpel, I don't like to have the 1st pass done without qpel. While there's usually not a big difference in overall filesize of the 1st pass with or without qpel, it can make a worthwhile difference during certain scenes ... in those scenes where the size difference with/without qpel is rather big, the size/quantizer prediction 1st->2nd will be off, rate control starts to sweat, and in the end the scene is harmed.

HeadBangeR77
1st March 2007, 01:04
Yes, exactly. Whatever quality settings are specified, they will be used. "Full quality 1st" won't cheat even so slightly.
First of all, thank you for clarifying things (since there isn't much going on in the XviD sub-forum I wasn't expecting such a quick answer ;)). When I've gathered all the info together, I will have everything I ever wanted to know about fast /hybrid /full quality 1st pass (I'm not planning to write a guide or sth, but it might be of some use for others, packed together in one thread).

The original idea behind "full-Q 1st" was that you can just use it as "final encode", for those cases where the 1st pass happens to be small enough, so that a 2nd pass isn't needed at all...
So instead of gathering statistics (as to frames type and size), like it is the case with fast/hybrid first pass, it tries to reach the desired file size, as entered manually (or via front-end /GUI) for the 2nd pass, doesn't it? Provided that, it forces the codec to make all the decisions that would normally be made during the 2nd run, so in such a case the 2nd pass is rather cosmetic?

From the theoretical aspect, I'm not a big friend of the "normal" fast 1st pass, mostly because of the frametype decision. (P/B-frame decision is done during 1st pass, 2nd pass just reuses the frametype of the 1st pass. Depending on the differences in used features between fast/full, the decisions of a fast 1st pass might be worse.)
What do you use then as a rule? The hybrid one, as in the presets?

Also, when the final encode is done with qpel, I don't like to have the 1st pass done without qpel. While there's usually not a big difference in overall filesize of the 1st pass with or without qpel, it can make a worthwhile difference during certain scenes ... in those scenes where the size difference with/without qpel is rather big, the size/quantizer prediction 1st->2nd will be off, rate control starts to sweat, and in the end the scene is harmed.
That's what I always do (rather intentionally, but for sure not blindly, since I would have to follow someone's directions then :p). Lower MSP, lower VHQ, but I keep QPEL for the 1st hybrid pass (provided I'm gonna use it in the 2nd) - like in my 2nd post here. Following yours and Teegedeck's tips, I assume VHQ (in general) and QPEL (from the reasons mentioned above) are important in the 1st hybrid pass. Does it make any sense to turn on VHQ on B-frames then (I don't know the speed impact, but for sure it's smaller than that caused by QPEL)?

Thanks again,
HDBR77

Didée
1st March 2007, 01:58
The original idea behind "full-Q 1st" was that you can just use it as "final encode", for those cases where the 1st pass happens to be small enough, so that a 2nd pass isn't needed at all...

So instead of gathering statistics (as to frames type and size), like it is the case with fast/hybrid first pass, it tries to reach the desired file size, as entered manually (or via front-end /GUI) for the 2nd pass, doesn't it?

No. Full-1st doesn't try to reach a certain size. It just encodes with I/P=q2 (unless changed in zones).
The typical case is/was for 2- or 3-CD encodes ... simple reasoning: You want to reach a filesize to fill 2 or 3 CDs. That's a fixed target, so you start with a 2-pass scenario, since you don't know beforehand what filesize you'll get with any quant. That's what 2-pass is for. But if it just happens that the 1st pass comes out at a usable size already, why run a 2nd one. Just compliant the 1st should be, in this case, and not have used "visually crappy" settings.


What do you use then as a rule? The hybrid one, as in the presets?

Not exactly like in the presets, but pretty similar.
(I got used to this "hybrid" style of 2-pass coding ages before there were those presets .. :D )


Following yours and Teegedeck's tips, I assume VHQ (in general) and QPEL (from the reasons mentioned above) are important in the 1st hybrid pass.
VHQ definetly. Regarding qpel, opinions are different. It's not "a must" for good results. When in a hurry, me too will do the 1st without qpel. ;)


Does it make any sense to turn on VHQ on B-frames then
For the 1st, no. Size differences (coded frame sizes of B frames) due to B-VHQ are so minor that it's a non-issue. And anything else related to B-VHQ during 1st pass is a non-issue too. No influence for 2nd pass. Same for chroma motion search.

Sharro
1st March 2007, 10:40
Didée good to see you here :) !

I'm always using in 1st pass the settings I use in the 2nd pass :p

As far as VHQ and MSP will using lower settings (for example, MSP=4, VHQ=3) have a significant impact on P/B frame decision of first pass ?

I assume that you use Q2 on first pass Didée, don't you ?

All the best,

Sharro

Sharro
1st March 2007, 20:12
I've been seeking for some help for my question on #xvid at freenode.

So I'll quote here what I've "learned":

Manao> {#xvid} Sharro: Didee says so :D

<prunedtree> it's content dependant anyway
<prunedtree> btw, in practice, stay with msp=6 ... iirc anything else isn't much faster but drop quality a lot
<prunedtree> vhq=1 vs vhq=4 makes sense ... it shouldn't affect p/b decision much, it's for local RD searches anyway
<Sharro> So in terms of P/B decision lowering MSP will affect P/B decision ?
<prunedtree> potentially, yes
<prunedtree> msp is basically the search effort. it's almost meaningless because it's optimised only for msp=6

All the best,

Sharro

HeadBangeR77
2nd March 2007, 14:16
No. Full-1st doesn't try to reach a certain size. It just encodes with I/P=q2 (unless changed in zones).
So assuming we haven't changed the 1st pass quantizer in zones (the default is the greyed out "weight 1.0" then, although it runs at Q2), we could run into the same trap as with fast first pass:
If the 1st pass average Q is much lower than the 2nd pass avg. Q, the prediction will be imprecise (though more precise than with the fast one, due to higher MSP, VHQ, eventually QPEL etc.).

The typical case is/was for 2- or 3-CD encodes ... simple reasoning: You want to reach a filesize to fill 2 or 3 CDs. That's a fixed target, so you start with a 2-pass scenario, since you don't know beforehand what filesize you'll get with any quant. That's what 2-pass is for. But if it just happens that the 1st pass comes out at a usable size already, why run a 2nd one. Just compliant the 1st should be, in this case, and not have used "visually crappy" settings.
Now I get it, thanks a lot. I also understand much better now, why "it's questionable if it's of much practical sense." It's really hard to imagine such an encode (unless with much downsized resolution), that would fit our needs with an average quantizer near 2.50, even with standard quantization. From my POV it's completely impractical then, since I haven't used anything below your 6of9 HVS over the last month. :D


Not exactly like in the presets, but pretty similar.
(I got used to this "hybrid" style of 2-pass coding ages before there were those presets .. :D )
I can imagine, considering the time when the presets were put together. ;)
Could you reveal your settings (depending on different real life content), or will they remain shrouded in mystery? ;)


For the 1st, no. Size differences (coded frame sizes of B frames) due to B-VHQ are so minor that it's a non-issue. And anything else related to B-VHQ during 1st pass is a non-issue too. No influence for 2nd pass. Same for chroma motion search.
I see. Since B-frames are constructed on the basis of the two nearest neighbouring P-frames, VHQ on the latter ones does the job as a rule. And chroma motion is used to enhance motion vectors, so it does make sense in the 2nd run only, or am I wrong?

No I will look at what Sharro has managed to get. ;)
ta,
HDBR77

HeadBangeR77
2nd March 2007, 16:20
I've been seeking for some help for my question on #xvid at freenode.
So I'll quote here what I've "learned":
Thanks for the effort and the information. :)

(...)
<prunedtree> it's content dependant anyway
<prunedtree> btw, in practice, stay with msp=6 ... iirc anything else isn't much faster but drop quality a lot
Was it meant for both passes, or just for the 2nd pass?
Anyway, I've just revised my 1st pass standard settings (MPS=5, VHQ=1, VHQ for B-frames, Chroma ME, QPEL, Turbo), and I'm gonna compare them with, let's say: MPS=6, VHQ=1, QPEL, Turbo(!?). Speed does matter here, 'cause my first pass was running with 3-4 fps with the previous settings already (I call it crawling, Didee would say simply "rather slow" or sth' similar :p). I'm gonna watch the samples then, take screen grabs , and use metrics as well, in this particular case.

As to 2nd pass (which is not the main object of discussion here), I must agree as to MPS and VHQ. Just finished my VHQ1, VHQ3, VHQ4 samples (rather long ones): the higher the VHQ the better quality visible while watching (just a bit), rather significant difference in metrics and lower quantizers according to XviD's stats-window (with the same file size!).

Like:
1) VHQ1: I 2.82, P 2.99, B 4.13, average 3.52, bitrate 4839 kbps
2) VHQ3: I 2.82, P 2.93, B 4.07, average 3.47, bitrate 4836 kbps
3) VHQ4: I 2.82, P 2.91, B 4.06, average 3.46, bitrate 4836 kbps

The rest: all the goodies on, 1st pass at Q2 with my previous typical settings, trellis always on for both passes.

And now I've got to say sorry to myself for the OT. :D
However I've found the above results rather interesting and just wanted to share.

cheers,
HDBR77

PS. 1st pass without VHQ on B-frames and Chroma ME, but with MSP=6 instead of 5 seems to be faster a bit.

Sharro
2nd March 2007, 19:43
Thanks for the effort and the information. :)

Always a pleasure!


Was it meant for both passes, or just for the 2nd pass?


For both, but specially on 1st pass it will affect P/B decision.


Anyway, I've just revised my 1st pass standard settings
... compare them with, let's say: MPS=6, VHQ=1, QPEL, Turbo(!?)


MSP=6 definetly :)

I'm doing similar tests, 100% Tegedeck 90HQ preset against MSP=6; VHQ=4




... lower quantizers according to XviD's stats-window (with the same file size!).


Same here.!



...1st pass at Q2 ...


My impression or the filesize of the second pass is more precise with Q2 on first pass than with Q3 as in presets ?

I haven't looked at speeds.

All the best,

Sharro

HeadBangeR77
3rd March 2007, 00:12
For both, but specially on 1st pass it will affect P/B decision.
We must separate 1st pass (the main topic here) and the 2nd one, or write more precisely. Did you mean MSP and VHQ for both passes, or just MSP? What I would like to know or check (though I'm testing now all the time, yet a bit different things), is the influence of VHQ values higher than 1 (the recommended) on the P/B decisions in the first pass.

Update:
I've just reread your posts, and marked what Manao had said:
vhq=1 vs vhq=4 makes sense ... it shouldn't affect p/b decision much, it's for local RD searches anyway
I know it makes sense for the 2nd pass (I've just finished taking metrics), but since it shouldn't affect p/b decision much, and the speed impact is significant, I think I will stay with VHQ=1 for the first pass.

As to MSP: the speed impact between MSP=5 and MSP=6 is mariginal (it's true MSP=6 is very well optimized), so if there's any potential quality gain (due to better frame type decisions), I'm gonna use MSP=6 in the 1st run. :)

I'm doing similar tests, 100% Tegedeck 90HQ preset against MSP=6; VHQ=4
You mean the 1st pass? Ayay, if this is the case, that's what I would like to know. Could you check:

MSP=5, VHQ=1, Turbo, No QPEL (presets)

verse

MSP=6, VHQ=1/2/3/4, Turbo (?), QPEL

??? Pretty please. :D
Turbo affects only QPEL and B-frames, so I think it could be left in for the first pass. However, since you normally do the 1st run with exactly the same settings as the 2nd one, you could uncheck it then. ;)

!!!
As to my small statistics with different VHQ values: plz remember I kept the same settings (my old ones) for the 1st pass for all of them (MSP=5, VHQ=1, VHQ for B-fames, Chroma ME, QPEL, Turbo - that's what I normally use to generate "quick" 1-pass samples while testing different filters/scripts/plug-ins). All the differences in quantizers result therefore from the VHQ values in the 2nd pass.
I'm testing some settings in the 1st pass atm, but not VHQ that I've left at 1.


My impression or the filesize of the second pass is more precise with Q2 on first pass than with Q3 as in presets ?
I really can't tell. With Heini's "6of9" (yes, Didee, I remember the principle and why it isn't 6of9 in fact ;)) I always get a bit undersized files (about 1MB), what doesn't happen to me with Didee's SixOfNine or Heini's MR. I haven't compared Q2 and Q3 (1st) and its influence on the final size (so far ;)).

cheers & good night :)
HDBR77

PS. Hey, I've just found this thread:
http://forum.doom9.org/showthread.php?t=93345
seems to cover many of the things discussed here.

Sharro
3rd March 2007, 22:15
Was it meant for both passes, or just for the 2nd pass?


Both passes, on 1st pass lower msp settings can affect P/B decision.

I'm not using Turbo on my first passes.

Not much time now to be more specific (family demanding my attention).

All the best,

Sharro

HeadBangeR77
5th March 2007, 14:49
After few days of trial and error (mostly "nightly sessions") I think I've found out the settings for the "hybrid" 1st pass, that best suit my needs. :)

The currently recommended settings for XviD presets use:
MSP=5, VHQ=1, Turbo, Trellis, all other goodies off
which is nonetheless more in terms of precision than a fast first pass would use (take a look at this post (http://forum.doom9.org/showthread.php?p=954366#post954366)). Apart from that it's generally recommended (for most of the presets) to run the 1st pass at constant quantizer 3, what makes frame size prediction much more accurate than a typical fast first pass (I haven't got the faintest idea if it influences the frame type decision as well?).

Now the settings I've been recently using:
MSP=6, VHQ=1, VHQ for B-frames, Turbo, QPEL and Trellis

***
A few words of explanation:
a) Since higher motion search precision is very well optimized, it doesn't affect speed (or to a very small, insignificant amount), and can only help to determine the most effective frame type decision in the first pass (thanks guys for pointing that out!). Therefore MSP=6 should be always used.

b) There is a significant speed impact while raising VHQ from 1 to 2 (larger than e.g. between VHQ=3 and 4). In this case I've decided to sacrifice precision (as to frame size) in favour of speed, and stay with VHQ=1, as in the presets. Besides: "it shouldn't affect p/b decision much, it's for local RD searches anyway".

c) I've roughly estimated a difference in the first pass bitrate with and without using VHQ on B-frames as 0.7-0.9%. Since B-frames are usually much smaller in their size (1/3 of P-frames at the most) because of using information from neighbouring frames and lower quantizers (ratio + offset), and therefore utilize much less bitrate, then the actual difference in B-frames size is larger. It's hard to tell exactly, but I'm pretty sure these are few percent. Thus I've decided to leave the option on.

d) Turbo affects B-frames and QPEL only. Because all I had originally wanted to achieve with this thread was a bit better precision than in the XviD's presets with rather proportional speed impact, I've decided to leave it on. Using QPEL slows the first pass, and using VHQ on B-frames too. Hence the Turbo option on to make up for this impact, at least partially. My estimations show 10% or more speed boost, like 31-32 minutes for the samples I was encoding, instead of 36 minutes without Turbo. I couldn't spot any negative influence on the 2nd pass final encode (watching, comparing stills, metrics). More about Turbo here... (http://forum.doom9.org/showthread.php?p=707858#post707858) and here (http://forum.doom9.org/showthread.php?p=884869#post884869).

e) QPEL has an influence on frame size (at least in my encodes - I've done many 1-pass samples with and without QPEL) - it's probably more important for me, since I often run the first pass at quantizer 2, so higher precision can only help (at the cost of speed however). Since Turbo compensates a bit for slower speed, and Didee usually uses it for the 1st run (now I'm behaving blindly, as a sheep following her shepherd :D), I'm gonna use it as well.

That's all. ;)
Thank you all for sharing experience and information. All suggestions are welcomed, apart from full quality first pass.

cheers,
HDBR77

Sharro
5th March 2007, 15:16
Hmmm,

Am I wrong or turbo sets QPEL=OFF ?

turbo or most of turbo (turbo is several flags put together), bvhq off, chroma motion off, trellis off. Also qpel off and gmc off.

All the best,

Sharro

HeadBangeR77
5th March 2007, 15:21
Nope. It's off by default in case of "fast first pass" - that's what sysKin was referring to (explaining what exactly is turned off in such a case).

Turbo is generally faster motion estimation for B-frames and quarter pixel (QPEL). I used to think it didn't speed things up too much, but I've just discovered I was wrong. :p

cheers
HDBR77

Sharro
5th March 2007, 16:13
Now, the b-frames ... you're using 2/1.60/0 right ?

All the best,

Sharro

HeadBangeR77
5th March 2007, 16:49
I've been using 2/1.62/0 as in our presets all the time. I can't find the particular thread atm, but Didee has mentioned somewhere that ratio=1.63 would produce B-frames with higher quantizers than 1.62, but at high quants (so high we wouldn't like to see, so it's irrelevant for us at least :devil: ) in general.
So I stick to 1.62 - I don't know if 1.60 would deliver different results; there might be a difference however, yet at high quants again.

I've just found a bunch of useful threads - gonna post links to them soon. ;)

1) "Golden ratio" for B-frames (http://forum.doom9.org/showthread.php?t=115357)

An interesting information on B-frames sensitivity there!
"Currently, reducing sensitivity will prevent B-frames in bright & high contrast scenes at first (where B-frames offer the most compressibility gain). In the dark scenes, where compression gain is small, but observed quality is critical, even with a "normally reduced" sensitivity like -5 to -10, XviD still will happily put 2 consecutive B-frames, and quantize away those small bits that (would) make the scene look real."

2) OT :D - Understanding CQMs (http://forum.doom9.org/showthread.php?p=318172#post318172)

To be continued (perhaps, some day) ... ;)

Sharro
5th March 2007, 21:11
I would be happy if I could avoid B-Frames on dark scenes :D

All the best,

Sharro

foxyshadis
6th March 2007, 00:07
In that case, you'll probably want to play with this: http://forum.doom9.org/showthread.php?t=114811

You can modulate the quantization (and therefore bitrate distribution) based on all kinds of scene, frame, and block properties.

HeadBangeR77
6th March 2007, 00:33
In that case, you'll probably want to play with this: http://forum.doom9.org/showthread.php?t=114811

You can modulate the quantization (and therefore bitrate distribution) based on all kinds of scene, frame, and block properties.
It was one of the first threads I had read here before registering. :D So far I've managed to get good results using CC, but not always (see here (http://forum.doom9.org/showthread.php?t=123065)).

Thanks for reminding :) - gonna dig in once again, although the patch is for xvid_encraw IIRC (?).

Sharro
6th March 2007, 10:07
Even though I'm happy with my star wars Ep. I to III encodes (to burn on a DVD+R DL, all muxed AVI's above 2.600MB) with preset90hq changing in first pass : NO TURBO, MSP=6, QPEL=ON (all other settings as presets) and in second pass MSP=6, VHQ=4 all else as presets. I only found blocks in 1 dark scene in Ep. I, even with my lcd monitor set at it's brightest mode. The ENC compress tests were above 98%.

I can't say the same about my Matrix I to III encode, where I randomly found blocks in Matrix II and III and frequently on Matrix I (ENC compress tests were between 92 and 95%) I will have a look into it, but blocks are present in the mpeg2source also so I don't expect any miracles. Maybe with curve compression I could get better results as most of the blocks are in the low motion scenes so I'll probably try both.

EDIT: Now I've looked into the other star wars encodes (done like 6 encodes each episode :D)I had done with bframes 2/1.60/0 bvop sensivity=0 all else same as above and they did behave worst as far as blocks in dark areas in concerned compared to bframes 1/1/1 bvop sensivity=-3.

All the best,

Sharro

Didée
6th March 2007, 11:02
with bframes 2/1.60/0 bvop sensivity=0 [...] and they did behave worst as far as blocks in dark areas in concerned compared to bframes 1/1/1 bvop sensivity=-3.


No surprise ... quoting myself (http://forum.doom9.org/showthread.php?p=742936#post742936):

In particular, one thing I'd like to see is something like "Penalty for Bframe sensitivity in dark scenes" : The usual setup of 2 (or even 3) max. consecutive Bframes at times is counterproductive during dark scenes, regarding perceived quality ... sure many Bframes during dark scenes "compress like hell", but they just don't look good.
And usually the max. Bframe usage is reached much earlier in the dark than it is in the light ...

It's a problem of human HVS vs. mechanical number-crunching ... official Xvid doesn't have much HVS tweaking yet. (But there are experimental builds of xvid_encraw (http://xvid.ist-dein-freund.de/), from Kopernikus.)

From the codec's point of view, dark scenes are perfectly suited to use Bframes, as much as possible. And so it does.

But man's eye has another point of view ...

HeadBangeR77
6th March 2007, 14:44
@ Didee:
I agree with you in general (seeing P-B-B in really dark scenes is the sight I would like to spare my eyes ;)), however I think B-frames has improved really much since those days... (http://forum.doom9.org/showthread.php?p=511646#post511646)

If I can force the codec (using CC, rather mild in comparison to what you use, yet stronger for high quality encodes than in the Teegedeck's presets, that excludes the use of CC with HQ profiles) to create a pattern of 2-3-2-3 or even 3-4-3-4-3-4 in dark scenes, then I'm happy. Of course I'm talking about high bitrate matrices with fine quantization steps (guess which one is included ;)). I've been watching my encodes and samples recently, comparing stills as well, even doing some devilish metrics ( ;) ) and patterns like that don't look bad to my eyes.

Trying to make high motion scenes slimmer by raising B-frames sensitivity, if we decide to tune codec's decisions by using zones (too time consuming, or should I say time-devouring) isn't always possible. When there's a lot of high motion, like fighting scenes, and the background textures change all the time (e.g. two fighting folks moving), I usually get all P-frames, since there's nothing to predict from to create B-frames.

Straight: do you happen to use Q2 for first pass in your encodes? :D
And if yes, within which limits? I mean the second pass average quantizer.

@ Sharro:
I think I'm gonna launch a topic on curve compression and B-frames in dark scenes, what I've been planning for a long time already.

I think the setting you used (MSP=6, VHQ=1, QPEL, no Turbo) for your first passes are very reasonable. As to B-frames issue, I'm gonna check myself, yet I always use CC, as mentioned above.

cheers,
HDBR77

PS. I will encode samples with: 2/1.62/0, 2/1.50/0, 2/1/1 and 1/1/1.

HeadBangeR77
7th March 2007, 13:29
I think almost all important questions concerning different kinds of the first pass have been answered here. :)
I'm only waiting for Didee to reveal his first pass settings, if he finds some time. I know he's generally going through real life quarantine and hence stays away from the forums, so I must be armed with patience. ;)

***
Since I don't want (and don't have enough time for it) to launch another thread, I think we could discuss some matters here - I have B-frames settings now on my mind.

Still comparing results (including metrics, which are my ultimate measure, if I can't see any difference while watching or comparing stills :p). Just quickly, basing on my first impressions:

1) B2/1.62/00 stands its ground rather well, so imo it could be used further even for high quality encodes, unless some artefacts pop out, like by Sharro, what could be prevented with CC, or at least my experience tells me so.

2) B2/1.50/00 looks really weird to me. The average quantizer is lower than by No 1 - bits go from P-frames to B-frames, so the desired effect is achieved. This should theoretically improve quality, yet it doesn't (or at least so it seems atm). Although an average B-frame quantizer is lower, I get more B-5s and B-6es, and so the minimal SSIM and PSNR are worse (quality isn't as constant as with the previous settings).

3) B2/1.00/1.00 looks promising for HQ encodes. Again, bits flow from P-frames to B-frames to a larger amount than by No 2, and this time it really improves both visual quality and metrics (average and minimal). Quantizers distribution is more even, I don't get any B6es and just a few B5s, so it does much better job than No 2, so it seems. :)

4) B1/1.00/1.00 - to be examined. ;)

cheers,
HDBR77

Sharro
7th March 2007, 14:19
Put BVop sensivity in your tests :)

All the best,

Sharro

HeadBangeR77
7th March 2007, 14:52
Put BVop sensivity in your tests :)

All the best,

Sharro
Gee, I've forgotten about that - don't tell me to do more sample encodes (I'm waiting 1.5 hour for one, then taking screengrabs and doing metrics <headache>).

If I find more time I'm gonna do two more samples with B-VOPs sensitivity -3 (or would you suggest sth' else?) for No 1, 3 and 4. Your homework is curve compression in the meantime. :p

greetings,
HDBR77

PS. The question still remains, what would happen if I used 2/1/1 or 1/1/1 with sensitivity -3 in a full encode? Such settings could potentially harm compressibility, if the bitrate wasn't sufficient (?)

My samples are rather fast motion, where B-frames are rarely put into the stream: with classical 2 consecutive B-frames and sensitivity 0, I'm getting almost 50% of P-frames and 47.5% of B-frames, among them only 24% consecutive in a row, what is rather unusual for full films (like 60% B-frames on average, and much more 2 consecutive present). I mean in case of my samples fewer B-frames can't do much harm (in fact they're helping :)), but I'm unsure about encoding full films with such settings. :confused:

HeadBangeR77
8th March 2007, 00:42
I've almost finished (I think I will have enough of encoding and testing for a good week :p), so I'm gonna update the results as soon as I have them. All samples (6985 frames, NTSC, film) have been encoded with Heini's "SixOfNine" CQM, the mentioned above first pass settings (including VHQ on B-frames and Turbo), and for the second run: MSP=6, VHQ=4, VHQ on B-frames, Chroma ME, QPEL and Trellis (no Turbo, no Adaptive Quantization nor any other shit). Overflow treatment 0/8/4, curve compression 15/7, Koepi's 1.1.2 build.

I. Pure numbers

1) B2/1.62/00
4863 kbps, avg. Q 3.45, I 2.93, P 2.89, B 4.06, max. 6 (17 frm.)
I-frames - 2.6%, P - 49.9%, B - 47.5% (24% 2 consecutive)

2) B2/1.50/00
4867 kbps, avg. Q 3.41, I 2.93, P 2.93, B 3.94, max. 6 (26 frm.)
I-frames - 2.6%, P - 49.9%, B - 47.5% (24% 2 consecutive)

3) B2/1.00/1.00
a) B-VOPs sensitivity 0
4867 kbps, avg. Q 3.37, I 2.93, P 2.95, B 3.85, max. 5 (35 frm.)
I-frames - 2.6%, P - 49.9%, B - 47.5% (24% 2 consecutive)

b) B-VOPs sensitivity -3
4865 kbps, avg. Q 3.36, I 2.99, P 2.96, B 3.88, max. 5 (43 frm.)
I-frames - 2.6%, P - 53.6%, B - 43.8% (12% 2 consecutive)

4) B1/1.00/1.00
a) B-VOPs sensitivity 0
4866 kbps, avg. Q 3.36, I 2.99, P 2.96, B 3.89, max. 5 (60 frm.)
I-frames - 2.6%, P - 54.5%, B - 42.9% (no consecutive)

b) B-VOPs sensitivity -3
4866 kbps, avg. Q 3.36, I 3.02, P 2.97, B 3.90, max. 5 (62 frm.)
I-frames - 2.6%, P - 55.9%, B - 41.5% (no consecutive)

5) Teegedeck's >90% HQ*
4865 kbps, avg. Q 3.40, I 2.99, P 3.01, B 3.96, max. 5 (48 frm.)
I-frames - 2.6%, P - 55.9%, B - 41.5% (no consecutive)

Statistic from XviD's statistics window, rechecked with the brilliant AVInaptic application.

The most bits for lower B-frames quantizers come from P-frames at first, and then from I-frames also (I don't know, if it's reasonable, we shall see ;)). When it comes to sensitivity of B-VOPs, the codec seems to behave well - in case of two consecutive ones it lowered their number by some amount (compare 3a and 3b); in case of just 1 B-frame it couldn't or didn't want to (am I personalizing XviD? gee! never mind - have a look at 4a & 4b). One could expect the encodes with the lowest average quantizer should look best and have the best metrics - well, it's not always the case...

* Sample encoded for better comparison: first pass with my modifications, second pass as in the presets i.e. MSP=4, VHQ=3 (B1/1.00/1.00, -3), the given quantizers limits (2-3, 2-4, 2-4).

HeadBangeR77
8th March 2007, 01:47
II. The devilish metrics ;)

1) B2/1.62/00
PSNR avg. 43.80352 || PSNR min. 39.3699 || SSIM avg. 0.97380 || SSIM min. 0.949538

2) B2/1.50/00
PSNR avg. 43.80020 || PSNR min. 39.0610 || SSIM avg. 0.97378 || SSIM min. 0.945840

3) B2/1.00/1.00
a) B-VOPs sensitivity 0
PSNR avg. 43.83302 || PSNR min. 40.1698 || SSIM avg. 0.97384 || SSIM min. 0.948212

b) B-VOPs sensitivity -3
PSNR avg. 43.85057 || PSNR min. 40.3516 || SSIM avg. 0.97392 || SSIM min. 0.948570

4) B1/1.00/1.00
a) B-VOPs sensitivity 0
PSNR avg. 43.85824 || PSNR min. 39.7095 || SSIM avg. 0.97395 || SSIM min. 0.949177

b) B-VOPs sensitivity -3
PSNR avg. 43.85522 || PSNR min. 40.1733 || SSIM avg. 0.97392 || SSIM min. 0.951267

5) Teegedeck's >90% HQ
PSNR avg. 43.79126 || PSNR min. 40.4840 || SSIM avg. 0.97344 || SSIM min. 0.951392


Red - the best
Blue - the second best

Comments later on...

Btw. Didee's SixOfNine gets much better metrics - I will post some results later on. What's interesting: with Heini's matrix the higher the VHQ in the 2nd pass, the better the metrics, yet with Didee's matrix I get better results with VHQ3 than with VHQ4, at least in grainy scenes. :)

HeadBangeR77
10th March 2007, 13:48
Didee's SixOfNine encodes, B2/1.00/1.00, sensitivity -3 (my chosen HQ settings for B-frames ;)):

a) VHQ3 - avg. Q 3.26
PSNR avg. 44.26538 || PSNR min. 40.2937 || SSIM avg. 0.97650 || SSIM min. 0.955335

b) VHQ4 - avg. Q 3.25
PSNR avg. 44.26340 || PSNR min. 40.4088 || SSIM avg. 0.97644 || SSIM min. 0.955364

The sample with VHQ3 kept more grain (not as much as Heini's, but did good job this time), that was present in the original MPEG-2 stream, so it's not only the devilish metrics, but it was visually better as well. :)

In general, as to metrics:
When my eyes clearly tell me one encode/sample is better than the other, I don't hesitate and choose the one that gives me better perceptual quality. However, when my eyes can't distinguish the encodes I've made, why not rely on metrics (?) Taking screen grabs and comparing them is extremely time-consuming, and doesn't always tell us which sample is better, for instance: it's hard to distinguish VHQ1 and VHQ4, and it's almost impossible to distinguish VHQ3 and VHQ4. The same applies to different B-frames settings, however analysing stills in this case is almost a nonsense - it's much better to watch a sample a couple of times. I hope I've made myself clear as to metrics.

I still hesitate which matrix to use in my HQ encodes, and I'm still unsure about B-frames settings. Just in case my bitrate would not be sufficient one 1B, I think I'm leaning towards using B2/1.00/1.00 with sensitivity -3, eventually B1/1.00/1.00 with the default 0 sensitivity.

I will write about my personal visual experiences later on, providing I finally find more time to watch them again.

cheers,
HDBR77