blob: a033a89af885b8949ccc938c5681fa4b94d42a58
1 | /* |
2 | *=================================================================== |
3 | * 3GPP AMR Wideband Floating-point Speech Codec |
4 | *=================================================================== |
5 | */ |
6 | #ifndef DEC_MAIN_H |
7 | #define DEC_MAIN_H |
8 | |
9 | #include "typedef.h" |
10 | #include "dec_dtx.h" |
11 | |
12 | #define L_FRAME 256 /* Frame size */ |
13 | #define PIT_MAX 231 /* Maximum pitch lag */ |
14 | #define L_INTERPOL (16 + 1) /* Length of filter for interpolation */ |
15 | #define L_MEANBUF 3 |
16 | #define L_FILT 12 /* Delay of up-sampling filter */ |
17 | #define L_FILT16k 15 /* Delay of down-sampling filter */ |
18 | #define M16k 20 /* Order of LP filter */ |
19 | |
20 | typedef struct { |
21 | Word32 mem_gc_thres; /* threshold for noise enhancer */ |
22 | Word16 mem_exc[(L_FRAME + 1) + PIT_MAX + L_INTERPOL];/* old excitation vector */ |
23 | Word16 mem_isf_buf[L_MEANBUF * M];/* isf buffer(frequency domain) */ |
24 | Word16 mem_hf[2 * L_FILT16k]; /* HF band-pass filter memory */ |
25 | Word16 mem_hf2[2 * L_FILT16k]; /* HF band-pass filter memory */ |
26 | Word16 mem_hf3[2 * L_FILT16k]; /* HF band-pass filter memory */ |
27 | Word16 mem_oversamp[2 * L_FILT]; /* synthesis oversampled filter memory */ |
28 | Word16 mem_gain[23]; /* gain decoder memory */ |
29 | Word16 mem_syn_hf[M16k]; /* HF synthesis memory */ |
30 | Word16 mem_isp[M]; /* old isp (immittance spectral pairs) */ |
31 | Word16 mem_isf[M]; /* old isf (frequency domain) */ |
32 | Word16 mem_isf_q[M]; /* past isf quantizer */ |
33 | Word16 mem_syn_hi[M]; /* modified synthesis memory (MSB) */ |
34 | Word16 mem_syn_lo[M]; /* modified synthesis memory (LSB) */ |
35 | Word16 mem_ph_disp[8]; /* phase dispersion memory */ |
36 | Word16 mem_sig_out[6]; /* hp50 filter memory for synthesis */ |
37 | Word16 mem_hp400[6]; /* hp400 filter memory for synthesis */ |
38 | Word16 mem_lag[5]; /* LTP lag history */ |
39 | Word16 mem_subfr_q[4]; /* old maximum scaling factor */ |
40 | Word16 mem_tilt_code; /* tilt of code */ |
41 | Word16 mem_q; /* old scaling factor */ |
42 | Word16 mem_deemph; /* speech deemph filter memory */ |
43 | Word16 mem_seed; /* random memory for frame erasure */ |
44 | Word16 mem_seed2; /* random memory for HF generation */ |
45 | Word16 mem_seed3; /* random memory for lag concealment */ |
46 | Word16 mem_T0; /* old pitch lag */ |
47 | Word16 mem_T0_frac; /* old pitch fraction lag */ |
48 | UWord16 mem_vad_hist; /* VAD history */ |
49 | D_DTX_State *dtx_decSt; |
50 | UWord8 mem_bfi; /* Previous BFI */ |
51 | UWord8 mem_state; /* BGH state machine memory */ |
52 | UWord8 mem_first_frame; /* First frame indicator */ |
53 | |
54 | } Decoder_State; |
55 | |
56 | #endif |
57 | |
58 |