DSPLIB User Guide
DSPLIB_cascadeBiquad_ci.cpp
Go to the documentation of this file.
1 /******************************************************************************/
5 /* Copyright (C) 2017 Texas Instruments Incorporated - https://www.ti.com/
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  *
14  * Redistributions in binary form must reproduce the above copyright
15  * notice, this list of conditions and the following disclaimer in the
16  * documentation and/or other materials provided with the
17  * distribution.
18  *
19  * Neither the name of Texas Instruments Incorporated nor the names of
20  * its contributors may be used to endorse or promote products derived
21  * from this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34  *
35  ******************************************************************************/
36 
37 /******************************************************************************
38  * Version 1.0 Date 4/13/22 Author: Asheesh Bhardwaj
39  *****************************************************************************/
40 
41 /*******************************************************************************
42  *
43  * INCLUDES
44  *
45  ******************************************************************************/
46 
47 #include "../common/c71/DSPLIB_inlines.h"
49 
50 /*******************************************************************************
51  *
52  * DEFINES
53  *
54  ******************************************************************************/
55 #define DSPLIB_CASCADEBIQUAD_IMPLEMENTED 0
56 
57 template <typename dataType>
59  const DSPLIB_bufParams2D_t *bufParamsIn,
60  const DSPLIB_bufParams1D_t *bufParamsFilterCoeff,
61  const DSPLIB_bufParams2D_t *bufParamsFilterVar,
62  const DSPLIB_bufParams2D_t *bufParamsOut,
63  const DSPLIB_cascadeBiquad_InitArgs *pKerInitArgs)
64 {
66  __SE_TEMPLATE_v1 se0Params;
67  __SE_TEMPLATE_v1 se1Params;
68  __SA_TEMPLATE_v1 sa0Params;
69  __SA_TEMPLATE_v1 sa1Params;
70 
72  uint8_t *pBlock = pKerPrivArgs->bufPblock;
73  uint32_t dataSize = pKerPrivArgs->initArgs.dataSize;
74  uint32_t numChannels = pKerPrivArgs->initArgs.numChannels;
75  uint32_t numStages = pKerPrivArgs->initArgs.numStages;
76  uint32_t dataBufferInPitch = pKerPrivArgs->dataBufferInPitch;
77  uint32_t dataBufferOutPitch = pKerPrivArgs->dataBufferOutPitch;
78  uint32_t filterVarPitch = pKerPrivArgs->filterVarPitch;
79 
80  __SE_ELETYPE SE_ELETYPE;
81  __SE_VECLEN SE_VECLEN;
82  __SA_VECLEN SA_VECLEN;
83 
84  typedef typename c7x::make_full_vector<dataType>::type vec;
85  SE_VECLEN = c7x::se_veclen<vec>::value;
86  SA_VECLEN = c7x::sa_veclen<vec>::value;
87  SE_ELETYPE = c7x::se_eletype<vec>::value;
88 
89  uint32_t eleCount = c7x::element_count_of<vec>::value;
90 
91 #if DSPLIB_DEBUGPRINT
92  printf("DSPLIB_DEBUGPRINT SE_VECLEN: %d, SA_VECLEN: %d, SE_ELETYPE: %d "
93  "numChannels %d numStages %d\n",
94  SE_VECLEN, SA_VECLEN, SE_ELETYPE, numChannels, numStages);
95  printf("DSPLIB_DEBUGPRINT SE_VECLEN: %d, SA_VECLEN: %d, SE_ELETYPE: %d "
96  "eleCount %d\n",
97  SE_VECLEN, SA_VECLEN, SE_ELETYPE, eleCount);
98 #endif
99 
100  uint32_t icnt1Param = (numChannels > eleCount) ? eleCount : numChannels;
101  icnt1Param = (icnt1Param == 0) ? 1 : icnt1Param;
102  uint32_t icnt2Param =
103  (numChannels % eleCount == 0) ? (numChannels / eleCount) : (numChannels + eleCount) / eleCount;
104 
105  /**********************************************************************/
106  /* Prepare streaming engine 1 to fetch the input */
107  /**********************************************************************/
108  se1Params = __gen_SE_TEMPLATE_v1();
109 
110  se1Params.ICNT0 = icnt1Param;
111  se1Params.ICNT1 = dataSize;
112  se1Params.DIM1 = (int32_t) dataBufferInPitch;
113  se1Params.ICNT2 = icnt2Param;
114  se1Params.DIM2 = eleCount;
115  se1Params.ELETYPE = SE_ELETYPE;
116  se1Params.VECLEN = SE_VECLEN;
117  se1Params.DECDIM1_WIDTH = numChannels;
118  se1Params.DECDIM1 = __SE_DECDIM_DIM2;
119  se1Params.DIMFMT = __SE_DIMFMT_3D;
120  /**********************************************************************/
121  /* Prepare streaming engine 0 to fetch filter variables */
122  /**********************************************************************/
123  se0Params = __gen_SE_TEMPLATE_v1();
124  se0Params.ICNT0 = icnt1Param;
125  se0Params.ICNT1 = numStages * 2;
126  se0Params.DIM1 = (int32_t) filterVarPitch;
127  se0Params.ICNT2 = icnt2Param;
128  se0Params.DIM2 = eleCount;
129  se0Params.ELETYPE = SE_ELETYPE;
130  se0Params.VECLEN = SE_VECLEN;
131  se0Params.DECDIM1_WIDTH = numChannels;
132  se0Params.DECDIM1 = __SE_DECDIM_DIM2;
133  se0Params.DIMFMT = __SE_DIMFMT_3D;
134 
135  /**********************************************************************/
136  /* Prepare SA template to store output */
137  /**********************************************************************/
138  sa0Params = __gen_SA_TEMPLATE_v1();
139 
140  sa0Params.ICNT0 = icnt1Param;
141  sa0Params.ICNT1 = dataSize;
142  sa0Params.DIM1 = (int32_t) dataBufferOutPitch;
143  sa0Params.ICNT2 = icnt2Param;
144  sa0Params.DIM2 = eleCount;
145  sa0Params.DECDIM1_WIDTH = numChannels;
146  sa0Params.DECDIM1 = __SA_DECDIM_DIM2;
147  sa0Params.DECDIM2_WIDTH = dataBufferOutPitch * dataSize;
148  sa0Params.DECDIM2 = __SA_DECDIM_DIM2;
149  sa0Params.VECLEN = SA_VECLEN;
150  sa0Params.DIMFMT = __SA_DIMFMT_3D;
151 
152  /**********************************************************************/
153  /* Prepare SA template to store filter variables */
154  /**********************************************************************/
155  sa1Params = __gen_SA_TEMPLATE_v1();
156 
157  sa1Params.ICNT0 = icnt1Param;
158  sa1Params.ICNT1 = numStages * 2;
159  sa1Params.DIM1 = (int32_t) filterVarPitch;
160  sa1Params.ICNT2 = icnt2Param;
161  sa1Params.DIM2 = eleCount;
162  sa1Params.DECDIM1_WIDTH = numChannels;
163  sa1Params.DECDIM1 = __SA_DECDIM_DIM2;
164  sa1Params.VECLEN = SA_VECLEN;
165  sa1Params.DIMFMT = __SA_DIMFMT_3D;
166 
167  *(__SE_TEMPLATE_v1 *) ((uint8_t *) pBlock + SE_SE0_PARAM_OFFSET) = se0Params;
168  *(__SE_TEMPLATE_v1 *) ((uint8_t *) pBlock + SE_SE1_PARAM_OFFSET) = se1Params;
169  *(__SA_TEMPLATE_v1 *) ((uint8_t *) pBlock + SE_SA0_PARAM_OFFSET) = sa0Params;
170  *(__SA_TEMPLATE_v1 *) ((uint8_t *) pBlock + SE_SA1_PARAM_OFFSET) = sa1Params;
171 
172  return status;
173 }
174 template <typename dataType> static inline dataType fast_recip(dataType x)
175 {
176  typedef typename c7x::make_full_vector<dataType>::type vec;
177 
178  vec a = (vec) x;
179  vec f = __recip(a);
180  f = f * (2 - a * f);
181  f = f * (2 - a * f);
182  f = f * (2 - a * f);
183  vec out = f * (2 - a * f);
184  return out.s[0];
185 }
186 
188  const DSPLIB_bufParams2D_t *bufParamsIn,
189  const DSPLIB_bufParams1D_t *bufParamsFilterCoeff,
190  const DSPLIB_bufParams2D_t *bufParamsFilterVar,
191  const DSPLIB_bufParams2D_t *bufParamsOut,
192  const DSPLIB_cascadeBiquad_InitArgs *pKerInitArgs);
193 /*******************************************************************************
194  *
195  * EXECUTION FUNCTIONS
196  *
197  ******************************************************************************/
198 
199 template <typename dataType>
201  void *restrict pIn,
202  void *restrict pFilterCoeff,
203  void *restrict pFilterVar,
204  void *restrict pOut)
205 {
206  __SE_TEMPLATE_v1 se0Params;
207  __SE_TEMPLATE_v1 se1Params;
208  __SA_TEMPLATE_v1 sa0Params;
209  __SA_TEMPLATE_v1 sa1Params;
210 
212  uint8_t *pBlock = pKerPrivArgs->bufPblock;
213  uint32_t dataSize = pKerPrivArgs->initArgs.dataSize;
214  // uint32_t numStages = pKerPrivArgs->initArgs.numStages;
215  uint32_t numChannels = pKerPrivArgs->initArgs.numChannels;
216 
217  dataType *pInLocal = (dataType *) pIn;
218  dataType *pFilterCoeffLocal = (dataType *) pFilterCoeff;
219  dataType *pFilterVarLocal = (dataType *) pFilterVar;
220  dataType *pOutLocal = (dataType *) pOut;
221 
222 #if DSPLIB_DEBUGPRINT
223  printf("Enter DSPLIB_cascadeBiquad_exec_ci\n");
224 #endif
225 
226  typedef typename c7x::make_full_vector<dataType>::type vec;
227  int eleCount = c7x::element_count_of<vec>::value;
228 
229  vec input;
230  // vec filter;
231 
232 #if DSPLIB_DEBUGPRINT
233  printf("Enter pFilter %p\n", pFilterCoeff);
234 #endif
235 
236  // Filter coefficient
237  se0Params = *(__SE_TEMPLATE_v1 *) ((uint8_t *) pBlock + SE_SE0_PARAM_OFFSET);
238  __SE0_OPEN(pFilterVarLocal, se0Params);
239 
240  // Input samples
241  se1Params = *(__SE_TEMPLATE_v1 *) ((uint8_t *) pBlock + SE_SE1_PARAM_OFFSET);
242  __SE1_OPEN(pInLocal, se1Params);
243 
244  // Output samples
245  sa0Params = *(__SA_TEMPLATE_v1 *) ((uint8_t *) pBlock + SE_SA0_PARAM_OFFSET);
246  __SA0_OPEN(sa0Params);
247 
248  // Filter variables read and write
249  sa1Params = *(__SA_TEMPLATE_v1 *) ((uint8_t *) pBlock + SE_SA1_PARAM_OFFSET);
250  __SA1_OPEN(sa1Params);
251 
252 #if DSPLIB_DEBUGPRINT
253  printf("DSPLIB_DEBUGPRINT dataSize %d numChannels %d numStages %d pOutLocal "
254  "%p\n",
255  dataSize, numChannels, pKerPrivArgs->initArgs.numStages, pOutLocal);
256 #endif
257 
258  vec output1, output2, output3;
259  vec temp1_mul_1, temp0_mul_1, d0_temp_1, d1_mul_1;
260  vec temp1_mul_2, temp0_mul_2, d0_temp_2, d1_mul_2;
261  vec temp1_mul_3, temp0_mul_3, d0_temp_3, d1_mul_3;
262  vec temp1_add_1, temp1_add_2, temp1_add_3;
263 
264  dataType coeff0 = pFilterCoeffLocal[0];
265  // printf("\ncoeff0: %10g\n", coeff0);
266  vec b10 = (vec) (coeff0); // pFilterCoeffLocal[0];
267  vec r = (vec) (fast_recip<dataType>(coeff0));
268  vec b11 = pFilterCoeffLocal[1] * r;
269  vec b12 = pFilterCoeffLocal[2] * r;
270  vec a11 = (vec) (-1 * pFilterCoeffLocal[3]);
271  vec a12 = (vec) (-1 * pFilterCoeffLocal[4]);
272 
273  vec b20, b21, b22, a21, a22;
274 
275 #if DSPLIB_CASCADEBIQUAD_IMPLEMENTED
276 /* This code can be implemented for numStages < 2 implementation*/
277  if (numStages >= 2) {
278  coeff0 = pFilterCoeffLocal[5];
279  b20 = (vec) (coeff0); // pFilterCoeffLocal[5];
280  r = (vec) fast_recip<dataType>(coeff0);
281  b21 = pFilterCoeffLocal[6] * r;
282  b22 = pFilterCoeffLocal[7] * r;
283  a21 = -pFilterCoeffLocal[8];
284  a22 = -pFilterCoeffLocal[9];
285  }
286  else {
287  // if second stage is unused, create coefficients of unity transfer function
288  b20 = (vec) 1.0;
289  b21 = (vec) 0;
290  b22 = (vec) 0;
291  a21 = (vec) 0;
292  a22 = (vec) 0;
293  }
294 #else
295 /* Current implementation supports numStages = 3 or numStages = 7 */
296  coeff0 = pFilterCoeffLocal[5];
297  b20 = (vec) (coeff0); // pFilterCoeffLocal[5];
298  r = (vec) fast_recip<dataType>(coeff0);
299  b21 = pFilterCoeffLocal[6] * r;
300  b22 = pFilterCoeffLocal[7] * r;
301  a21 = -pFilterCoeffLocal[8];
302  a22 = -pFilterCoeffLocal[9];
303 
304 #endif
305 
306 
307  vec b30, b31, b32, a31, a32;
308 
309 #if DSPLIB_CASCADEBIQUAD_IMPLEMENTED
310 /* This code can be implemented for numStages < 3 implementation */
311 
312  if (numStages >= 3) {
313  coeff0 = pFilterCoeffLocal[10];
314  b30 = (vec) (coeff0); // pFilterCoeffLocal[10];
315  r = (vec) fast_recip<dataType>(coeff0);
316  b31 = pFilterCoeffLocal[11] * r;
317  b32 = pFilterCoeffLocal[12] * r;
318  a31 = -pFilterCoeffLocal[13];
319  a32 = -pFilterCoeffLocal[14];
320  }
321  else {
322  // if third stage is unused, create coefficients of unity transfer function
323  b30 = (vec) 1.0;
324  b31 = (vec) 0;
325  b32 = (vec) 0;
326  a31 = (vec) 0;
327  a32 = (vec) 0;
328  }
329 #else
330  /* Current implementation supports numStages = 3 or numStages = 7 */
331  coeff0 = pFilterCoeffLocal[10];
332  b30 = (vec) (coeff0); // pFilterCoeffLocal[10];
333  r = (vec) fast_recip<dataType>(coeff0);
334  b31 = pFilterCoeffLocal[11] * r;
335  b32 = pFilterCoeffLocal[12] * r;
336  a31 = -pFilterCoeffLocal[13];
337  a32 = -pFilterCoeffLocal[14];
338 
339 #endif
340 
341  /* Get the filter states into corresponding regs */
342 
343  vec outGain = b10 * b20 * b30; // Final output gain rescales based on b0 term
344 
345  vec b11_a11 = b11 + a11;
346  vec b12_a12 = b12 + a12;
347  vec b21_a21 = b21 + a21;
348  vec b22_a22 = b22 + a22;
349  vec b31_a31 = b31 + a31;
350  vec b32_a32 = b32 + a32;
351 
352 #if DSPLIB_DEBUGPRINT
353  DSPLIB_debugPrintVector(outGain);
354 // DSPLIB_debugPrintVector(b10);
355 // DSPLIB_debugPrintVector(b11);
356 // DSPLIB_debugPrintVector(b12);
357 // DSPLIB_debugPrintVector(b20);
358 // DSPLIB_debugPrintVector(b21);
359 // DSPLIB_debugPrintVector(b22);
360 // DSPLIB_debugPrintVector(b30);
361 // DSPLIB_debugPrintVector(b31);
362 // DSPLIB_debugPrintVector(b32);
363 #endif
364 
365  for (uint32_t chCount = 0; chCount < numChannels; chCount += eleCount) {
366  // Read filter variables
367  vec filtVars_d0_1 = c7x::strm_eng<0, vec>::get_adv();
368  vec filtVars_d1_1 = c7x::strm_eng<0, vec>::get_adv();
369  vec filtVars_d0_2 = c7x::strm_eng<0, vec>::get_adv();
370  vec filtVars_d1_2 = c7x::strm_eng<0, vec>::get_adv();
371  vec filtVars_d0_3 = c7x::strm_eng<0, vec>::get_adv();
372  vec filtVars_d1_3 = c7x::strm_eng<0, vec>::get_adv();
373 
374 #if DSPLIB_DEBUGPRINT
375 // DSPLIB_debugPrintVector(filtVars_d0_1);
376 // DSPLIB_debugPrintVector(filtVars_d1_1);
377 // DSPLIB_debugPrintVector(filtVars_d0_2);
378 // DSPLIB_debugPrintVector(filtVars_d1_2);
379 // DSPLIB_debugPrintVector(filtVars_d0_3);
380 // DSPLIB_debugPrintVector(filtVars_d1_3);
381 #endif
382  for (uint32_t samp = 0; samp < dataSize; samp++) {
383  // multi channel second stage
384  input = c7x::strm_eng<1, vec>::get();
385 #if DSPLIB_DEBUGPRINT
386 // DSPLIB_debugPrintVector(input);
387 #endif
388  output1 = input + filtVars_d0_1; // output1 = input1 + vd01;
389  temp1_mul_1 = input * b11_a11; // t1 = (((b11 + a11) * input1) + vd11) ;
390  temp1_add_1 = temp1_mul_1 + filtVars_d1_1;
391  temp0_mul_1 = a12 * filtVars_d0_1; // t0 = (a12 * vd01);
392  d0_temp_1 = a11 * filtVars_d0_1; // vd01 = ((a11 * vd01) + t1) ;
393  filtVars_d0_1 = d0_temp_1 + temp1_add_1;
394  input = c7x::strm_eng<1, vec>::get_adv();
395  d1_mul_1 = b12_a12 * input; // vd11 = (((b12 + a12) * input1) + t0) ;
396  filtVars_d1_1 = d1_mul_1 + temp0_mul_1;
397 
398  // multi channel second stage
399  output2 = output1 + filtVars_d0_2; // output2 = (output01 + vd02);
400  temp1_mul_2 = b21_a21 * output1; // t3 = (((b21 + a21) * output01) + vd12);
401  temp1_add_2 = temp1_mul_2 + filtVars_d1_2;
402  temp0_mul_2 = a22 * filtVars_d0_2; // t2 = (a22 * vd02);
403  d0_temp_2 = a21 * filtVars_d0_2; // vd02 = ((a21 * vd02) + t3) ;
404  filtVars_d0_2 = d0_temp_2 + temp1_add_2;
405  d1_mul_2 = b22_a22 * output1; // vd12 = (((b22 + a22) * output01) + t2) ;
406  filtVars_d1_2 = d1_mul_2 + temp0_mul_2;
407 
408  // multi channel third stage
409  output3 = output2 + filtVars_d0_3; // output3 = (output02 + vd03);
410  temp1_mul_3 = b31_a31 * output2;
411  temp1_add_3 = temp1_mul_3 + filtVars_d1_3; // t5 = (((b31 + a31) * output02) + vd13) ;
412  temp0_mul_3 = a32 * filtVars_d0_3; // t4 = (a32 * vd03);
413  d0_temp_3 = a31 * filtVars_d0_3; // vd03 = ((a31 * vd03) + t5) ;
414  filtVars_d0_3 = d0_temp_3 + temp1_add_3;
415  d1_mul_3 = b32_a32 * output2; // vd13 = (((b32 + a32) * output02) + t4) ;
416  filtVars_d1_3 = d1_mul_3 + temp0_mul_3;
417 
418  __vpred tmp = c7x::strm_agen<0, vec>::get_vpred();
419  vec *VB1 = c7x::strm_agen<0, vec>::get_adv(pOutLocal);
420 #if DSPLIB_DEBUGPRINT
421 // if (samp == 0 || samp == 1) {
422 // DSPLIB_debugPrintVector(input);
423 // DSPLIB_debugPrintVector(output1);
424 // DSPLIB_debugPrintVector(output2);
425 // DSPLIB_debugPrintVector(output3);
426 // }
427 #endif
428  vec output = output3 * outGain;
429 #if DSPLIB_DEBUGPRINT
430  // if (samp == 0 || samp == 1) {
431  DSPLIB_debugPrintVector(output);
432 // }
433 #endif
434  __vstore_pred(tmp, VB1, output);
435  }
436 
437  __vpred tmp1 = c7x::strm_agen<1, vec>::get_vpred();
438  vec *VB2 = c7x::strm_agen<1, vec>::get_adv(pFilterVarLocal);
439  __vstore_pred(tmp1, VB2, filtVars_d0_1);
440 
441  tmp1 = c7x::strm_agen<1, vec>::get_vpred();
442  VB2 = c7x::strm_agen<1, vec>::get_adv(pFilterVarLocal);
443  __vstore_pred(tmp1, VB2, filtVars_d1_1);
444 
445  tmp1 = c7x::strm_agen<1, vec>::get_vpred();
446  VB2 = c7x::strm_agen<1, vec>::get_adv(pFilterVarLocal);
447  __vstore_pred(tmp1, VB2, filtVars_d0_2);
448 
449  tmp1 = c7x::strm_agen<1, vec>::get_vpred();
450  VB2 = c7x::strm_agen<1, vec>::get_adv(pFilterVarLocal);
451  __vstore_pred(tmp1, VB2, filtVars_d1_2);
452 
453  tmp1 = c7x::strm_agen<1, vec>::get_vpred();
454  VB2 = c7x::strm_agen<1, vec>::get_adv(pFilterVarLocal);
455  __vstore_pred(tmp1, VB2, filtVars_d0_3);
456 
457  tmp1 = c7x::strm_agen<1, vec>::get_vpred();
458  VB2 = c7x::strm_agen<1, vec>::get_adv(pFilterVarLocal);
459  __vstore_pred(tmp1, VB2, filtVars_d1_3);
460  }
461  __SE0_CLOSE();
462  __SE1_CLOSE();
463  __SA0_CLOSE();
464  __SA1_CLOSE();
465 
466  return DSPLIB_SUCCESS;
467 }
468 
470  void *restrict pIn,
471  void *restrict pFilterCoeff,
472  void *restrict pFilterVar,
473  void *restrict pOut);
#define SE_SE0_PARAM_OFFSET
#define SE_SA0_PARAM_OFFSET
#define SE_SE1_PARAM_OFFSET
static dataType fast_recip(dataType x)
DSPLIB_STATUS DSPLIB_cascadeBiquad_init_ci(DSPLIB_kernelHandle handle, const DSPLIB_bufParams2D_t *bufParamsIn, const DSPLIB_bufParams1D_t *bufParamsFilterCoeff, const DSPLIB_bufParams2D_t *bufParamsFilterVar, const DSPLIB_bufParams2D_t *bufParamsOut, const DSPLIB_cascadeBiquad_InitArgs *pKerInitArgs)
This function is the initialization function for the C7x implementation of the kernel....
template DSPLIB_STATUS DSPLIB_cascadeBiquad_init_ci< float >(DSPLIB_kernelHandle handle, const DSPLIB_bufParams2D_t *bufParamsIn, const DSPLIB_bufParams1D_t *bufParamsFilterCoeff, const DSPLIB_bufParams2D_t *bufParamsFilterVar, const DSPLIB_bufParams2D_t *bufParamsOut, const DSPLIB_cascadeBiquad_InitArgs *pKerInitArgs)
DSPLIB_STATUS DSPLIB_cascadeBiquad_exec_ci(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pFilterCoeff, void *restrict pFilterVar, void *restrict pOut)
This function is the main execution function for the C7x implementation of the kernel....
template DSPLIB_STATUS DSPLIB_cascadeBiquad_exec_ci< float >(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pFilterCoeff, void *restrict pFilterVar, void *restrict pOut)
Header file for kernel's internal use. For the kernel's interface, please see DSPLIB_cascadeBiquad.
#define SE_SA1_PARAM_OFFSET
DSPLIB_STATUS_NAME
The enumeration of all status codes.
Definition: DSPLIB_types.h:151
void * DSPLIB_kernelHandle
Handle type for DSPLIB operations.
Definition: DSPLIB_types.h:172
@ DSPLIB_SUCCESS
Definition: DSPLIB_types.h:152
A structure for a 1 dimensional buffer descriptor.
A structure for a 2 dimensional buffer descriptor.
Structure containing the parameters to initialize the kernel.
uint32_t dataSize
Size of input data
uint32_t numChannels
number of channels
uint32_t numStages
Size of batch in terms of number of channels of input data
Structure that is reserved for internal use by the kernel.
uint8_t bufPblock[DSPLIB_CASCADEBIQUAD_PBLOCK_SIZE]
uint32_t filterVarPitch
Pitch of filter Variable buffer for different channels DSPLIB_cascadeBiquad_init that will be retriev...
uint32_t dataBufferOutPitch
Pitch of output buffer for different batches DSPLIB_cascadeBiquad_init that will be retrieved and use...
DSPLIB_cascadeBiquad_InitArgs initArgs
Structure holding initialization parameters
uint32_t dataBufferInPitch
Pitch of input buffer for different batches DSPLIB_cascadeBiquad_init that will be retrieved and used...