9 |
|
|
10 |
#include "lfobench.h" |
#include "lfobench.h" |
11 |
|
|
12 |
#include "../src/engines/common/LFOSine.h" |
#include "../src/engines/common/LFOSineNumericComplexNr.h" |
13 |
#include "../src/engines/common/SineLFO.h" |
#include "../src/engines/common/LFOSineBuiltinFn.h" |
14 |
|
|
15 |
// return value of this benchmark |
// return value of this benchmark |
16 |
// to indicate the best performing solution |
// to indicate the best performing solution |
19 |
#define INVALID_RESULT -1 |
#define INVALID_RESULT -1 |
20 |
|
|
21 |
#if SIGNED |
#if SIGNED |
22 |
LFOSine<LFO::range_signed>* pSineLFO = NULL; |
LFOSineNumericComplexNr<LFO::range_signed>* pSineLFO = NULL; |
23 |
SineLFO<LFO::range_signed>* pSineLFOBuiltin = NULL; |
LFOSineBuiltinFn<LFO::range_signed>* pSineLFOBuiltin = NULL; |
24 |
#else // unsigned |
#else // unsigned |
25 |
LFOSine<LFO::range_unsigned>* pSineLFO = NULL; |
LFOSineNumericComplexNr<LFO::range_unsigned>* pSineLFO = NULL; |
26 |
SineLFO<LFO::range_unsigned>* pSineLFOBuiltin = NULL; |
LFOSineBuiltinFn<LFO::range_unsigned>* pSineLFOBuiltin = NULL; |
27 |
#endif |
#endif |
28 |
|
|
29 |
double sine_complex_nr(smpl_t* pDestinationBuffer, float* pAmp, const int steps, const float frequency) { |
double sine_complex_nr(smpl_t* pDestinationBuffer, float* pAmp, const int steps, const float frequency) { |
94 |
#endif |
#endif |
95 |
|
|
96 |
#if SIGNED |
#if SIGNED |
97 |
pSineLFO = new LFOSine<LFO::range_signed>(MAX); |
pSineLFO = new LFOSineNumericComplexNr<LFO::range_signed>(MAX); |
98 |
pSineLFOBuiltin = new SineLFO<LFO::range_signed>(MAX); |
pSineLFOBuiltin = new LFOSineBuiltinFn<LFO::range_signed>(MAX); |
99 |
#else // unsigned |
#else // unsigned |
100 |
pSineLFO = new LFOSine<LFO::range_unsigned>(MAX); |
pSineLFO = new LFOSineNumericComplexNr<LFO::range_unsigned>(MAX); |
101 |
pSineLFOBuiltin = new SineLFO<LFO::range_unsigned>(MAX); |
pSineLFOBuiltin = new LFOSineBuiltinFn<LFO::range_unsigned>(MAX); |
102 |
#endif |
#endif |
103 |
|
|
104 |
// output buffer for the calculated sinusoid wave |
// output buffer for the calculated sinusoid wave |