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