Initialize Tizen 2.3
[external/opencore-amr.git] / opencore / codecs_v2 / audio / gsm_amr / amr_nb / enc / src / lpc.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: lpc.h
35
36 ------------------------------------------------------------------------------
37  INCLUDE DESCRIPTION
38
39       File             : lpc.h
40       Purpose          : 2 LP analyses centered at 2nd and 4th subframe
41                          for mode 12.2. For all other modes a
42                          LP analysis centered at 4th subframe is
43                          performed.
44
45 ------------------------------------------------------------------------------
46 */
47
48 #ifndef _LPC_H_
49 #define _LPC_H_
50 #define lpc_h "$Id $"
51
52 /*----------------------------------------------------------------------------
53 ; INCLUDES
54 ----------------------------------------------------------------------------*/
55 #include "typedef.h"
56 #include "levinson.h"
57 #include "mode.h"
58 #include "get_const_tbls.h"
59
60
61 /*--------------------------------------------------------------------------*/
62 #ifdef __cplusplus
63 extern "C"
64 {
65 #endif
66
67     /*----------------------------------------------------------------------------
68     ; MACROS
69     ; [Define module specific macros here]
70     ----------------------------------------------------------------------------*/
71
72     /*----------------------------------------------------------------------------
73     ; DEFINES
74     ; [Include all pre-processor statements here.]
75     ----------------------------------------------------------------------------*/
76
77     /*----------------------------------------------------------------------------
78     ; EXTERNAL VARIABLES REFERENCES
79     ; [Declare variables used in this module but defined elsewhere]
80     ----------------------------------------------------------------------------*/
81
82     /*----------------------------------------------------------------------------
83     ; SIMPLE TYPEDEF'S
84     ----------------------------------------------------------------------------*/
85
86     /*----------------------------------------------------------------------------
87     ; ENUMERATED TYPEDEF'S
88     ----------------------------------------------------------------------------*/
89
90     /*----------------------------------------------------------------------------
91     ; STRUCTURES TYPEDEF'S
92     ----------------------------------------------------------------------------*/
93     typedef struct
94     {
95         LevinsonState *levinsonSt;
96     } lpcState;
97
98
99     /*----------------------------------------------------------------------------
100     ; GLOBAL FUNCTION DEFINITIONS
101     ; [List function prototypes here]
102     ----------------------------------------------------------------------------*/
103     Word16 lpc_init(lpcState **st);
104     /* initialize one instance of the pre processing state.
105        Stores pointer to filter status struct in *st. This pointer has to
106        be passed to lpc in each call.
107        returns 0 on success
108      */
109
110     Word16 lpc_reset(lpcState *st);
111     /* reset of pre processing state (i.e. set state memory to zero)
112        returns 0 on success
113      */
114     void lpc_exit(lpcState **st);
115     /* de-initialize pre processing state (i.e. free status struct)
116        stores NULL in *st
117      */
118
119     void lpc(
120         lpcState *st,     /* i/o: State struct                */
121         enum Mode mode,   /* i  : coder mode                  */
122         Word16 x[],       /* i  : Input signal           Q15  */
123         Word16 x_12k2[],  /* i  : Input signal (EFR)     Q15  */
124         Word16 a[],       /* o  : predictor coefficients Q12  */
125         CommonAmrTbls* common_amr_tbls, /* i : ptr to struct with table ptrs */
126         Flag   *pOverflow
127     );
128
129
130 #ifdef __cplusplus
131 }
132 #endif
133
134 #endif  /* _LPC_H_ */
135
136
137
138