[speex-dev] fixed point macros

Rib Rdb ribrdb at ribrdb.com
Mon May 10 09:47:17 PDT 2004

Do the two types have a constant integer and fractional part (ie 8.8 
and 16.16), or does it vary.  If it varies, is there any way to figure 
out where the split is for a certain variable?
On May 8, 2004, at 11:28 PM, Jean-Marc Valin wrote:

> Le sam 08/05/2004 à 19:30, Rib Rdb a écrit :
>> is there documentation of what the various fixed point macros do, so I
>> can work on converting more of the code to fixed point?  Is there only
>> one fixed point type, or are more than one used?
> Sorry, not documented yet... There are two fixed-point types:
> spx_word16_t and spx_word32_t. Both of them are defined as float when
> compiling normally and are defined to short (16 bits) and int (32 bits)
> for fixed-point. As for the macros, here are some of them (the rest
> should be easy to guess):
> ADD16, ADD32 adders for 16 and 32 bits
> MULT16_16 multiply a 16 bit value by another 16 bit value (result in 
> 32)
> MAC16_16 same but also adds to the first argument
> MULT16_16_Q15 multiply a 16 bit value by another 16 bit value and shift
> right by 15 (result assumed to fit in 16 bits)
> Note that all these functions DO NOT perform saturation, so you need to
> make sure that the operations can't possibly overflow (or use the
> SATURATE macro, but preferably not). A good thing to do is to configure
> with --enable-fixed-point-debug (or define FIXED_DEBUG) and test with
> several files and look at differences between floating point and fixed
> point.
> 	Jean-Marc
> -- 
> Jean-Marc Valin
> http://www.xiph.org/~jm/
> Université de Sherbrooke, Québec, Canada

--- >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 'speex-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 Speex-dev mailing list