[XviD-devel] _real_ adaptive quantization

Christoph Lampert xvid-devel@xvid.org
Tue, 1 Oct 2002 16:13:14 +0200 (CEST)


On 1 Oct 2002, skal wrote:
> > Now, the most frequently used values will become constant anyway, because
> > the quantized coefficient becomes zero. If that happens for one quant, 
> > its the same for all higher quants, too. So there is a huge potential 
> > for saving space, if it's really needed. 
> 
> 	Hem... measuring quantization distortion, one is interested by
> 	the *remainder* of the division Coeff / q, not the quotient
> 	(sent to bitstream coding later on, when Q is decided).

Yes. But when I do these calculations, I need distorsion of a given
coefficient for all quants from min to max. 
So I would cycle through all quantizers for a given coefficient. By not
using a fixed length array but some pointer-construction (with an END
marker), it possible to mark the point where   distorsion==coefficient
and after that, always this distorsion value can be used for all higher
quants of this coefficient. 

Btw. since you seem to be online: 

Is there a quantizer value where calculating the error/distorsion is 
equivalent to a very fast (MMX) operation, like ANDing with a constant? 

Like quant 6 means calculating modulus 15 which is almost ANDing with 0x0F 
Or is it 16? That would be perfect... Same holds for quant 3 -> modulus
7 or 8. 

I wanted to look at distorsion modelling (e.g. in rho-level domain) from
a small number of samples. This could save the need for quant/dequant and
could speedup calculations enourmously. 

gruel