Mercurial > hg > vamp-plugin-sdk
comparison vamp-sdk/PluginHostAdapter.cpp @ 108:1e7ab0399852
* marginal performance improvement through use of reserve() in
PluginHostAdapter::convertFeatures
author | cannam |
---|---|
date | Fri, 08 Feb 2008 10:50:31 +0000 |
parents | b907557b2fb9 |
children | 44e6b94c2696 |
comparison
equal
deleted
inserted
replaced
107:bbe67d59b427 | 108:1e7ab0399852 |
---|---|
392 | 392 |
393 VampFeatureList &list = features[i]; | 393 VampFeatureList &list = features[i]; |
394 | 394 |
395 if (list.featureCount > 0) { | 395 if (list.featureCount > 0) { |
396 | 396 |
397 Feature feature; | |
398 feature.values.reserve(list.features[0].valueCount); | |
399 | |
397 for (unsigned int j = 0; j < list.featureCount; ++j) { | 400 for (unsigned int j = 0; j < list.featureCount; ++j) { |
398 | 401 |
399 Feature feature; | |
400 feature.hasTimestamp = list.features[j].hasTimestamp; | 402 feature.hasTimestamp = list.features[j].hasTimestamp; |
401 feature.timestamp = RealTime(list.features[j].sec, | 403 feature.timestamp = RealTime(list.features[j].sec, |
402 list.features[j].nsec); | 404 list.features[j].nsec); |
403 | 405 |
404 for (unsigned int k = 0; k < list.features[j].valueCount; ++k) { | 406 for (unsigned int k = 0; k < list.features[j].valueCount; ++k) { |
408 if (list.features[j].label) { | 410 if (list.features[j].label) { |
409 feature.label = list.features[j].label; | 411 feature.label = list.features[j].label; |
410 } | 412 } |
411 | 413 |
412 fs[i].push_back(feature); | 414 fs[i].push_back(feature); |
415 | |
416 if (list.features[j].valueCount > 0) { | |
417 feature.values.clear(); | |
418 } | |
419 | |
420 if (list.features[j].label) { | |
421 feature.label = ""; | |
422 } | |
413 } | 423 } |
414 } | 424 } |
415 } | 425 } |
416 } | 426 } |
417 | 427 |