Initialize Tizen 2.3
[external/opencore-amr.git] / opencore / codecs_v2 / audio / gsm_amr / amr_wb / dec / src / e_pv_amrwbdec.h
1 /* ------------------------------------------------------------------
2  * Copyright (C) 1998-2009 PacketVideo
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13  * express or implied.
14  * See the License for the specific language governing permissions
15  * and limitations under the License.
16  * -------------------------------------------------------------------
17  */
18 /****************************************************************************************
19 Portions of this file are derived from the following 3GPP standard:
20
21     3GPP TS 26.173
22     ANSI-C code for the Adaptive Multi-Rate - Wideband (AMR-WB) speech codec
23     Available from http://www.3gpp.org
24
25 (C) 2007, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC)
26 Permission to distribute, modify and use this file under the standard license
27 terms listed above has been obtained from the copyright holder.
28 ****************************************************************************************/
29 /*
30
31  Filename: e_pv_amrwbdec.h
32
33 */
34
35 /*----------------------------------------------------------------------------
36 ; CONTINUE ONLY IF NOT ALREADY DEFINED
37 ----------------------------------------------------------------------------*/
38 #ifndef E_PV_AMRWBDEC_H
39 #define E_PV_AMRWBDEC_H
40
41 /*----------------------------------------------------------------------------
42 ; INCLUDES
43 ----------------------------------------------------------------------------*/
44
45 #include "pvamrwbdecoder_cnst.h"             /* coder constant parameters */
46 #include "dtx.h"
47
48 /*----------------------------------------------------------------------------
49 ; MACROS
50 ; Define module specific macros here
51 ----------------------------------------------------------------------------*/
52
53 /*----------------------------------------------------------------------------
54 ; DEFINES
55 ; Include all pre-processor statements here.
56 ----------------------------------------------------------------------------*/
57
58 /*----------------------------------------------------------------------------
59 ; EXTERNAL VARIABLES REFERENCES
60 ; Declare variables used in this module but defined elsewhere
61 ----------------------------------------------------------------------------*/
62
63 /*----------------------------------------------------------------------------
64 ; SIMPLE TYPEDEF'S
65 ----------------------------------------------------------------------------*/
66
67 /*----------------------------------------------------------------------------
68 ; ENUMERATED TYPEDEF'S
69 ----------------------------------------------------------------------------*/
70
71 /*----------------------------------------------------------------------------
72 ; STRUCTURES TYPEDEF'S
73 ----------------------------------------------------------------------------*/
74
75
76 typedef struct
77 {
78     int16 old_exc[PIT_MAX + L_INTERPOL];  /* old excitation vector */
79     int16 ispold[M];                      /* old isp (immittance spectral pairs)*/
80     int16 isfold[M];                      /* old isf (frequency domain) */
81     int16 isf_buf[L_MEANBUF * M];         /* isf buffer(frequency domain) */
82     int16 past_isfq[M];                   /* past isf quantizer */
83     int16 tilt_code;                      /* tilt of code */
84     int16 Q_old;                          /* old scaling factor */
85     int16 Qsubfr[4];                      /* old maximum scaling factor */
86     int32 L_gc_thres;                     /* threshold for noise enhancer */
87     int16 mem_syn_hi[M];                  /* modified synthesis memory (MSB) */
88     int16 mem_syn_lo[M];                  /* modified synthesis memory (LSB) */
89     int16 mem_deemph;                     /* speech deemph filter memory */
90     int16 mem_sig_out[6];                 /* hp50 filter memory for synthesis */
91     int16 mem_oversamp[2 * L_FILT];       /* synthesis oversampled filter memory */
92     int16 mem_syn_hf[M16k];               /* HF synthesis memory */
93     int16 mem_hf[2 * L_FILT16k];          /* HF band-pass filter memory */
94     int16 mem_hf2[2 * L_FILT16k];         /* HF band-pass filter memory */
95     int16 mem_hf3[2 * L_FILT16k];         /* HF band-pass filter memory */
96     int16 seed;                           /* random memory for frame erasure */
97     int16 seed2;                          /* random memory for HF generation */
98     int16 old_T0;                         /* old pitch lag */
99     int16 old_T0_frac;                    /* old pitch fraction lag */
100     int16 lag_hist[5];
101     int16 dec_gain[23];                   /* gain decoder memory */
102     int16 seed3;                          /* random memory for lag concealment */
103     int16 disp_mem[8];                    /* phase dispersion memory */
104     int16 mem_hp400[6];                   /* hp400 filter memory for synthesis */
105
106     int16 prev_bfi;
107     int16 state;
108     int16 first_frame;
109     dtx_decState dtx_decSt;
110     int16 vad_hist;
111
112 } Decoder_State;
113
114 typedef struct
115 {
116     Decoder_State state;
117     int16 ScratchMem[L_SUBFR + L_SUBFR16k + ((L_SUBFR + M + M16k +1)<<1) + \
118                      (2*L_FRAME + 1) + PIT_MAX + L_INTERPOL + NB_SUBFR*(M+1) \
119                      + 3*(M+L_SUBFR) + M16k];
120 } PV_AmrWbDec;
121
122
123 /*----------------------------------------------------------------------------
124 ; END
125 ----------------------------------------------------------------------------*/
126 #endif