Mercurial > hg > vamp-plugin-sdk
comparison host/vamp-simple-host.cpp @ 91:200a663bace1
* more fine tuning of handling of block and step sizes
author | cannam |
---|---|
date | Thu, 01 Nov 2007 10:25:35 +0000 |
parents | d17b9ca3b8c9 |
children | c94c066a4897 |
comparison
equal
deleted
inserted
replaced
90:036db77506f7 | 91:200a663bace1 |
---|---|
243 cerr << "Running plugin: \"" << plugin->getIdentifier() << "\"..." << endl; | 243 cerr << "Running plugin: \"" << plugin->getIdentifier() << "\"..." << endl; |
244 | 244 |
245 int blockSize = plugin->getPreferredBlockSize(); | 245 int blockSize = plugin->getPreferredBlockSize(); |
246 int stepSize = plugin->getPreferredStepSize(); | 246 int stepSize = plugin->getPreferredStepSize(); |
247 | 247 |
248 if (blockSize == 0) blockSize = 1024; | 248 if (blockSize == 0) { |
249 blockSize = 1024; | |
250 } | |
249 if (stepSize == 0) { | 251 if (stepSize == 0) { |
250 if (plugin->getInputDomain() == Vamp::Plugin::FrequencyDomain) { | 252 if (plugin->getInputDomain() == Vamp::Plugin::FrequencyDomain) { |
251 stepSize = blockSize/2; | 253 stepSize = blockSize/2; |
252 } else { | 254 } else { |
253 stepSize = blockSize; | 255 stepSize = blockSize; |
254 } | 256 } |
257 } else if (stepSize > blockSize) { | |
258 cerr << "WARNING: stepSize " << stepSize << " > blockSize " << blockSize << ", resetting blockSize to "; | |
259 if (plugin->getInputDomain() == Vamp::Plugin::FrequencyDomain) { | |
260 blockSize = stepSize * 2; | |
261 } else { | |
262 blockSize = stepSize; | |
263 } | |
264 cerr << blockSize << endl; | |
255 } | 265 } |
256 | 266 |
257 int channels = sfinfo.channels; | 267 int channels = sfinfo.channels; |
258 | 268 |
259 float *filebuf = new float[blockSize * channels]; | 269 float *filebuf = new float[blockSize * channels]; |