grid_tbl.cpp revision 4f1efc098cb5791c3e9f483f2af84aef70d2d0a0
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/****************************************************************************************
19Portions 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)
26Permission to distribute, modify and use this file under the standard license
27terms listed above has been obtained from the copyright holder.
28****************************************************************************************/
29/*
30
31 Filename: /audio/gsm_amr/c/src/grid_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 grid_tbl[] used by the az_lsp()
48 function.
49
50 //  Table for az_lsp()
51 //
52 // grid[0] = 1.0;
53 // grid[grid_points+1] = -1.0;
54 // for (i = 1; i < grid_points; i++)
55 //   grid[i] = cos((6.283185307*i)/(2.0*grid_points));
56 //
57 //
58
59------------------------------------------------------------------------------
60*/
61
62/*----------------------------------------------------------------------------
63; INCLUDES
64----------------------------------------------------------------------------*/
65#include "typedef.h"
66
67/*--------------------------------------------------------------------------*/
68#ifdef __cplusplus
69extern "C"
70{
71#endif
72
73    /*----------------------------------------------------------------------------
74    ; MACROS
75    ; [Define module specific macros here]
76    ----------------------------------------------------------------------------*/
77
78    /*----------------------------------------------------------------------------
79    ; DEFINES
80    ; [Include all pre-processor statements here. Include conditional
81    ; compile variables also.]
82    ----------------------------------------------------------------------------*/
83#define grid_points 60
84
85    /*----------------------------------------------------------------------------
86    ; LOCAL FUNCTION DEFINITIONS
87    ; [List function prototypes here]
88    ----------------------------------------------------------------------------*/
89
90    /*----------------------------------------------------------------------------
91    ; LOCAL VARIABLE DEFINITIONS
92    ; [Variable declaration - defined here and used outside this module]
93    ----------------------------------------------------------------------------*/
94    extern const Word16 grid[grid_points + 1] =
95    {
96        32760, 32723, 32588, 32364, 32051, 31651,
97        31164, 30591, 29935, 29196, 28377, 27481,
98        26509, 25465, 24351, 23170, 21926, 20621,
99        19260, 17846, 16384, 14876, 13327, 11743,
100        10125, 8480, 6812, 5126, 3425, 1714,
101        0, -1714, -3425, -5126, -6812, -8480,
102        -10125, -11743, -13327, -14876, -16384, -17846,
103        -19260, -20621, -21926, -23170, -24351, -25465,
104        -26509, -27481, -28377, -29196, -29935, -30591,
105        -31164, -31651, -32051, -32364, -32588, -32723,
106        -32760
107    };
108
109    /*--------------------------------------------------------------------------*/
110#ifdef __cplusplus
111}
112#endif
113
114/*
115------------------------------------------------------------------------------
116 FUNCTION NAME:
117------------------------------------------------------------------------------
118 INPUT AND OUTPUT DEFINITIONS
119
120 Inputs:
121    None
122
123 Outputs:
124    None
125
126 Returns:
127    None
128
129 Global Variables Used:
130    None
131
132 Local Variables Needed:
133    None
134
135------------------------------------------------------------------------------
136 FUNCTION DESCRIPTION
137
138 None
139
140------------------------------------------------------------------------------
141 REQUIREMENTS
142
143 None
144
145------------------------------------------------------------------------------
146 REFERENCES
147
148 [1] grid.tab,  UMTS GSM AMR speech codec, R99 - Version 3.2.0, March 2, 2001
149
150------------------------------------------------------------------------------
151 PSEUDO-CODE
152
153
154------------------------------------------------------------------------------
155 RESOURCES USED [optional]
156
157 When the code is written for a specific target processor the
158 the resources used should be documented below.
159
160 HEAP MEMORY USED: x bytes
161
162 STACK MEMORY USED: x bytes
163
164 CLOCK CYCLES: (cycle count equation for this function) + (variable
165                used to represent cycle count for each subroutine
166                called)
167     where: (cycle count variable) = cycle count for [subroutine
168                                     name]
169
170------------------------------------------------------------------------------
171 CAUTION [optional]
172 [State any special notes, constraints or cautions for users of this function]
173
174------------------------------------------------------------------------------
175*/
176
177/*----------------------------------------------------------------------------
178; FUNCTION CODE
179----------------------------------------------------------------------------*/
180
181