Log in

View Full Version : Questions about quantization types in MPEG4 ASP


gamebox
9th October 2015, 22:01
Hello all. :) I've recently been experimenting with custom quantization matrices (like eqm v3ulr), for the purpose of testing the limits of this compression technology, and now I have some questions so I can understand MPEG4 ASP better.

First, what kind of "MPEG" quantization is the one available along H263? MPEG as in MPEG-1, MPEG-2, or something else? I ask that to understand the treatment it gives to image details.

Second, what makes H263 a separate quantization matrix? I understand it is not just MPEG with different coefficients. Why H263 has less ringing compared to MPEG?

Third, why are there no custom H263 matrices?

Thanks for your time. :)

LoRd_MuldeR
10th October 2015, 01:07
MPEG-4 ASP supports two different types of quantization, which are referred to as "MPEG" and "H263".

Only the "MPEG" type works with quantization matrices. Thus, only the "MPEG" type allows for using custom matrices. The "H263" type works in a different way, thus no quantization matrix, thus no custom matrices.

It seems that, in general, the H263 type produces a more "smooth" image, while the MPEG type produces a "sharper" image and preserves more detail. So you probably want to go with the MPEG type, unless you do ultra-low bitrate encodes.

If you want to use a custom matrix, MPEG is the only possible choice. But, regardless of what quantization type you choose, MPEG-4 ASP is still different from MPEG-2 or MPEG-1. Anyway, why bother about MPEG-4 ASP these days?

gamebox
10th October 2015, 11:46
Thanks for your reply, Lord Mulder. :)

Though, I know most of the things you pointed out. What I was asking about the MPEG quantization type in MPEG4 ASP was how different it is from quantization types used in MPEG-1 and MPEG-2? Visually, it seems very close to MPEG-1 for me, but I wanted to know if that MPEG quantization type in MPEG4 ASP is some sort of "legacy" or has some new ideas not seen/used in previous technologies. I know MPEG-4 ASP brings new features in intra/inter image compression, GOPs and in some other places - but that's another issue.

When you say that H263 quantization type works "in a different way" than MPEG, I was curious to know in what sense is it different? If it doesn't have a quantization matrix to discard certain visual frequencies, how is that vital compression "step" realized there? And why is there less "ringing" compared to MPEG? I know that both H263 and MPEG operate on similar 8x8 blocks, and the result of both quantization types looks very similar too (apart from "smoothness" of H263 and the fact it discards different details than MPEG), so I was wondering what sets them apart.

The reason to "bother" with this technology of yesterday is to sense it's limits in terms of maximum compression/lowest bitrate achievable and acceptable. Besides, old DVD/Divx standalones are becoming very cheap nowadays and could be nice toys to play with. :) I have some MPEG4 AVC standalone decoding hardware already, but sadly none of those cheap devices uses optical media.

LoRd_MuldeR
10th October 2015, 12:12
When you say that H263 quantization type works "in a different way" than MPEG, I was curious to know in what sense is it different? If it doesn't have a quantization matrix to discard certain visual frequencies, how is that vital compression "step" realized there? And why is there less "ringing" compared to MPEG? I know that both H263 and MPEG operate on similar 8x8 blocks, and the result of both quantization types looks very similar too (apart from "smoothness" of H263 and the fact it discards different details than MPEG), so I was wondering what sets them apart.

The only thing that changes between the "MPEG" and "H263" quantization types is how the quantization is done. I think all the rest (e.g. transform size, etc) is 100% the same. When working with quantization matrices (MPEG type), we have a matrix containing the same number of entires as there are frequencies (coefficients). So, for each frequency coefficient, the encoder picks the corresponding entry from the matrix, divides the coefficient's original value through that entry, and rounds the result to the nearest integer value. The decoder reverses this process (except for the irreversible rounding errors!), by multiplying the stored (quantized) coefficient value with the corresponding entry from the same quantization matrix.

Simply put, the quantization matrix allows for controlling the amount of "loss" (rounding error) separately for each frequency, because there is one entry per frequency. And because the entries of the quantization matrix can be chosen as desired (known as "custom matrix"). However, there is no need to implement quantization like this! With the "H263" quantization type, the encoder simply uses a certain formula to compute the quantized coefficient value solely from the original coefficient value. And the decoder uses the inverse formula to restore the original coefficient value (except for the irreversible rounding errors!) solely from the stored (quantized) coefficient value. I cannot give you the exact formula right now - you could look it up in the specs, if you really need to know in detail. But, AFAIK, the H263 quantization type gives results very close - though not identical - to the MPEG type using a "flat" matrix, i.e. quantization matrix with all all entries set to 16.


[EDIT]

http://i.imgur.com/fcunPtS.jpg

SeeMoreDigital
10th October 2015, 18:04
Besides, old DVD/Divx standalones are becoming very cheap nowadays and could be nice toys to play with. :) I have some MPEG4 AVC standalone decoding hardware already, but sadly none of those cheap devices uses optical media.Sadly it's not that easy...

Many hardware playback devices (depending on their AV decoding chip-sets) don't support MPEG-4 ASP encodes generated using custom quantization matrices. And those that do don't support very many flavours :eek:


Cheers