Log in

View Full Version : Quality percentages explained.... please.


yetanotherid
23rd November 2008, 18:44
I've been using AutoGK for a while now. Very happy with it. I'm a bit stumped on the meaning of the percentages it gives when running compressibility tests etc though.

I understand that when running single pass encoding the percentage equals quality.

Normally when converting to XviD I pick a target file size and hope for a reasonable quality when performing 2 pass encoding. If I guess wrong I pick new file size and do it again. I try to aim for the final quality to be around 75% (with a decent resolution of course) under the assumption that this would give me equal or better quality than a 75% single pass encode, and probably with a smaller file size. That seemed logical to me otherwise what's the point of two pass encoding if it doesn't improve quality and/or reduce file size when compared with single pass encoding?
So after all this time running two pass encoding I tried both and the result surprised me.

I picked a video, ran single pass 75% quality encoding and it gave me a 1.9GB file (old 16:9 video).
Okay I thought, now I'll run two pass encoding making sure the audio and resolution settings are the same and I'll get as good a quality or better video. It looks the same, but I don't understand the percentages.

Compressibility percentage is: 74.49
Predicted comptest value is: 70.03%
Expected quality of first pass size: 73.38%

Could somebody please explain the exact meaning of each of those percentages and their relationship to the original 75% quality single pass encode? I know they don't differ greatly, but I was expecting them to be higher than 75% rather than lower.

The only other setting which I believe could effect the result is the stand-alone player compatibility option. I have it enabled but apparently some compatibility settings are ignored when using single pass encoding. Could that explain the difference?

Or do I just not understand what I'm looking at? It's just that if a 75% single pass encode gives me certain file size, I'd have expected 2 pass encoding with that target file size to be 80% or more.

Thanks.

CWR03
24th November 2008, 02:14
The problem with encoding single-pass at a quality percent setting is that it doesn't take motion into account. If you encode two movies with 2-pass that are the exact same runtime and resolution, but one is an action film and one contains lots of static scenes, the action film will look worse at the same filesize because it reallocates the bitrate where it's needed to prevent the higher motion scenes from being "blocky". There's really no way to judge the quality of a 2-pass encode beforehand.

yetanotherid
24th November 2008, 12:10
So how does the 75% quality single pass setting work when it comes to the two films in your example? Is it 75% "average" quality so the film with static scenes will always look good while the action movie will have parts of low quality? Or is the 75% quality setting enough to ensure the action looks fine while the static scene quality is higher than necessary?

I'd assumed it was the latter which is why I assumed I could encode using a 75% quality single pass, then take the resulting file size, use it as the target file size for 2 pass encoding and in the end have a higher quality encode due to it being more efficient.

"If you encode two movies with 2-pass that are the exact same runtime and resolution, but one is an action film and one contains lots of static scenes, the action film will look worse at the same filesize because it reallocates the bitrate where it's needed to prevent the higher motion scenes from being "blocky"."

Even that makes no sense to me.
I understand the "action film looking worse" part. That makes sense. But to say it looks worse "because" it reallocates the bitrate where it's needed? Isn't that the whole point of reallocating the bitrate, to reduce the amount by which the action film looks worse (to use the bitrate more efficiently) rather than it being the cause of it?
I must be not getting something there.

Thanks.

Dark Shikari
24th November 2008, 12:35
"If you encode two movies with 2-pass that are the exact same runtime and resolution, but one is an action film and one contains lots of static scenes, the action film will look worse at the same filesize because it reallocates the bitrate where it's needed to prevent the higher motion scenes from being "blocky"."

Even that makes no sense to me.
I understand the "action film looking worse" part. That makes sense. But to say it looks worse "because" it reallocates the bitrate where it's needed? Isn't that the whole point of reallocating the bitrate, to reduce the amount by which the action film looks worse (to use the bitrate more efficiently) rather than it being the cause of it?
I must be not getting something there.

Thanks.It doesn't make sense because its wrong.

Most encoders use the same formula for 1pass and 2pass, and thus the bitrate distribution is, ideally, the same. The difference in distribution is because in 1pass mode, the encoder doesn't know what the overall complexity of the input is and thus has to guess. However, the formula is the same: its just using a guess instead of the actual numbers.

The idea of "bitrate being allocated to action scenes" is probably a lost-in-translation-somewhere-along-the-way explanation of quantizer curve compression, which is to raise quantizer in complex scenes and lower it in simple scenes. As far as I know, both Xvid, x264, and libavcodec ratecontrol use this. This works for the following reasons:

1. In fast motion/etc, you can get away with lower quality to begin with.
2. Often, high motion scenes take vastly more bitrate than low motion, so saving a few bits there can disproportionately help the lower motion scenes compared to the loss of quality in higher motion.
3. Simpler scenes inherently need a lower quantizer to achieve the same visual quality as complex scenes.

CWR03
24th November 2008, 14:36
I realize now that my explanation wasn't very complete. An action film will look worse in low-motion scenes than a film with many static scenes because a lot of the bitrate has been reallocated to the higher motion scenes.

CWR03
24th November 2008, 14:39
It doesn't make sense because its wrong.
If I'm not mistaken, AutoGK uses constant bitrate for 1-pass encodes - if I'm wrong, then so would be my comments.

yetanotherid
24th November 2008, 15:41
Okay.... cause I just gotta know how this works because not knowing feels too much like being stupid..... ;-)

If I open either video using ffdshow it tells me the same story for each one. Frame mean quantizer jumps everywhere between 2 and 5, the frame bitrate is all over the place. So from that I'd assume the single pass encode wasn't constant bitrate.... or constant quantizer? I'm now even more confused.

Opening both AVIs with Gspot it tells me the info for the single pass 75% quality encode is:
File size 1.94GB, 1718kbps, Qf 0.229
The 2 pass encode:
File size 1.99GB, 1776kbps, Qf 0.237

I guess when the single pass encode hit 1.9GB I must have just gone for a 2GB target on the 2 pass encode. Which means there were a few more bits to play with. That explains the higher bit rate but the higher Qf I'm not getting.
So despite the slightly higher bitrate the mean frame quantizer was also slightly higher using 2 pass encoding.

It seems the 1 pass encoding "guess" explanation is the one which my brain is able to accept while inducing the least confusion in my head. :-) Although I'm still not sure I understand exactly what's going on.
If anyone's got an alternative way of explaining it to help me get my head around it, please feel free to share.

Thanks again.

Dark Shikari
24th November 2008, 17:14
If I'm not mistaken, AutoGK uses constant bitrate for 1-pass encodesIf it did, that would be retarded.

yetanotherid
24th November 2008, 17:20
if it did, that would be retarded.

lol. :d

manono
26th November 2008, 03:08
If I'm not mistaken, AutoGK uses constant bitrate for 1-pass encodes - if I'm wrong, then so would be my comments.
Hehe, you're wrong. It's 1-pass VBR encoding. Theoretically all scenes, complex and static, get the same average quant/quality - the average quant/quality being based on the percentage chosen. This will be modified if you choose to encode for ESS and MTK chipsets as the max bitrate will be throttled and you might get much higher quants during complex scenes. This is so there won't be stutters/freezes/glitches when playing the AVIs in DVD/MPEG-4 players which may not be able to handle high bitrates for extended periods.

yetanotherid
26th November 2008, 06:02
This will be modified if you choose to encode for ESS and MTK chipsets as the max bitrate will be throttled and you might get much higher quants during complex scenes. This is so there won't be stutters/freezes/glitches when playing the AVIs in DVD/MPEG-4 players which may not be able to handle high bitrates for extended periods.

I always wondered what exactly happens when you picked that option, and which compatibility settings are ignored when doing single pass encoding with AutoGK (the warning message doesn't tell you). I didn't know it limits the bitrate. I assumed it was more to do with the number of executive b frames, or GMC frames (which I don't really understand).

I'm actually planning on moving on from AutoGK. There seems to finally be some better options available. But none I've found with a chipset compatibility setting as such. I'm just trying to work out how to make sure my standalone player can cope with my AVIs if I'm using something else.
What about pixel aspect ratio? Does that matter? Staxrip seems to encode differently which I like because it got the aspect ratio of my test encode perfect. AutoGK always seems to have to "fudge" it a bit.

And one other question if you don't mind.... perhaps I should have started a new thread.... I recently converted a DVD which was 720x480 with a 16:9 aspect ratio. When I converted it with AutoGK it gave me 720x304. StaxRip told me full resolution was 704 rather than 720 and produced a 704x352 avi which was spot on when compared with the original video's output aspect ratio. I must still not be understanding aspect ratios properly as I'm not understanding why the 704 avi is larger on my monitor than the 720 one.
Why 704 rather than 720 being the full resolution, and why does AutoGK always have to "fudge" it? Here's the full specs. If someone could explain them I'd appreciate it.

720x304, SAR: 2.368 (45:19), PAR: 1.000 (1:1), DAR: 2.368 (45:19)

704x352, SAR: 2.000 (2:1), PAR: 1.212 (~17:14), DAR: 2.424 (~17:7)

When compared with the original video, as it displayed on my monitor using Media Player Classic, the first conversion (AutoGK) definitely had a slightly different aspect ratio. The second one (StaxRip) was spot on.

Sorry for all the questions. Just trying to learn.
Thanks.

manono
26th November 2008, 23:24
I assumed it was more to do with the number of executive b frames, or GMC frames (which I don't really understand).
I think there is only 1 B-Frame with all settings. If using XviD, there's no GMC or Q-Pel used. Another difference if choosing the ESS chipset option is that you get only the standard quantisation matrices, and not the custom matrices as with the default or MTK choices.
Staxrip seems to encode differently which I like because it got the aspect ratio of my test encode perfect. AutoGK always seems to have to "fudge" it a bit.
I haven't used StaxRip, and it's good, I know, but AR differences might be attributable to AutoGK's use of Mod16 resolutions and/or it not using ITU resizing by default. You can turn on ITU resizing in the Hidden Options (I would). But like I said, as I've never used StaxRip I wouldn't know for sure.
...and produced a 704x352 avi which was spot on when compared with the original video's output aspect ratio
I'd take AutoGK's result over a 704x352 result, as that's 2:1, and unless this DVD was made by some fly-by-night company that cropped the heck out of it, as far as I know, there's no such thing as a 2:1 movie. What movie was that, if you don't mind me asking? And which region and DVD company? Oh, I see - different PAR. Then you might try turning on ITU resizing in the Hidden Options of AutoGK (CTRL-F9). AutoGK makes all AVIs 1:1. At the time of development there weren't any DVD/MPEG-4 players that would take the PAR into account. There are a few now.

yetanotherid
28th November 2008, 07:52
Thanks for the info. I'm starting to get the idea now.
I've probably seen the ITU resizing option before but not thought about it. Now I'll have to try the same conversion again to see what happens.

So I guess as far as the compatibility thing goes I'll just have to suck it and see. I put XviD in "Home Cinema" mode (or whatever it's called) before running StaxRip so hopefully I'm safe there. Just got to make sure the standalone players cope with different PARs.

Are there any good standalone h.264 players yet?

yetanotherid
8th December 2008, 09:48
Well I tried the ITU resizing option and still ended up with the same 720x304 video with square pixels, so now I'm confused as to the difference in resizing methods.

I assume PAR is pixel aspect ratio, and DAR is display aspect ratio, and I know SAR is sample aspect ratio but I don't actually know what sample aspect ratio means. Anyone who can help there?

manono
8th December 2008, 10:35
Well I tried the ITU resizing option and still ended up with the same 720x304 video with square pixels,
You won't necessarily get a different resolution out of it (although often you do), but I suspect it was cropped differently before resizing to the same resolution. If you still have the earlier 720x304 encode handy, and if you compare the 2, you should see some differences.

yetanotherid
8th December 2008, 11:27
YIf you still have the earlier 720x304 encode handy, and if you compare the 2, you should see some differences.

Me and my overly enthusiastic use of the delete button.....

Off to encode something...... :(

yetanotherid
10th December 2008, 16:30
If you still have the earlier 720x304 encode handy, and if you compare the 2, you should see some differences.

Well I did some more encoding over the last few days, comparing resizing methods etc.

Comparing the video I converted using the two different resizing methods I was suprised to find (given your recommendation) that AutoGKs default resizing method was much closer to the original video aspect ratio then using the UTI method. Both produced a 720x304 AVI, but the UTI version had small back bars on the sides and the video was a bit squished vertically.

Here's another question if anyone can help. I noticed when converting some of the videos AutoGK was choosing either a 704x304 resolution, a 720x304 resolution or a 720x320 resolution (depending on whether I gave it a large enough file size). But what I did notice was that even when it selected a 720x320 resolution, the resulting AVI was still only 720x304. Any idea why that's happening? :confused:

manono
11th December 2008, 05:43
OK, first read this:

http://forum.doom9.org/showthread.php?t=42708

Scroll down to the paragraph that begins, The main reason for this thread though, is to post a reply that TheWEF made recently on the subject of the Pixel Aspect Ratio (PAR) and the ITU-R BT.601 Standard. Maybe also read the 2 links it gives at the bottom.

Second, you haven't said yet what you're using to define the "correct" AR. You're playing the original DVD, I assume. Using what? If PowerDVD, then it gets it wrong, and can't be trusted to show you the correct anything. The same can be said about most software DVD players. You could try and find something big and round, a sun, moon, ball, etc., and measure the width and height.

Granted that there shouldn't be black bars on the sides when done. Maybe the amount of black varies in different parts of the video. Maybe you have to make some adjustments in the Hidden Options to get AutoGK to remove them better.
But what I did notice was that even when it selected a 720x320 resolution, the resulting AVI was still only 720x304. Any idea why that's happening?
I don't understand. Are you saying the log shows it to be 720x320 but the AVI is really 720x304?

yetanotherid
12th December 2008, 04:58
OK, first read this:
http://forum.doom9.org/showthread.php?t=42708
Scroll down to the paragraph that begins, The main reason for this thread though, is to post a reply that TheWEF made recently on the subject of the Pixel Aspect Ratio (PAR) and the ITU-R BT.601 Standard. Maybe also read the 2 links it gives at the bottom.

I'll probably have to read it again, but I think I'm getting my head around this.....

Second, you haven't said yet what you're using to define the "correct" AR. You're playing the original DVD, I assume. Using what?

Well I'll admit I simply assumed when playing the DVD I'd be seeing the correct aspect ratio. I'm using Media Player Classic and ffdshow.
When I say "the original DVD" it is a copy shrunk to fit on a burnable disc. If the aspect ration went astray during that process and was then corrected again.... I think I might have a lay down and a little cry.... ;-)

Granted that there shouldn't be black bars on the sides when done. Maybe the amount of black varies in different parts of the video. Maybe you have to make some adjustments in the Hidden Options to get AutoGK to remove them better.

Obviously I'm going to have to do some more comparisons using "original" DVDs now, but I converted 6 DVDs when I was doing the tests and the results were the same each time. The default resize method "appeared" to be more accurate.
Should MPC display the aspect ratio correctly? Because it's not that the aspect ratio was different as such, both methods produced the same size AVI, it's more that the default method looked the same as the original. The UTI method produced a video which when compared using MPC, appeared.... well the best way to explain it..... if you could grab the picture with a finger and thumb in the middle and squeeze it together a little, which would also cause it to stretch towards the sides....

I don't understand. Are you saying the log shows it to be 720x320 but the AVI is really 720x304?

Yes. That's exactly it. I'm pretty sure it happened using both resize methods.
If I used a 1200MB file size (one particular DVD), AutoGK chose a 704x304 aspect ratio (it looked like it simply chopped a few pixels each side). If I used a 1250MB file size it gave me 720x304. When I tried 1300MB it told me it was giving me 720x320 but the result was still 720x304 only despite the extra 50MB AutoGK was claiming a lower quality percentage. With a 1350MB file size AutoGK told me it had chosen 720x320 but the result was still 720x304.

I'm pretty sure that's how the chosen aspect ratios, quality and file sizes matched up but I didn't keep the log files. I'm 100% sure it was claiming 720x320 and giving me 720x304 though. And 720x304, when compared with the original DVD was pretty right.

yetanotherid
13th December 2008, 04:58
Okay this is fun. Now I might just have a lay down and a big cry......

So I thought I'd try a fresh conversion comparing the two resizing methods. I picked an original DVD off the shelf. It was T2 - The Directors cut. I ripped it to my hard drive then asked AVG to convert the last vob file. After a few attempts to get AutoGK happy to give me the full resolution I then re-encoded it using the exact same settings, but turning the UTI resize option on. Then it got interesting....

The first AVI using the default resizing method was supposed to be, according to AutoGK's log file, 720x304. However this time it was the opposite of my last experience. The resulting AVI was in fact 720x320. So I opened up the UTI resized AVI using Media Player Classic. AutoGK said it was going to give me a 720x304 AVI again, but this time that is what I got. Comparing the two I didn't see and resolution "distortion" like last time. The UTI resized AVI didn't of course have the same height as the first, so the picture was squished down accordingly. Quite evenly though, over the whole picture. If you saw it by itself it would look quite natural.

So finally I fired up another instance of Media Player Classic and loaded up the original vob file. With free windows sizing disabled in Media Player Classic I then made the window smaller until it's size matched that of the windows playing the AVIs. No doubt about it at all, the AVI produced using the default resize method, the one that was supposed to be 720x304 but turned out to be 720x320, that AVI was almost an exact match for the original as MPC was displaying it on my monitor. The UTI resized AVI was not.

Okay so now I have no idea what's right, what's wrong, and what's in between. If it could possibly make a difference I'm not using the version of XviD that comes with AutoGK. I guess as soon as I get a chance I'll have to revert back to that version of XviD and run the same conversions again to see what happens. Until then though, does anyone have any idea as to WTF is going on???? :-)

Thanks.

manono
13th December 2008, 06:07
I have no idea how MPC does its resizing. Use whichever method makes you happy. After all, you're not trying to please me, but yourself. This is a subject that can (and sometimes does), incite flame wars and all kinds of crazyness. I'm far from an expert on the subject and just take my cue from my betters.

yetanotherid
13th December 2008, 06:13
To be honest, I'm just trying to get it right. By that I mean a conversion method that's going to be as close as to the original as possible every time, if that's possible. I'm starting to wonder....
I'd also like to know if what MPC is displaying can be relied on etc.

I might start a new thread on this once I've redone those conversions with the version of XviD that comes with AutoGK, assuming I get the same results, and see if I can get some answers. I'm not actually looking for correct or incorrect as such, just wanting to know what's actually happening and why. Then I can decide what makes me happy. ;-)

Thanks.

yetanotherid
15th December 2008, 14:54
Well I thought I'd add one more post here, just for the sake of completeness on the subject......
Yesterday I restored another Ghost image, one made back before I installed any codecs or third party media players or conversion software. I then installed Nero, AutoGK 2.48 with the default version of XviD, Media Player Classic and ffdshow. I copied vob files from three pre-ripped DVDs to the PC along with an mpeg2 video recorded from free to air TV (720x576, 16:9). I converted each to an AVI using AutoGK's default resize method and then again to an AVI using the UTI resize method.

I then loaded the original video files into three different players (Nero, WMP and MPC) in order to determine it was being displayed the same in each player. I did the same with the converted AVIs. Either all three players get it wrong or they all get it right, but either way whatever video I played in one player looked exactly the same in the other two. From there I then simply used MPC to compare the original videos with the corresponding AVIs for each resizing method.
In all four cases, the AVI created using AutoGK's default resize method displayed pretty much the same as the original. In all four cases though the AVI created using the UTI resize method was displaying in a noticeably different way to the original. The actual resolution was always the same, but the way the image had been resized obviously wasn't. The UTI resize method always seemed to distort the image in some way (stretching it a bit while cropping more at the sides for example).

I'm not trying to start any flame wars or arguments etc. I just thought seeing as I went to all the trouble of running some tests myself I'd share the results. All I can do is take my cue from what my eyes tell me, and for the moment I guess that'll keep me happy. ;-)

deejay.2001
10th January 2009, 20:48
hi

i was as wondering if someone could tell me differencies and explain which file to keep and which is better
i encoded with (AUTOGK) twice movie with final size 1400mb file, one with 640 fixed width, second with auto width...i was wondering which file to keep dont seem any differencies in bitrate 1800kbps in both files when i checked it in gspot

so both files same setup, the only difference is chosen width

1. file 640x480 fixed width (i have chosen manualy), size 1400mb
Compressibility percentage is: 57.21
Predicted comptest value is: 57.21%
Expected quality of first pass size: 56.75%

2. file auto width chosen by autogk 576x432, size 1400mb
Compressibility percentage is: 48.58%
Predicted comptest value is: 72.58%
Expected quality of first pass size: 67.75%

so both files encoded the same way, autogk just chosen lower resolution, i dont know why because overall bitrate was around 1800kbps in both files which i think is high enough to chose higher resolution

can someone tell me why autogk has chosen lower bitrate if final bitrate was high enough around 1800kbps...
which file i should keep, my eye dont see any difference....how important are those percentages by encoding...
thanks to all for input

manono
11th January 2009, 03:22
Hi-
..i dont know why because overall bitrate was around 1800kbps in both files
If on auto width, it tries to get a predicted comptest value of between 70-75% (or so, len0x could give you the more accurate figures.). Even though that figure was revised downward in the expected quality, it got 72.58%.

As for which is the better quality encode, you'll have to decide for yourself, and it's probably impossible to do. The lower resolution one (the auto width one) will be slightly softer but have less artifacting because it has a lower average quant. The fixed width one will be slightly sharper but have more artifacts, perhaps in the form of color smearing during complex scenes and mosquito noise around sharp edges. The percentage is still high enough so I doubt it has any macroblocking during complex/action scenes, as you'd get with even lower average percentages.

But, as I said, the encodes are so close and the differences so minute that you may not be able to see anything different between them. You could run them both through DRF Analyzer and note that the higher resolution one also has a higher average quant.
...1800kbps in both files which i think is high enough to chose higher resolution
The bitrate has next to nothing to do with the outcome quality. Different movies compress differently. 1800 could be overkill for one movie at one resolution and not near enough for a different movie at the same resolution and all other settings the same. The only way to be assured even quality among all your encodes is to run 1-pass Quality Percentage encodes, but then your file sizes will be all over the place. Try it yourself for a few different kinds of movies and you'll quickly discover that the bitrate needed to ensure the same quality can be very different for different movies.
.

yetanotherid
11th January 2009, 06:17
2. file auto width chosen by autogk 576x432, size 1400mb
Compressibility percentage is: 48.58%
Predicted comptest value is: 72.58%
Expected quality of first pass size: 67.75%


can someone tell me why autogk has chosen lower bitrate if final bitrate was high enough around 1800kbps...
which file i should keep, my eye dont see any difference....how important are those percentages by encoding...
thanks to all for input

I agree with everything manono said and just wanted to add:
You appear to have an older (maybe) video there in 4:3 aspect ratio/resolution. Therefore it has a larger "area" of picture than a wide screen video of the same width would. It's also possible that if it's an older video it's also of a lower quality than average and harder to compress.

I've encoded old 4:3 VHS tapes which I've transferred to the PC. Because of the VHS factor the quality wasn't great and then there's the larger picture area.....
I recently transferred some old 30 minute TV shows. To keep them at 75% quality and full resolution AutoGK was producing video with double the average bitrate you're referring to and file sizes between 700 and 900MB.

deejay.2001
11th January 2009, 12:34
thanks for answers
according to your input probably best is leave width on auto,
because you might get low numbers in those tests...
can you guys please tell me what numbers in those percentages should be around in each to achive good rip or what is i should look at the most?


Compressibility percentage is: ?
Predicted comptest value is: ?%
Expected quality of first pass size: ?%


thanks all

manono
11th January 2009, 14:21
The compressibility percentage doesn't mean much as it's always done using a 640 width (I think) and testing with 5% of the movie. The predicted value is an educated guess based on the final resolution selected and also testing only 5% of the movie. The most accurate one is the expected quality, because it gives a percentage based on the entire movie done at the final resolution.

What's a good figure? The ones that AutoGK tries to achieve.