comparison data/model/FFTModel.h @ 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 bac86d3fc6c9
children fad8f533ca13
comparison
equal deleted inserted replaced
1325:3aea4f7617bb 1326:54af1e21705c
20 #include "DenseTimeValueModel.h" 20 #include "DenseTimeValueModel.h"
21 21
22 #include "base/Window.h" 22 #include "base/Window.h"
23 23
24 #include <bqfft/FFT.h> 24 #include <bqfft/FFT.h>
25 #include <bqvec/Allocators.h>
25 26
26 #include <set> 27 #include <set>
27 #include <vector> 28 #include <vector>
28 #include <complex> 29 #include <complex>
29 #include <deque> 30 #include <deque>
165 startFrame -= m_windowSize / 2; 166 startFrame -= m_windowSize / 2;
166 endFrame -= m_windowSize / 2; 167 endFrame -= m_windowSize / 2;
167 return { startFrame, endFrame }; 168 return { startFrame, endFrame };
168 } 169 }
169 170
170 std::vector<std::complex<float> > getFFTColumn(int column) const; 171 typedef std::vector<float, breakfastquay::StlAllocator<float>> fvec;
171 std::vector<float> getSourceSamples(int column) const; 172 typedef std::vector<std::complex<float>,
172 std::vector<float> getSourceData(std::pair<sv_frame_t, sv_frame_t>) const; 173 breakfastquay::StlAllocator<std::complex<float>>> cvec;
173 std::vector<float> getSourceDataUncached(std::pair<sv_frame_t, sv_frame_t>) const; 174
175 cvec getFFTColumn(int column) const;
176 fvec getSourceSamples(int column) const;
177 fvec getSourceData(std::pair<sv_frame_t, sv_frame_t>) const;
178 fvec getSourceDataUncached(std::pair<sv_frame_t, sv_frame_t>) const;
174 179
175 struct SavedSourceData { 180 struct SavedSourceData {
176 std::pair<sv_frame_t, sv_frame_t> range; 181 std::pair<sv_frame_t, sv_frame_t> range;
177 std::vector<float> data; 182 fvec data;
178 }; 183 };
179 mutable SavedSourceData m_savedData; 184 mutable SavedSourceData m_savedData;
180 185
181 struct SavedColumn { 186 struct SavedColumn {
182 int n; 187 int n;
183 std::vector<std::complex<float> > col; 188 cvec col;
184 }; 189 };
185 mutable std::deque<SavedColumn> m_cached; 190 mutable std::deque<SavedColumn> m_cached;
186 size_t m_cacheSize; 191 size_t m_cacheSize;
187 }; 192 };
188 193