diff options
author | Jean-Marc Valin <jean-marc.valin@octasic.com> | 2008-08-11 18:35:19 +0400 |
---|---|---|
committer | Jean-Marc Valin <jean-marc.valin@octasic.com> | 2008-08-11 18:35:40 +0400 |
commit | 95fceab730829224aa519350723e36b949f1bd96 (patch) | |
tree | 45a1650e831f065d44e06875f1178c27489b908f | |
parent | 4c5bcb890d80908307dde43f7cc629f8cc2ebd92 (diff) |
Making it more explicit that the nb filter size is constant
-rw-r--r-- | libspeex/filters.h | 4 | ||||
-rw-r--r-- | libspeex/ltp.c | 2 | ||||
-rw-r--r-- | libspeex/nb_celp.c | 10 |
3 files changed, 10 insertions, 6 deletions
diff --git a/libspeex/filters.h b/libspeex/filters.h index e3a5980..d0689ea 100644 --- a/libspeex/filters.h +++ b/libspeex/filters.h @@ -87,4 +87,8 @@ spx_word16_t comb_gain, /*gain of comb filter*/ char *stack ); + +#define filter10(x, num, den, y, N, mem, stack) filter_mem16(x, num, den, y, N, 10, mem, stack) + + #endif diff --git a/libspeex/ltp.c b/libspeex/ltp.c index d07ade1..3297313 100644 --- a/libspeex/ltp.c +++ b/libspeex/ltp.c @@ -421,7 +421,7 @@ int scaledown iir_mem16(e, ak, e, nsf, p, mm, stack); for (j=0;j<p;j++) mm[j] = 0; - filter_mem16(e, awk1, awk2, e, nsf, p, mm, stack); + filter10(e, awk1, awk2, e, nsf, mm, stack); for (j=0;j<nsf;j++) x[2][j] = e[j]; } diff --git a/libspeex/nb_celp.c b/libspeex/nb_celp.c index 999cc6e..9e29cb6 100644 --- a/libspeex/nb_celp.c +++ b/libspeex/nb_celp.c @@ -529,7 +529,7 @@ int nb_encode(void *state, void *vin, SpeexBits *bits) SPEEX_COPY(st->sw, st->winBuf, diff); SPEEX_COPY(st->sw+diff, in, NB_FRAME_SIZE-diff); - filter_mem16(st->sw, bw_lpc1, bw_lpc2, st->sw, NB_FRAME_SIZE, NB_ORDER, st->mem_sw_whole, stack); + filter10(st->sw, bw_lpc1, bw_lpc2, st->sw, NB_FRAME_SIZE, st->mem_sw_whole, stack); open_loop_nbest_pitch(st->sw, NB_PITCH_START, NB_PITCH_END, NB_FRAME_SIZE, nol_pitch, nol_pitch_coef, 6, stack); @@ -891,19 +891,19 @@ int nb_encode(void *state, void *vin, SpeexBits *bits) iir_mem16(ringing, interp_qlpc, ringing, response_bound, NB_ORDER, mem, stack); for (i=0;i<NB_ORDER;i++) mem[i]=SHL32(st->mem_sw[i],1); - filter_mem16(ringing, st->bw_lpc1, st->bw_lpc2, ringing, response_bound, NB_ORDER, mem, stack); + filter10(ringing, st->bw_lpc1, st->bw_lpc2, ringing, response_bound, mem, stack); SPEEX_MEMSET(&ringing[response_bound], 0, NB_SUBFRAME_SIZE-response_bound); #else iir_mem16(ringing, interp_qlpc, ringing, NB_SUBFRAME_SIZE, NB_ORDER, mem, stack); for (i=0;i<NB_ORDER;i++) mem[i]=SHL32(st->mem_sw[i],1); - filter_mem16(ringing, bw_lpc1, bw_lpc2, ringing, NB_SUBFRAME_SIZE, NB_ORDER, mem, stack); + filter10(ringing, bw_lpc1, bw_lpc2, ringing, NB_SUBFRAME_SIZE, mem, stack); #endif /* Compute weighted signal */ for (i=0;i<NB_ORDER;i++) mem[i]=st->mem_sw[i]; - filter_mem16(sw, bw_lpc1, bw_lpc2, sw, NB_SUBFRAME_SIZE, NB_ORDER, mem, stack); + filter10(sw, bw_lpc1, bw_lpc2, sw, NB_SUBFRAME_SIZE, mem, stack); if (st->complexity==0) for (i=0;i<NB_ORDER;i++) @@ -1041,7 +1041,7 @@ int nb_encode(void *state, void *vin, SpeexBits *bits) /* Compute weighted signal again, from synthesized speech (not sure it's the right thing) */ if (st->complexity!=0) - filter_mem16(sw, bw_lpc1, bw_lpc2, sw, NB_SUBFRAME_SIZE, NB_ORDER, st->mem_sw, stack); + filter10(sw, bw_lpc1, bw_lpc2, sw, NB_SUBFRAME_SIZE, st->mem_sw, stack); } |