[vorbis-dev] FLOOR_fromdB_LOOKUP

Gian-Carlo Pascutto gcp at sjeng.org
Sat Oct 13 06:09:51 PDT 2001



> Hello,
> You know, I always worry about the precision
> and the float constants... and there is a large
> lookup table in the floor1.c ... and I figure out
> a way to keep the code size and speed, but
> to improve the precision at this lookup table.
> (the difference is small, but audible)
> 
> Here is the modifications in the floor1.c:
> 
> static unsigned long FLOOR_fromdB_LOOKUP[256]={
> 0x33E4B434,0x33F390FF,0x3401B286,

[snip] 

>   d[x]*=*((float *)&FLOOR_fromdB_LOOKUP[y]);

Hmm, doesn't this trick depend on float representation
within the CPU, and hence is inherently nonportable?

Also, AFAIK float only guarantees 7 significant digits. 
The constants in the current source all have at least 8, so 
they should be safe.

I don't really understand how this could make a
difference, let alone an audible one.


-- 
GCP

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.




More information about the Vorbis-dev mailing list