[vorbis-dev] Modification requests / question

Michael Smith msmith at labyrinth.net.au
Mon Dec 25 18:29:18 PST 2000



>> #define vorbis_ftoi(f) ((int)(f+.5f))
>> 
>Is f always >= 0 ?
>
>If no, the function is works wrong.
>If yes, the name of the function is dangerous.
>
>May be someone can call it with vorbis_ftoi(-2.1) and gets a -1.

No, it's not always called with f >= 0. However, it's used only in two
places - in one, it compensates for this problem appropriately, so it's not
a problem.

In the other, it isn't sensitive to slightly-off results (and errors here
can't propogate any further) - the speed difference seems worthwhile in
practice.

Michael

--- >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