Project Ne10
An open, optimized software library for the ARM architecture.
NE10_init_dsp.c
Go to the documentation of this file.
1 /*
2  * Copyright 2012-16 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 #include <stdio.h>
29 
30 #include "NE10_dsp.h"
31 
33 {
34  if (NE10_OK == is_NEON_available)
35  {
41 
45 
49 
50 #ifdef ENABLE_NE10_FIR_FLOAT_NEON
52 #else
54 #endif // ENABLE_NE10_FIR_FLOAT_NEON
55 
56 #ifdef ENABLE_NE10_FIR_DECIMATE_FLOAT_NEON
58 #else
60 #endif // ENABLE_NE10_FIR_DECIMATE_FLOAT_NEON
61 
62 #ifdef ENABLE_NE10_FIR_INTERPOLATE_FLOAT_NEON
64 #else
66 #endif // ENABLE_NE10_FIR_INTERPOLATE_FLOAT_NEON
67 
68 #ifdef ENABLE_NE10_FIR_LATTICE_FLOAT_NEON
70 #else
72 #endif // ENABLE_NE10_FIR_LATTICE_FLOAT_NEON
73 
74 #ifdef ENABLE_NE10_FIR_SPARSE_FLOAT_NEON
76 #else
78 #endif // ENABLE_NE10_FIR_SPARSE_FLOAT_NEON
79 
80 #ifdef ENABLE_NE10_IIR_LATTICE_FLOAT_NEON
82 #else
84 #endif // ENABLE_NE10_IIR_LATTICE_FLOAT_NEON
85  }
86  else
87  {
93 
97 
101 
107 
109  }
110  return NE10_OK;
111 }
112 
113 // These are actual definitions of our function pointers that are declared in inc/NE10_dsp.h
116 
120  ne10_int32_t inverse_fft);
121 
123  ne10_float32_t *fin,
125 
129 
133  ne10_int32_t inverse_fft,
134  ne10_int32_t scaled_flag);
135 
136 
138  ne10_int32_t *fin,
140  ne10_int32_t scaled_flag);
141 
145  ne10_int32_t scaled_flag);
146 
150  ne10_int32_t inverse_fft,
151  ne10_int32_t scaled_flag);
152 
154  ne10_int16_t *fin,
156  ne10_int32_t scaled_flag);
157 
161  ne10_int32_t scaled_flag);
162 
164  ne10_float32_t * pSrc,
165  ne10_float32_t * pDst,
166  ne10_uint32_t blockSize);
167 
170  ne10_float32_t * pSrc,
171  ne10_float32_t * pDst,
172  ne10_uint32_t blockSize);
173 
176  ne10_float32_t * pSrc,
177  ne10_float32_t * pDst,
178  ne10_uint32_t blockSize);
179 
182  ne10_float32_t * pSrc,
183  ne10_float32_t * pDst,
184  ne10_uint32_t blockSize);
185 
188  ne10_float32_t * pSrc,
189  ne10_float32_t * pDst,
190  ne10_float32_t * pScratchIn,
191  ne10_uint32_t blockSize);
192 
194  ne10_float32_t * pSrc,
195  ne10_float32_t * pDst,
196  ne10_uint32_t blockSize);
Structure for the 16-bit fixed point FFT function.
Definition: NE10_types.h:294
void ne10_fft_c2c_1d_int32_neon(ne10_fft_cpx_int32_t *fout, ne10_fft_cpx_int32_t *fin, ne10_fft_cfg_int32_t cfg, ne10_int32_t inverse_fft, ne10_int32_t scaled_flag)
Specific implementation of ne10_fft_c2c_1d_int32 using NEON SIMD capabilities.
Instance structure for the floating-point FIR Sparse filter.
Definition: NE10_types.h:403
void ne10_fft_c2r_1d_int32_neon(ne10_int32_t *fout, ne10_fft_cpx_int32_t *fin, ne10_fft_r2c_cfg_int32_t cfg, ne10_int32_t scaled_flag)
Specific implementation of ne10_fft_c2r_1d_int32 using NEON SIMD capabilities.
void ne10_fft_c2r_1d_float32_c(ne10_float32_t *fout, ne10_fft_cpx_float32_t *fin, ne10_fft_r2c_cfg_float32_t cfg)
Specific implementation of ne10_fft_c2r_1d_float32 using plain C.
int32_t ne10_int32_t
Definition: NE10_types.h:76
void ne10_fft_c2c_1d_float32_neon(ne10_fft_cpx_float32_t *fout, ne10_fft_cpx_float32_t *fin, ne10_fft_cfg_float32_t cfg, ne10_int32_t inverse_fft)
Specific implementation of ne10_fft_c2c_1d_float32 using NEON SIMD capabilities.
void ne10_fir_interpolate_float_neon(const ne10_fir_interpolate_instance_f32_t *S, ne10_float32_t *pSrc, ne10_float32_t *pDst, ne10_uint32_t blockSize) asm("ne10_fir_interpolate_float_neon")
Specific implementation of ne10_fir_interpolate_float using NEON SIMD capabilities.
void(* ne10_fft_c2r_1d_int32)(ne10_int32_t *fout, ne10_fft_cpx_int32_t *fin, ne10_fft_r2c_cfg_int32_t cfg, ne10_int32_t scaled_flag)
Mixed radix-2/4 complex-to-real IFFT of 32-bit fixed point Q31 data.
void ne10_fft_c2r_1d_int16_neon(ne10_int16_t *fout, ne10_fft_cpx_int16_t *fin, ne10_fft_r2c_cfg_int16_t cfg, ne10_int32_t scaled_flag)
Specific implementation of ne10_fft_c2r_1d_int16 using NEON SIMD capabilities.
void ne10_fft_c2r_1d_int16_c(ne10_int16_t *fout, ne10_fft_cpx_int16_t *fin, ne10_fft_r2c_cfg_int16_t cfg, ne10_int32_t scaled_flag)
Specific implementation of ne10_fft_c2r_1d_int16 using plain C.
void(* ne10_fft_c2r_1d_int16)(ne10_int16_t *fout, ne10_fft_cpx_int16_t *fin, ne10_fft_r2c_cfg_int16_t cfg, ne10_int32_t scaled_flag)
Mixed radix-2/4 complex-to-real IFFT of 16-bit fixed point Q15 data.
void ne10_fir_decimate_float_neon(const ne10_fir_decimate_instance_f32_t *S, ne10_float32_t *pSrc, ne10_float32_t *pDst, ne10_uint32_t blockSize) asm("ne10_fir_decimate_float_neon")
Specific implementation of ne10_fir_decimate_float using NEON SIMD capabilities.
float ne10_float32_t
Definition: NE10_types.h:80
ne10_fft_cfg_float32_t ne10_fft_alloc_c2c_float32_neon(ne10_int32_t nfft)
Specific implementation of ne10_fft_alloc_c2c_float32 for ne10_fft_c2c_1d_float32_neon.
Definition: NE10_fft.c:348
void ne10_fft_r2c_1d_int16_neon(ne10_fft_cpx_int16_t *fout, ne10_int16_t *fin, ne10_fft_r2c_cfg_int16_t cfg, ne10_int32_t scaled_flag)
Specific implementation of ne10_fft_r2c_1d_int16 using NEON SIMD capabilities.
void ne10_fft_c2c_1d_int16_c(ne10_fft_cpx_int16_t *fout, ne10_fft_cpx_int16_t *fin, ne10_fft_cfg_int16_t cfg, ne10_int32_t inverse_fft, ne10_int32_t scaled_flag)
Specific implementation of ne10_fft_c2c_1d_int16 using plain C.
void(* ne10_fft_c2c_1d_int32)(ne10_fft_cpx_int32_t *fout, ne10_fft_cpx_int32_t *fin, ne10_fft_cfg_int32_t cfg, ne10_int32_t inverse_fft, ne10_int32_t scaled_flag)
Mixed radix-2/4 complex FFT/IFFT of 32-bit fixed point Q31 data.
void ne10_fft_r2c_1d_int16_c(ne10_fft_cpx_int16_t *fout, ne10_int16_t *fin, ne10_fft_r2c_cfg_int16_t cfg, ne10_int32_t scaled_flag)
Specific implementation of ne10_fft_r2c_1d_int16 using plain C.
Structure for the floating point FFT state.
Definition: NE10_types.h:239
void(* ne10_fft_c2c_1d_int16)(ne10_fft_cpx_int16_t *fout, ne10_fft_cpx_int16_t *fin, ne10_fft_cfg_int16_t cfg, ne10_int32_t inverse_fft, ne10_int32_t scaled_flag)
Mixed radix-2/4 complex FFT/IFFT of 16-bit fixed point Q15 data.
void(* ne10_fft_c2c_1d_float32)(ne10_fft_cpx_float32_t *fout, ne10_fft_cpx_float32_t *fin, ne10_fft_cfg_float32_t cfg, ne10_int32_t inverse_fft)
Mixed radix-2/3/4/5 complex FFT/IFFT of single precision floating point data.
void(* ne10_fft_r2c_1d_float32)(ne10_fft_cpx_float32_t *fout, ne10_float32_t *fin, ne10_fft_r2c_cfg_float32_t cfg)
Mixed radix-2/4 real-to-complex FFT of single precision floating point data.
void ne10_fft_r2c_1d_int32_c(ne10_fft_cpx_int32_t *fout, ne10_int32_t *fin, ne10_fft_r2c_cfg_int32_t cfg, ne10_int32_t scaled_flag)
Specific implementation of ne10_fft_r2c_1d_int32 using plain C.
void ne10_fir_decimate_float_c(const ne10_fir_decimate_instance_f32_t *S, ne10_float32_t *pSrc, ne10_float32_t *pDst, ne10_uint32_t blockSize)
Specific implementation of ne10_fir_decimate_float using plain C.
Definition: NE10_fir.c:429
ne10_fft_cfg_float32_t(* ne10_fft_alloc_c2c_float32)(ne10_int32_t nfft)
Creates a configuration structure for ne10_fft_c2c_1d_float32.
void ne10_iir_lattice_float_c(const ne10_iir_lattice_instance_f32_t *S, ne10_float32_t *pSrc, ne10_float32_t *pDst, ne10_uint32_t blockSize)
Specific implementation of ne10_iir_lattice_float using plain C.
Definition: NE10_iir.c:112
ne10_result_t is_NEON_available
Definition: NE10_init.c:37
ne10_fft_state_float32_t * ne10_fft_cfg_float32_t
Configuration structure for floating point FFT.
Definition: NE10_types.h:267
void(* ne10_fft_r2c_1d_int32)(ne10_fft_cpx_int32_t *fout, ne10_int32_t *fin, ne10_fft_r2c_cfg_int32_t cfg, ne10_int32_t scaled_flag)
Mixed radix-2/4 real-to-complex FFT of 32-bit fixed point Q31 data.
uint32_t ne10_uint32_t
Definition: NE10_types.h:77
ne10_fft_cfg_int32_t ne10_fft_alloc_c2c_int32_neon(ne10_int32_t nfft)
Specific implementation of ne10_fft_alloc_c2c_int32 for ne10_fft_c2c_1d_int32_neon.
Definition: NE10_fft.c:451
Instance structure for the floating point IIR Lattice filter.
Definition: NE10_types.h:416
void(* ne10_fft_c2r_1d_float32)(ne10_float32_t *fout, ne10_fft_cpx_float32_t *fin, ne10_fft_r2c_cfg_float32_t cfg)
Mixed radix-2/4 complex-to-real IFFT of single precision floating point data.
Instance structure for the floating-point FIR Interpolation.
Definition: NE10_types.h:392
void ne10_fir_lattice_float_neon(const ne10_fir_lattice_instance_f32_t *S, ne10_float32_t *pSrc, ne10_float32_t *pDst, ne10_uint32_t blockSize) asm("ne10_fir_lattice_float_neon")
Specific implementation of ne10_fir_lattice_float using NEON SIMD capabilities.
ne10_fft_cfg_float32_t ne10_fft_alloc_c2c_float32_c(ne10_int32_t nfft)
Specific implementation of ne10_fft_alloc_c2c_float32 for ne10_fft_c2c_1d_float32_c.
Instance structure for the floating-point FIR filter.
Definition: NE10_types.h:361
void ne10_fft_r2c_1d_int32_neon(ne10_fft_cpx_int32_t *fout, ne10_int32_t *fin, ne10_fft_r2c_cfg_int32_t cfg, ne10_int32_t scaled_flag)
Specific implementation of ne10_fft_r2c_1d_int32 using NEON SIMD capabilities.
void ne10_fft_c2c_1d_int32_c(ne10_fft_cpx_int32_t *fout, ne10_fft_cpx_int32_t *fin, ne10_fft_cfg_int32_t cfg, ne10_int32_t inverse_fft, ne10_int32_t scaled_flag)
Specific implementation of ne10_fft_c2c_1d_int32 using plain C.
ne10_fft_cfg_int32_t(* ne10_fft_alloc_c2c_int32)(ne10_int32_t nfft)
Creates a configuration structure for ne10_fft_c2c_1d_int32.
Structure for the 32-bit fixed point FFT function.
Definition: NE10_types.h:325
void ne10_fir_sparse_float_neon(ne10_fir_sparse_instance_f32_t *S, ne10_float32_t *pSrc, ne10_float32_t *pDst, ne10_float32_t *pScratch, ne10_uint32_t blockSize) asm("ne10_fir_sparse_float_neon")
Specific implementation of ne10_fir_sparse_float using NEON SIMD capabilities.
void(* ne10_fir_decimate_float)(const ne10_fir_decimate_instance_f32_t *S, ne10_float32_t *pSrc, ne10_float32_t *pDst, ne10_uint32_t blockSize)
Processing function for the floating-point FIR decimator.
void ne10_fft_c2c_1d_float32_c(ne10_fft_cpx_float32_t *fout, ne10_fft_cpx_float32_t *fin, ne10_fft_cfg_float32_t cfg, ne10_int32_t inverse_fft)
Specific implementation of ne10_fft_c2c_1d_float32 using plain C.
ne10_result_t ne10_init_dsp(ne10_int32_t is_NEON_available)
Definition: NE10_init_dsp.c:32
Instance structure for the floating point FIR Lattice filter.
Definition: NE10_types.h:371
void ne10_fir_float_c(const ne10_fir_instance_f32_t *S, ne10_float32_t *pSrc, ne10_float32_t *pDst, ne10_uint32_t blockSize)
Specific implementation of ne10_fir_float using plain C.
Definition: NE10_fir.c:111
void(* ne10_iir_lattice_float)(const ne10_iir_lattice_instance_f32_t *S, ne10_float32_t *pSrc, ne10_float32_t *pDst, ne10_uint32_t blockSize)
Processing function for the floating-point IIR lattice filter.
void ne10_iir_lattice_float_neon(const ne10_iir_lattice_instance_f32_t *S, ne10_float32_t *pSrc, ne10_float32_t *pDst, ne10_uint32_t blockSize) asm("ne10_iir_lattice_float_neon")
Specific implementation of ne10_iir_lattice_float using NEON SIMD capabilities.
Instance structure for the floating-point FIR Decimation.
Definition: NE10_types.h:381
void ne10_fir_lattice_float_c(const ne10_fir_lattice_instance_f32_t *S, ne10_float32_t *pSrc, ne10_float32_t *pDst, ne10_uint32_t blockSize)
Specific implementation of ne10_fir_lattice_float using plain C.
Definition: NE10_fir.c:929
void(* ne10_fir_sparse_float)(ne10_fir_sparse_instance_f32_t *S, ne10_float32_t *pSrc, ne10_float32_t *pDst, ne10_float32_t *pScratchIn, ne10_uint32_t blockSize)
Processing function for the floating-point sparse FIR filter.
void ne10_fir_interpolate_float_c(const ne10_fir_interpolate_instance_f32_t *S, ne10_float32_t *pSrc, ne10_float32_t *pDst, ne10_uint32_t blockSize)
Specific implementation of ne10_fir_interpolate_float using plain C.
Definition: NE10_fir.c:679
void ne10_fft_c2r_1d_float32_neon(ne10_float32_t *fout, ne10_fft_cpx_float32_t *fin, ne10_fft_r2c_cfg_float32_t cfg)
Specific implementation of ne10_fft_c2r_1d_float32 using NEON SIMD capabilities.
void(* ne10_fir_float)(const ne10_fir_instance_f32_t *S, ne10_float32_t *pSrc, ne10_float32_t *pDst, ne10_uint32_t blockSize)
#define NE10_OK
Definition: NE10_types.h:65
void(* ne10_fir_lattice_float)(const ne10_fir_lattice_instance_f32_t *S, ne10_float32_t *pSrc, ne10_float32_t *pDst, ne10_uint32_t blockSize)
Processing function for the floating-point FIR lattice filter.
void ne10_fir_float_neon(const ne10_fir_instance_f32_t *S, ne10_float32_t *pSrc, ne10_float32_t *pDst, ne10_uint32_t blockSize) asm("ne10_fir_float_neon")
Specific implementation of ne10_fir_float using NEON SIMD capabilities.
ne10_fft_cfg_int32_t ne10_fft_alloc_c2c_int32_c(ne10_int32_t nfft)
Specific implementation of ne10_fft_alloc_c2c_int32 for ne10_fft_c2c_1d_int32_c.
void ne10_fft_r2c_1d_float32_c(ne10_fft_cpx_float32_t *fout, ne10_float32_t *fin, ne10_fft_r2c_cfg_float32_t cfg)
Specific implementation of ne10_fft_r2c_1d_float32 using plain C.
void ne10_fft_c2r_1d_int32_c(ne10_int32_t *fout, ne10_fft_cpx_int32_t *fin, ne10_fft_r2c_cfg_int32_t cfg, ne10_int32_t scaled_flag)
Specific implementation of ne10_fft_c2r_1d_int32 using plain C.
void(* ne10_fft_r2c_1d_int16)(ne10_fft_cpx_int16_t *fout, ne10_int16_t *fin, ne10_fft_r2c_cfg_int16_t cfg, ne10_int32_t scaled_flag)
Mixed radix-2/4 real-to-complex FFT of 16-bit fixed point Q15 data.
void ne10_fir_sparse_float_c(ne10_fir_sparse_instance_f32_t *S, ne10_float32_t *pSrc, ne10_float32_t *pDst, ne10_float32_t *pScratchIn, ne10_uint32_t blockSize)
Specific implementation of ne10_fir_sparse_float using plain C.
Definition: NE10_fir.c:1386
int16_t ne10_int16_t
Definition: NE10_types.h:74
void(* ne10_fir_interpolate_float)(const ne10_fir_interpolate_instance_f32_t *S, ne10_float32_t *pSrc, ne10_float32_t *pDst, ne10_uint32_t blockSize)
Processing function for the floating-point FIR interpolator.
int ne10_result_t
Definition: NE10_types.h:82
void ne10_fft_c2c_1d_int16_neon(ne10_fft_cpx_int16_t *fout, ne10_fft_cpx_int16_t *fin, ne10_fft_cfg_int16_t cfg, ne10_int32_t inverse_fft, ne10_int32_t scaled_flag)
Specific implementation of ne10_fft_c2c_1d_int16 using NEON SIMD capabilities.
void ne10_fft_r2c_1d_float32_neon(ne10_fft_cpx_float32_t *fout, ne10_float32_t *fin, ne10_fft_r2c_cfg_float32_t cfg)
Specific implementation of ne10_fft_r2c_1d_float32 using NEON SIMD capabilities.
ne10_fft_state_int32_t * ne10_fft_cfg_int32_t
Definition: NE10_types.h:340