View Full Version : How to use Didées six of nine matix (1-pass @ quant 3)?
Alvy
28th September 2004, 08:02
Hello,
some time ago I read that first past should be done with quant=3 (can't find the original thread).
What is about the second past? Should the max. quantizer be set to 3 in general?
Does this apply to both six of nine matrices?
Why not quant 2 (had good results with that)?
Alvy
Ark
28th September 2004, 08:13
As far as I know, 6of9 matrix is aimed at high bitrate encodings, either 1pass at q2 or 2pass for a given target size, I too remember something for a 1st pass at q3, but I don't remembe well.
But for me there's no problem doing a normal 2pass encode done as with any other matrices.
Didée
28th September 2004, 09:05
Of course you can do a normal 1st-pass @ q2. That will not b0rk your encoding, or something like that. ;)
But 1st-pass @ q3 is more ideal in most cases. (And this applies as well to other hi-BR matrices, like "Selur's high BR", "Fox home entertainement", "Andreas 78'er", "flat-8", and such.)
Remember that in 2nd pass, XviD is only *guessing* the frame sizes for any target quantizer from the frame sizes in the 1st pass. This guessing is based on experience values, but is never really accurate. (It's the main job of the overflow treatment routine to handle with this "misguessing").
Now, without too much detail: The bigger the framesizes in 1st-pass are, and the more different the 1st-pass framesizes are from those in the 2nd pass, the more deviation will take place, and the more work overflow control has to do. That's also the reason why a traditional 1st-pass is done @ q2. It could be done @ q1 as well, but isn't.
Then, the (very roughly over the thumb) quantizer relation 6of9 <--> standard
q2 <--> "q1.5"
q3 <--> q2
q4 <--> "q2.5"
q5 <--> q3
tells the rest of the story:
q2 delivers rather big framesizes, and makes prediction of 2nd-pass framesizes a little more inaccurate.
q3 is relatively close to q2-standard, and therefore deals better as a base for framesize prediction.
Moreover, 1st-pass @ q3 will give "reasonable" results for compressability tests - 50% ~ 80% then still is the usable range. 1st-pass @ q2 will give much lower results on comp. tests. (Which is no problem as well, but one had to think in different ranges of e.g. 33%~60%)
virus
28th September 2004, 10:04
Originally posted by Didée
Now, without too much detail: The bigger the framesizes in 1st-pass are, and the more different the 1st-pass framesizes are from those in the 2nd pass, the more deviation will take place, and the more work overflow control has to do.
I see your point.
That can applied to all matrices then. The MPEG matrix scales worse than 6of9 due to the larger coeffs so making a 1st pass with a quantizer that "matches" better the average quantizer on the 2nd should be better, too. Or not?
Didée
28th September 2004, 11:10
Yes and no. It depends on the level of compression in 2nd pass, the "target average quantizer".
IF your final encoding, using standard matrix, is going to have quantizers >3 only, then it would probably be better to use q3 on 1st-pass, too.
But if you're aiming for an ecoding with an avg. quant of 2.5, then a q3-1st-pass is a bad idea: "inverse" scaling of framesizes is more inaccurate than the other, normal, way round.
Ideally, a 1st-pass should be done at that quantizer that is the lowest one appearing in the final encoding in "mentionable amounts". When working without (or only weak) curve compression, that means the number before the decimal point of the "average P-frame quant" in 2nd pass.
BTW, all numbers above for average quants refer to P-frames only, for simplicity of discussion.
virus
28th September 2004, 11:31
OK Didée, I see we agree completely on that. My question was made thinking something like "if I'm doing low-bitrate and my target Q is going between 6 and 7, maybe a first pass at 4 can work better".
I've never tried a 1st pass with Q > 2 (my encodings usually have avg Q < 2.5 so it's not needed). Now I'm curious to test it with the MPEG matrix and see what happens... :)
Alvy
28th September 2004, 12:53
Ah I understand.
Thank you for the answers!
nightrhyme
1st October 2004, 16:09
Since I'm a little new. I don't know how to force Quant-2 1-pass in a 2-pass encode.
Do I restrict the Quants in Quantizer Restrictions ? And to what value ?
Or do I force fixed Quant using a Zone ?
//Thanx in advance
manono
1st October 2004, 17:33
Hi-
I'm not sure I understood all of that, nightrhyme, but Quant 2 is the default first pass setting. If you wish to try out what was suggested above (running the first pass at a quant just below what the final average P-Frame quant will be), then you can force the first pass to your desired quant, at the same time as creating a .pass file, by using the Zones. Thanks to Teegedeck for explaining how to do that once upon a time.
nightrhyme
1st October 2004, 23:07
Originally posted by manono
Hi-
I'm not sure I understood all of that, nightrhyme, but Quant 2 is the default first pass setting. If you wish to try out what was suggested above (running the first pass at a quant just below what the final average P-Frame quant will be), then you can force the first pass to your desired quant, at the same time as creating a .pass file, by using the Zones. Thanks to Teegedeck for explaining how to do that once upon a time.
Thanx now I understand :)
jaapaa
25th October 2004, 21:32
Originally posted by Didée
Moreover, 1st-pass @ q3 will give "reasonable" results for compressability tests - 50% ~ 80% then still is the usable range. 1st-pass @ q2 will give much lower results on comp. tests. (Which is no problem as well, but one had to think in different ranges of e.g. 33%~60%)
Just to make sure, that I understand the above right... When I run the first pass at q3, a reasonable result could be expected when aiming the final filesize at 50% to 80% range of the first pass filesize?
movmasty
26th October 2004, 00:36
Originally posted by jaapaa
Just to make sure, that I understand the above right... When I run the first pass at q3, a reasonable result could be expected when aiming the final filesize at 50% to 80% range of the first pass filesize?
if we talk about custom matrices, then Q 3 will be the same compression as q2 default matrice, so the final filesize should be in the usual range, that is 80-50%....if you set min Q at 3 for the 2nd pass too
if 1st pass is at 3 with the default matrice,and B frames will get a min Q of 5 unless you set lower parametres for the B,
you could run the 2nd either with a min of 2(quality) or 3(compression)
with min 2 the range will be like 115-80%
with min 3 90-70%, 90-70 is higer than 80-50 because with default and not hq matrices the 1st pass will be already well compressed.
Are 2 different questions, Q 3 giving same compression as 2 with cust matrices
and run the 1st pass at 3 because nearer to final average quantizer.
PiXuS
30th October 2004, 16:17
Originally posted by manono
Hi-
I'm not sure I understood all of that, nightrhyme, but Quant 2 is the default first pass setting. If you wish to try out what was suggested above (running the first pass at a quant just below what the final average P-Frame quant will be), then you can force the first pass to your desired quant, at the same time as creating a .pass file, by using the Zones. Thanks to Teegedeck for explaining how to do that once upon a time.
I searched for posts about "zone" and "xvid" from "Teegedeck" (and other permutations) but couldn't find the "magic-post" you are refering to.
I have some interest in doing 2-pass encodes using the SixOfNine CQM but have a hard time with the zones. On the first pass, I configured one zone (the one which start @ frame 0) for a fixed quant of 3 and no K G or C flag. b-frames are disabled (they should, no?).
The encoding goes as it should with only q=3 used. Then, on the second pass, I set the zone to Weight=1.00 and enable the b-frames. My problem is that no b-frames are used during the 2nd pass encode.
What am I doing wrong? I am in a multi-day encode right now so I can't make small tests (like check if Gordian Knot enables b-frames on the first pass... I never noticed).
I am using the latest stable build of XviD (v1.0.2) compiled by Koepi.
Thanks !
loni_blues
30th October 2004, 18:07
I don`t know what's wrong with b-frames not showing up.
However, I believe firstpass settings should be the same as secondpass ones with the obvious exception of quantizer 3 in firstpass and weight 1 in second pass in zones section. All the other settings I keep the same for both passes (b-frames also).
Here's the link I found for Teegedeck's post:
http://forum.doom9.org/showthread.php?s=&threadid=82267&perpage=20&highlight=zone&pagenumber=1
PiXuS
30th October 2004, 18:20
Originally posted by loni_blues
I don`t know what's wrong with b-frames not showing up.
However, I believe firstpass settings should be the same as secondpass ones with the obvious exception of quantizer 3 in firstpass and weight 1 in second pass in zones section. All the other settings I keep the same for both passes (b-frames also).
Here's the link I found for Teegedeck's post:
http://forum.doom9.org/showthread.php?s=&threadid=82267&perpage=20&highlight=zone&pagenumber=1
Yeah, I had found that post. I figured it wasn't the one refered to by Manono because it is rather vague (the idea is there but not a lot of details on the method).
Anyway... so, on the first pass you are encoding with b-frames.. b-frames are used, right? Okay... I thought on the first pass only 'I' and 'P' frames were to be used.. don't know why I thought that way. ;)
Thanks for your help.
Edit: Well, I finally could test with GK. B-frames ARE used in the first pass. So, to answer my own question, all you need to do to force a given quant on first pass is to force the zone accordingly and disable features which would not be used if "Full Quality First Pass" was unchecked (as Teegedeck pointed to)
Audionut
3rd November 2004, 00:48
Originally posted by loni_blues
I don`t know what's wrong with b-frames not showing up.
However, I believe firstpass settings should be the same as secondpass ones with the obvious exception of quantizer 3 in firstpass and weight 1 in second pass in zones section. All the other settings I keep the same for both passes (b-frames also).
Here's the link I found for Teegedeck's post:
http://forum.doom9.org/showthread.php?s=&threadid=82267&perpage=20&highlight=zone&pagenumber=1
Originally posted by sysKin
In theory, P/B decision alghorithm is "tuned" to work in quant 2 (ie with high-quality frames).Here (http://forum.doom9.org/showthread.php?s=&threadid=84785)
Originally posted by Teegedeck
(First pass must be done at quant=3 via zone setup; using fixed quantizers in zones prevents XviD from automatically disabling stuff like trellis for speed-up in first pass,
Of course you can just select "Full Quality First Pass" from the xvid options to prevent xvid from disabling these other options.
There are other benifits from this aswell.
Originally posted by Koepi
Due to the fast first pass we're now doing it was necessary to compensate for it's side-effects. IFrames got quantized too high. Still this isn't the best solution, but we'll work something more graceful out I think. Here (http://forum.doom9.org/showthread.php?s=&threadid=70245&highlight=Iframe+boost)
You can also see this thread (http://forum.doom9.org/showthread.php?s=&postid=565255#post565255)
PiXuS
3rd November 2004, 04:46
@Audionut
Arrrggg... so according to the the post (http://forum.doom9.org/showthread.php?s=&threadid=70245&highlight=Iframe+boost) you mentionned by Koepi, if we do a 2-pass 1st pass @ a forced quant using the Zones and don't disable what is normally disabled when not using the Zones... we are phoked because on the second pass, a boost which shouldn't be there is used.......
So if we use Zones on the first pass, we also need to disable all kind of boosts on the second pass? In C-style pseudo-code it would look like the following:
if (2-pass 1st pass WITH Zones)
then disable boosts in second pass
else
use second pass defaults
?
http://img44.exs.cx/img44/2180/2nd_pass_settings.png
That is the conf. panel for the second pass with XviD 1.1 (the alpha build by Koepi). We only need to zero the "Intra-frames tuning" settings and also the "Overflow treatment"?
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.