[Speex-dev] Unifying fixed point and floating point

Nic Roets speex at rational.co.za
Sat Sep 17 15:05:40 PDT 2005

I've been browsing around the speex-1.10 source tree.

Firstly I see 'float' is still used in many places. Can't we change them all to the appropriate type (spx_wordxx_t or similar) defined in arch.h ?

Secondly I see there is a lot of duplication regarding real-valued constants. One way would be to say:
#define CONSTANT(x) (x)
#define CONSTANT(x) ((int)((x)*16384.0 + 0.5))
and then use the macro appropriately.

This would assume that all the compilers we intent to support has the ability to evaluate constant expressions at compile time. In my experience this assumption is reasonable.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/speex-dev/attachments/20050918/02c7471e/attachment.htm

More information about the Speex-dev mailing list