Log in

View Full Version : Quality of XviD's .avi


FiW
24th July 2002, 06:39
what calculate quality of xvid's .avi (like nandub/divx3)?

The People's Elbow
24th July 2002, 11:03
:confused: :confused: :scared: :confused: :scared: :scared:

Acaila
24th July 2002, 11:17
Nothing can, it's a Nandub/DivX3 only feature.

MoonWalker
24th July 2002, 20:24
Originally posted by Acaila
Nothing can, it's a Nandub/DivX3 only feature.

Acaila do you know how NanDub/DivX3 calculates this?(ie from i-frames/total frames etc)

MoonWalker

Acaila
24th July 2002, 20:50
No I don't.

If I'd have to guess I'd say that DivX3 stores the quantizer number it used to compress each frame in the final file and Nandub reads the quantizers and calculates a quality estimate from that.

Anybody know for sure?

manono
24th July 2002, 22:36
Hi-

The DivX Quality figure from DivX 3.11 comes from 200/Ave DRF (so, if Ave DRF=3, then DivX Qual.=66.67). If you know the Ave Quant (DivX 5.02 give it to you in the Analyze.log file) in XviD, you could derive an analogous figure. So how can you figure the average quant in XviD?

MoonWalker
24th July 2002, 23:01
I just took a look at nandub's source but I was a little lost and I couldn't found something...Well if it's 200/(Avg Quant) I can make my prog to calculate it..It already calculates the avg quant..The think that I don't get is why it's 200/(Avg Quant):p ??...

Maybe someone could look the source of nandub to see it it's 200/(Avg Quant) (I don't doubt manono that this is but I want someone to tell me how he has found it :p :p ).

MoonWalker

pandv
25th July 2002, 01:24
The think that I don't get is why it's 200/(Avg Quant)

Because if a movie encode is saturated (maximum quality, encoded with a constant quantizer of 2), the average quantizer is 2.

So, 200/2 = 100% quality.

You can get very bad encodes with 100% quality. Reduce the resolution to 100*..., and you get it. The exact number can be found with Nandub.

pandv

manono
25th July 2002, 03:22
Hi-

You can get very bad encodes with 100% quality.

Absolutely correct. You can also force high figures with the overuse of smoothers. But for "honest" encodes I find it a useful figure to have.

MoonWalker
25th July 2002, 08:44
Ok.I will make my prog display this...

You can get very bad encodes with 100% quality. Reduce the resolution to 100*..., and you get it. The exact number can be found with Nandub

I didn't get this..If you encode a movie with quant 2 you can get bad encodes?(If I get it right)

MoonWalker

BTW Anyone who knows where I can find in the sources of Nandub this?? :p

FiW
25th July 2002, 10:33
InputFile.cpp
...
if( pInfo->isDivX ) {
unsigned char *b = (unsigned char *)malloc( lActualBytes );
if( b ) {
if (!inputVideoAVI->read(i, 1, b, lActualBytes, &lActualBytes, NULL)) {
pInfo->lDivXComp += ((b[0] & 0x3E)>>1);
}
free( b );
}
}
...
if( pInfo->isDivX ) {
sprintf(g_msgBuf, "%7.3f", 200.0/(((double)pInfo->lDivXComp)/thisPtr->videoSrc->streamInfo.dwLength) );
SetDlgItemText(hDlg, IDC_VIDEO_COMPRESSIONLEVEL, g_msgBuf);
}
...

unplugged
25th July 2002, 11:19
Does exist an (auxiliary) image/video comparison tool like EAQUAL works with sound?

Something based on ITU Radiocommunication research...

manono
25th July 2002, 15:07
Hi-

I didn't get this..If you encode a movie with quant 2 you can get bad encodes?(If I get it right)

I think the point pandv was making was this:

Say you have a very noisy 2 hour movie that you encode in DivX 3.11 for 1 CD at 640x272. You may wind up with a very bad looking movie with DivX Qual=30 or something like that. But if you lower the resolution to 100*xxx (as in his example), then the DivX Qual=100, every frame encoded at Quant (DRF) 2, and the result may look even worse.

So, yes, in this not very realistic example the whole movie will be Quant 2 and still look like s**t.

pandv
25th July 2002, 20:03
Yes, manono is right.

Of course, my example is a extreme case to ilustrate the need to choose the right encode parameters.

Supose you want your movie to fit on one CD.

If you keep the original resolution you get high quantizers (and low quality).

If you reduce your resolution you get fewer high quantizers (and a superior quality.) This is true, also if you overreduce your resolution.

In the middle, there are one point with the correct resolution to get the bigger visual quality (not the bigger Nandub quality).

So, you can only compare the Nandub quality if you had choosed the correct resolution (with the help of GordianKnot, maybe).

And, also the smoothers, the quantizer distribution (curve tweak), etc. can modify the visual quality without a direct relation with the nandub quality.

Pandv.

MoonWalker
25th July 2002, 20:20
sprintf(g_msgBuf, "%7.3f", 200.0/(((double)pInfo->lDivXComp)/thisPtr->videoSrc->streamInfo.dwLength) );

I don't get this very well :p but this is 200/(avg quant * lenght)??

FiW
25th July 2002, 20:28
sprintf(g_msgBuf, "%7.3f", 200.0/(((double)pInfo->lDivXComp)/thisPtr->videoSrc->streamInfo.dwLength) );
avg.drf = amount.of.all.drf / frames
quality = 200 / amount.of.all.drf / frames
quality = 200 / avg.drf

MoonWalker
25th July 2002, 20:44
Thanks FiW...

Well I should read the code more carefully, make my brain work, and get some sleep :)

I will make my prog display this..

Thanks,
MoonWalker