diff options
| author | Dan Everton <dan@iocaine.org> | 2007-02-10 11:44:26 +0000 |
|---|---|---|
| committer | Dan Everton <dan@iocaine.org> | 2007-02-10 11:44:26 +0000 |
| commit | 7bf62e8da66ca8ff0acc2702f92ea4fe06eb94b1 (patch) | |
| tree | c9db4558a73ae3094839c4655fa0b8ebc2231c56 /apps/codecs/libspeex/math_approx.h | |
| parent | 51587512635a8b19e6a5f19a20074d0d4d1f17da (diff) | |
| download | rockbox-7bf62e8da66ca8ff0acc2702f92ea4fe06eb94b1.zip rockbox-7bf62e8da66ca8ff0acc2702f92ea4fe06eb94b1.tar.gz rockbox-7bf62e8da66ca8ff0acc2702f92ea4fe06eb94b1.tar.bz2 rockbox-7bf62e8da66ca8ff0acc2702f92ea4fe06eb94b1.tar.xz | |
* Sync Speex codec with Speex SVN revision 12449 (roughly Speex 1.2beta1).
* Redo the changes required to make Speex compile in Rockbox. Should be a bit easier to keep in sync with Speex SVN now.
* Fix name of Speex library in codecs Makefile.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12254 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libspeex/math_approx.h')
| -rw-r--r-- | apps/codecs/libspeex/math_approx.h | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/apps/codecs/libspeex/math_approx.h b/apps/codecs/libspeex/math_approx.h index 265cdec..49cfda6 100644 --- a/apps/codecs/libspeex/math_approx.h +++ b/apps/codecs/libspeex/math_approx.h @@ -35,37 +35,28 @@ #ifndef MATH_APPROX_H #define MATH_APPROX_H - #include "misc.h" -#ifdef FIXED_POINT spx_word16_t spx_cos(spx_word16_t x); +spx_int16_t spx_ilog2(spx_uint32_t x); +spx_int16_t spx_ilog4(spx_uint32_t x); +#ifdef FIXED_POINT spx_word16_t spx_sqrt(spx_word32_t x); -float spx_sqrtf(float arg); spx_word16_t spx_acos(spx_word16_t x); -float spx_floor(float x); -float spx_exp(float x); -extern const float exp_lookup_int[]; -/** Returns: Math.exp((idx-10) / 8.0) Range:0-32*/ -static inline float spx_exp_lookup(int xf){ - return exp_lookup_int[xf]; -} -//Placeholders: -float pow(float a,float b); -float log(float l); -float fabs(float l); -float sin(float l); -//float floor(float l); +spx_word32_t spx_exp(spx_word16_t x); +spx_word16_t spx_cos_norm(spx_word32_t x); -#define floor spx_floor -#define exp spx_exp -#define sqrt spx_sqrt -#define acos spx_acos -#define cos spx_cos +/* Input in Q15, output in Q14 */ +spx_word16_t spx_atan(spx_word32_t x); #else + #define spx_sqrt sqrt #define spx_acos acos +#define spx_exp exp +#define spx_cos_norm(x) (cos((.5f*M_PI)*(x))) +#define spx_atan atan + #endif #endif |