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 ****************************************************************************************/
31 Filename: /audio/gsm_amr/c/src/gains_tbl.c
33 ------------------------------------------------------------------------------
36 Description: Created this file from the reference, gains.tab
38 Description: Added include of "typedef.h" to includes section.
40 Description: Added #ifdef __cplusplus and removed "extern" from table
43 Description: Put "extern" back.
48 ------------------------------------------------------------------------------
51 ------------------------------------------------------------------------------
54 /*----------------------------------------------------------------------------
56 ----------------------------------------------------------------------------*/
59 /*--------------------------------------------------------------------------*/
65 /*----------------------------------------------------------------------------
67 ; [Define module specific macros here]
68 ----------------------------------------------------------------------------*/
70 /*----------------------------------------------------------------------------
72 ; [Include all pre-processor statements here. Include conditional
73 ; compile variables also.]
74 ----------------------------------------------------------------------------*/
75 #define NB_QUA_PITCH 16
76 #define NB_QUA_CODE 32
78 /*----------------------------------------------------------------------------
79 ; LOCAL FUNCTION DEFINITIONS
80 ; [List function prototypes here]
81 ----------------------------------------------------------------------------*/
83 /*----------------------------------------------------------------------------
84 ; LOCAL VARIABLE DEFINITIONS
85 ; [Variable declaration - defined here and used outside this module]
86 ----------------------------------------------------------------------------*/
89 extern const Word16 qua_gain_pitch[NB_QUA_PITCH] =
91 0, 3277, 6556, 8192, 9830, 11469, 12288, 13107,
92 13926, 14746, 15565, 16384, 17203, 18022, 18842, 19661
96 extern const Word16 qua_gain_code[(NB_QUA_CODE+1)*3] =
98 /* gain factor (g_fac) and quantized energy error (qua_ener_MR122, qua_ener)
101 * qua_ener_MR122 = log2(g_fac) (not the rounded floating point value, but
102 * the value the original EFR algorithm
103 * calculates from g_fac [using Log2])
104 * qua_ener = 20*log10(g_fac); (rounded floating point value)
107 * g_fac (Q11), qua_ener_MR122 (Q10), qua_ener (Q10)
144 /*--------------------------------------------------------------------------*/
150 ------------------------------------------------------------------------------
152 ------------------------------------------------------------------------------
153 INPUT AND OUTPUT DEFINITIONS
164 Global Variables Used:
167 Local Variables Needed:
170 ------------------------------------------------------------------------------
175 ------------------------------------------------------------------------------
180 ------------------------------------------------------------------------------
183 [1] gains.tab, UMTS GSM AMR speech codec, R99 - Version 3.2.0, March 2, 2001
185 ------------------------------------------------------------------------------
189 ------------------------------------------------------------------------------
190 RESOURCES USED [optional]
192 When the code is written for a specific target processor the
193 the resources used should be documented below.
195 HEAP MEMORY USED: x bytes
197 STACK MEMORY USED: x bytes
199 CLOCK CYCLES: (cycle count equation for this function) + (variable
200 used to represent cycle count for each subroutine
202 where: (cycle count variable) = cycle count for [subroutine
205 ------------------------------------------------------------------------------
207 [State any special notes, constraints or cautions for users of this function]
209 ------------------------------------------------------------------------------
212 /*----------------------------------------------------------------------------
214 ----------------------------------------------------------------------------*/