View Full Version : quality based mode in dev-api-3
len0x
18th January 2004, 19:45
Weird thing happening with the following setup:
quality based mode
min quants = 2
max quants = 3
custom mpeg matrixes
bframes: 1/150/100/0
VHQ1
Chroma motion + optimizer
Then I select say 20% quality and get one file. After that I select 30% quality and get exact the same file! Then I select 40% quality and get again exact the same file! So in fact I get step like change in size with the steps of 25-30% which is wrong... I don't have this problem if I use quants 3/4 and increase even 1% in quality will give me increase in file size. So I was wondering if anyone else had such problems in the past. As this obviously will not be fixed - does anyone knows a workaround? (or may be it's just a particular problem with settings...)
PowerMacG4
18th January 2004, 20:17
Originally posted by len0x
Weird thing happening with the following setup:
quality based mode
min quants = 2
max quants = 3
custom mpeg matrixes
bframes: 1/150/100/0
VHQ1
Chroma motion + optimizer
Then I select say 20% quality and get one file. After that I select 30% quality and get exact the same file! Then I select 40% quality and get again exact the same file! So in fact I get step like change in size with the steps of 25-30% which is wrong... I don't have this problem if I use quants 3/4 and increase even 1% in quality will give me increase in file size. So I was wondering if anyone else had such problems in the past. As this obviously will not be fixed - does anyone knows a workaround? (or may be it's just a particular problem with settings...)
I don't really understand what you are asking, but you shouldn't limit quants like that.
Soulhunter
18th January 2004, 20:22
I could be wrong, but...
When you limit the quants. to 2/3, the resulting file can only hold quants with 2/3 !!!
Example:
100% quality would produce a "all quants. = 2" file..
95% quality would produce a "most quants. = 2, some = 3" file..
90% quality would produce a "some quants. = 2, most = 3" file..
50% quality would produce a "all quants. = 3" file..
40% quality would also produce a "all quants. = 3" file..
30% quality would also produce a "all quants. = 3" file..
20% quality would also produce a "all quants. = 3" file..
1% quality would also produce a "all quants. = 3" file..
And so on...
Hope you know what I mean... ;)
The quality cant be lower than the restriction you set as minimum qunat... :rolleyes:
With your settings, the lowest possible quality is a fixed quant. 3 encode !!!
But as I said, I could be wrong... ;)
Bye
Flipin
18th January 2004, 20:42
Quality mode calculates the average quants needed to obtain the quality requested. If you choose quality 30, it'll probably choose quants around 10 and 12. If you choose q90, it'll be around quant 4. Quants define the perceived quality and is propotional to filesize. Quality goes up, quants go down. And since the quality mode affects quants, limiting quants will limit quality mode.
simply put:
1. Don't manually limit the quality if you wish to manually adjust the quality.
2. adjusting manually quants (quant mode) will give you direct control over quality.
3. The quality mode has been removed and replaced by quant mode in newer xvid versions.
4. Reporting bugs from older versions is not very useful.
I hope this helps..
EDIT:
it would seem someone posted ahead. Maybe I shouldn't go eat while answering. :p
len0x
18th January 2004, 21:02
Guys, I didn't ask your opinion on limiting quantizers and I'm perfectly aware of what I'm doing :) (but thanks anyway)
Guess what - I found a problem: it's chroma optimizer which causes it - without it everything behaves like it should. Just so you know now :)
P.S. For those who don't know how quality based mode works brief summary: it always uses just _two_ quantizers.
Soulhunter
18th January 2004, 22:10
Originally posted by len0x
P.S. For those who don't know how quality based mode works brief summary: it always uses just _two_ quantizers.
Hmm... Which two ???
Different ones, for different percentage ???
So, how has your result changed now ???
Do you really get lower file size at lower quality percentage ???
When yes, what quants are used then ???
Lower quants than 2/3 ???
When yes, what is the quant limitation to 2/3 then good for ???
I just try to open up my horizon... ;)
Bye
len0x
18th January 2004, 22:28
XviD calculates average quantizer from min quant, max quant and quality percentage and uses integers below and above for encoding. Average quantizer is kept by using specific frequences of lower and upper quantizers (and therefore you are able to get different sizes even for a small change in average quantizer, i.e. 2.75 vs 2.80). So if you average quant is less than 3 then 2/3 quants are used no matter what, so there is no harm in limiting them manually if you know the average quantizer you're going for...
P.S. small change in average quant didn't work for me with chroma optimizer on, but worked without.
Soulhunter
18th January 2004, 22:43
Originally posted by len0x
...so there is no harm in limiting them manually if you know the average quantizer you're going for...
THX for the info... ;)
So Its like a "advanced" fixed quant. mode in this case...
When you would need a avg. quant of 2.5, FQ would do a "stupid" quant. 2,3,2,3,2,3... encoding !!!
While QB with limited 2/3 quants. would place them more intelligent, like 3,2,2,2,3,3... for example !!!
Right... ???
Never got the idea to use the QB mode this way !!!
Bye
Assault
18th January 2004, 23:01
No that isn't right Soulhunter. There's no smart qant decision. QB encoding chooses the quantizer by that formula: ((MaxQuant-MinQuant)/100 * (100-quality) + MinQuant)
If you for example choose a min quant of 2, a max quant of 3 and a percentage of 50 your encode will have an average quant of 2.5 (((3-2)/100*(100-50)+2)=2.5).
Btw. the quants will be chosen like that: 2,3,2,3,2,3,2,3,2,3. ;)
Assault
Soulhunter
18th January 2004, 23:22
Originally posted by Assault
There's no smart qant decision.
Then there "should" be one in the future... ;)
Originally posted by Assault
If you for example choose a min quant of 2, a max quant of 3 and a percentage of 50 your encode will have an average quant of 2.5...
Btw. the quants will be chosen like that: 2,3,2,3,2,3,2,3,2,3. ;)
So, then I don't see a reason for using QB with limited quants, instead of using fixed quants... :confused:
Thought that was the reason why len0x did this... :rolleyes:
But both results will be 2,3,2,3,2,3... then !!!
Bye
len0x
18th January 2004, 23:41
Originally posted by Soulhunter
Thought that was the reason why len0x did this... :rolleyes:
the reason I'm using 2 quant limitation is because I'm able to control average quantizer more precizely. Consider this: normally you have 2/31 and 100% so that gives you step of 0.29 for average quant. But if I use always two next quants then step is 0.01...
Soulhunter
19th January 2004, 00:10
Originally posted by len0x
the reason I'm using 2 quant limitation is because I'm able to control average quantizer more precizely. Consider this: normally you have 2/31 and 100% so that gives you step of 0.29 for average quant. But if I use always two next quants then step is 0.01...
Got it... :D
Bye
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.