PDA

View Full Version : How to correlate DivX / H.264 quantizers ?


MarcioAB
5th May 2008, 02:23
Is there any way to correlate them ?

Thank you

Dark Shikari
5th May 2008, 03:46
The MPEG-4 ASP linear quantizer scale is quite odd (and at odds with almost all other quantizer scales). But as a generality, QP2 in ASP is roughly equivalent to QP18 in AVC.

Selur
5th May 2008, 08:25
here's what I got from some posts in the forum:
The mapping is approximately H264QP = 12 + 6*log2(MPEGQP).
For example, MPEG at QP=2 is equivalent to H.264 at QP=18.
It's equivalence in quantizer (or lambda for rate-distortion). Which tends to be somewhere between size and quality.
The equivalent of XviD's quant 2/4 would be P-frames at qp=18 and B-frames at qp=24. But I have always been annoyed by XviD's low quality B-frames, so I turned it down. P@qp=18 with B@qp=21 (i.e. pb_factor=1.4) is the optimal psnr per bitrate, but you'll have to decide for yourself whether it looks better.
H.264@qp=37 is ~equivalent to mpeg4@qp=18, while H.264@qp=46 would be equivalent to mpeg4@qp=50 if the scale went that high.

weaver4
5th May 2008, 22:13
So are these three equal?
Xvid Q=2
DivX Q=3
H264 Q=18

So for DivX would the equation be:

H264QP = 12 + 6*log2(DivXMPEGQP - 1)

Brother John
8th May 2008, 13:23
Define “equal”.

Selur
8th May 2008, 16:26
and who said that Xvid quant=2 equals DivX quant=3?

weaver4
8th May 2008, 16:41
I believe that going lower than Q=2 on XviD has no improvement and the same goes for DivX at Q=3 and H264 at Q=18.

XviD at Q=3 is "roughly" equal to DivX at Q=4 in filesize and quality.

Dark Shikari
8th May 2008, 18:59
I believe that going lower than Q=2 on XviD has no improvement and the same goes for DivX at Q=3 and H264 at Q=18.

XviD at Q=3 is "roughly" equal to DivX at Q=4 in filesize and quality.Xvid and DivX use the same quantizer scale.

Brother John
8th May 2008, 23:42
If you want to compare visual quality the quantizer alone doesn’t tell you too much. You MUST compare complete encoder setups at about the same file size.

That ASP QP2 = AVC QP 18 is just a very rough approximation of this (in itself really vague) concept of »maximum quality«. It’s true that some people claim that DivX comes out quite differently than Xvid at the same quant but that’s most likely caused by the rest of the encoder setup. DivX and Xvid are both MPEG-4 (A)SP encoders and use exactly the same quantizer concept.

Irakli
9th May 2008, 13:34
That ASP QP2 = AVC QP 18 is just a very rough approximation of this (in itself really vague) concept of »maximum quality«.

100% agree. I can also add that XviD at q2 in many cases comes out at a filesize which is too big to be useful.

For example, yesterday I tried to encode The Godfather (part 1) DVD to XviD at q2 with custom matrix (I am not satisfied with the quality of h263 quant method). Resulting file's bitrate was about 4650kbps (too much to fit on DVD5 and very close to the bitrate of the original). The same encode using x264 at crf 18 gives comfortable 2900kbps (meaning the whole movie with original ac3 soundtrack is just 3.9GB in size).

Regards,
Irakli

MarcioAB
10th May 2008, 02:38
I'm analyzing Quantizers versus Compression using some movies (Signs, Eragon, Casablanca) as reference and found that a movie with a constant Q has a direct (linear) relationship with Log(Compression Index).
Based on that (only on Signs so far) and assuming DixX is a little less "efficient" than x264, I found the following DivX / x264 relations:

2 / 15.7
3 / 20.5
4 / 23.5

Also found this form to classify:

http://pws.prserv.net/marcioab/Image1.gif

Will post a picture from the graph as soon as I can.

weaver4
12th May 2008, 00:27
Xvid and DivX use the same quantizer scale.

Yes they do but the base quantizer for DivX is 3 and XviD is 2.

That is why programs like autogk tell you to set the quality level to 75% for XviD and 60% for DivX. Where the quality table for quantizers looks like this.

2.5 = 80 %
2.67 = 75 %
2.99 = 67 %
3.51 = 57 %
4.0 = 50 %

http://www.autogk.me.uk/modules.php?name=TutorialEN