diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-07-26 17:04:54 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-07-26 17:04:54 +0000 |
commit | 2fa99a7ade8748fae314aeab2fea83e9bc88c36c (patch) | |
tree | 689c1cb15f7e7304b955e296748c800ce430542d /pjmedia/src/pjmedia-codec/speex/fftwrap.c | |
parent | d80219f36636faa876c84b586e7b4b4815767be3 (diff) |
- 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
Diffstat (limited to 'pjmedia/src/pjmedia-codec/speex/fftwrap.c')
-rw-r--r-- | pjmedia/src/pjmedia-codec/speex/fftwrap.c | 18 |
1 files changed, 16 insertions, 2 deletions
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;i<N;i++) _in[i] = (int)floor(.5+in[i]); spx_fft(table, _in, _out); for (i=0;i<N;i++) out[i] = _out[i]; +#if 0 if (!fixed_point) { float scale; @@ -257,6 +263,7 @@ void spx_fft_float(void *table, float *in, float *out) spx_drft_forward(&t, out); spx_drft_clear(&t); } +#endif } void spx_ifft_float(void *table, float *in, float *out) @@ -268,13 +275,19 @@ void spx_ifft_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;i<N;i++) _in[i] = (int)floor(.5+in[i]); spx_ifft(table, _in, _out); for (i=0;i<N;i++) out[i] = _out[i]; +#if 0 if (!fixed_point) { int i; @@ -285,6 +298,7 @@ void spx_ifft_float(void *table, float *in, float *out) spx_drft_backward(&t, out); spx_drft_clear(&t); } +#endif } #else |