Skip to content

Commit f7f1280

Browse files
Jean-Baptiste Queruandroid code review
authored andcommitted
Merge changes Ib4e27ea3,I4ad55266,Ie32b32c7
* changes: stagefright amrnb: Remove extern from table definitions stagefright amrnb: Add includes for prototype declarations of tables stagefright amrnb: Add missing const qualifier to table declarations in headers
2 parents 1a864db + dafebd6 commit f7f1280

29 files changed

+93
-67
lines changed

media/libstagefright/codecs/amrnb/common/include/az_lsp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ extern "C"
8383
; EXTERNAL VARIABLES REFERENCES
8484
; Declare variables used in this module but defined elsewhere
8585
----------------------------------------------------------------------------*/
86-
extern Word16 grid[];
86+
extern const Word16 grid[];
8787

8888
/*----------------------------------------------------------------------------
8989
; SIMPLE TYPEDEF'S

media/libstagefright/codecs/amrnb/common/include/inv_sqrt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ extern "C"
8585
; EXTERNAL VARIABLES REFERENCES
8686
; Declare variables used in this module but defined elsewhere
8787
----------------------------------------------------------------------------*/
88-
extern Word16 inv_sqrt_tbl[];
88+
extern const Word16 inv_sqrt_tbl[];
8989
/*----------------------------------------------------------------------------
9090
; SIMPLE TYPEDEF'S
9191
----------------------------------------------------------------------------*/

media/libstagefright/codecs/amrnb/common/include/log2_norm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ extern "C"
8585
; EXTERNAL VARIABLES REFERENCES
8686
; Declare variables used in this module but defined elsewhere
8787
----------------------------------------------------------------------------*/
88-
extern Word16 log2_tbl[];
88+
extern const Word16 log2_tbl[];
8989
/*----------------------------------------------------------------------------
9090
; SIMPLE TYPEDEF'S
9191
----------------------------------------------------------------------------*/

media/libstagefright/codecs/amrnb/common/include/pow2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ extern "C"
8181
; EXTERNAL VARIABLES REFERENCES
8282
; Declare variables used in this module but defined elsewhere
8383
----------------------------------------------------------------------------*/
84-
extern Word16 pow2_tbl[];
84+
extern const Word16 pow2_tbl[];
8585
/*----------------------------------------------------------------------------
8686
; SIMPLE TYPEDEF'S
8787
----------------------------------------------------------------------------*/

media/libstagefright/codecs/amrnb/common/include/sqrt_l.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ extern "C"
8282
; EXTERNAL VARIABLES REFERENCES
8383
; Declare variables used in this module but defined elsewhere
8484
----------------------------------------------------------------------------*/
85-
extern Word16 sqrt_l_tbl[];
85+
extern const Word16 sqrt_l_tbl[];
8686

8787
/*----------------------------------------------------------------------------
8888
; SIMPLE TYPEDEF'S

media/libstagefright/codecs/amrnb/common/src/bitno_tab.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ extern "C"
152152
; Variable declaration - defined here and used outside this module
153153
----------------------------------------------------------------------------*/
154154
/* number of parameters per modes (values must be <= MAX_PRM_SIZE!) */
155-
extern const Word16 prmno[N_MODES] =
155+
const Word16 prmno[N_MODES] =
156156
{
157157
PRMNO_MR475,
158158
PRMNO_MR515,
@@ -166,7 +166,7 @@ extern "C"
166166
};
167167

168168
/* number of parameters to first subframe per modes */
169-
extern const Word16 prmnofsf[N_MODES - 1] =
169+
const Word16 prmnofsf[N_MODES - 1] =
170170
{
171171
PRMNOFSF_MR475,
172172
PRMNOFSF_MR515,
@@ -179,7 +179,7 @@ extern "C"
179179
};
180180

181181
/* parameter sizes (# of bits), one table per mode */
182-
extern const Word16 bitno_MR475[PRMNO_MR475] =
182+
const Word16 bitno_MR475[PRMNO_MR475] =
183183
{
184184
8, 8, 7, /* LSP VQ */
185185
8, 7, 2, 8, /* first subframe */
@@ -188,7 +188,7 @@ extern "C"
188188
4, 7, 2, /* fourth subframe */
189189
};
190190

191-
extern const Word16 bitno_MR515[PRMNO_MR515] =
191+
const Word16 bitno_MR515[PRMNO_MR515] =
192192
{
193193
8, 8, 7, /* LSP VQ */
194194
8, 7, 2, 6, /* first subframe */
@@ -197,7 +197,7 @@ extern "C"
197197
4, 7, 2, 6, /* fourth subframe */
198198
};
199199

200-
extern const Word16 bitno_MR59[PRMNO_MR59] =
200+
const Word16 bitno_MR59[PRMNO_MR59] =
201201
{
202202
8, 9, 9, /* LSP VQ */
203203
8, 9, 2, 6, /* first subframe */
@@ -206,7 +206,7 @@ extern "C"
206206
4, 9, 2, 6, /* fourth subframe */
207207
};
208208

209-
extern const Word16 bitno_MR67[PRMNO_MR67] =
209+
const Word16 bitno_MR67[PRMNO_MR67] =
210210
{
211211
8, 9, 9, /* LSP VQ */
212212
8, 11, 3, 7, /* first subframe */
@@ -215,7 +215,7 @@ extern "C"
215215
4, 11, 3, 7, /* fourth subframe */
216216
};
217217

218-
extern const Word16 bitno_MR74[PRMNO_MR74] =
218+
const Word16 bitno_MR74[PRMNO_MR74] =
219219
{
220220
8, 9, 9, /* LSP VQ */
221221
8, 13, 4, 7, /* first subframe */
@@ -224,7 +224,7 @@ extern "C"
224224
5, 13, 4, 7, /* fourth subframe */
225225
};
226226

227-
extern const Word16 bitno_MR795[PRMNO_MR795] =
227+
const Word16 bitno_MR795[PRMNO_MR795] =
228228
{
229229
9, 9, 9, /* LSP VQ */
230230
8, 13, 4, 4, 5, /* first subframe */
@@ -233,7 +233,7 @@ extern "C"
233233
6, 13, 4, 4, 5, /* fourth subframe */
234234
};
235235

236-
extern const Word16 bitno_MR102[PRMNO_MR102] =
236+
const Word16 bitno_MR102[PRMNO_MR102] =
237237
{
238238
8, 9, 9, /* LSP VQ */
239239
8, 1, 1, 1, 1, 10, 10, 7, 7, /* first subframe */
@@ -242,7 +242,7 @@ extern "C"
242242
5, 1, 1, 1, 1, 10, 10, 7, 7, /* fourth subframe */
243243
};
244244

245-
extern const Word16 bitno_MR122[PRMNO_MR122] =
245+
const Word16 bitno_MR122[PRMNO_MR122] =
246246
{
247247
7, 8, 9, 8, 6, /* LSP VQ */
248248
9, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 5, /* first subframe */
@@ -251,15 +251,15 @@ extern "C"
251251
6, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 5 /* fourth subframe */
252252
};
253253

254-
extern const Word16 bitno_MRDTX[PRMNO_MRDTX] =
254+
const Word16 bitno_MRDTX[PRMNO_MRDTX] =
255255
{
256256
3,
257257
8, 9, 9,
258258
6
259259
};
260260

261261
/* overall table with all parameter sizes for all modes */
262-
extern const Word16 * const bitno[N_MODES] =
262+
const Word16 * const bitno[N_MODES] =
263263
{
264264
bitno_MR475,
265265
bitno_MR515,

media/libstagefright/codecs/amrnb/common/src/bitreorder_tab.cpp

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ terms listed above has been obtained from the copyright holder.
123123
; INCLUDES
124124
----------------------------------------------------------------------------*/
125125
#include "typedef.h"
126+
#include "bitreorder_tab.h"
126127

127128
/*--------------------------------------------------------------------------*/
128129
#ifdef __cplusplus
@@ -171,7 +172,7 @@ extern "C"
171172
; Variable declaration - defined here and used outside this module
172173
----------------------------------------------------------------------------*/
173174
/* number of parameters per modes (values must be <= MAX_PRM_SIZE!) */
174-
extern const Word16 numOfBits[NUM_MODES] =
175+
const Word16 numOfBits[NUM_MODES] =
175176
{
176177
NUMBIT_MR475,
177178
NUMBIT_MR515,
@@ -191,7 +192,7 @@ extern "C"
191192
NUMBIT_NO_DATA
192193
};
193194

194-
extern const Word16 reorderBits_MR475[NUMBIT_MR475] =
195+
const Word16 reorderBits_MR475[NUMBIT_MR475] =
195196
{
196197
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
197198
10, 11, 12, 13, 14, 15, 23, 24, 25, 26,
@@ -205,7 +206,7 @@ extern "C"
205206
92, 31, 52, 65, 86
206207
};
207208

208-
extern const Word16 reorderBits_MR515[NUMBIT_MR515] =
209+
const Word16 reorderBits_MR515[NUMBIT_MR515] =
209210
{
210211
7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
211212
13, 12, 11, 10, 9, 8, 23, 24, 25, 26,
@@ -220,7 +221,7 @@ extern "C"
220221
53, 72, 91
221222
};
222223

223-
extern const Word16 reorderBits_MR59[NUMBIT_MR59] =
224+
const Word16 reorderBits_MR59[NUMBIT_MR59] =
224225
{
225226
0, 1, 4, 5, 3, 6, 7, 2, 13, 15,
226227
8, 9, 11, 12, 14, 10, 16, 28, 74, 29,
@@ -236,7 +237,7 @@ extern "C"
236237
38, 59, 84, 105, 37, 58, 83, 104
237238
};
238239

239-
extern const Word16 reorderBits_MR67[NUMBIT_MR67] =
240+
const Word16 reorderBits_MR67[NUMBIT_MR67] =
240241
{
241242
0, 1, 4, 3, 5, 6, 13, 7, 2, 8,
242243
9, 11, 15, 12, 14, 10, 28, 82, 29, 83,
@@ -254,7 +255,7 @@ extern "C"
254255
36, 61, 90, 115
255256
};
256257

257-
extern const Word16 reorderBits_MR74[NUMBIT_MR74] =
258+
const Word16 reorderBits_MR74[NUMBIT_MR74] =
258259
{
259260
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
260261
10, 11, 12, 13, 14, 15, 16, 26, 87, 27,
@@ -273,7 +274,7 @@ extern "C"
273274
39, 68, 100, 129, 40, 69, 101, 130
274275
};
275276

276-
extern const Word16 reorderBits_MR795[NUMBIT_MR795] =
277+
const Word16 reorderBits_MR795[NUMBIT_MR795] =
277278
{
278279
8, 7, 6, 5, 4, 3, 2, 14, 16, 9,
279280
10, 12, 13, 15, 11, 17, 20, 22, 24, 23,
@@ -293,7 +294,7 @@ extern "C"
293294
139, 37, 69, 103, 135, 38, 70, 104, 136
294295
};
295296

296-
extern const Word16 reorderBits_MR102[NUMBIT_MR102] =
297+
const Word16 reorderBits_MR102[NUMBIT_MR102] =
297298
{
298299
7, 6, 5, 4, 3, 2, 1, 0, 16, 15,
299300
14, 13, 12, 11, 10, 9, 8, 26, 27, 28,
@@ -318,7 +319,7 @@ extern "C"
318319
63, 46, 55, 56
319320
};
320321

321-
extern const Word16 reorderBits_MR122[NUMBIT_MR122] =
322+
const Word16 reorderBits_MR122[NUMBIT_MR122] =
322323
{
323324
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
324325
10, 11, 12, 13, 14, 23, 15, 16, 17, 18,
@@ -348,7 +349,7 @@ extern "C"
348349
};
349350

350351
/* overall table with all parameter sizes for all modes */
351-
extern const Word16 * const reorderBits[NUM_MODES-1] =
352+
const Word16 * const reorderBits[NUM_MODES-1] =
352353
{
353354
reorderBits_MR475,
354355
reorderBits_MR515,
@@ -361,7 +362,7 @@ extern "C"
361362
};
362363

363364
/* Number of Frames (16-bit segments sent for each mode */
364-
extern const Word16 numCompressedBytes[16] =
365+
const Word16 numCompressedBytes[16] =
365366
{
366367
13, /*4.75*/
367368
14, /*5.15*/

media/libstagefright/codecs/amrnb/common/src/bytesused.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ extern "C"
152152
; LOCAL STORE/BUFFER/POINTER DEFINITIONS
153153
; Variable declaration - defined here and used outside this module
154154
----------------------------------------------------------------------------*/
155-
extern const short BytesUsed[16] =
155+
const short BytesUsed[16] =
156156
{
157157
13, /* 4.75 */
158158
14, /* 5.15 */

media/libstagefright/codecs/amrnb/common/src/c2_9pf_tab.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ extern "C"
8686
; LOCAL VARIABLE DEFINITIONS
8787
; [Variable declaration - defined here and used outside this module]
8888
----------------------------------------------------------------------------*/
89-
extern const Word16 startPos[2*4*2] = {0, 2, 0, 3,
89+
extern const Word16 startPos[];
90+
const Word16 startPos[2*4*2] = {0, 2, 0, 3,
9091
0, 2, 0, 3,
9192
1, 3, 2, 4,
9293
1, 4, 1, 4

media/libstagefright/codecs/amrnb/common/src/gains_tbl.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,16 @@ extern "C"
8686
----------------------------------------------------------------------------*/
8787

8888

89-
extern const Word16 qua_gain_pitch[NB_QUA_PITCH] =
89+
extern const Word16 qua_gain_pitch[];
90+
const Word16 qua_gain_pitch[NB_QUA_PITCH] =
9091
{
9192
0, 3277, 6556, 8192, 9830, 11469, 12288, 13107,
9293
13926, 14746, 15565, 16384, 17203, 18022, 18842, 19661
9394
};
9495

9596

96-
extern const Word16 qua_gain_code[(NB_QUA_CODE+1)*3] =
97+
extern const Word16 qua_gain_code[];
98+
const Word16 qua_gain_code[(NB_QUA_CODE+1)*3] =
9799
{
98100
/* gain factor (g_fac) and quantized energy error (qua_ener_MR122, qua_ener)
99101
* are stored:

0 commit comments

Comments
 (0)