From 2fa99a7ade8748fae314aeab2fea83e9bc88c36c Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Wed, 26 Jul 2006 17:04:54 +0000 Subject: - Bring speex codec up to date with their SVN trunk - Speex codec should work in FIXED_POINT mode when PJ_HAS_FLOATING_POINT is set to zero. - ulaw2linear will return zero if zero is given (this would make the VAD works better, and it also fixed click noise when call is established/hangup). git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@628 74dad513-b988-da41-8d7b-12977e46ad98 --- pjmedia/src/pjmedia-codec/speex/fftwrap.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'pjmedia/src/pjmedia-codec/speex/fftwrap.c') diff --git a/pjmedia/src/pjmedia-codec/speex/fftwrap.c b/pjmedia/src/pjmedia-codec/speex/fftwrap.c index de093569..79a1de30 100644 --- a/pjmedia/src/pjmedia-codec/speex/fftwrap.c +++ b/pjmedia/src/pjmedia-codec/speex/fftwrap.c @@ -42,6 +42,7 @@ #include "misc.h" +#define MAX_FFT_SIZE 2048 #ifdef FIXED_POINT static int maximize_range(spx_word16_t *in, spx_word16_t *out, spx_word16_t bound, int len) @@ -225,9 +226,8 @@ void spx_ifft(void *table, spx_word16_t *in, spx_word16_t *out) #endif -int fixed_point = 1; #ifdef FIXED_POINT -#include "smallft.h" +/*#include "smallft.h"*/ void spx_fft_float(void *table, float *in, float *out) @@ -239,13 +239,19 @@ void spx_fft_float(void *table, float *in, float *out) int N = ((struct kiss_config *)table)->N; #else #endif +#ifdef VAR_ARRAYS spx_word16_t _in[N]; spx_word16_t _out[N]; +#else + spx_word16_t _in[MAX_FFT_SIZE]; + spx_word16_t _out[MAX_FFT_SIZE]; +#endif for (i=0;iN; #else #endif +#ifdef VAR_ARRAYS spx_word16_t _in[N]; spx_word16_t _out[N]; +#else + spx_word16_t _in[MAX_FFT_SIZE]; + spx_word16_t _out[MAX_FFT_SIZE]; +#endif for (i=0;i