Making sure there's no exported symbol with a speex_ prefix when compiling
[speexdsp.git] / tmv / profile_tm.h
1 /* Copyright (C) 2007 Hong Zhiqian */\r
2 /**\r
3    @file profile_tm.h\r
4    @author Hong Zhiqian\r
5    @brief Various compatibility routines for Speex (TriMedia version)\r
6 */\r
7 /*\r
8    Redistribution and use in source and binary forms, with or without\r
9    modification, are permitted provided that the following conditions\r
10    are met:\r
11    \r
12    - Redistributions of source code must retain the above copyright\r
13    notice, this list of conditions and the following disclaimer.\r
14    \r
15    - Redistributions in binary form must reproduce the above copyright\r
16    notice, this list of conditions and the following disclaimer in the\r
17    documentation and/or other materials provided with the distribution.\r
18    \r
19    - Neither the name of the Xiph.org Foundation nor the names of its\r
20    contributors may be used to endorse or promote products derived from\r
21    this software without specific prior written permission.\r
22    \r
23    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
24    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
25    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
26    A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR\r
27    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\r
28    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r
29    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\r
30    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\r
31    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\r
32    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\r
33    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
34 */\r
35 /**\r
36 *       @remarks        This file provide some capabilities to measure clock cycles.\r
37 *                               Use this if unable to compile with TriMedia profile options\r
38 */\r
39 \r
40 extern int __profile_begin;\r
41 extern int __profile_end;\r
42 \r
43 #if TM_PROFILE\r
44 #define PROFILE_START()                                                                                         \\r
45                 {                                                                                                                       \\r
46                         __profile_begin = cycles();                                                             \\r
47                 }                                                                                                                       \\r
48 \r
49 #define PROFILE_STOP()                                                                                          \\r
50                 {                                                                                                                       \\r
51                         __profile_end = cycles();                                                               \\r
52                         printf("%s\t%d\n", __FUNCTION__, end - begin);                  \\r
53                 }                                                                                                                       \\r
54 \r
55 #else\r
56 #define PROFILE_START()\r
57 #define PROFILE_STOP()\r
58 #endif\r
59 \r
60 #if TM_PROFILE_SPXAUTOCORR\r
61 #define _SPX_AUTOCORR_START()   PROFILE_START()\r
62 #define _SPX_AUTOCORR_STOP()    PROFILE_STOP()\r
63 #else\r
64 #define _SPX_AUTOCORR_START()\r
65 #define _SPX_AUTOCORR_STOP()\r
66 #endif\r
67 \r
68 #if TM_PROFILE_INNERPROD\r
69 #define INNERPROD_START()       PROFILE_START()\r
70 #define INNERPROD_STOP()        PROFILE_STOP()\r
71 #else\r
72 #define INNERPROD_START()\r
73 #define INNERPROD_STOP()\r
74 #endif\r
75 \r
76 #if TM_PROFILE_PITCHXCORR\r
77 #define PITCHXCORR_START()      PROFILE_START()\r
78 #define PITCHXCORR_STOP()       PROFILE_STOP()\r
79 #else\r
80 #define PITCHXCORR_START()\r
81 #define PITCHXCORR_STOP()\r
82 #endif\r
83 \r
84 #if TM_PROFILE_COMPUTEPITCHERROR\r
85 #define COMPUTEPITCHERROR_START()       PROFILE_START()\r
86 #define COMPUTEPITCHERROR_STOP()        PROFILE_STOP()\r
87 #else\r
88 #define COMPUTEPITCHERROR_START()\r
89 #define COMPUTEPITCHERROR_STOP()\r
90 #endif\r
91 \r
92 #if TM_PROFILE_PITCHGAINSEARCH3TAPVQ\r
93 #define PITCHGAINSEARCH3TAPVQ_START()   PROFILE_START()\r
94 #define PITCHGAINSEARCH3TAPVQ_STOP()    PROFILE_STOP()\r
95 #else\r
96 #define PITCHGAINSEARCH3TAPVQ_START()\r
97 #define PITCHGAINSEARCH3TAPVQ_STOP()\r
98 #endif\r
99 \r
100 #if TM_PROFILE_OPENLOOPNBESTPITCH\r
101 #define OPENLOOPNBESTPITCH_START()      PROFILE_START()\r
102 #define OPENLOOPNBESTPITCH_STOP()       PROFILE_STOP()\r
103 #else\r
104 #define OPENLOOPNBESTPITCH_START()\r
105 #define OPENLOOPNBESTPITCH_STOP()\r
106 #endif\r
107 \r
108 \r
109 #if TM_PROFILE_LSP_INTERPOLATE\r
110 #define LSPINTERPOLATE_START()  PROFILE_START()\r
111 #define LSPINTERPOLATE_STOP()   PROFILE_STOP()\r
112 #else\r
113 #define LSPINTERPOLATE_START()\r
114 #define LSPINTERPOLATE_STOP()\r
115 #endif\r
116 \r
117 #if TM_PROFILE_CHEBPOLYEVA\r
118 #define CHEBPOLYEVA_START()     PROFILE_START()\r
119 #define CHEBPOLYEVA_STOP()      PROFILE_STOP()\r
120 #else\r
121 #define CHEBPOLYEVA_START()\r
122 #define CHEBPOLYEVA_STOP()\r
123 #endif\r
124 \r
125 \r
126 #if TM_PROFILE_COMPUTEQUANTWEIGHTS\r
127 #define COMPUTEQUANTWEIGHTS_START()     PROFILE_START()\r
128 #define COMPUTEQUANTWEIGHTS_STOP()      PROFILE_STOP()\r
129 #else\r
130 #define COMPUTEQUANTWEIGHTS_START()\r
131 #define COMPUTEQUANTWEIGHTS_STOP()\r
132 #endif\r
133 \r
134 #if TM_PROFILE_LSPQUANT\r
135 #define LSPQUANT_START()        PROFILE_START()\r
136 #define LSPQUANT_STOP()         PROFILE_STOP()\r
137 #else\r
138 #define LSPQUANT_START()\r
139 #define LSPQUANT_STOP()\r
140 #endif\r
141 \r
142 #if TM_PROFILE_LSPWEIGHTQUANT\r
143 #define LSPWEIGHTQUANT_START()          PROFILE_START()\r
144 #define LSPWEIGHTQUANT_STOP()           PROFILE_STOP()\r
145 #else\r
146 #define LSPWEIGHTQUANT_START()\r
147 #define LSPWEIGHTQUANT_STOP()\r
148 #endif\r
149 \r
150 #if TM_PROFILE_FIRMEM16\r
151 #define FIRMEM16_START()        PROFILE_START()\r
152 #define FIRMEM16_STOP()         PROFILE_STOP()\r
153 #else\r
154 #define FIRMEM16_START()\r
155 #define FIRMEM16_STOP()\r
156 #endif\r
157 \r
158 #if TM_PROFILE_IIRMEM16\r
159 #define IIRMEM16_START()        PROFILE_START()\r
160 #define IIRMEM16_STOP()         PROFILE_STOP()\r
161 #else\r
162 #define IIRMEM16_START()\r
163 #define IIRMEM16_STOP()\r
164 #endif\r
165 \r
166 #if TM_PROFILE_FILTERMEM16\r
167 #define FILTERMEM16_START()             PROFILE_START()\r
168 #define FILTERMEM16_STOP()              PROFILE_STOP()\r
169 #else\r
170 #define FILTERMEM16_START()\r
171 #define FILTERMEM16_STOP()\r
172 #endif\r
173 \r
174 #if TM_PROFILE_COMPUTERMS16\r
175 #define COMPUTERMS16_START()    PROFILE_START()\r
176 #define COMPUTERMS16_STOP()             PROFILE_STOP()\r
177 #else\r
178 #define COMPUTERMS16_START()\r
179 #define COMPUTERMS16_STOP()\r
180 #endif\r
181         \r
182 #if TM_PROFILE_NORMALIZE16\r
183 #define NORMALIZE16_START()             PROFILE_START()\r
184 #define NORMALIZE16_STOP()              PROFILE_STOP()\r
185 #else\r
186 #define NORMALIZE16_START()\r
187 #define NORMALIZE16_STOP()\r
188 #endif\r
189 \r
190 #if TM_PROFILE_BWLPC\r
191 #define BWLPC_START()           PROFILE_START()\r
192 #define BWLPC_STOP()            PROFILE_STOP()\r
193 #else\r
194 #define BWLPC_START()\r
195 #define BWLPC_STOP()\r
196 #endif\r
197 \r
198 #if TM_PROFILE_HIGHPASS\r
199 #define HIGHPASS_START()        PROFILE_START()\r
200 #define HIGHPASS_STOP()         PROFILE_STOP()\r
201 #else\r
202 #define HIGHPASS_START()\r
203 #define HIGHPASS_STOP()\r
204 #endif\r
205 \r
206 #if TM_PROFILE_SIGNALMUL\r
207 #define SIGNALMUL_START()               PROFILE_START()\r
208 #define SIGNALMUL_STOP()                PROFILE_STOP()\r
209 #else\r
210 #define SIGNALMUL_START()\r
211 #define SIGNALMUL_STOP()\r
212 #endif\r
213 \r
214 #if TM_PROFILE_SIGNALDIV\r
215 #define SIGNALDIV_START()               PROFILE_START()\r
216 #define SIGNALDIV_STOP()                PROFILE_STOP()\r
217 #else\r
218 #define SIGNALDIV_START()\r
219 #define SIGNALDIV_STOP()\r
220 #endif\r
221 \r
222 #if TM_PROFILE_COMPUTEIMPULSERESPONSE\r
223 #define COMPUTEIMPULSERESPONSE_START()          PROFILE_START()\r
224 #define COMPUTEIMPULSERESPONSE_STOP()           PROFILE_STOP()\r
225 #else\r
226 #define COMPUTEIMPULSERESPONSE_START()\r
227 #define COMPUTEIMPULSERESPONSE_STOP()\r
228 #endif\r
229 \r
230 #if TM_PROFILE_COMPUTEWEIGHTEDCODEBOOK\r
231 #define COMPUTEWEIGHTEDCODEBOOK_START()                 PROFILE_START()\r
232 #define COMPUTEWEIGHTEDCODEBOOK_STOP()                  PROFILE_STOP()\r
233 #else\r
234 #define COMPUTEWEIGHTEDCODEBOOK_START()\r
235 #define COMPUTEWEIGHTEDCODEBOOK_STOP()\r
236 #endif\r
237 \r
238 #if TM_PROFILE_TARGETUPDATE\r
239 #define TARGETUPDATE_START()                    PROFILE_START()\r
240 #define TARGETUPDATE_STOP()                             PROFILE_STOP()\r
241 #else\r
242 #define TARGETUPDATE_START()\r
243 #define TARGETUPDATE_STOP()\r
244 #endif\r
245 \r
246 \r
247 #if TM_PROFILE_VQNBEST\r
248 #define VQNBEST_START()         PROFILE_START()\r
249 #define VQNBEST_STOP()          PROFILE_STOP()\r
250 #else\r
251 #define VQNBEST_START()\r
252 #define VQNBEST_STOP()\r
253 #endif\r
254 \r
255 #if TM_PROFILE_VQNBESTSIGN\r
256 #define VQNBESTSIGN_START()             PROFILE_START()\r
257 #define VQNBESTSIGN_STOP()              PROFILE_STOP()\r
258 #else\r
259 #define VQNBESTSIGN_START()\r
260 #define VQNBESTSIGN_STOP()\r
261 #endif\r
262 \r
263 #if TM_PROFILE_PREPROCESSANALYSIS\r
264 #define PREPROCESSANAYLSIS_START()              PROFILE_START()\r
265 #define PREPROCESSANAYLSIS_STOP()               PROFILE_STOP()\r
266 #else\r
267 #define PREPROCESSANAYLSIS_START()\r
268 #define PREPROCESSANAYLSIS_STOP()\r
269 #endif\r
270 \r
271 #if TM_PROFILE_UPDATENOISEPROB\r
272 #define UPDATENOISEPROB_START()         PROFILE_START()\r
273 #define UPDATENOISEPROB_STOP()          PROFILE_STOP()\r
274 #else\r
275 #define UPDATENOISEPROB_START()\r
276 #define UPDATENOISEPROB_STOP()\r
277 #endif\r
278 \r
279 #if TM_PROFILE_COMPUTEGAINFLOOR\r
280 #define COMPUTEGAINFLOOR_START()        PROFILE_START()\r
281 #define COMPUTEGAINFLOOR_STOP()         PROFILE_STOP()\r
282 #else\r
283 #define COMPUTEGAINFLOOR_START()\r
284 #define COMPUTEGAINFLOOR_STOP()\r
285 #endif\r
286 \r
287 #if TM_PROFILE_FILTERDCNOTCH16\r
288 #define FILTERDCNOTCH16_START()         PROFILE_START()\r
289 #define FILTERDCNOTCH16_STOP()          PROFILE_STOP()\r
290 #else\r
291 #define FILTERDCNOTCH16_START()\r
292 #define FILTERDCNOTCH16_STOP()\r
293 #endif\r
294 \r
295 #if TM_PROFILE_MDFINNERPROD\r
296 #define MDFINNERPROD_START()            PROFILE_START()\r
297 #define MDFINNERPROD_STOP()                     PROFILE_STOP()\r
298 #else\r
299 #define MDFINNERPROD_START()\r
300 #define MDFINNERPROD_STOP()\r
301 #endif\r
302 \r
303 #if TM_PROFILE_SPECTRALMULACCUM\r
304 #define SPECTRALMULACCUM_START()                PROFILE_START()\r
305 #define SPECTRALMULACCUM_STOP()                 PROFILE_STOP()\r
306 #else\r
307 #define SPECTRALMULACCUM_START()\r
308 #define SPECTRALMULACCUM_STOP()\r
309 #endif\r
310 \r
311 #if TM_PROFILE_WEIGHTEDSPECTRALMULCONJ\r
312 #define WEIGHTEDSPECTRALMULCONJ_START()         PROFILE_START()\r
313 #define WEIGHTEDSPECTRALMULCONJ_STOP()          PROFILE_STOP()\r
314 #else\r
315 #define WEIGHTEDSPECTRALMULCONJ_START()\r
316 #define WEIGHTEDSPECTRALMULCONJ_STOP()\r
317 #endif\r
318 \r
319 #if TM_PROFILE_MDFADJUSTPROP\r
320 #define MDFADJUSTPROP_START()           PROFILE_START()\r
321 #define MDFADJUSTPROP_STOP()            PROFILE_STOP()\r
322 #else\r
323 #define MDFADJUSTPROP_START()\r
324 #define MDFADJUSTPROP_STOP()\r
325 #endif\r
326 \r
327 #if TM_PROFILE_SPEEXECHOGETRESIDUAL\r
328 #define SPEEXECHOGETRESIDUAL_START()    PROFILE_START()\r
329 #define SPEEXECHOGETRESIDUAL_STOP()             PROFILE_STOP()\r
330 #else\r
331 #define SPEEXECHOGETRESIDUAL_START()\r
332 #define SPEEXECHOGETRESIDUAL_STOP()\r
333 #endif\r
334 \r
335 #if TM_PROFILE_LSPENFORCEMARGIN\r
336 #define LSPENFORCEMARGIN_START()        PROFILE_START()\r
337 #define LSPENFORCEMARGIN_STOP()         PROFILE_STOP()\r
338 #else\r
339 #define LSPENFORCEMARGIN_START()\r
340 #define LSPENFORCEMARGIN_STOP()\r
341 #endif\r
342 \r
343 #if TM_PROFILE_LSPTOLPC\r
344 #define LSPTOLPC_START()        PROFILE_START()\r
345 #define LSPTOLPC_STOP()         PROFILE_STOP()\r
346 #else\r
347 #define LSPTOLPC_START()\r
348 #define LSPTOLPC_STOP()\r
349 #endif\r
350 \r
351 #if TM_PROFILE_MAXIMIZERANGE\r
352 #define MAXIMIZERANGE_START()   PROFILE_START()\r
353 #define MAXIMIZERANGE_STOP()    PROFILE_STOP()\r
354 #else\r
355 #define MAXIMIZERANGE_START()\r
356 #define MAXIMIZERANGE_STOP()\r
357 #endif\r
358 \r
359 #if TM_PROFILE_RENORMRANGE\r
360 #define RENORMRANGE_START()     PROFILE_START()\r
361 #define RENORMRANGE_STOP()      PROFILE_STOP()\r
362 #else\r
363 #define RENORMRANGE_START()\r
364 #define RENORMRANGE_STOP()\r
365 #endif\r
366 \r
367 #if TM_PROFILE_POWERSPECTRUM\r
368 #define POWERSPECTRUM_START()   PROFILE_START()\r
369 #define POWERSPECTRUM_STOP()    PROFILE_STOP()\r
370 #else\r
371 #define POWERSPECTRUM_START()\r
372 #define POWERSPECTRUM_STOP()\r
373 #endif\r
374 \r
375 #if TM_PROFILE_QMFSYNTH\r
376 #define QMFSYNTH_START()        PROFILE_START()\r
377 #define QMFSYNTH_STOP()         PROFILE_STOP()\r
378 #else\r
379 #define QMFSYNTH_START()\r
380 #define QMFSYNTH_STOP()\r
381 #endif\r
382 \r
383 #if TM_PROFILE_QMFDECOMP\r
384 #define QMFDECOMP_START()       PROFILE_START()\r
385 #define QMFDECOMP_STOP()        PROFILE_STOP()\r
386 #else\r
387 #define QMFDECOMP_START()\r
388 #define QMFDECOMP_STOP()\r
389 #endif\r
390 \r
391 #if TM_PROFILE_FILTERBANKCOMPUTEBANK32\r
392 #define FILTERBANKCOMPUTEBANK32_START() PROFILE_START()\r
393 #define FILTERBANKCOMPUTEBANK32_STOP()  PROFILE_STOP()\r
394 #else\r
395 #define FILTERBANKCOMPUTEBANK32_START()\r
396 #define FILTERBANKCOMPUTEBANK32_STOP()\r
397 #endif\r
398 \r
399 #if TM_PROFILE_FILTERBANKCOMPUTEPSD16\r
400 #define FILTERBANKCOMPUTEPSD16_START()  PROFILE_START()\r
401 #define FILTERBANKCOMPUTEPSD16_STOP()   PROFILE_STOP()\r
402 #else\r
403 #define FILTERBANKCOMPUTEPSD16_START()\r
404 #define FILTERBANKCOMPUTEPSD16_STOP()\r
405 #endif\r
406 \r
407 \r