Skip to content

Commit b3094e4

Browse files
committed
stagefright amrwb: Make local const arrays static
Some of these tables exist in both the amrnb and amrwb libraries, but with different content. This avoids some cases of multiple definitions of symbols, if linking in both libraries statically into the same executable, if the libraries are built as C. (As C++, the local symbols get mangled so they don't conflict with the external C symbols in amrnb, that are unmangled.) Most of this was committed on the master branch of the opencore repository in commit 0cd4b3ac412dd0a8370ce339e89cf346c6cfe395, based on AOSP contribution 10016. Change-Id: I5387e699ce54a56dc43fcfa0396dee5c99280fd9
1 parent 6a300a5 commit b3094e4

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

media/libstagefright/codecs/amrwb/src/homing_amr_wb_dec.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -134,29 +134,29 @@ extern "C"
134134
; LOCAL STORE/BUFFER/POINTER DEFINITIONS
135135
; Variable declaration - defined here and used outside this module
136136
----------------------------------------------------------------------------*/
137-
const int16 prmnofsf[NUM_OF_SPMODES] =
137+
static const int16 prmnofsf[NUM_OF_SPMODES] =
138138
{
139139
63, 81, 100,
140140
108, 116, 128,
141141
136, 152, 156
142142
};
143143

144144

145-
const int16 dfh_M7k[PRMN_7k] =
145+
static const int16 dfh_M7k[PRMN_7k] =
146146
{
147147
3168, 29954, 29213, 16121,
148148
64, 13440, 30624, 16430,
149149
19008
150150
};
151151

152-
const int16 dfh_M9k[PRMN_9k] =
152+
static const int16 dfh_M9k[PRMN_9k] =
153153
{
154154
3168, 31665, 9943, 9123,
155155
15599, 4358, 20248, 2048,
156156
17040, 27787, 16816, 13888
157157
};
158158

159-
const int16 dfh_M12k[PRMN_12k] =
159+
static const int16 dfh_M12k[PRMN_12k] =
160160
{
161161
3168, 31665, 9943, 9128,
162162
3647, 8129, 30930, 27926,
@@ -165,7 +165,7 @@ const int16 dfh_M12k[PRMN_12k] =
165165
13948
166166
};
167167

168-
const int16 dfh_M14k[PRMN_14k] =
168+
static const int16 dfh_M14k[PRMN_14k] =
169169
{
170170
3168, 31665, 9943, 9131,
171171
24815, 655, 26616, 26764,
@@ -174,7 +174,7 @@ const int16 dfh_M14k[PRMN_14k] =
174174
221, 20321, 17823
175175
};
176176

177-
const int16 dfh_M16k[PRMN_16k] =
177+
static const int16 dfh_M16k[PRMN_16k] =
178178
{
179179
3168, 31665, 9943, 9131,
180180
24815, 700, 3824, 7271,
@@ -184,7 +184,7 @@ const int16 dfh_M16k[PRMN_16k] =
184184
6759, 24576
185185
};
186186

187-
const int16 dfh_M18k[PRMN_18k] =
187+
static const int16 dfh_M18k[PRMN_18k] =
188188
{
189189
3168, 31665, 9943, 9135,
190190
14787, 14423, 30477, 24927,
@@ -195,7 +195,7 @@ const int16 dfh_M18k[PRMN_18k] =
195195
0
196196
};
197197

198-
const int16 dfh_M20k[PRMN_20k] =
198+
static const int16 dfh_M20k[PRMN_20k] =
199199
{
200200
3168, 31665, 9943, 9129,
201201
8637, 31807, 24646, 736,
@@ -206,7 +206,7 @@ const int16 dfh_M20k[PRMN_20k] =
206206
30249, 29123, 0
207207
};
208208

209-
const int16 dfh_M23k[PRMN_23k] =
209+
static const int16 dfh_M23k[PRMN_23k] =
210210
{
211211
3168, 31665, 9943, 9132,
212212
16748, 3202, 28179, 16317,
@@ -218,7 +218,7 @@ const int16 dfh_M23k[PRMN_23k] =
218218
23392, 26053, 31216
219219
};
220220

221-
const int16 dfh_M24k[PRMN_24k] =
221+
static const int16 dfh_M24k[PRMN_24k] =
222222
{
223223
3168, 31665, 9943, 9134,
224224
24776, 5857, 18475, 28535,

media/libstagefright/codecs/amrwb/src/isp_isf.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ terms listed above has been obtained from the copyright holder.
108108

109109
/* table of cos(x) in Q15 */
110110

111-
const int16 table[129] =
111+
static const int16 table[129] =
112112
{
113113
32767,
114114
32758, 32729, 32679, 32610, 32522, 32413, 32286, 32138,

media/libstagefright/codecs/amrwb/src/phase_dispersion.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ terms listed above has been obtained from the copyright holder.
109109
/* impulse response with phase dispersion */
110110

111111
/* 2.0 - 6.4 kHz phase dispersion */
112-
const int16 ph_imp_low[L_SUBFR] =
112+
static const int16 ph_imp_low[L_SUBFR] =
113113
{
114114
20182, 9693, 3270, -3437, 2864, -5240, 1589, -1357,
115115
600, 3893, -1497, -698, 1203, -5249, 1199, 5371,
@@ -122,7 +122,7 @@ const int16 ph_imp_low[L_SUBFR] =
122122
};
123123

124124
/* 3.2 - 6.4 kHz phase dispersion */
125-
const int16 ph_imp_mid[L_SUBFR] =
125+
static const int16 ph_imp_mid[L_SUBFR] =
126126
{
127127
24098, 10460, -5263, -763, 2048, -927, 1753, -3323,
128128
2212, 652, -2146, 2487, -3539, 4109, -2107, -374,

0 commit comments

Comments
 (0)