[Speex-dev] Unifying fixed point and floating point
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...
More information about the Speex-dev