[vorbis-dev] integer pcm decode patch

David Balazic david.balazic at uni-mb.si
Wed May 3 08:53:02 PDT 2000



Jonathan Blow (jon at bolt-action.com) wrote :

>    Being a game developer I possess some arcane knowledge about how to
>    do wacky things with IEEE-754 floating point numbers. A standard trick
>    that we do in games is to manipulate this format directly to squeeze out
>    the values we want. This does two things: it (a) eliminates floating
>    point multiplies, which are more expensive than adds on some processors,
>    and (b) it eliminates the _ftol or equivalent code that the compiler 
>    sticks in when you go from any float size to integer (This stuff is there
>    to enforce the IEEE rounding semantics which, most of the time you are
>    converting float to int, you don't really care about... and it is this
>    stuff that usually takes all the time).

I think correct rounding IS important. I noticed some code ( not in
vorbis )
uses simple assigments :

int i; float a;
i = a;

Which is wrong for signed audio data because it round towards zero,
while
correct would be rounding to nearest.

The error is small, but the whole idea behind vorbis is go have
_good_quality_
at low space usage , right ?

Dithering might be considered too, for that matter .

Regards 
David Balazic

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/



More information about the Vorbis-dev mailing list