Log in

View Full Version : Quantitative Quality


BxWrapper
2nd December 2002, 06:12
I don't know if this the right forum, but let me roll on.

Quantization during MPEG encoding introduces the lossy part of MPEG encoding. It can be seen as a low pass filter rejecting the high frequency components of the picture. High quantization will produce less sharper image.

So far, we let our eyes judging the result as we claim "very good", "almost original DVD" and so on. I am probing that there must be some a way to judge the image quality with quantative method.

The question will be which one is the reference to compared with ? In most cases, original source can be assumed as a reference. In most cases, the closest the result to the original, is the better. However, it may not applicable for all case.

Here is the idea:

We can substract the original frame with the transcoded frame, pixel by pixel. To get more accuracy, we may need to do this on several frame.

I suggest comparing the luma component only since it is more sensitive to human eyes and also for simplicity.

If the original frame is equal to to the transcoded frame, the result will be a total black image. If it is not equal, pixels' differences will be pictured in the result. Then we can calculate the percentage of the black pixel as a indicator of "closeness" or quantitative quality.

I think this can be done using avisynth script (haven't checked yet) except probably for the quantitative quality figure.

Just a thought, you may disagree.

DJ Bobo
2nd December 2002, 12:29
I think, that pixel to pixel comparison was done in some guides of doom9. So I assume, it's possible if you respect some given rules.

But I think the average quantizer already gives you an idea about the image quality: the lower the avg quantizer, the closer to the original.

BxWrapper
2nd December 2002, 14:55
@DJ Bobo,

The guides is about codec comparison if I was looking the same thing you said.

I am talking a different thing. I am talking about a quantitative method to judge the quality of transcoded source.

I use the following Avisynth script:

LoadPlugin("C:\PROGRA~1\GORDIA~1\mpeg2dec.dll")
Clip1 = mpeg2source("E:\MOVIES BUFFER\rush\rip.d2v").crop(4,72,712,430).BicubicResize(704,304,0,0.75).greyscale()
Clip2 = Avisource("F:\Movies\movie.avi",false).greyscale()
Subtract(clip1,clip2)
Levels(127,1,129,0,255)

There are 2 interesting facts with the above script.

First, SUBTRACT adds "bias" 50% grey scale to the output.
Second, the substratct's result is quite small in magnitude, almost invisible and mostly occured at the edge of an object (quantization effect).

To make this visible, we need Levels(127,1,129,0,255) command to amplify the difference.

Open this script in VDub (make sure you get the correct files with the same resolutions). The movie's artifacs are now visible.

?¿öM¿?
2nd December 2002, 19:38
That is really interesting, I like your idea.:D

Acaila
2nd December 2002, 22:02
The basic theory behind your idea is sound, but compression with DivX 5 makes direct comparison of an encoded video with its source in my opinion impossible.
B-frames, GMC, psycovisuals, preprocessing all change a frame in ways that still "look" like the original, but when doing a direct comparison might have an 80% or so difference. The difficulty here is that all good codecs don't just stupidly compress a video, but they try to intelligently decide where compression can be increased in situation where it won't result in a (for us) visual degradation. A computer however looks at a frame quite differently then us humans do and thus will give you a different result when comparing.

BxWrapper
3rd December 2002, 09:20
@Acaila

Couldn’t agree more.
The idea is just to show “how much” different between the encoded frame against the original frame.

To be honest, it is a little bit surprised for me to see how small is the difference between those two. It is almost imperceptible !. I can only see it clearly when it is being amplified using the Level command. But nonetheless, it is there :)

A little bit OT, this is the same case with MP3 or other lossy audio format. We know our ears (adult) is probably limited to 8 KHz max (when the last time I did a chamber test ;)). And those lossy compressions technique takes advantage of this fact. BUT, nonetheless, for some perfectionist with golden ear, they can hear the difference :). They definitely miss the high frequencies and its harmonics of the original sound when listening to it.

When talking about video, it may be the same case or may be not.
The truth is that high frequency components have been suppressed to gain the compression.

DJ Bobo
3rd December 2002, 13:18
8 KHz? you've gotta be kidding! if that's true, you've got damn bad bad ears.
Most people can hear up to 16~17KHz. Younger people can hear up to 18~20KHz.
During a test, I and some friend of mine were able to hear up to 22KHz (the test limit was 22KHz). May be I can hear more, if anyone knows a test that goes beyond 22KHz (say 24KHz), please tell me.

BxWrapper
3rd December 2002, 15:38
Indeed,

And you are one of those guys with golden ears, I guess. :D

The 8kHz is the -3dB cutt-off response. The peak is probably 5kHz (human voice).

I still could hear 13 kHz but not as sensitive as in the lower frequency. I guess it is quite fine for fortiesh.

By the way, MP3 probably is not for you. Should OGG's q > 10 ? :)

DJ Bobo
3rd December 2002, 15:49
Oh no, I'm not that freak, I can live with a 15~16KHz low-pass filter, especially when it's not a really important rip (in that case 128kbps j-stereo or 80kbps mono MP3 is fully sufficient)

There is also a funny thing, starting from a 18~19KHz low-pass filter, I can't hear the difference between the original CD and the MP3, so for high quality rips (titles I really care about), I tend to use at least 192kbps. Still I use a low-pass of 20KHz for CD rips and 20,3KHz for DVD rips.

Nevertheless I can hear frequencies beyond 20KHz.

Iznogoud
3rd December 2002, 16:09
I tought that the all audio/ HiFi equipment are "cutted" between 20 Hz -20 KHz (like audio cd:s are), so with what do you listen sounds over 20 KHz? Don´t get me wrong, I believe you can hear it and good for you but from where? I can just about hear 16 KHz:(

DJ Bobo
3rd December 2002, 23:25
I don't know anymore, I found some wav file somewhere which frequency was changed continiously from 10 to 22KHz, and I was able to hear it to the very end, so I assume I can even hear beyond 22KHz ...

Hmm .. I found it: http://ff123.net/sweep.html

BTW, I have a decent SONY stereo system, so I guess it's good enough for such tests isn't it? :D

RadicalEd
4th December 2002, 00:16
its sad, I'm 16 and I got about 15khz on that test (good kilpsch speakers too)
yah well, as long as I can still hear bass thats all that matters :/

trodas
4th December 2002, 16:57
Damn, only 17.2kHz.
I dont know, maybe i can hear more (on studies i used to hear about 20Khz signal on osciloscope), but im 27 years old and probably aging have something to do there... :mad: :mad: :mad:

Tought, my young years is not as good, as it maybe sounds, as i used to hear high pitches from TVs and such crap, what really bother me a lot... Now the TVsets are quiet, coz maybe means, that i lost my ability to hear them...

OTOH, the audio system i have got is a real crap, its homemade by me, into 1992 from czech components, so, probably the two bands speakers and the homemade aplifier really cant get out of it more that 17kHz? Who knows, but hearing the 17,2kHz pitch hurt - not much, but a little...

DJ Bobo - what for you? :rolleyes: :(

Emp3r0r
4th December 2002, 19:03
I can hear tv's when they are on too. I thought I was crazy but maybe I just have good hearing.

Swede
4th December 2002, 19:07
Me too. I hear monitors all over the office but since I think this is a bit weird I don't tell anyone, I just turn them off. :)

DJ Bobo
4th December 2002, 19:39
@ trodas
As said, I can hear it to the very end thanks god! :)
I'm 21 btw

Acaila
4th December 2002, 20:41
The downside is I can only hear up to 18kHz.
The upside is I did a test similar to this about 10 years ago (I'm 23 now), and my max was also 18kHz back then. So at least my hearing hasn't degraded :).

Ps. I can hear whether TV's are on perfectly, but I've never heard a monitor before. What do they sound like?

?¿öM¿?
4th December 2002, 21:20
Originally posted by Acaila
Ps. I can hear whether TV's are on perfectly, but I've never heard a monitor before. What do they sound like?

The sweetest thing you could ever here. It is your loss that you cannot appreciate the beauty of a monitors high pitched buzzing.:D :D
LOL.

Iznogoud
4th December 2002, 22:48
The noise that a tv makes when it's on is exactly 15625 Hz, so even old geezers (30+ like me) can hear it... I can also hear a monitor easily and a very similar noise from my pc:s power supply. But I stll think you can't get anything over 20KHz out from "normal" stereo system so testing your hearing at home is not very scientific.