andrewm@379
|
1 /*
|
andrewm@379
|
2 * Copyright 2011-15 ARM Limited and Contributors.
|
andrewm@379
|
3 * All rights reserved.
|
andrewm@379
|
4 *
|
andrewm@379
|
5 * Redistribution and use in source and binary forms, with or without
|
andrewm@379
|
6 * modification, are permitted provided that the following conditions are met:
|
andrewm@379
|
7 * * Redistributions of source code must retain the above copyright
|
andrewm@379
|
8 * notice, this list of conditions and the following disclaimer.
|
andrewm@379
|
9 * * Redistributions in binary form must reproduce the above copyright
|
andrewm@379
|
10 * notice, this list of conditions and the following disclaimer in the
|
andrewm@379
|
11 * documentation and/or other materials provided with the distribution.
|
andrewm@379
|
12 * * Neither the name of ARM Limited nor the
|
andrewm@379
|
13 * names of its contributors may be used to endorse or promote products
|
andrewm@379
|
14 * derived from this software without specific prior written permission.
|
andrewm@379
|
15 *
|
andrewm@379
|
16 * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND
|
andrewm@379
|
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
andrewm@379
|
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
andrewm@379
|
19 * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY
|
andrewm@379
|
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
andrewm@379
|
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
andrewm@379
|
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
andrewm@379
|
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
andrewm@379
|
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
andrewm@379
|
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
andrewm@379
|
26 */
|
andrewm@379
|
27
|
andrewm@379
|
28 /*
|
andrewm@379
|
29 * NE10 Library : inc/NE10_types.h
|
andrewm@379
|
30 */
|
andrewm@379
|
31
|
andrewm@379
|
32 /** NE10 defines a number of types for use in its function signatures.
|
andrewm@379
|
33 * The types are defined within this header file.
|
andrewm@379
|
34 */
|
andrewm@379
|
35
|
andrewm@379
|
36 #ifndef NE10_TYPES_H
|
andrewm@379
|
37 #define NE10_TYPES_H
|
andrewm@379
|
38
|
andrewm@379
|
39 #include <stdio.h>
|
andrewm@379
|
40 #include <stdlib.h>
|
andrewm@379
|
41 #include <stdint.h>
|
andrewm@379
|
42 #include <math.h>
|
andrewm@379
|
43 #include <string.h>
|
andrewm@379
|
44 #include <assert.h>
|
andrewm@379
|
45
|
andrewm@379
|
46 /**
|
andrewm@379
|
47 * @TODO Move the definition of NE10_UNROLL_LEVEL to cmake configuration files.
|
andrewm@379
|
48 * Macro NE10_UNROLL_LEVEL controls algorithm of FFT funtions.
|
andrewm@379
|
49 * When NE10_UNROLL_LEVEL == 0, complex FFT performs radix-4 x2 per loop.
|
andrewm@379
|
50 * When NE10_UNROLL_LEVEL == 1, complex FFT performs radix-4 x4 per loop.
|
andrewm@379
|
51 */
|
andrewm@379
|
52 #if !defined(NE10_UNROLL_LEVEL)
|
andrewm@379
|
53 #if defined(__arm__)
|
andrewm@379
|
54 #define NE10_UNROLL_LEVEL 0
|
andrewm@379
|
55 #elif defined(__aarch64__)
|
andrewm@379
|
56 #define NE10_UNROLL_LEVEL 1
|
andrewm@379
|
57 #else
|
andrewm@379
|
58 #define NE10_UNROLL_LEVEL 0
|
andrewm@379
|
59 #endif
|
andrewm@379
|
60 #endif
|
andrewm@379
|
61
|
andrewm@379
|
62 /////////////////////////////////////////////////////////
|
andrewm@379
|
63 // constant values that are used across the library
|
andrewm@379
|
64 /////////////////////////////////////////////////////////
|
andrewm@379
|
65 #define NE10_OK 0
|
andrewm@379
|
66 #define NE10_ERR -1
|
andrewm@379
|
67
|
andrewm@379
|
68 /////////////////////////////////////////////////////////
|
andrewm@379
|
69 // some external definitions to be exposed to the users
|
andrewm@379
|
70 /////////////////////////////////////////////////////////
|
andrewm@379
|
71
|
andrewm@379
|
72 typedef signed char ne10_int8_t;
|
andrewm@379
|
73 typedef unsigned char ne10_uint8_t;
|
andrewm@379
|
74 typedef signed short ne10_int16_t;
|
andrewm@379
|
75 typedef unsigned short ne10_uint16_t;
|
andrewm@379
|
76 typedef signed int ne10_int32_t;
|
andrewm@379
|
77 typedef unsigned int ne10_uint32_t;
|
andrewm@379
|
78 typedef signed long long int ne10_int64_t;
|
andrewm@379
|
79 typedef unsigned long long int ne10_uint64_t;
|
andrewm@379
|
80 typedef float ne10_float32_t;
|
andrewm@379
|
81 typedef double ne10_float64_t;
|
andrewm@379
|
82 typedef int ne10_result_t; // resulting [error-]code
|
andrewm@379
|
83
|
andrewm@379
|
84 /**
|
andrewm@379
|
85 * @brief a 2-tuple of ne10_float32_t values.
|
andrewm@379
|
86 */
|
andrewm@379
|
87 typedef struct
|
andrewm@379
|
88 {
|
andrewm@379
|
89 ne10_float32_t x;
|
andrewm@379
|
90 ne10_float32_t y;
|
andrewm@379
|
91 } ne10_vec2f_t;
|
andrewm@379
|
92
|
andrewm@379
|
93 /**
|
andrewm@379
|
94 * @brief a 3-tuple of ne10_float32_t values.
|
andrewm@379
|
95 */
|
andrewm@379
|
96 typedef struct
|
andrewm@379
|
97 {
|
andrewm@379
|
98 ne10_float32_t x;
|
andrewm@379
|
99 ne10_float32_t y;
|
andrewm@379
|
100 ne10_float32_t z;
|
andrewm@379
|
101 } ne10_vec3f_t;
|
andrewm@379
|
102
|
andrewm@379
|
103 /**
|
andrewm@379
|
104 * @brief a 4-tuple of ne10_float32_t values.
|
andrewm@379
|
105 */
|
andrewm@379
|
106 typedef struct
|
andrewm@379
|
107 {
|
andrewm@379
|
108 ne10_float32_t x;
|
andrewm@379
|
109 ne10_float32_t y;
|
andrewm@379
|
110 ne10_float32_t z;
|
andrewm@379
|
111 ne10_float32_t w;
|
andrewm@379
|
112 } ne10_vec4f_t;
|
andrewm@379
|
113
|
andrewm@379
|
114 /////////////////////////////////////////////////////////
|
andrewm@379
|
115 // definitions for matrix
|
andrewm@379
|
116 /////////////////////////////////////////////////////////
|
andrewm@379
|
117
|
andrewm@379
|
118 typedef struct
|
andrewm@379
|
119 {
|
andrewm@379
|
120 ne10_float32_t r1;
|
andrewm@379
|
121 ne10_float32_t r2;
|
andrewm@379
|
122 } __attribute__ ( (packed)) ne10_mat_row2f;
|
andrewm@379
|
123
|
andrewm@379
|
124 typedef struct
|
andrewm@379
|
125 {
|
andrewm@379
|
126 ne10_mat_row2f c1;
|
andrewm@379
|
127 ne10_mat_row2f c2;
|
andrewm@379
|
128
|
andrewm@379
|
129 } __attribute__ ( (packed)) ne10_mat2x2f_t; // a 2x2 matrix
|
andrewm@379
|
130
|
andrewm@379
|
131 static inline void createColumnMajorMatrix2x2 (ne10_mat2x2f_t * outMat, ne10_float32_t m11, ne10_float32_t m21, ne10_float32_t m12, ne10_float32_t m22)
|
andrewm@379
|
132 {
|
andrewm@379
|
133 assert (NULL != outMat);
|
andrewm@379
|
134
|
andrewm@379
|
135 outMat->c1.r1 = m11;
|
andrewm@379
|
136 outMat->c1.r2 = m21;
|
andrewm@379
|
137 outMat->c2.r1 = m12;
|
andrewm@379
|
138 outMat->c2.r2 = m22;
|
andrewm@379
|
139 }
|
andrewm@379
|
140
|
andrewm@379
|
141
|
andrewm@379
|
142 typedef struct
|
andrewm@379
|
143 {
|
andrewm@379
|
144 ne10_float32_t r1;
|
andrewm@379
|
145 ne10_float32_t r2;
|
andrewm@379
|
146 ne10_float32_t r3;
|
andrewm@379
|
147 } __attribute__ ( (packed)) ne10_mat_row3f;
|
andrewm@379
|
148
|
andrewm@379
|
149 typedef struct
|
andrewm@379
|
150 {
|
andrewm@379
|
151 ne10_mat_row3f c1;
|
andrewm@379
|
152 ne10_mat_row3f c2;
|
andrewm@379
|
153 ne10_mat_row3f c3;
|
andrewm@379
|
154
|
andrewm@379
|
155 } __attribute__ ( (packed)) ne10_mat3x3f_t; // a 3x3 matrix
|
andrewm@379
|
156
|
andrewm@379
|
157 static inline void createColumnMajorMatrix3x3 (ne10_mat3x3f_t * outMat, ne10_float32_t m11, ne10_float32_t m21, ne10_float32_t m31,
|
andrewm@379
|
158 ne10_float32_t m12, ne10_float32_t m22, ne10_float32_t m32,
|
andrewm@379
|
159 ne10_float32_t m13, ne10_float32_t m23, ne10_float32_t m33)
|
andrewm@379
|
160 {
|
andrewm@379
|
161 assert (NULL != outMat);
|
andrewm@379
|
162
|
andrewm@379
|
163 outMat->c1.r1 = m11;
|
andrewm@379
|
164 outMat->c1.r2 = m21;
|
andrewm@379
|
165 outMat->c1.r3 = m31;
|
andrewm@379
|
166
|
andrewm@379
|
167 outMat->c2.r1 = m12;
|
andrewm@379
|
168 outMat->c2.r2 = m22;
|
andrewm@379
|
169 outMat->c2.r3 = m32;
|
andrewm@379
|
170
|
andrewm@379
|
171 outMat->c3.r1 = m13;
|
andrewm@379
|
172 outMat->c3.r2 = m23;
|
andrewm@379
|
173 outMat->c3.r3 = m33;
|
andrewm@379
|
174 }
|
andrewm@379
|
175
|
andrewm@379
|
176
|
andrewm@379
|
177 typedef struct
|
andrewm@379
|
178 {
|
andrewm@379
|
179 ne10_float32_t r1;
|
andrewm@379
|
180 ne10_float32_t r2;
|
andrewm@379
|
181 ne10_float32_t r3;
|
andrewm@379
|
182 ne10_float32_t r4;
|
andrewm@379
|
183 } __attribute__ ( (packed)) ne10_mat_row4f;
|
andrewm@379
|
184
|
andrewm@379
|
185 typedef struct
|
andrewm@379
|
186 {
|
andrewm@379
|
187 ne10_mat_row4f c1;
|
andrewm@379
|
188 ne10_mat_row4f c2;
|
andrewm@379
|
189 ne10_mat_row4f c3;
|
andrewm@379
|
190 ne10_mat_row4f c4;
|
andrewm@379
|
191
|
andrewm@379
|
192 } __attribute__ ( (packed)) ne10_mat4x4f_t; // a 4x4 matrix
|
andrewm@379
|
193
|
andrewm@379
|
194 static inline void createColumnMajorMatrix4x4 (ne10_mat4x4f_t * outMat, ne10_float32_t m11, ne10_float32_t m21, ne10_float32_t m31, ne10_float32_t m41,
|
andrewm@379
|
195 ne10_float32_t m12, ne10_float32_t m22, ne10_float32_t m32, ne10_float32_t m42,
|
andrewm@379
|
196 ne10_float32_t m13, ne10_float32_t m23, ne10_float32_t m33, ne10_float32_t m43,
|
andrewm@379
|
197 ne10_float32_t m14, ne10_float32_t m24, ne10_float32_t m34, ne10_float32_t m44)
|
andrewm@379
|
198 {
|
andrewm@379
|
199 assert (NULL != outMat);
|
andrewm@379
|
200
|
andrewm@379
|
201 outMat->c1.r1 = m11;
|
andrewm@379
|
202 outMat->c1.r2 = m21;
|
andrewm@379
|
203 outMat->c1.r3 = m31;
|
andrewm@379
|
204 outMat->c1.r4 = m41;
|
andrewm@379
|
205
|
andrewm@379
|
206 outMat->c2.r1 = m12;
|
andrewm@379
|
207 outMat->c2.r2 = m22;
|
andrewm@379
|
208 outMat->c2.r3 = m32;
|
andrewm@379
|
209 outMat->c2.r4 = m42;
|
andrewm@379
|
210
|
andrewm@379
|
211 outMat->c3.r1 = m13;
|
andrewm@379
|
212 outMat->c3.r2 = m23;
|
andrewm@379
|
213 outMat->c3.r3 = m33;
|
andrewm@379
|
214 outMat->c3.r4 = m43;
|
andrewm@379
|
215
|
andrewm@379
|
216 outMat->c4.r1 = m14;
|
andrewm@379
|
217 outMat->c4.r2 = m24;
|
andrewm@379
|
218 outMat->c4.r3 = m34;
|
andrewm@379
|
219 outMat->c4.r4 = m44;
|
andrewm@379
|
220 }
|
andrewm@379
|
221
|
andrewm@379
|
222 /////////////////////////////////////////////////////////
|
andrewm@379
|
223 // definitions for fft
|
andrewm@379
|
224 /////////////////////////////////////////////////////////
|
andrewm@379
|
225
|
andrewm@379
|
226 /**
|
andrewm@379
|
227 * @brief structure for the floating point FFT function.
|
andrewm@379
|
228 */
|
andrewm@379
|
229 #define NE10_MAXFACTORS 32
|
andrewm@379
|
230 typedef struct
|
andrewm@379
|
231 {
|
andrewm@379
|
232 ne10_float32_t r;
|
andrewm@379
|
233 ne10_float32_t i;
|
andrewm@379
|
234 } ne10_fft_cpx_float32_t;
|
andrewm@379
|
235
|
andrewm@379
|
236 /**
|
andrewm@379
|
237 * @brief structure for the floating point FFT state
|
andrewm@379
|
238 *
|
andrewm@379
|
239 */
|
andrewm@379
|
240 typedef struct
|
andrewm@379
|
241 {
|
andrewm@379
|
242 ne10_int32_t nfft;
|
andrewm@379
|
243 ne10_int32_t *factors;
|
andrewm@379
|
244 ne10_fft_cpx_float32_t *twiddles;
|
andrewm@379
|
245 ne10_fft_cpx_float32_t *buffer;
|
andrewm@379
|
246 ne10_fft_cpx_float32_t *last_twiddles;
|
andrewm@379
|
247 /**
|
andrewm@379
|
248 * @biref Flag to control scaling behaviour in forward floating point complex FFT.
|
andrewm@379
|
249 * @note If is_forward_scaled is set 0, Ne10 will not scale output of forward floating
|
andrewm@379
|
250 * point complex FFT. Otherwise, Ne10 will scale output of forward floating
|
andrewm@379
|
251 * point complex FFT.
|
andrewm@379
|
252 * @warning
|
andrewm@379
|
253 * Only non-power-of-2 FFT is affected by this flag.
|
andrewm@379
|
254 */
|
andrewm@379
|
255 ne10_int32_t is_forward_scaled;
|
andrewm@379
|
256 /**
|
andrewm@379
|
257 * @biref Flag to control scaling behaviour in backward floating point complex FFT.
|
andrewm@379
|
258 * @note If is_backward_scaled is set 0, Ne10 will not scale output of backward floating
|
andrewm@379
|
259 * point complex FFT. Otherwise, Ne10 will scale output of backward floating
|
andrewm@379
|
260 * point complex FFT.
|
andrewm@379
|
261 * @warning
|
andrewm@379
|
262 * Only non-power-of-2 FFT is affected by this flag.
|
andrewm@379
|
263 */
|
andrewm@379
|
264 ne10_int32_t is_backward_scaled;
|
andrewm@379
|
265 } ne10_fft_state_float32_t;
|
andrewm@379
|
266
|
andrewm@379
|
267 /**
|
andrewm@379
|
268 * @brief Configure for floating point FFT.
|
andrewm@379
|
269 */
|
andrewm@379
|
270 typedef ne10_fft_state_float32_t* ne10_fft_cfg_float32_t;
|
andrewm@379
|
271
|
andrewm@379
|
272 typedef struct
|
andrewm@379
|
273 {
|
andrewm@379
|
274 ne10_fft_cpx_float32_t *buffer;
|
andrewm@379
|
275 #if (NE10_UNROLL_LEVEL == 0)
|
andrewm@379
|
276 ne10_int32_t ncfft;
|
andrewm@379
|
277 ne10_int32_t *factors;
|
andrewm@379
|
278 ne10_fft_cpx_float32_t *twiddles;
|
andrewm@379
|
279 ne10_fft_cpx_float32_t *super_twiddles;
|
andrewm@379
|
280 #elif (NE10_UNROLL_LEVEL > 0)
|
andrewm@379
|
281 ne10_int32_t nfft;
|
andrewm@379
|
282 ne10_fft_cpx_float32_t *r_twiddles;
|
andrewm@379
|
283 ne10_int32_t *r_factors;
|
andrewm@379
|
284 ne10_fft_cpx_float32_t *r_twiddles_backward;
|
andrewm@379
|
285 ne10_fft_cpx_float32_t *r_twiddles_neon;
|
andrewm@379
|
286 ne10_fft_cpx_float32_t *r_twiddles_neon_backward;
|
andrewm@379
|
287 ne10_int32_t *r_factors_neon;
|
andrewm@379
|
288 ne10_fft_cpx_float32_t *r_super_twiddles_neon;
|
andrewm@379
|
289 #endif
|
andrewm@379
|
290 } ne10_fft_r2c_state_float32_t;
|
andrewm@379
|
291
|
andrewm@379
|
292 typedef ne10_fft_r2c_state_float32_t* ne10_fft_r2c_cfg_float32_t;
|
andrewm@379
|
293
|
andrewm@379
|
294 /**
|
andrewm@379
|
295 * @brief structure for the 16 bits fixed point FFT function.
|
andrewm@379
|
296 */
|
andrewm@379
|
297 typedef struct
|
andrewm@379
|
298 {
|
andrewm@379
|
299 ne10_int16_t r;
|
andrewm@379
|
300 ne10_int16_t i;
|
andrewm@379
|
301 } ne10_fft_cpx_int16_t;
|
andrewm@379
|
302
|
andrewm@379
|
303 typedef struct
|
andrewm@379
|
304 {
|
andrewm@379
|
305 ne10_int32_t nfft;
|
andrewm@379
|
306 ne10_int32_t *factors;
|
andrewm@379
|
307 ne10_fft_cpx_int16_t *twiddles;
|
andrewm@379
|
308 ne10_fft_cpx_int16_t *buffer;
|
andrewm@379
|
309 } ne10_fft_state_int16_t;
|
andrewm@379
|
310
|
andrewm@379
|
311 typedef ne10_fft_state_int16_t* ne10_fft_cfg_int16_t;
|
andrewm@379
|
312
|
andrewm@379
|
313 typedef struct
|
andrewm@379
|
314 {
|
andrewm@379
|
315 ne10_int32_t nfft;
|
andrewm@379
|
316 ne10_int32_t ncfft;
|
andrewm@379
|
317 ne10_int32_t *factors;
|
andrewm@379
|
318 ne10_fft_cpx_int16_t *twiddles;
|
andrewm@379
|
319 ne10_fft_cpx_int16_t *super_twiddles;
|
andrewm@379
|
320 ne10_fft_cpx_int16_t *buffer;
|
andrewm@379
|
321 } ne10_fft_r2c_state_int16_t;
|
andrewm@379
|
322
|
andrewm@379
|
323 typedef ne10_fft_r2c_state_int16_t* ne10_fft_r2c_cfg_int16_t;
|
andrewm@379
|
324
|
andrewm@379
|
325 /**
|
andrewm@379
|
326 * @brief structure for the 32 bits fixed point FFT function.
|
andrewm@379
|
327 */
|
andrewm@379
|
328 typedef struct
|
andrewm@379
|
329 {
|
andrewm@379
|
330 ne10_int32_t r;
|
andrewm@379
|
331 ne10_int32_t i;
|
andrewm@379
|
332 } ne10_fft_cpx_int32_t;
|
andrewm@379
|
333
|
andrewm@379
|
334 typedef struct
|
andrewm@379
|
335 {
|
andrewm@379
|
336 ne10_int32_t nfft;
|
andrewm@379
|
337 ne10_int32_t *factors;
|
andrewm@379
|
338 ne10_fft_cpx_int32_t *twiddles;
|
andrewm@379
|
339 ne10_fft_cpx_int32_t *buffer;
|
andrewm@379
|
340 ne10_fft_cpx_int32_t *last_twiddles;
|
andrewm@379
|
341 } ne10_fft_state_int32_t;
|
andrewm@379
|
342
|
andrewm@379
|
343 typedef ne10_fft_state_int32_t* ne10_fft_cfg_int32_t;
|
andrewm@379
|
344
|
andrewm@379
|
345 typedef struct
|
andrewm@379
|
346 {
|
andrewm@379
|
347 ne10_int32_t nfft;
|
andrewm@379
|
348 ne10_int32_t ncfft;
|
andrewm@379
|
349 ne10_int32_t *factors;
|
andrewm@379
|
350 ne10_fft_cpx_int32_t *twiddles;
|
andrewm@379
|
351 ne10_fft_cpx_int32_t *super_twiddles;
|
andrewm@379
|
352 ne10_fft_cpx_int32_t *buffer;
|
andrewm@379
|
353 } ne10_fft_r2c_state_int32_t;
|
andrewm@379
|
354
|
andrewm@379
|
355 typedef ne10_fft_r2c_state_int32_t* ne10_fft_r2c_cfg_int32_t;
|
andrewm@379
|
356
|
andrewm@379
|
357 /////////////////////////////////////////////////////////
|
andrewm@379
|
358 // definitions for fir
|
andrewm@379
|
359 /////////////////////////////////////////////////////////
|
andrewm@379
|
360
|
andrewm@379
|
361 /**
|
andrewm@379
|
362 * @brief Instance structure for the floating-point FIR filter.
|
andrewm@379
|
363 */
|
andrewm@379
|
364 typedef struct
|
andrewm@379
|
365 {
|
andrewm@379
|
366 ne10_uint16_t numTaps; /**< Length of the filter. */
|
andrewm@379
|
367 ne10_float32_t *pState; /**< Points to the state variable array. The array is of length numTaps+maxBlockSize-1. */
|
andrewm@379
|
368 ne10_float32_t *pCoeffs; /**< Points to the coefficient array. The array is of length numTaps. */
|
andrewm@379
|
369 } ne10_fir_instance_f32_t;
|
andrewm@379
|
370
|
andrewm@379
|
371 /**
|
andrewm@379
|
372 * @brief Instance structure for the floating point FIR Lattice filter.
|
andrewm@379
|
373 */
|
andrewm@379
|
374 typedef struct
|
andrewm@379
|
375 {
|
andrewm@379
|
376 ne10_uint16_t numStages; /**< numStages of the of lattice filter. */
|
andrewm@379
|
377 ne10_float32_t *pState; /**< Points to the state variable array. The array is of length numStages. */
|
andrewm@379
|
378 ne10_float32_t *pCoeffs; /**< Points to the coefficient array. The array is of length numStages. */
|
andrewm@379
|
379 } ne10_fir_lattice_instance_f32_t;
|
andrewm@379
|
380
|
andrewm@379
|
381 /**
|
andrewm@379
|
382 * @brief Instance structure for the floating-point FIR Decimation.
|
andrewm@379
|
383 */
|
andrewm@379
|
384 typedef struct
|
andrewm@379
|
385 {
|
andrewm@379
|
386 ne10_uint8_t M; /**< Decimation Factor. */
|
andrewm@379
|
387 ne10_uint16_t numTaps; /**< Length of the filter. */
|
andrewm@379
|
388 ne10_float32_t *pCoeffs; /**< Points to the coefficient array. The array is of length numTaps.*/
|
andrewm@379
|
389 ne10_float32_t *pState; /**< Points to the state variable array. The array is of length numTaps+maxBlockSize-1. */
|
andrewm@379
|
390 } ne10_fir_decimate_instance_f32_t;
|
andrewm@379
|
391
|
andrewm@379
|
392 /**
|
andrewm@379
|
393 * @brief Instance structure for the floating-point FIR Interpolation.
|
andrewm@379
|
394 */
|
andrewm@379
|
395 typedef struct
|
andrewm@379
|
396 {
|
andrewm@379
|
397 ne10_uint8_t L; /**< Interpolation Factor. */
|
andrewm@379
|
398 ne10_uint16_t phaseLength; /**< Length of each polyphase filter component. */
|
andrewm@379
|
399 ne10_float32_t *pCoeffs; /**< Points to the coefficient array. The array is of length numTaps.*/
|
andrewm@379
|
400 ne10_float32_t *pState; /**< Points to the state variable array. The array is of length numTaps+maxBlockSize-1. */
|
andrewm@379
|
401 } ne10_fir_interpolate_instance_f32_t;
|
andrewm@379
|
402
|
andrewm@379
|
403 /**
|
andrewm@379
|
404 * @brief Instance structure for the floating-point FIR Sparse filter.
|
andrewm@379
|
405 */
|
andrewm@379
|
406 typedef struct
|
andrewm@379
|
407 {
|
andrewm@379
|
408 ne10_uint16_t numTaps; /**< Length of the filter. */
|
andrewm@379
|
409 ne10_uint16_t stateIndex; /**< Index pointer for the state buffer .*/
|
andrewm@379
|
410 ne10_float32_t *pState; /**< Points to the state variable array. The array is of length numTaps+maxBlockSize-1. */
|
andrewm@379
|
411 ne10_float32_t *pCoeffs; /**< Points to the coefficient array. The array is of length numTaps.*/
|
andrewm@379
|
412 ne10_uint16_t maxDelay; /**< the largest number of delay line values .*/
|
andrewm@379
|
413 ne10_int32_t *pTapDelay; /**< Pointer to the array containing positions of the non-zero tap values. */
|
andrewm@379
|
414 } ne10_fir_sparse_instance_f32_t;
|
andrewm@379
|
415
|
andrewm@379
|
416 /**
|
andrewm@379
|
417 * @brief Instance structure for the floating point IIR Lattice filter.
|
andrewm@379
|
418 */
|
andrewm@379
|
419 typedef struct
|
andrewm@379
|
420 {
|
andrewm@379
|
421 ne10_uint16_t numStages; /**< numStages of the of lattice filter. */
|
andrewm@379
|
422 ne10_float32_t *pState; /**< Points to the state variable array. The array is of length numStages + blockSize -1. */
|
andrewm@379
|
423 ne10_float32_t *pkCoeffs; /**< Points to the reflection coefficient array. The array is of length numStages. */
|
andrewm@379
|
424 ne10_float32_t *pvCoeffs; /**< Points to the ladder coefficient array. The array is of length numStages+1. */
|
andrewm@379
|
425 } ne10_iir_lattice_instance_f32_t;
|
andrewm@379
|
426
|
andrewm@379
|
427 /////////////////////////////////////////////////////////
|
andrewm@379
|
428 // definitions for imgproc module
|
andrewm@379
|
429 /////////////////////////////////////////////////////////
|
andrewm@379
|
430
|
andrewm@379
|
431 /**
|
andrewm@379
|
432 * @brief Structure for point in image
|
andrewm@379
|
433 */
|
andrewm@379
|
434 typedef struct
|
andrewm@379
|
435 {
|
andrewm@379
|
436 ne10_uint32_t x;
|
andrewm@379
|
437 ne10_uint32_t y;
|
andrewm@379
|
438 } ne10_point_t;
|
andrewm@379
|
439
|
andrewm@379
|
440 typedef struct
|
andrewm@379
|
441 {
|
andrewm@379
|
442 ne10_uint32_t x;
|
andrewm@379
|
443 ne10_uint32_t y;
|
andrewm@379
|
444 } ne10_size_t;
|
andrewm@379
|
445
|
andrewm@379
|
446 typedef enum
|
andrewm@379
|
447 {
|
andrewm@379
|
448 UBUNTU_COMMAND_LINE,
|
andrewm@379
|
449 ANDROID_DEMO,
|
andrewm@379
|
450 IOS_DEMO
|
andrewm@379
|
451 } ne10_print_target_t;
|
andrewm@379
|
452
|
andrewm@379
|
453 #endif
|