9 |
|
|
10 |
#include "lfobench.h" |
#include "lfobench.h" |
11 |
|
|
12 |
#include "../src/engines/common/LFOSawIntMath.h" |
#include "../src/engines/common/LFOSawIntMathNew.h" |
13 |
#include "../src/engines/common/SawLFO.h" |
#include "../src/engines/common/LFOSawIntMathOld.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 |
LFOSawIntMath<LFO::range_signed>* pSawIntLFO = NULL; |
LFOSawIntMathNew<LFO::range_signed>* pSawIntLFO = NULL; |
23 |
SawLFO<LFO::range_signed,true>* pSawLFOold = NULL; |
LFOSawIntMathOld<LFO::range_signed,true>* pSawLFOold = NULL; |
24 |
#else // unsigned |
#else // unsigned |
25 |
LFOSawIntMath<LFO::range_unsigned>* pSawIntLFO = NULL; |
LFOSawIntMathNew<LFO::range_unsigned>* pSawIntLFO = NULL; |
26 |
SawLFO<LFO::range_unsigned,true>* pSawLFOold = NULL; |
LFOSawIntMathOld<LFO::range_unsigned,true>* pSawLFOold = NULL; |
27 |
#endif |
#endif |
28 |
|
|
29 |
double saw_new_int_math(smpl_t* pDestinationBuffer, float* pAmp, const int steps, const float frequency) { |
double saw_new_int_math(smpl_t* pDestinationBuffer, float* pAmp, const int steps, const float frequency) { |
94 |
#endif |
#endif |
95 |
|
|
96 |
#if SIGNED |
#if SIGNED |
97 |
pSawIntLFO = new LFOSawIntMath<LFO::range_signed>(MAX); |
pSawIntLFO = new LFOSawIntMathNew<LFO::range_signed>(MAX); |
98 |
pSawLFOold = new SawLFO<LFO::range_signed,true>(MAX); |
pSawLFOold = new LFOSawIntMathOld<LFO::range_signed,true>(MAX); |
99 |
#else // unsigned |
#else // unsigned |
100 |
pSawIntLFO = new LFOSawIntMath<LFO::range_unsigned>(MAX); |
pSawIntLFO = new LFOSawIntMathNew<LFO::range_unsigned>(MAX); |
101 |
pSawLFOold = new SawLFO<LFO::range_unsigned,true>(MAX); |
pSawLFOold = new LFOSawIntMathOld<LFO::range_unsigned,true>(MAX); |
102 |
#endif |
#endif |
103 |
|
|
104 |
// output buffer for the calculated sinusoid wave |
// output buffer for the calculated sinusoid wave |