1 #include "BIQUADF16.h"
2 #include "Error.h"
3 
4 
test_biquad_cascade_df1_f16()5     void BIQUADF16::test_biquad_cascade_df1_f16()
6     {
7        arm_biquad_cascade_df1_f16(&instBiquadDf1, this->pSrc, this->pDst, this->nbSamples);
8     }
9 
test_biquad_cascade_df2T_f16()10     void BIQUADF16::test_biquad_cascade_df2T_f16()
11     {
12        arm_biquad_cascade_df2T_f16(&instBiquadDf2T, this->pSrc, this->pDst, this->nbSamples);
13     }
14 
15 
test_biquad_cascade_stereo_df2T_f16()16     void BIQUADF16::test_biquad_cascade_stereo_df2T_f16()
17     {
18        arm_biquad_cascade_stereo_df2T_f16(&instStereo, this->pSrc, this->pDst, this->nbSamples);
19     }
20 
21 
22 
setUp(Testing::testID_t id,std::vector<Testing::param_t> & params,Client::PatternMgr * mgr)23     void BIQUADF16::setUp(Testing::testID_t id,std::vector<Testing::param_t>& params,Client::PatternMgr *mgr)
24     {
25 
26 
27 
28        std::vector<Testing::param_t>::iterator it = params.begin();
29        this->numStages = *it++;
30        this->nbSamples = *it;
31 
32 
33 
34 
35        switch(id)
36        {
37            case TEST_BIQUAD_CASCADE_DF1_F16_1:
38                   samples.reload(BIQUADF16::SAMPLES1_F16_ID,mgr,this->nbSamples);
39                   output.create(this->nbSamples,BIQUADF16::OUT_SAMPLES_F16_ID,mgr);
40                   coefs.reload(BIQUADF16::COEFS1_F16_ID,mgr,this->numStages * 5);
41                   state.create(4*this->numStages,BIQUADF16::STATE_F16_ID,mgr);
42 
43                   arm_biquad_cascade_df1_init_f16(&instBiquadDf1,
44                     this->numStages,
45                     coefs.ptr(),
46                     state.ptr());
47 
48            break;
49 
50            case TEST_BIQUAD_CASCADE_DF2T_F16_2:
51                samples.reload(BIQUADF16::SAMPLES1_F16_ID,mgr,this->nbSamples);
52                output.create(this->nbSamples,BIQUADF16::OUT_SAMPLES_F16_ID,mgr);
53                coefs.reload(BIQUADF16::COEFS1_F16_ID,mgr,this->numStages * 5);
54                state.create(2*this->numStages,BIQUADF16::STATE_F16_ID,mgr);
55 
56 
57 #if defined(ARM_MATH_NEON)
58                // For Neon, neonCoefs is the coef array and is bigger
59                neonCoefs.create(8*this->numStages,BIQUADF16::STATE_F16_ID,mgr);
60 
61                arm_biquad_cascade_df2T_init_f16(&instBiquadDf2T,
62                     this->numStages,
63                     neonCoefs.ptr(),
64                     state.ptr());
65 
66                // Those Neon coefs must be computed from original coefs
67                arm_biquad_cascade_df2T_compute_coefs_f16(&instBiquadDf2T,this->numStages,coefs.ptr());
68 #else
69 
70               // For cortex-M, coefs is the coef array
71               arm_biquad_cascade_df2T_init_f16(&instBiquadDf2T,
72                     this->numStages,
73                     coefs.ptr(),
74                     state.ptr());
75 
76 
77 #endif
78            break;
79 
80            case TEST_BIQUAD_CASCADE_STEREO_DF2T_F16_3:
81                   samples.reload(BIQUADF16::SAMPLES1_F16_ID,mgr,2*this->nbSamples);
82                   output.create(2*this->nbSamples,BIQUADF16::OUT_SAMPLES_F16_ID,mgr);
83                   coefs.reload(BIQUADF16::COEFS1_F16_ID,mgr,this->numStages * 5);
84                   state.create(4*this->numStages,BIQUADF16::STATE_F16_ID,mgr);
85 
86                   arm_biquad_cascade_stereo_df2T_init_f16(&instStereo,
87                     this->numStages,
88                     coefs.ptr(),
89                     state.ptr());
90            break;
91        }
92 
93        this->pSrc=samples.ptr();
94        this->pDst=output.ptr();
95 
96     }
97 
tearDown(Testing::testID_t id,Client::PatternMgr * mgr)98     void BIQUADF16::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
99     {
100         (void)id;
101         (void)mgr;
102     }
103