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  Filename: /audio/gsm_amr/c/src/log2_tbl.c
32 
33 ------------------------------------------------------------------------------
34  REVISION HISTORY
35 
36  Description: Added #ifdef __cplusplus and removed "extern" from table
37               definition.
38 
39  Description: Put "extern" back.
40 
41  Who:                       Date:
42  Description:
43 
44 ------------------------------------------------------------------------------
45  MODULE DESCRIPTION
46 
47  This file contains the declaration for log2_tbl[] used by the log2() and
48  log2_norm() function.
49 
50 ------------------------------------------------------------------------------
51 */
52 
53 /*----------------------------------------------------------------------------
54 ; INCLUDES
55 ----------------------------------------------------------------------------*/
56 #include "typedef.h"
57 #include "log2_norm.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. Include conditional
73     ; compile variables also.]
74     ----------------------------------------------------------------------------*/
75 
76     /*----------------------------------------------------------------------------
77     ; LOCAL FUNCTION DEFINITIONS
78     ; [List function prototypes here]
79     ----------------------------------------------------------------------------*/
80 
81     /*----------------------------------------------------------------------------
82     ; LOCAL VARIABLE DEFINITIONS
83     ; [Variable declaration - defined here and used outside this module]
84     ----------------------------------------------------------------------------*/
85 
86     const Word16 log2_tbl[33] =
87     {
88         0, 1455, 2866, 4236, 5568, 6863, 8124, 9352, 10549, 11716,
89         12855, 13967, 15054, 16117, 17156, 18172, 19167, 20142, 21097, 22033,
90         22951, 23852, 24735, 25603, 26455, 27291, 28113, 28922, 29716, 30497,
91         31266, 32023, 32767
92     };
93 
94     /*--------------------------------------------------------------------------*/
95 #ifdef __cplusplus
96 }
97 #endif
98 
99 /*
100 ------------------------------------------------------------------------------
101  FUNCTION NAME:
102 ------------------------------------------------------------------------------
103  INPUT AND OUTPUT DEFINITIONS
104 
105  Inputs:
106     None
107 
108  Outputs:
109     None
110 
111  Returns:
112     None
113 
114  Global Variables Used:
115     None
116 
117  Local Variables Needed:
118     None
119 
120 ------------------------------------------------------------------------------
121  FUNCTION DESCRIPTION
122 
123  None
124 
125 ------------------------------------------------------------------------------
126  REQUIREMENTS
127 
128  None
129 
130 ------------------------------------------------------------------------------
131  REFERENCES
132 
133  [1] log2.tab,  UMTS GSM AMR speech codec, R99 - Version 3.2.0, March 2, 2001
134 
135 ------------------------------------------------------------------------------
136  PSEUDO-CODE
137 
138 
139 ------------------------------------------------------------------------------
140  RESOURCES USED [optional]
141 
142  When the code is written for a specific target processor the
143  the resources used should be documented below.
144 
145  HEAP MEMORY USED: x bytes
146 
147  STACK MEMORY USED: x bytes
148 
149  CLOCK CYCLES: (cycle count equation for this function) + (variable
150                 used to represent cycle count for each subroutine
151                 called)
152      where: (cycle count variable) = cycle count for [subroutine
153                                      name]
154 
155 ------------------------------------------------------------------------------
156  CAUTION [optional]
157  [State any special notes, constraints or cautions for users of this function]
158 
159 ------------------------------------------------------------------------------
160 */
161 
162 /*----------------------------------------------------------------------------
163 ; FUNCTION CODE
164 ----------------------------------------------------------------------------*/
165 
166