Initialize Tizen 2.3
[external/opencore-amr.git] / opencore / codecs_v2 / audio / gsm_amr / amr_nb / dec / src / pstfilt.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.073
22     ANSI-C code for the Adaptive Multi-Rate (AMR) speech codec
23     Available from http://www.3gpp.org
24
25 (C) 2004, 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
32
33
34  Filename: pstfilt.h
35
36 ------------------------------------------------------------------------------
37  INCLUDE DESCRIPTION
38
39       File             : pstfilt.h
40       Purpose          : Performs adaptive postfiltering on the synthesis
41                        : speech
42
43 ------------------------------------------------------------------------------
44 */
45
46 #ifndef _PSTFILT_H_
47 #define _PSTFILT_H_
48 #define pstfilt_h "$Id $"
49
50 /*----------------------------------------------------------------------------
51 ; INCLUDES
52 ----------------------------------------------------------------------------*/
53 #include "typedef.h"
54 #include "mode.h"
55 #include "cnst.h"
56 #include "preemph.h"
57 #include "agc.h"
58
59 /*--------------------------------------------------------------------------*/
60 #ifdef __cplusplus
61 extern "C"
62 {
63 #endif
64
65     /*----------------------------------------------------------------------------
66     ; MACROS
67     ; [Define module specific macros here]
68     ----------------------------------------------------------------------------*/
69
70     /*----------------------------------------------------------------------------
71     ; DEFINES
72     ; [Include all pre-processor statements here.]
73     ----------------------------------------------------------------------------*/
74
75     /*----------------------------------------------------------------------------
76     ; EXTERNAL VARIABLES REFERENCES
77     ; [Declare variables used in this module but defined elsewhere]
78     ----------------------------------------------------------------------------*/
79
80     /*----------------------------------------------------------------------------
81     ; SIMPLE TYPEDEF'S
82     ----------------------------------------------------------------------------*/
83
84     /*----------------------------------------------------------------------------
85     ; ENUMERATED TYPEDEF'S
86     ----------------------------------------------------------------------------*/
87
88     /*----------------------------------------------------------------------------
89     ; STRUCTURES TYPEDEF'S
90     ----------------------------------------------------------------------------*/
91     typedef struct
92     {
93         Word16 res2[L_SUBFR];
94         Word16 mem_syn_pst[M];
95         preemphasisState preemph_state;
96         agcState agc_state;
97         Word16 synth_buf[M + L_FRAME];
98     } Post_FilterState;
99
100     /*----------------------------------------------------------------------------
101     ; GLOBAL FUNCTION DEFINITIONS
102     ; [List function prototypes here]
103     ----------------------------------------------------------------------------*/
104     Word16 Post_Filter_reset(Post_FilterState *st);
105     /* reset post filter (i.e. set state memory to zero)
106        returns 0 on success
107      */
108
109     void Post_Filter(
110         Post_FilterState *st, /* i/o : post filter states                        */
111         enum Mode mode,       /* i   : AMR mode                                  */
112         Word16 *syn,          /* i/o : synthesis speech (postfiltered is output) */
113         Word16 *Az_4,         /* i   : interpolated LPC parameters in all subfr. */
114         Flag   *pOverflow
115     );
116     /* filters the signal syn using the parameters in Az_4 to calculate filter
117        coefficients.
118        The filter must be set up using Post_Filter_init prior to the first call
119        to Post_Filter. Post_FilterState is updated to mirror the current state
120        of the filter
121
122        return 0 on success
123      */
124
125 #ifdef __cplusplus
126 }
127 #endif
128
129 #endif  /* _PSTFILT_H_ */
130
131
132