View Full Version : XviD best min/max quantizer settings?
Elias
18th March 2005, 12:46
Well, I decided to install the good old DivX 5.02 and noticed that its quantizer settings were different than the XviD 1.1 Beta 1, so I decided to use the DivX 5.02 quant settings on the latest XviD. Turned out I got great quality with tiny filesize (as used to be the case with DivX 5.02). Sure, it was somewhat more lossy but considering the filesize, it's worth it. Anyway, here are some good quantizer settings:
XviD 1.1 Beta 1 default: = Closer to being lossless, but way more size (MPEG-4 can't be lossless, but it sure looks more lossless).
Min: 1
Max: 31
DivX 5.02 default: = The loss in quality is barely perceivable, but the drop in size is :D
Min: 2
Max: 12
These quant settings were encoded at maximum bitrate of course, with pretty much the same settings for both codecs. The output was pretty much the same for both codecs with the same quant settings. If there are any more good quant settings you know about, please post them in this thread. The same way I've done above.
Manao
18th March 2005, 13:41
You're comparing apples and oranges.
You specify a bitrate, the first one (1-31) respects that bitrate, and you advise to use the other settings - which didn't respect the bitrate - because it gives a smaller filesize ?
Elias
18th March 2005, 13:44
Originally posted by Manao
You're comparing apples and oranges.
You specify a bitrate, the first one (1-31) respects that bitrate, and you advise to use the other settings - which didn't respect the bitrate - because it gives a smaller filesize ? Basically, yeah. You don't have to use the one I advised though :)
Manao
18th March 2005, 13:53
But do you understand that that makes your conclusion ( 2-12 being better that 1-31 ) completely unfounded and false ?
Elias
18th March 2005, 13:55
Originally posted by Manao
But do you understand that that makes your conclusion ( 2-12 being better that 1-31 ) completely unfounded and false ? Why? Elaborate.
Doom9
18th March 2005, 13:58
perhaps if you would look at the quantizers used in both clips you could figure it out on your own ;) Hint: q2 is a higher compression than q1...
Teegedeck
18th March 2005, 14:11
As a matter of fact, Elias has only 'rediscovered' something that's been repeated quite a number of times (by me, for example...).
Quant=1 is a waste of bitrate and doesn't look better than quant=2; it is the default minimum quantizer only because the constant newbie complaints about undersizing with XviD in 2-pass mode got on everybody's nerves.
Of course you get a better efficiency with min. quant=2, you even get less quantizer fluctuation in 2-pass, it is very advisable to use this setting! Nothing new...
Just make sure you choose a higher resolution if you get undersizing.
Shinigami-Sama
18th March 2005, 19:24
I;d love undersized files
and I don;t caer about slight differances
so quant1 isn'
t to much of a waste
but then again I don't go for mpeg4 spep conform either files only play through my pc
why someone would complain about undersized files I have no idea...
so quant2 is defualt
*changes*
better
I'll stick to min1 thank you very much
but..
isn't saying something is hte best against forum rules?
;)
Leak
18th March 2005, 23:32
Originally posted by Shinigami-Sama
isn't saying something is hte best against forum rules?
;)
I guess saying that you'd best drop your caffeine intake to normal levels wouldn't break any rules, but maybe make your posts more readable... :D
np: Chronolux - Fractional (Silent Season Dub)
Shinigami-Sama
19th March 2005, 01:12
Originally posted by Leak
I guess saying that you'd best drop your caffeine intake to normal levels wouldn't break any rules, but maybe make your posts more readable... :D
np: Chronolux - Fractional (Silent Season Dub)
err
I'm not sure that would help seing as how caffine has no affect on me anymore:rolleyes:
but I though I got all the typos out I'm tring at least
not sure if it helps though seeing as how I'm so used to them I don't seem them anymore
to to clear it up if I didn't make sense
me=stick to min quant1
me=don't care about reaching a specific file
therefore quant1=good imho
I hope that cleared it up
Didée
19th March 2005, 02:45
Originally posted by Shinigami-Sama
to to clear it up if I didn't make sense
me=stick to min quant1
me=don't care about reaching a specific file
therefore quant1=good imho
I hope that cleared it up
Yes , that cleared it up.
However the bare truth isOriginally posted by Teegedeck
Quant=1 is a waste of bitrate
Period.
Shinigami-Sama
19th March 2005, 02:46
when you don't care about filesize
how can it possilby be waste?
I mean I can see the diferance on my tv so therefore it isn't a waste to me
but I break specs with every encode so..
Teegedeck
19th March 2005, 09:25
Sure, whatever floats your boat.
Though if your TV is a traditional cathode ray tube even an SVCD will look 'great' on it.
Anyway, use what you want but please don't be surprised that I am reminded of people who say they can distinguish 320 kbp/s MP3 from uncompressed - as long as they know which file is which! I promise that you won't see a difference between quant=1 and quant=2 when you don't know what it is you're watching.
Spyn
19th March 2005, 13:42
source : 12000 frames (10%) Wonderful Days (Anime) PAL, source is free of any artifacts, noise, grain ... and is very compressive (you say compressible or compressive ?)
bitrate : 1058
Xvid settings : only b-frames enabled at default settings
max I-frame intervall : 250
SSIM result quant 1-31 : 90.12
SSIM result quant 2-31 : 90.13
obieobieobie
19th March 2005, 14:00
Quant1 has some appliactions. I have found that when encoding dark scenes with rain (take the scene in the Shawshank Redemption when Dufresne exits the sewer pipe into freedom as an example, it has lightning flashes too) quant1 managed to retain details while quant2 was a bit washed out and blurry.
jon.schaffer
19th March 2005, 14:10
Spyn, sorry to say my opinion here, but I think such a test is useless.
Too many parameters are not seen here.
The target size of the movie VS its compressibility is one to take into consideration.
1) If your movie is easy to compress (don"t know either about compressible or compressive ;)) and that you set a target size not too big, the codec will put very few or no Q1 frames at all, because it is useless. Result? There will be no change in the quality.
2) If you set a bigger target size than the first pass (Q2), then the codec "fatten" the file with Q1 frames. Furthermore, by creating Q1 frames and "wasting" so much bytes, the codec has unfortunately to create high quantizer frames from time to time, thus degrading the picture quality in some scenes.
(this is simplistic because, in fact, even in the first case, some Q1 frames are created whereas they should not be there since useless. So, we find higher quants in some frames. And remember: there must be many high quant frames to compensate one "huge" Q1 frame)
... all this to say that your test is just one example and that another with just one modified parameter can demonstrate the opposite...
@obieobieobie
Agree with you. I think Teegedeck is slightly exaggerating when saying "Quant=1 (...) doesn't look better than quant=2"
Q1 retain much more details. The picure is much more sharper.
But his second argument is really a STRONG one:
"Quant=1 is a waste of bitrate" and it does not worth the sporadic quality gain in a movie. It may trash an encode in some scenes and disturbs the rate control.
Manao
19th March 2005, 14:17
And anyway, just to relativize some more Spyn test : when computing the SSIM, the last stage of the computation is SSIM = (real_ssim ^ 8) * 100. That stage is done in order us to visualize more easily differences. However, know that before that stage, real_ssim for SSIM=0.9012 was 0.987081 and for SSIM=0.9013 it was 0.987094. Huh, not much of a difference, isn't it ? In any way, certaintly not something you could spot.
obieobieobie
19th March 2005, 14:33
"Quant=1 is a waste of bitrate" and it does not worth the sporadic quality gain in a movie. It may trash an encode in some scenes and disturbs the rate control.
Yes, I somewhat agree with you. I just wanted to share my experiences with quant1 and that it's not totally useless in the right circumstances. The rest of the encode looked great too and it hit the size I wanted it to. I found that that scene is an important part of the movie and that it deserved to be shown with all details intact. :)
Shinigami-Sama
19th March 2005, 22:09
Originally posted by Teegedeck
Sure, whatever floats your boat.
Though if your TV is a traditional cathode ray tube even an SVCD will look 'great' on it.
Anyway, use what you want but please don't be surprised that I am reminded of people who say they can distinguish 320 kbp/s MP3 from uncompressed - as long as they know which file is which! I promise that you won't see a difference between quant=1 and quant=2 when you don't know what it is you're watching.
I never have a real file size I shot for so size doesn't matter so; I can't possibly waste bits if I don't shot any specif size eh?
anways I ahve a crt 16:9 hdtv as it says in my sig; and yes I can tell the differance between some compressed music and uncompressed, it;s hard though but I can. And no svcds don't look 'great' on my tv, I;ve tried :)
warath
19th March 2005, 22:23
With Xvid 1.1 I see no difference from quant=1, or quant=2, and thought I read somewhere (wish I could find it again) that 1.1 was modified and quant=1 is like setting the old xvid to quant=2, it will compress where it can, and give back bits to sections that can't be as compressed, therefore leaving the file size alone.
Even if I've miss-read something, in all my encoding with xvid1.1 i can see no difference from setting it to 1, or 2 for the min!
Manao
19th March 2005, 22:27
That's because quantizer 1 will get used only if your first pass size is smaller that the bitrate you requested in the second pass. And in that case, setting min_quantizer = 2 would have prevent you to reach the correct filesize. ( but of course, as reported previously, quantizer 1 being a bit of an overkill, if you reach such a situation, you should reencode with a smaller target bitrate, and use the free bits for example on the audio )
Didée
19th March 2005, 23:37
Originally posted by Shinigami-Sama
when you don't care about filesize
how can it possilby be waste?
When you don't care about filesize, then the whole question is pointless. Because then you don't use a range of quantization. You would do a constant-quant encode @ 1, and let it go. Perhaps even with "motion search precision" set to "none", and enjoy your hi-Q encode after a blazingly fast encoding.
Of course there are cases where quality of q2 is not sufficient for an A-top reproduction of a scene. Of course the quality difference between q2 and q1 is at times very noticeable.
Still, q1 is a waste of bitrate.
If one is dealing with a source that is very compressable, and/or that needs something better than q2 in some places, then it is time to ... use a "high bitrate" matrix. Those will provide a much better distribution of available bits. It's an old story that was discussed many times, and more than once by me. Understand that q1 throws about 200% of bitrate than q2 does on the same scene, with no gradation beween them. Imagine you want to give 5 bucks to a poor man sitting on the street, but looking in your wallet, all you find is a 100$ note - oops! And there are a LOT of poor man that could need support ...
A high bitrate matrix simply provides you with more loose money for those cases where you can't expect any change [money].
Sagittaire
20th March 2005, 00:11
1) DivX 5.02 is a very old codec ...
2) If for second pass average quant is high (q4 and more for I,P in average), [1-31] or [2-31] doesn't change anything: Rate Control will use rarely Q1 frame in second pass. With lower average quant in [1-31] quant interval the size quant prediction is not good: files will be under or oversized ...
3) If you want make very low quant encoding in H263 (like for example Q1.5 for I,P average) you must use q1 for better size prediction in first pass ...
4) If you want really make very high bitrate encoding the best solution is "high bitrate matrix" like Fox or other not because these matrix are "better for high bitrate" but because quant repartition will be very better ...
aeternitas
20th March 2005, 07:11
Originally posted by Shinigami-Sama
I never have a real file size I shot for so size doesn't matter so; I can't possibly waste bits if I don't shot any specif size eh?
anways I ahve a crt 16:9 hdtv as it says in my sig; and yes I can tell the differance between some compressed music and uncompressed, it;s hard though but I can. And no svcds don't look 'great' on my tv, I;ve tried :)
I think youre confused. There is a differance between lossy and lossless compression. Hearing the differance between a source and a compressed from source is like saying "100% digital quality" .. meaning youre not saying anything and you look ridiculous.
You can pretend you can hear the differance between CD raw and 320 mp3, but we all know you probably cant. Also, if you can hear the differance between raw and losslessly compressed audio then its time to laugh.
Shinigami-Sama
20th March 2005, 07:26
Originally posted by aeternitas
I think youre confused. There is a differance between lossy and lossless compression. Hearing the differance between a source and a compressed from source is like saying "100% digital quality" .. meaning youre not saying anything and you look ridiculous.
You can pretend you can hear the differance between CD raw and 320 mp3, but we all know you probably cant. Also, if you can hear the differance between raw and losslessly compressed audio then its time to laugh.
considering I said some and not [b]all[/a]... - also I never said anything aoubt raw an lossless..
Spyn
21st March 2005, 15:55
Originally posted by jon.schaffer
Spyn, sorry to say my opinion here, but I think such a test is useless.
Too many parameters are not seen here.
The target size of the movie VS its compressibility is one to take into consideration.
1) If your movie is easy to compress (don"t know either about compressible or compressive ;)) and that you set a target size not too big, the codec will put very few or no Q1 frames at all, because it is useless. Result? There will be no change in the quality.
2) If you set a bigger target size than the first pass (Q2), then the codec "fatten" the file with Q1 frames. Furthermore, by creating Q1 frames and "wasting" so much bytes, the codec has unfortunately to create high quantizer frames from time to time, thus degrading the picture quality in some scenes.
(this is simplistic because, in fact, even in the first case, some Q1 frames are created whereas they should not be there since useless. So, we find higher quants in some frames. And remember: there must be many high quant frames to compensate one "huge" Q1 frame)
... all this to say that your test is just one example and that another with just one modified parameter can demonstrate the opposite...
@obieobieobie
Agree with you. I think Teegedeck is slightly exaggerating when saying "Quant=1 (...) doesn't look better than quant=2"
Q1 retain much more details. The picure is much more sharper.
But his second argument is really a STRONG one:
"Quant=1 is a waste of bitrate" and it does not worth the sporadic quality gain in a movie. It may trash an encode in some scenes and disturbs the rate control.
i'm agree with you ;)
Wondeful days is extremly compressive (99% with lanczosresize 672*368) so there sould be very few q1 frames.
these q1 frames are able to reduce the average quality of the movie even if they are very few so for a low compressive movie i think the quality difference should be more important.
got a perfect q1 frames for 20 q5 frames for example is not a good idea ;)
medp7060
23rd January 2010, 00:21
As a matter of fact, Elias has only 'rediscovered' something that's been repeated quite a number of times (by me, for example...).
Quant=1 is a waste of bitrate and doesn't look better than quant=2; it is the default minimum quantizer only because the constant newbie complaints about undersizing with XviD in 2-pass mode got on everybody's nerves.
Of course you get a better efficiency with min. quant=2, you even get less quantizer fluctuation in 2-pass, it is very advisable to use this setting! Nothing new...
Just make sure you choose a higher resolution if you get undersizing.
Do these statements still hold true after 5 years in 2010?
jon.schaffer
31st January 2010, 00:30
Do these statements still hold true after 5 years in 2010?
Yes !
henryho_hk
1st February 2010, 05:46
Increase the resolution, apply less denoising or use a sharper custom matrix.
Nephilis
1st February 2010, 12:17
Or reduce the B-VOP's quantizer ratio to 1.00 from 1.50 ..
MatLz
1st February 2010, 13:38
But in some videos you will absolutely need qmin at 1.....one example: xxxHolic the movie....if you don't do that, you will have a bad surprise in the middle of the movie...
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.