Mercurial > hg > vamp-plugin-tester
comparison TestOutputs.cpp @ 28:b1bc4d045a4b vamp-plugin-tester-v1.0
* Solaris build fixes
author | cannam |
---|---|
date | Thu, 24 Sep 2009 14:11:14 +0000 |
parents | 7dd6a549b2f9 |
children | ed9d3c27f687 |
comparison
equal
deleted
inserted
replaced
27:5dcdc86d45d4 | 28:b1bc4d045a4b |
---|---|
48 #include <memory> | 48 #include <memory> |
49 using namespace std; | 49 using namespace std; |
50 | 50 |
51 #include <cmath> | 51 #include <cmath> |
52 | 52 |
53 #ifndef __GNUC__ | |
54 #include <alloca.h> | |
55 #endif | |
56 | |
53 Tester::TestRegistrar<TestOutputNumbers> | 57 Tester::TestRegistrar<TestOutputNumbers> |
54 TestOutputNumbers::m_registrar("B1 Output number mismatching"); | 58 TestOutputNumbers::m_registrar("B1 Output number mismatching"); |
55 | 59 |
56 Tester::TestRegistrar<TestTimestamps> | 60 Tester::TestRegistrar<TestTimestamps> |
57 TestTimestamps::m_registrar("B2 Invalid or dubious timestamp usage"); | 61 TestTimestamps::m_registrar("B2 Invalid or dubious timestamp usage"); |
70 size_t count = 100; | 74 size_t count = 100; |
71 | 75 |
72 if (!initAdapted(p.get(), channels, _step, _step, r)) return r; | 76 if (!initAdapted(p.get(), channels, _step, _step, r)) return r; |
73 if (!data) data = createTestAudio(channels, _step, count); | 77 if (!data) data = createTestAudio(channels, _step, count); |
74 for (size_t i = 0; i < count; ++i) { | 78 for (size_t i = 0; i < count; ++i) { |
79 #ifdef __GNUC__ | |
75 float *ptr[channels]; | 80 float *ptr[channels]; |
81 #else | |
82 float **ptr = (float **)alloca(channels * sizeof(float)); | |
83 #endif | |
76 size_t idx = i * _step; | 84 size_t idx = i * _step; |
77 for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx; | 85 for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx; |
78 RealTime timestamp = RealTime::frame2RealTime(idx, rate); | 86 RealTime timestamp = RealTime::frame2RealTime(idx, rate); |
79 Plugin::FeatureSet fs = p->process(ptr, timestamp); | 87 Plugin::FeatureSet fs = p->process(ptr, timestamp); |
80 appendFeatures(f, fs); | 88 appendFeatures(f, fs); |
120 size_t count = 100; | 128 size_t count = 100; |
121 | 129 |
122 if (!initDefaults(p.get(), channels, step, block, r)) return r; | 130 if (!initDefaults(p.get(), channels, step, block, r)) return r; |
123 if (!data) data = createTestAudio(channels, block, count); | 131 if (!data) data = createTestAudio(channels, block, count); |
124 for (size_t i = 0; i < count; ++i) { | 132 for (size_t i = 0; i < count; ++i) { |
133 #ifdef __GNUC__ | |
125 float *ptr[channels]; | 134 float *ptr[channels]; |
135 #else | |
136 float **ptr = (float **)alloca(channels * sizeof(float)); | |
137 #endif | |
126 size_t idx = i * step; | 138 size_t idx = i * step; |
127 for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx; | 139 for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx; |
128 RealTime timestamp = RealTime::frame2RealTime(idx, rate); | 140 RealTime timestamp = RealTime::frame2RealTime(idx, rate); |
129 Plugin::FeatureSet fs = p->process(ptr, timestamp); | 141 Plugin::FeatureSet fs = p->process(ptr, timestamp); |
130 appendFeatures(f, fs); | 142 appendFeatures(f, fs); |