[XviD-devel] Hadamard Transform

Christoph Lampert xvid-devel@xvid.org
Fri, 6 Sep 2002 13:35:54 +0200 (CEST)


On 6 Sep 2002, skal wrote:
> >        1 -= 2          2 += 2            2 += 1    
> > (a, b) -----> (a-b ,b) -----> (a-b, 2*b) -----> (a-b, b+a)
> > 
> > I don't know if this is faster (extra operation?), but it 
> > might help not needing a 9th register.
> 
> 	Indeed, it could apply here, but that's not a good
> 	trick when precision is at stake. The *2 operation
> 	will spoil (precious) 1bit of precision. Ok, for
> 	Hadamard, it's useless, but for DCT, e.g, where room
> 	for fractional bits is very tight, it can ruin
> 	the scheme. It should not be tried first, actually.
> 	Only on the late late stage of optimization, if it
> 	leads to better re-ordering...

Hm, would it? For DCT, maybe, if you multiply with something before
adding... 
But here, since you calculate b+a anyway, and a-b, too, you need several
extra bits anyway if you want to keep precision. Not? 

gruel 


P.S. Another link: Hadamard is intended to become an approximation of DCT.
The reasons you can see here: 

http://www.informatik.uni-leipzig.de/cgip/lehre/ss02/vorl03.pdf

It's german, but you can find pictures at page 13 for Hadamard 
and at page 15 for DCT. As you see, for "real life picture, the 
transforms behave similar.

gruel