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/stereo.c | |
| 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/stereo.c')
| -rw-r--r-- | apps/codecs/libspeex/stereo.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/codecs/libspeex/stereo.c b/apps/codecs/libspeex/stereo.c index 72adb45..f18387e 100644 --- a/apps/codecs/libspeex/stereo.c +++ b/apps/codecs/libspeex/stereo.c @@ -36,7 +36,7 @@ #include <speex/speex_stereo.h> #include <speex/speex_callbacks.h> #include "vq.h" -#include <math_approx.h> +#include <math.h> /*float e_ratio_quant[4] = {1, 1.26, 1.587, 2};*/ static const float e_ratio_quant[4] = {.25f, .315f, .397f, .5f}; @@ -148,7 +148,7 @@ void speex_decode_stereo_int(spx_int16_t *data, int frame_size, SpeexStereoState { float balance, e_ratio; int i; - float e_tot=0.0, e_left, e_right, e_sum; + float e_tot=0, e_left, e_right, e_sum; balance=stereo->balance; e_ratio=stereo->e_ratio; @@ -157,11 +157,11 @@ void speex_decode_stereo_int(spx_int16_t *data, int frame_size, SpeexStereoState e_tot += ((float)data[i])*data[i]; } e_sum=e_tot/e_ratio; - e_left = e_sum*balance / (1.0+balance); + e_left = e_sum*balance / (1+balance); e_right = e_sum-e_left; - e_left = spx_sqrtf(e_left/(e_tot+.01)); - e_right = spx_sqrtf(e_right/(e_tot+.01)); + e_left = sqrt(e_left/(e_tot+.01)); + e_right = sqrt(e_right/(e_tot+.01)); for (i=frame_size-1;i>=0;i--) { @@ -183,7 +183,7 @@ int speex_std_stereo_request_handler(SpeexBits *bits, void *state, void *data) if (speex_bits_unpack_unsigned(bits, 1)) sign=-1; tmp = speex_bits_unpack_unsigned(bits, 5); - stereo->balance = spx_exp(sign*.25*tmp); + stereo->balance = exp(sign*.25*tmp); tmp = speex_bits_unpack_unsigned(bits, 2); stereo->e_ratio = e_ratio_quant[tmp]; |