Mercurial > hg > beaglert
comparison include/ne10/NE10_dsp.h @ 379:24c3a0663d54 prerelease
Added Ne10 headers within include directory
author | andrewm |
---|---|
date | Sun, 12 Jun 2016 18:16:20 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
378:8db03611ee76 | 379:24c3a0663d54 |
---|---|
1 /* | |
2 * Copyright 2012-15 ARM Limited and Contributors. | |
3 * All rights reserved. | |
4 * | |
5 * Redistribution and use in source and binary forms, with or without | |
6 * modification, are permitted provided that the following conditions are met: | |
7 * * Redistributions of source code must retain the above copyright | |
8 * notice, this list of conditions and the following disclaimer. | |
9 * * Redistributions in binary form must reproduce the above copyright | |
10 * notice, this list of conditions and the following disclaimer in the | |
11 * documentation and/or other materials provided with the distribution. | |
12 * * Neither the name of ARM Limited nor the | |
13 * names of its contributors may be used to endorse or promote products | |
14 * derived from this software without specific prior written permission. | |
15 * | |
16 * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND | |
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |
19 * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY | |
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | |
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | |
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | |
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
26 */ | |
27 | |
28 /* | |
29 * NE10 Library : inc/NE10_dsp.h | |
30 */ | |
31 | |
32 | |
33 #include "NE10_types.h" | |
34 | |
35 #ifndef NE10_DSP_H | |
36 #define NE10_DSP_H | |
37 | |
38 #ifdef __cplusplus | |
39 extern "C" { | |
40 #endif | |
41 | |
42 /////////////////////////// | |
43 // function prototypes: | |
44 /////////////////////////// | |
45 | |
46 /* fft functions*/ | |
47 | |
48 /* function pointers*/ | |
49 extern ne10_fft_cfg_float32_t (*ne10_fft_alloc_c2c_float32) (ne10_int32_t nfft); | |
50 extern ne10_fft_cfg_int32_t (*ne10_fft_alloc_c2c_int32) (ne10_int32_t nfft); | |
51 | |
52 extern void (*ne10_fft_c2c_1d_float32) (ne10_fft_cpx_float32_t *fout, | |
53 ne10_fft_cpx_float32_t *fin, | |
54 ne10_fft_cfg_float32_t cfg, | |
55 ne10_int32_t inverse_fft); | |
56 | |
57 extern void (*ne10_fft_r2c_1d_float32) (ne10_fft_cpx_float32_t *fout, | |
58 ne10_float32_t *fin, | |
59 ne10_fft_r2c_cfg_float32_t cfg); | |
60 | |
61 extern void (*ne10_fft_c2r_1d_float32) (ne10_float32_t *fout, | |
62 ne10_fft_cpx_float32_t *fin, | |
63 ne10_fft_r2c_cfg_float32_t cfg); | |
64 | |
65 extern void (*ne10_fft_c2c_1d_int32) (ne10_fft_cpx_int32_t *fout, | |
66 ne10_fft_cpx_int32_t *fin, | |
67 ne10_fft_cfg_int32_t cfg, | |
68 ne10_int32_t inverse_fft, | |
69 ne10_int32_t scaled_flag); | |
70 | |
71 extern void (*ne10_fft_r2c_1d_int32) (ne10_fft_cpx_int32_t *fout, | |
72 ne10_int32_t *fin, | |
73 ne10_fft_r2c_cfg_int32_t cfg, | |
74 ne10_int32_t scaled_flag); | |
75 | |
76 extern void (*ne10_fft_c2r_1d_int32) (ne10_int32_t *fout, | |
77 ne10_fft_cpx_int32_t *fin, | |
78 ne10_fft_r2c_cfg_int32_t cfg, | |
79 ne10_int32_t scaled_flag); | |
80 | |
81 extern void (*ne10_fft_c2c_1d_int16) (ne10_fft_cpx_int16_t *fout, | |
82 ne10_fft_cpx_int16_t *fin, | |
83 ne10_fft_cfg_int16_t cfg, | |
84 ne10_int32_t inverse_fft, | |
85 ne10_int32_t scaled_flag); | |
86 | |
87 extern void (*ne10_fft_r2c_1d_int16) (ne10_fft_cpx_int16_t *fout, | |
88 ne10_int16_t *fin, | |
89 ne10_fft_r2c_cfg_int16_t cfg, | |
90 ne10_int32_t scaled_flag); | |
91 | |
92 extern void (*ne10_fft_c2r_1d_int16) (ne10_int16_t *fout, | |
93 ne10_fft_cpx_int16_t *fin, | |
94 ne10_fft_r2c_cfg_int16_t cfg, | |
95 ne10_int32_t scaled_flag); | |
96 | |
97 /* init functions*/ | |
98 extern ne10_fft_cfg_int16_t ne10_fft_alloc_c2c_int16 (ne10_int32_t nfft); | |
99 | |
100 /* destroy functions */ | |
101 extern void ne10_fft_destroy_c2c_float32 (ne10_fft_cfg_float32_t); | |
102 extern void ne10_fft_destroy_c2c_int32 (ne10_fft_cfg_int32_t); | |
103 extern void ne10_fft_destroy_c2c_int16 (ne10_fft_cfg_int16_t); | |
104 | |
105 extern void ne10_fft_destroy_r2c_float32 (ne10_fft_r2c_cfg_float32_t); | |
106 extern void ne10_fft_destroy_r2c_int32 (ne10_fft_r2c_cfg_int32_t); | |
107 extern void ne10_fft_destroy_r2c_int16 (ne10_fft_r2c_cfg_int16_t); | |
108 | |
109 extern ne10_fft_r2c_cfg_float32_t ne10_fft_alloc_r2c_float32 (ne10_int32_t nfft); | |
110 extern ne10_fft_r2c_cfg_int32_t ne10_fft_alloc_r2c_int32 (ne10_int32_t nfft); | |
111 extern ne10_fft_r2c_cfg_int16_t ne10_fft_alloc_r2c_int16 (ne10_int32_t nfft); | |
112 | |
113 /* C version*/ | |
114 extern ne10_fft_cfg_float32_t ne10_fft_alloc_c2c_float32_c (ne10_int32_t nfft); | |
115 extern ne10_fft_cfg_int32_t ne10_fft_alloc_c2c_int32_c (ne10_int32_t nfft); | |
116 | |
117 extern void ne10_fft_c2c_1d_float32_c (ne10_fft_cpx_float32_t *fout, | |
118 ne10_fft_cpx_float32_t *fin, | |
119 ne10_fft_cfg_float32_t cfg, | |
120 ne10_int32_t inverse_fft); | |
121 | |
122 extern void ne10_fft_r2c_1d_float32_c (ne10_fft_cpx_float32_t *fout, | |
123 ne10_float32_t *fin, | |
124 ne10_fft_r2c_cfg_float32_t cfg); | |
125 | |
126 extern void ne10_fft_c2r_1d_float32_c (ne10_float32_t *fout, | |
127 ne10_fft_cpx_float32_t *fin, | |
128 ne10_fft_r2c_cfg_float32_t cfg); | |
129 | |
130 extern void ne10_fft_c2c_1d_int32_c (ne10_fft_cpx_int32_t *fout, | |
131 ne10_fft_cpx_int32_t *fin, | |
132 ne10_fft_cfg_int32_t cfg, | |
133 ne10_int32_t inverse_fft, | |
134 ne10_int32_t scaled_flag); | |
135 | |
136 extern void ne10_fft_r2c_1d_int32_c (ne10_fft_cpx_int32_t *fout, | |
137 ne10_int32_t *fin, | |
138 ne10_fft_r2c_cfg_int32_t cfg, | |
139 ne10_int32_t scaled_flag); | |
140 | |
141 extern void ne10_fft_c2r_1d_int32_c (ne10_int32_t *fout, | |
142 ne10_fft_cpx_int32_t *fin, | |
143 ne10_fft_r2c_cfg_int32_t cfg, | |
144 ne10_int32_t scaled_flag); | |
145 | |
146 extern void ne10_fft_c2c_1d_int16_c (ne10_fft_cpx_int16_t *fout, | |
147 ne10_fft_cpx_int16_t *fin, | |
148 ne10_fft_cfg_int16_t cfg, | |
149 ne10_int32_t inverse_fft, | |
150 ne10_int32_t scaled_flag); | |
151 | |
152 extern void ne10_fft_r2c_1d_int16_c (ne10_fft_cpx_int16_t *fout, | |
153 ne10_int16_t *fin, | |
154 ne10_fft_r2c_cfg_int16_t cfg, | |
155 ne10_int32_t scaled_flag); | |
156 | |
157 extern void ne10_fft_c2r_1d_int16_c (ne10_int16_t *fout, | |
158 ne10_fft_cpx_int16_t *fin, | |
159 ne10_fft_r2c_cfg_int16_t cfg, | |
160 ne10_int32_t scaled_flag); | |
161 | |
162 | |
163 /* NEON version*/ | |
164 extern ne10_fft_cfg_float32_t ne10_fft_alloc_c2c_float32_neon (ne10_int32_t nfft); | |
165 extern ne10_fft_cfg_int32_t ne10_fft_alloc_c2c_int32_neon (ne10_int32_t nfft); | |
166 | |
167 extern void ne10_fft_c2c_1d_float32_neon (ne10_fft_cpx_float32_t *fout, | |
168 ne10_fft_cpx_float32_t *fin, | |
169 ne10_fft_cfg_float32_t cfg, | |
170 ne10_int32_t inverse_fft); | |
171 | |
172 extern void ne10_fft_r2c_1d_float32_neon (ne10_fft_cpx_float32_t *fout, | |
173 ne10_float32_t *fin, | |
174 ne10_fft_r2c_cfg_float32_t cfg); | |
175 | |
176 extern void ne10_fft_c2r_1d_float32_neon (ne10_float32_t *fout, | |
177 ne10_fft_cpx_float32_t *fin, | |
178 ne10_fft_r2c_cfg_float32_t cfg); | |
179 | |
180 extern void ne10_fft_c2c_1d_int32_neon (ne10_fft_cpx_int32_t *fout, | |
181 ne10_fft_cpx_int32_t *fin, | |
182 ne10_fft_cfg_int32_t cfg, | |
183 ne10_int32_t inverse_fft, | |
184 ne10_int32_t scaled_flag); | |
185 | |
186 extern void ne10_fft_r2c_1d_int32_neon (ne10_fft_cpx_int32_t *fout, | |
187 ne10_int32_t *fin, | |
188 ne10_fft_r2c_cfg_int32_t cfg, | |
189 ne10_int32_t scaled_flag); | |
190 | |
191 extern void ne10_fft_c2r_1d_int32_neon (ne10_int32_t *fout, | |
192 ne10_fft_cpx_int32_t *fin, | |
193 ne10_fft_r2c_cfg_int32_t cfg, | |
194 ne10_int32_t scaled_flag); | |
195 | |
196 extern void ne10_fft_c2c_1d_int16_neon (ne10_fft_cpx_int16_t *fout, | |
197 ne10_fft_cpx_int16_t *fin, | |
198 ne10_fft_cfg_int16_t cfg, | |
199 ne10_int32_t inverse_fft, | |
200 ne10_int32_t scaled_flag); | |
201 | |
202 extern void ne10_fft_r2c_1d_int16_neon (ne10_fft_cpx_int16_t *fout, | |
203 ne10_int16_t *fin, | |
204 ne10_fft_r2c_cfg_int16_t cfg, | |
205 ne10_int32_t scaled_flag); | |
206 | |
207 extern void ne10_fft_c2r_1d_int16_neon (ne10_int16_t *fout, | |
208 ne10_fft_cpx_int16_t *fin, | |
209 ne10_fft_r2c_cfg_int16_t cfg, | |
210 ne10_int32_t scaled_flag); | |
211 | |
212 /* fir functions*/ | |
213 | |
214 /* function pointers*/ | |
215 extern void (*ne10_fir_float) (const ne10_fir_instance_f32_t * S, | |
216 ne10_float32_t * pSrc, | |
217 ne10_float32_t * pDst, | |
218 ne10_uint32_t blockSize); | |
219 | |
220 extern void (*ne10_fir_decimate_float) (const ne10_fir_decimate_instance_f32_t * S, | |
221 ne10_float32_t * pSrc, | |
222 ne10_float32_t * pDst, | |
223 ne10_uint32_t blockSize); | |
224 | |
225 extern void (*ne10_fir_interpolate_float) (const ne10_fir_interpolate_instance_f32_t * S, | |
226 ne10_float32_t * pSrc, | |
227 ne10_float32_t * pDst, | |
228 ne10_uint32_t blockSize); | |
229 | |
230 extern void (*ne10_fir_lattice_float) (const ne10_fir_lattice_instance_f32_t * S, | |
231 ne10_float32_t * pSrc, | |
232 ne10_float32_t * pDst, | |
233 ne10_uint32_t blockSize); | |
234 | |
235 extern void (*ne10_fir_sparse_float) (ne10_fir_sparse_instance_f32_t * S, | |
236 ne10_float32_t * pSrc, | |
237 ne10_float32_t * pDst, | |
238 ne10_float32_t * pScratchIn, | |
239 ne10_uint32_t blockSize); | |
240 | |
241 | |
242 /* init functions*/ | |
243 extern ne10_result_t ne10_fir_init_float (ne10_fir_instance_f32_t * S, | |
244 ne10_uint16_t numTaps, | |
245 ne10_float32_t * pCoeffs, | |
246 ne10_float32_t * pState, | |
247 ne10_uint32_t blockSize); | |
248 | |
249 extern ne10_result_t ne10_fir_decimate_init_float (ne10_fir_decimate_instance_f32_t * S, | |
250 ne10_uint16_t numTaps, | |
251 ne10_uint8_t M, | |
252 ne10_float32_t * pCoeffs, | |
253 ne10_float32_t * pState, | |
254 ne10_uint32_t blockSize); | |
255 | |
256 extern ne10_result_t ne10_fir_interpolate_init_float (ne10_fir_interpolate_instance_f32_t * S, | |
257 ne10_uint8_t L, | |
258 ne10_uint16_t numTaps, | |
259 ne10_float32_t * pCoeffs, | |
260 ne10_float32_t * pState, | |
261 ne10_uint32_t blockSize); | |
262 | |
263 extern ne10_result_t ne10_fir_lattice_init_float (ne10_fir_lattice_instance_f32_t * S, | |
264 ne10_uint16_t numStages, | |
265 ne10_float32_t * pCoeffs, | |
266 ne10_float32_t * pState); | |
267 | |
268 extern ne10_result_t ne10_fir_sparse_init_float (ne10_fir_sparse_instance_f32_t * S, | |
269 ne10_uint16_t numTaps, | |
270 ne10_float32_t * pCoeffs, | |
271 ne10_float32_t * pState, | |
272 ne10_int32_t * pTapDelay, | |
273 ne10_uint16_t maxDelay, | |
274 ne10_uint32_t blockSize); | |
275 | |
276 /* C version*/ | |
277 extern void ne10_fir_float_c (const ne10_fir_instance_f32_t * S, | |
278 ne10_float32_t * pSrc, | |
279 ne10_float32_t * pDst, | |
280 ne10_uint32_t blockSize); | |
281 | |
282 extern void ne10_fir_decimate_float_c (const ne10_fir_decimate_instance_f32_t * S, | |
283 ne10_float32_t * pSrc, | |
284 ne10_float32_t * pDst, | |
285 ne10_uint32_t blockSize); | |
286 | |
287 extern void ne10_fir_interpolate_float_c (const ne10_fir_interpolate_instance_f32_t * S, | |
288 ne10_float32_t * pSrc, | |
289 ne10_float32_t * pDst, | |
290 ne10_uint32_t blockSize); | |
291 | |
292 extern void ne10_fir_lattice_float_c (const ne10_fir_lattice_instance_f32_t * S, | |
293 ne10_float32_t * pSrc, | |
294 ne10_float32_t * pDst, | |
295 ne10_uint32_t blockSize); | |
296 | |
297 extern void ne10_fir_sparse_float_c (ne10_fir_sparse_instance_f32_t * S, | |
298 ne10_float32_t * pSrc, | |
299 ne10_float32_t * pDst, | |
300 ne10_float32_t * pScratchIn, | |
301 ne10_uint32_t blockSize); | |
302 | |
303 | |
304 /* NEON version*/ | |
305 | |
306 /** | |
307 * @addtogroup FIR | |
308 * @{ | |
309 */ | |
310 #ifdef ENABLE_NE10_FIR_FLOAT_NEON | |
311 extern void ne10_fir_float_neon (const ne10_fir_instance_f32_t * S, | |
312 ne10_float32_t * pSrc, | |
313 ne10_float32_t * pDst, | |
314 ne10_uint32_t blockSize) | |
315 asm ("ne10_fir_float_neon"); | |
316 #endif // ENABLE_NE10_FIR_FLOAT_NEON | |
317 /** @} */ //end of FIR group | |
318 | |
319 /** | |
320 * @addtogroup FIR_Decimate | |
321 * @{ | |
322 */ | |
323 #ifdef ENABLE_NE10_FIR_DECIMATE_FLOAT_NEON | |
324 extern void ne10_fir_decimate_float_neon (const ne10_fir_decimate_instance_f32_t * S, | |
325 ne10_float32_t *pSrc, | |
326 ne10_float32_t *pDst, | |
327 ne10_uint32_t blockSize) asm ("ne10_fir_decimate_float_neon"); | |
328 | |
329 /** @} */ //end of FIR_decimate group | |
330 #endif // ENABLE_NE10_FIR_DECIMATE_FLOAT_NEON | |
331 /** | |
332 * @addtogroup FIR_Interpolate | |
333 * @{ | |
334 */ | |
335 #ifdef ENABLE_NE10_FIR_INTERPOLATE_FLOAT_NEON | |
336 extern void ne10_fir_interpolate_float_neon (const ne10_fir_interpolate_instance_f32_t * S, | |
337 ne10_float32_t *pSrc, | |
338 ne10_float32_t *pDst, | |
339 ne10_uint32_t blockSize) asm ("ne10_fir_interpolate_float_neon"); | |
340 #endif // ENABLE_NE10_FIR_INTERPOLATE_FLOAT_NEON | |
341 /** @} */ //end of FIR_interpolate group | |
342 | |
343 /** | |
344 * @addtogroup FIR_Lattice | |
345 * @{ | |
346 */ | |
347 #ifdef ENABLE_NE10_FIR_LATTICE_FLOAT_NEON | |
348 extern void ne10_fir_lattice_float_neon (const ne10_fir_lattice_instance_f32_t * S, | |
349 ne10_float32_t * pSrc, | |
350 ne10_float32_t * pDst, | |
351 ne10_uint32_t blockSize) asm ("ne10_fir_lattice_float_neon"); | |
352 #endif // ENABLE_NE10_FIR_LATTICE_FLOAT_NEON | |
353 /** @} */ //end of FIR_Lattice group | |
354 | |
355 /** | |
356 * @addtogroup FIR_Sparse | |
357 * @{ | |
358 */ | |
359 #ifdef ENABLE_NE10_FIR_SPARSE_FLOAT_NEON | |
360 extern void ne10_fir_sparse_float_neon (ne10_fir_sparse_instance_f32_t * S, | |
361 ne10_float32_t * pSrc, | |
362 ne10_float32_t * pDst, | |
363 ne10_float32_t * pScratch, | |
364 ne10_uint32_t blockSize) | |
365 asm ("ne10_fir_sparse_float_neon"); | |
366 #endif // ENABLE_NE10_FIR_SPARSE_FLOAT_NEON | |
367 /** @} */ //end of FIR_sparse group | |
368 | |
369 | |
370 /* iir functions*/ | |
371 | |
372 /* function pointers*/ | |
373 extern void (*ne10_iir_lattice_float) (const ne10_iir_lattice_instance_f32_t * S, | |
374 ne10_float32_t * pSrc, | |
375 ne10_float32_t * pDst, | |
376 ne10_uint32_t blockSize); | |
377 | |
378 /* init functions*/ | |
379 extern ne10_result_t ne10_iir_lattice_init_float (ne10_iir_lattice_instance_f32_t * S, | |
380 ne10_uint16_t numStages, | |
381 ne10_float32_t * pkCoeffs, | |
382 ne10_float32_t * pvCoeffs, | |
383 ne10_float32_t * pState, | |
384 ne10_uint32_t blockSize); | |
385 | |
386 | |
387 /* C version*/ | |
388 extern void ne10_iir_lattice_float_c (const ne10_iir_lattice_instance_f32_t * S, | |
389 ne10_float32_t * pSrc, | |
390 ne10_float32_t * pDst, | |
391 ne10_uint32_t blockSize); | |
392 | |
393 /* NEON version*/ | |
394 | |
395 /** | |
396 * @addtogroup IIR_Lattice | |
397 * @{ | |
398 */ | |
399 #ifdef ENABLE_NE10_IIR_LATTICE_FLOAT_NEON | |
400 extern void ne10_iir_lattice_float_neon (const ne10_iir_lattice_instance_f32_t * S, | |
401 ne10_float32_t * pSrc, | |
402 ne10_float32_t * pDst, | |
403 ne10_uint32_t blockSize) asm ("ne10_iir_lattice_float_neon"); | |
404 #endif // ENABLE_NE10_IIR_LATTICE_FLOAT_NEON | |
405 /** @} */ //end of IIR_Lattice group | |
406 | |
407 #ifdef __cplusplus | |
408 } | |
409 #endif | |
410 | |
411 #endif |