FreeCalypso > hg > gsm-codec-lib
diff libgsmefr/pstfilt2.c @ 87:41d8e8f4058d
libgsmefr: pstfilt2.c compiles
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 26 Nov 2022 10:27:34 +0000 |
parents | 49dd1ac8e75b |
children |
line wrap: on
line diff
--- a/libgsmefr/pstfilt2.c Sat Nov 26 09:56:19 2022 +0000 +++ b/libgsmefr/pstfilt2.c Sat Nov 26 10:27:34 2022 +0000 @@ -8,12 +8,16 @@ * *************************************************************************/ +#include "gsm_efr.h" #include "typedef.h" +#include "namespace.h" #include "basic_op.h" #include "sig_proc.h" -#include "count.h" +#include "memops.h" +#include "no_count.h" #include "codec.h" #include "cnst.h" +#include "dec_state.h" /*---------------------------------------------------------------* * Postfilter constant parameters (defined in "cnst.h") * @@ -32,14 +36,6 @@ * static vectors * *------------------------------------------------------------*/ - /* inverse filtered synthesis */ - -static Word16 res2[L_SUBFR]; - - /* memory of filter 1/A(z/0.75) */ - -static Word16 mem_syn_pst[M]; - /* Spectral expansion factors */ const Word16 F_gamma3[M] = @@ -61,11 +57,11 @@ * *************************************************************************/ -void Init_Post_Filter (void) +void Init_Post_Filter (struct EFR_decoder_state *st) { - Set_zero (mem_syn_pst, M); + Set_zero (st->mem_syn_pst, M); - Set_zero (res2, L_SUBFR); + Set_zero (st->res2, L_SUBFR); return; } @@ -86,6 +82,7 @@ *************************************************************************/ void Post_Filter ( + struct EFR_decoder_state *st, Word16 *syn, /* in/out: synthesis speech (postfiltered is output) */ Word16 *Az_4 /* input: interpolated LPC parameters in all subframes */ ) @@ -120,7 +117,7 @@ /* filtering of synthesis speech by A(z/0.7) to find res2[] */ - Residu (Ap3, &syn[i_subfr], res2, L_SUBFR); + Residu (Ap3, &syn[i_subfr], st->res2, L_SUBFR); /* tilt compensation filter */ @@ -157,15 +154,16 @@ temp2 = div_s (temp2, temp1); } - preemphasis (res2, temp2, L_SUBFR); + preemphasis (st, st->res2, temp2, L_SUBFR); /* filtering through 1/A(z/0.75) */ - Syn_filt (Ap4, res2, &syn_pst[i_subfr], L_SUBFR, mem_syn_pst, 1); + Syn_filt (Ap4, st->res2, &syn_pst[i_subfr], L_SUBFR, + st->mem_syn_pst, 1); /* scale output to input */ - agc (&syn[i_subfr], &syn_pst[i_subfr], AGC_FAC, L_SUBFR); + agc (st, &syn[i_subfr], &syn_pst[i_subfr], AGC_FAC, L_SUBFR); Az += MP1; }