1 /* ------------------------------------------------------------------
2 * Copyright (C) 1998-2009 PacketVideo
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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
14 * See the License for the specific language governing permissions
15 * and limitations under the License.
16 * -------------------------------------------------------------------
18 /****************************************************************************************
19 Portions of this file are derived from the following 3GPP standard:
22 ANSI-C code for the Adaptive Multi-Rate (AMR) speech codec
23 Available from http://www.3gpp.org
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 ****************************************************************************************/
30 ------------------------------------------------------------------------------
36 ------------------------------------------------------------------------------
39 This file contains all the constant definitions and prototype definitions
40 needed by the file, gain_q.c
42 ------------------------------------------------------------------------------
45 /*----------------------------------------------------------------------------
46 ; CONTINUE ONLY IF NOT ALREADY DEFINED
47 ----------------------------------------------------------------------------*/
49 #define gain_q_h "$Id $"
51 /*----------------------------------------------------------------------------
53 ----------------------------------------------------------------------------*/
58 #include "get_const_tbls.h"
60 /*--------------------------------------------------------------------------*/
66 /*----------------------------------------------------------------------------
68 ; Define module specific macros here
69 ----------------------------------------------------------------------------*/
71 /*----------------------------------------------------------------------------
73 ; Include all pre-processor statements here.
74 ----------------------------------------------------------------------------*/
76 /*----------------------------------------------------------------------------
77 ; EXTERNAL VARIABLES REFERENCES
78 ; Declare variables used in this module but defined elsewhere
79 ----------------------------------------------------------------------------*/
81 /*----------------------------------------------------------------------------
83 ----------------------------------------------------------------------------*/
85 /*----------------------------------------------------------------------------
86 ; ENUMERATED TYPEDEF'S
87 ----------------------------------------------------------------------------*/
89 /*----------------------------------------------------------------------------
90 ; STRUCTURES TYPEDEF'S
91 ----------------------------------------------------------------------------*/
94 Word16 sf0_exp_gcode0;
95 Word16 sf0_frac_gcode0;
96 Word16 sf0_exp_target_en;
97 Word16 sf0_frac_target_en;
98 Word16 sf0_exp_coeff[5];
99 Word16 sf0_frac_coeff[5];
100 Word16 *gain_idx_ptr;
102 gc_predState gc_predSt;
103 gc_predState gc_predUnqSt;
104 GainAdaptState *adaptSt;
107 /*----------------------------------------------------------------------------
108 ; GLOBAL FUNCTION DEFINITIONS
109 ; Function Prototype declaration
110 ----------------------------------------------------------------------------*/
111 Word16 gainQuant_init(gainQuantState **st);
112 /* initialize one instance of the pre processing state.
113 Stores pointer to filter status struct in *st. This pointer has to
114 be passed to gainQuant in each call.
117 Word16 gainQuant_reset(gainQuantState *st);
118 /* reset of pre processing state (i.e. set state memory to zero)
121 void gainQuant_exit(gainQuantState **st);
122 /* de-initialize pre processing state (i.e. free status struct)
127 gainQuantState *st, /* i/o : State struct */
128 enum Mode mode, /* i : coder mode */
129 Word16 res[], /* i : LP residual, Q0 */
130 Word16 exc[], /* i : LTP excitation (unfiltered), Q0 */
131 Word16 code[], /* i : CB innovation (unfiltered), Q13 */
132 /* (unsharpened for MR475) */
133 Word16 xn[], /* i : Target vector. */
134 Word16 xn2[], /* i : Target vector. */
135 Word16 y1[], /* i : Adaptive codebook. */
136 Word16 Y2[], /* i : Filtered innovative vector. */
137 Word16 g_coeff[], /* i : Correlations <xn y1> <y1 y1> */
138 /* Compute in G_pitch(). */
139 Word16 even_subframe, /* i : even subframe indicator flag */
140 Word16 gp_limit, /* i : pitch gain limit */
141 Word16 *sf0_gain_pit, /* o : Pitch gain sf 0. MR475 */
142 Word16 *sf0_gain_cod, /* o : Code gain sf 0. MR475 */
143 Word16 *gain_pit, /* i/o : Pitch gain. */
144 Word16 *gain_cod, /* o : Code gain. */
145 /* MR475: gain_* unquantized in even */
146 /* subframes, quantized otherwise */
147 Word16 **anap, /* o : Index of quantization */
148 CommonAmrTbls* common_amr_tbls, /* i : ptr to struct of tbl ptrs */
149 Flag *pOverflow /* o : overflow indicator */
152 /*----------------------------------------------------------------------------
154 ----------------------------------------------------------------------------*/
159 #endif /* gain_q_h */