diff options
author | jm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800> | 2007-11-10 13:59:13 +0300 |
---|---|---|
committer | jm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800> | 2007-11-10 13:59:13 +0300 |
commit | 84064b108f2633b1dd2de4735f236203a541efef (patch) | |
tree | 9b3d6ab5516525ea23f84aa740db43b9a8b864d8 /libspeex/nb_celp.c | |
parent | 2c715001f0271a01ace52b5ab66384b747729910 (diff) |
Lag window now stored as const data instead of computed at init time. Also,
force either FIXED_POINT or FLOATING_POINT to be defined so we can catch
a missing config.h
git-svn-id: http://svn.xiph.org/trunk/speex@14122 0101bb08-14d6-0310-b084-bc0e0c8e3800
Diffstat (limited to 'libspeex/nb_celp.c')
-rw-r--r-- | libspeex/nb_celp.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/libspeex/nb_celp.c b/libspeex/nb_celp.c index 8c8630d..4b2903d 100644 --- a/libspeex/nb_celp.c +++ b/libspeex/nb_celp.c @@ -108,6 +108,7 @@ const float exc_gain_quant_scal1[2]={0.70469f, 1.05127f}; #define sqr(x) ((x)*(x)) +extern const spx_word16_t lag_window[]; extern const spx_word16_t lpc_window[]; void *nb_encoder_init(const SpeexMode *m) @@ -137,7 +138,6 @@ void *nb_encoder_init(const SpeexMode *m) st->gamma2=mode->gamma2; st->min_pitch=mode->pitchStart; st->max_pitch=mode->pitchEnd; - st->lag_factor=mode->lag_factor; st->lpc_floor = mode->lpc_floor; st->submodes=mode->submodes; @@ -166,9 +166,7 @@ void *nb_encoder_init(const SpeexMode *m) st->window= lpc_window; /* Create the window for autocorrelation (lag-windowing) */ - st->lagWindow = (spx_word16_t*)speex_alloc((st->lpcSize+1)*sizeof(spx_word16_t)); - for (i=0;i<st->lpcSize+1;i++) - st->lagWindow[i]=16384*exp(-.5*sqr(2*M_PI*st->lag_factor*i)); + st->lagWindow = lag_window; st->old_lsp = (spx_lsp_t*)speex_alloc((st->lpcSize)*sizeof(spx_lsp_t)); st->old_qlsp = (spx_lsp_t*)speex_alloc((st->lpcSize)*sizeof(spx_lsp_t)); @@ -225,8 +223,6 @@ void nb_encoder_destroy(void *state) speex_free (st->old_qlsp); speex_free (st->swBuf); - speex_free (st->lagWindow); - speex_free (st->old_lsp); speex_free (st->mem_sp); speex_free (st->mem_sw); |