diff data/model/FFTModel.cpp @ 1326:54af1e21705c 3.0-integration

Update to use bqvec allocator for float vectors
author Chris Cannam
date Tue, 13 Dec 2016 15:23:21 +0000
parents 12a1da4719c7
children fad8f533ca13
line wrap: on
line diff
--- a/data/model/FFTModel.cpp	Tue Dec 13 12:03:48 2016 +0000
+++ b/data/model/FFTModel.cpp	Tue Dec 13 15:23:21 2016 +0000
@@ -188,7 +188,7 @@
     return true;
 }
 
-vector<float>
+FFTModel::fvec
 FFTModel::getSourceSamples(int column) const
 {
     // m_fftSize may be greater than m_windowSize, but not the reverse
@@ -204,7 +204,7 @@
         return data;
     } else {
         vector<float> pad(off, 0.f);
-        vector<float> padded;
+        fvec padded;
         padded.reserve(m_fftSize);
         padded.insert(padded.end(), pad.begin(), pad.end());
         padded.insert(padded.end(), data.begin(), data.end());
@@ -213,7 +213,7 @@
     }
 }
 
-vector<float>
+FFTModel::fvec
 FFTModel::getSourceData(pair<sv_frame_t, sv_frame_t> range) const
 {
 //    cerr << "getSourceData(" << range.first << "," << range.second
@@ -235,11 +235,9 @@
         
         sv_frame_t discard = range.first - m_savedData.range.first;
 
-        vector<float> acc(m_savedData.data.begin() + discard,
-                          m_savedData.data.end());
+        fvec acc(m_savedData.data.begin() + discard, m_savedData.data.end());
 
-        vector<float> rest =
-            getSourceDataUncached({ m_savedData.range.second, range.second });
+        fvec rest = getSourceDataUncached({ m_savedData.range.second, range.second });
 
         acc.insert(acc.end(), rest.begin(), rest.end());
         
@@ -256,7 +254,7 @@
     }
 }
 
-vector<float>
+FFTModel::fvec
 FFTModel::getSourceDataUncached(pair<sv_frame_t, sv_frame_t> range) const
 {
     decltype(range.first) pfx = 0;
@@ -298,7 +296,7 @@
     return data;
 }
 
-vector<complex<float>>
+FFTModel::cvec
 FFTModel::getFFTColumn(int n) const
 {
     // The small cache (i.e. the m_cached deque) is for cases where
@@ -321,7 +319,7 @@
     m_windower.cut(samples.data());
     breakfastquay::v_fftshift(samples.data(), m_fftSize);
 
-    vector<complex<float>> col(m_fftSize/2 + 1);
+    cvec col(m_fftSize/2 + 1);
     
     m_fft.forwardInterleaved(samples.data(),
                              reinterpret_cast<float *>(col.data()));