diff transform/FeatureExtractionModelTransformer.cpp @ 556:53e5dc8439e7

* get whole columns at a time from fft model when running transform
author Chris Cannam
date Mon, 09 Feb 2009 11:53:29 +0000
parents 3ccf48fb81d6
children a40023bebd15
line wrap: on
line diff
--- a/transform/FeatureExtractionModelTransformer.cpp	Mon Feb 09 11:38:08 2009 +0000
+++ b/transform/FeatureExtractionModelTransformer.cpp	Mon Feb 09 11:53:29 2009 +0000
@@ -449,6 +449,13 @@
 
     setCompletion(0);
 
+    float *reals = 0;
+    float *imaginaries = 0;
+    if (frequencyDomain) {
+        reals = new float[blockSize/2 + 1];
+        imaginaries = new float[blockSize/2 + 1];
+    }
+
     while (!m_abandoned) {
 
         if (frequencyDomain) {
@@ -472,9 +479,10 @@
         if (frequencyDomain) {
             for (size_t ch = 0; ch < channelCount; ++ch) {
                 int column = (blockFrame - startFrame) / stepSize;
+                fftModels[ch]->getValuesAt(column, reals, imaginaries);
                 for (size_t i = 0; i <= blockSize/2; ++i) {
-                    fftModels[ch]->getValuesAt
-                        (column, i, buffers[ch][i*2], buffers[ch][i*2+1]);
+                    buffers[ch][i*2] = reals[i];
+                    buffers[ch][i*2+1] = imaginaries[i];
                 }
             }
         } else {
@@ -518,6 +526,8 @@
         for (size_t ch = 0; ch < channelCount; ++ch) {
             delete fftModels[ch];
         }
+        delete[] reals;
+        delete[] imaginaries;
     }
 }