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: gains_tbl.cpp
33 ------------------------------------------------------------------------------
36 ------------------------------------------------------------------------------
39 /*----------------------------------------------------------------------------
41 ----------------------------------------------------------------------------*/
44 /*--------------------------------------------------------------------------*/
50 /*----------------------------------------------------------------------------
52 ; [Define module specific macros here]
53 ----------------------------------------------------------------------------*/
55 /*----------------------------------------------------------------------------
57 ; [Include all pre-processor statements here. Include conditional
58 ; compile variables also.]
59 ----------------------------------------------------------------------------*/
60 #define NB_QUA_PITCH 16
61 #define NB_QUA_CODE 32
63 /*----------------------------------------------------------------------------
64 ; LOCAL FUNCTION DEFINITIONS
65 ; [List function prototypes here]
66 ----------------------------------------------------------------------------*/
68 /*----------------------------------------------------------------------------
69 ; LOCAL VARIABLE DEFINITIONS
70 ; [Variable declaration - defined here and used outside this module]
71 ----------------------------------------------------------------------------*/
74 extern const Word16 qua_gain_pitch[];
75 const Word16 qua_gain_pitch[NB_QUA_PITCH] =
77 0, 3277, 6556, 8192, 9830, 11469, 12288, 13107,
78 13926, 14746, 15565, 16384, 17203, 18022, 18842, 19661
82 extern const Word16 qua_gain_code[];
83 const Word16 qua_gain_code[(NB_QUA_CODE+1)*3] =
85 /* gain factor (g_fac) and quantized energy error (qua_ener_MR122, qua_ener)
88 * qua_ener_MR122 = log2(g_fac) (not the rounded floating point value, but
89 * the value the original EFR algorithm
90 * calculates from g_fac [using Log2])
91 * qua_ener = 20*log10(g_fac); (rounded floating point value)
94 * g_fac (Q11), qua_ener_MR122 (Q10), qua_ener (Q10)
131 /*--------------------------------------------------------------------------*/
137 ------------------------------------------------------------------------------
139 ------------------------------------------------------------------------------
140 INPUT AND OUTPUT DEFINITIONS
151 Global Variables Used:
154 Local Variables Needed:
157 ------------------------------------------------------------------------------
162 ------------------------------------------------------------------------------
167 ------------------------------------------------------------------------------
170 [1] gains.tab, UMTS GSM AMR speech codec, R99 - Version 3.2.0, March 2, 2001
172 ------------------------------------------------------------------------------
176 ------------------------------------------------------------------------------
178 [State any special notes, constraints or cautions for users of this function]
180 ------------------------------------------------------------------------------
183 /*----------------------------------------------------------------------------
185 ----------------------------------------------------------------------------*/