[XviD-devel] iDCT cooefficients different...

Christoph Lampert xvid-devel@xvid.org
Thu, 25 Jul 2002 12:31:50 +0200 (CEST)


On Thu, 25 Jul 2002, Winnie Weber wrote:

> Hello all,
> 
> does anyone know why the coefficients created from the MMX IDCT and the
> generic integer version of the IDCT are DIFFERENT? It's just a small difference
> around
> 1 or -1, but it's there. The MMX coeffs are even different compared to the
> MPEG4-Reference IDCT.

Yes. The MMX algorithms are much faster, but give slightly different
results. However, it's not such that the non-MMX method would give 
"real" values and MMX "wrong", because both are rounded to integer, of
course. Maybe normal integer method rounding is more accurate, true... 
Always using float or even doubles would be best. But also much too slow.

> Actually, I think this can cause some 'little' troubles if I have an encoder
> using 'MMX' code and an decoder using 'generic' integer IDCT code, because
> epecially in INTER frames (where coeffs are SMALL) this may result in a
> wrong residual image added.

The standard allows (I)DCT coefficients to slighty differ from
reference implementation, as far as I know, +-1 is the threshhold, so it's
rounding effects are covered, but "calculation errors" are not. 

The effect in residual coding is then small enough that it can be
neglected, since there is another (and most often ignored) rule that
every macroblock has to be INTRA coded at least once every 180 frames or
so. 

If I remember correctly, you can see accuracy of different DCT methods 
versus the reference implementatio in some dialog (for choice of
CPU). It's rather interesting...

gruel

-- 
Christoph H. Lampert chl@math.uni-bonn.de | Diese Signature wurde maschi-     
Beringstr. 6, Raum 14 Tel. (0228) 73-2948 | nell erstellt und bedarf
Sprechstunden: keine, aber meistens da    | keiner Unterschrift. AZ 27B-6