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: bitno_tab.cpp
33 ------------------------------------------------------------------------------
34 INPUT AND OUTPUT DEFINITIONS
39 Local Stores/Buffers/Pointers Needed:
42 Global Stores/Buffers/Pointers Needed:
48 Pointers and Buffers Modified:
51 Local Stores Modified:
54 Global Stores Modified:
57 ------------------------------------------------------------------------------
61 Purpose : Tables for bit2prm and prm2bit
63 ------------------------------------------------------------------------------
68 ------------------------------------------------------------------------------
73 ------------------------------------------------------------------------------
77 ------------------------------------------------------------------------------
81 /*----------------------------------------------------------------------------
83 ----------------------------------------------------------------------------*/
85 #include "cnst.h" /* parameter sizes: MAX_PRM_SIZE */
86 #include "mode.h" /* N_MODES */
87 #include "bitno_tab.h"
90 /*--------------------------------------------------------------------------*/
96 /*----------------------------------------------------------------------------
98 ; Define module specific macros here
99 ----------------------------------------------------------------------------*/
102 /*----------------------------------------------------------------------------
104 ; Include all pre-processor statements here. Include conditional
105 ; compile variables also.
106 ----------------------------------------------------------------------------*/
108 /*----------------------------------------------------------------------------
109 ; LOCAL FUNCTION DEFINITIONS
110 ; Function Prototype declaration
111 ----------------------------------------------------------------------------*/
114 /*----------------------------------------------------------------------------
115 ; LOCAL STORE/BUFFER/POINTER DEFINITIONS
116 ; Variable declaration - defined here and used outside this module
117 ----------------------------------------------------------------------------*/
118 /* number of parameters per modes (values must be <= MAX_PRM_SIZE!) */
119 const Word16 prmno[N_MODES] =
132 /* number of parameters to first subframe per modes */
133 const Word16 prmnofsf[N_MODES - 1] =
145 /* parameter sizes (# of bits), one table per mode */
146 const Word16 bitno_MR475[PRMNO_MR475] =
148 8, 8, 7, /* LSP VQ */
149 8, 7, 2, 8, /* first subframe */
150 4, 7, 2, /* second subframe */
151 4, 7, 2, 8, /* third subframe */
152 4, 7, 2, /* fourth subframe */
155 const Word16 bitno_MR515[PRMNO_MR515] =
157 8, 8, 7, /* LSP VQ */
158 8, 7, 2, 6, /* first subframe */
159 4, 7, 2, 6, /* second subframe */
160 4, 7, 2, 6, /* third subframe */
161 4, 7, 2, 6, /* fourth subframe */
164 const Word16 bitno_MR59[PRMNO_MR59] =
166 8, 9, 9, /* LSP VQ */
167 8, 9, 2, 6, /* first subframe */
168 4, 9, 2, 6, /* second subframe */
169 8, 9, 2, 6, /* third subframe */
170 4, 9, 2, 6, /* fourth subframe */
173 const Word16 bitno_MR67[PRMNO_MR67] =
175 8, 9, 9, /* LSP VQ */
176 8, 11, 3, 7, /* first subframe */
177 4, 11, 3, 7, /* second subframe */
178 8, 11, 3, 7, /* third subframe */
179 4, 11, 3, 7, /* fourth subframe */
182 const Word16 bitno_MR74[PRMNO_MR74] =
184 8, 9, 9, /* LSP VQ */
185 8, 13, 4, 7, /* first subframe */
186 5, 13, 4, 7, /* second subframe */
187 8, 13, 4, 7, /* third subframe */
188 5, 13, 4, 7, /* fourth subframe */
191 const Word16 bitno_MR795[PRMNO_MR795] =
193 9, 9, 9, /* LSP VQ */
194 8, 13, 4, 4, 5, /* first subframe */
195 6, 13, 4, 4, 5, /* second subframe */
196 8, 13, 4, 4, 5, /* third subframe */
197 6, 13, 4, 4, 5, /* fourth subframe */
200 const Word16 bitno_MR102[PRMNO_MR102] =
202 8, 9, 9, /* LSP VQ */
203 8, 1, 1, 1, 1, 10, 10, 7, 7, /* first subframe */
204 5, 1, 1, 1, 1, 10, 10, 7, 7, /* second subframe */
205 8, 1, 1, 1, 1, 10, 10, 7, 7, /* third subframe */
206 5, 1, 1, 1, 1, 10, 10, 7, 7, /* fourth subframe */
209 const Word16 bitno_MR122[PRMNO_MR122] =
211 7, 8, 9, 8, 6, /* LSP VQ */
212 9, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 5, /* first subframe */
213 6, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 5, /* second subframe */
214 9, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 5, /* third subframe */
215 6, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 5 /* fourth subframe */
218 const Word16 bitno_MRDTX[PRMNO_MRDTX] =
225 /* overall table with all parameter sizes for all modes */
226 const Word16 * const bitno[N_MODES] =
238 /*----------------------------------------------------------------------------
239 ; EXTERNAL FUNCTION REFERENCES
240 ; Declare functions defined elsewhere and referenced in this module
241 ----------------------------------------------------------------------------*/
244 /*----------------------------------------------------------------------------
245 ; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
246 ; Declare variables used in this module but defined elsewhere
247 ----------------------------------------------------------------------------*/
250 /*--------------------------------------------------------------------------*/
255 /*----------------------------------------------------------------------------
257 ----------------------------------------------------------------------------*/
259 /*----------------------------------------------------------------------------
260 ; Define all local variables
261 ----------------------------------------------------------------------------*/
264 /*----------------------------------------------------------------------------
266 ----------------------------------------------------------------------------*/
269 /*----------------------------------------------------------------------------
270 ; Return nothing or data or data pointer
271 ----------------------------------------------------------------------------*/