[vorbis-dev] Tarkin at last

Kenneth C. Arnold kcarnold at arnoldnet.net
Thu Jan 4 19:34:58 PST 2001


According to Lourens Veen (sometime around Thu, Jan 04, 2001 at 07:05:13PM +0100):
> Hmm, I now have a program that can read in a TGA file, to a 2D Haar
> wavelet transform, transform back, and then output another TGA. It
> works, and as far as I've been able to figure out everything's correct,
> however there seem to be some rounding errors. I'm using an array of
> floats to hold the image data, which is normalised to the 0..1 range. If
> I enlarge the range to 0..255 the errors get smaller, but even at
> 0..2550 they're still there. I think this is pretty weird, since the
> dynamic range of float should be big enough.

Don't know about the Haar wavelet transform (though education would be
very much appreciated), but tip is to check each calculation, and what
the compiler could possibly do to mangle it. You will get errors if
you exceed the float range on even one operation, even if you
immediately bring it back down to within normalized range. You could
try casting each number to a double within the calculation and casting
the result back to float (though this is terribly
inefficient). Multiplying by 9^(9^9) is generally not a good idea in
just about _any_ program.


-- 
Kenneth Arnold <ken at arnoldnet.net> / kcarnold / Linux user #180115
http://arnoldnet.net/~kcarnold/



<HR NOSHADE>
<UL>
<LI>application/pgp-signature attachment: stored
</UL>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: part
Type: application/octet-stream
Size: 233 bytes
Desc: not available
Url : http://lists.xiph.org/pipermail/vorbis-dev/attachments/20010104/8ee75b5f/part.obj


More information about the Vorbis-dev mailing list