comparison host/vamp-simple-host.cpp @ 42:1eb2419fc326

* fix to step size for frequency domain plugins * textual updates
author cannam
date Mon, 30 Oct 2006 10:20:21 +0000
parents ae3e47e76d2d
children 3bbe244611bb
comparison
equal deleted inserted replaced
41:31cd55174467 42:1eb2419fc326
210 210
211 cerr << "Preferred block size = " << blockSize << ", step size = " 211 cerr << "Preferred block size = " << blockSize << ", step size = "
212 << stepSize << endl; 212 << stepSize << endl;
213 213
214 if (blockSize == 0) blockSize = 1024; 214 if (blockSize == 0) blockSize = 1024;
215 if (stepSize == 0) stepSize = blockSize;
216 215
217 bool rightBlockSize = true; 216 bool rightBlockSize = true;
217
218 if (plugin->getInputDomain() == Vamp::Plugin::FrequencyDomain) { 218 if (plugin->getInputDomain() == Vamp::Plugin::FrequencyDomain) {
219
219 int p = 1, b = blockSize; 220 int p = 1, b = blockSize;
220 while (b) { 221 while (b) {
221 p <<= 1; 222 p <<= 1;
222 b >>= 1; 223 b >>= 1;
223 } 224 }
226 << blockSize << ",\nwhich is not supported by this host. "; 227 << blockSize << ",\nwhich is not supported by this host. ";
227 blockSize = p; 228 blockSize = p;
228 cerr << "Rounding up to " << blockSize << "." << endl; 229 cerr << "Rounding up to " << blockSize << "." << endl;
229 rightBlockSize = false; 230 rightBlockSize = false;
230 } 231 }
232 if (stepSize == 0) stepSize = blockSize / 2;
233
234 } else {
235
236 if (stepSize == 0) stepSize = blockSize;
231 } 237 }
232 238
233 int channels = sfinfo.channels; 239 int channels = sfinfo.channels;
234 240
235 float *filebuf = new float[blockSize * channels]; 241 float *filebuf = new float[blockSize * channels];