Mercurial > hg > svcore
diff data/fft/FFTMemoryCache.h @ 1069:32ab6c48efaa
Merge from branch tonioni
author | Chris Cannam |
---|---|
date | Mon, 20 Apr 2015 09:11:34 +0100 |
parents | cc27f35aa75c |
children |
line wrap: on
line diff
--- a/data/fft/FFTMemoryCache.h Mon Mar 02 17:21:34 2015 +0000 +++ b/data/fft/FFTMemoryCache.h Mon Apr 20 09:11:34 2015 +0100 @@ -66,7 +66,7 @@ float getNormalizedMagnitudeAt(int x, int y) const { if (m_storageType == FFTCache::Rectangular) return getMagnitudeAt(x, y) / m_factor[x]; else if (m_storageType == FFTCache::Polar) return m_fmagnitude[x][y]; - else return float(m_magnitude[x][y]) / 65535.0; + else return float(m_magnitude[x][y]) / 65535.f; } float getMaximumMagnitudeAt(int x) const { @@ -81,7 +81,7 @@ return m_fphase[x][y]; } else { int16_t i = (int16_t)m_phase[x][y]; - return (float(i) / 32767.0) * M_PI; + return float(i / 32767.0 * M_PI); } } @@ -114,7 +114,7 @@ } else { for (int i = 0; i < count; ++i) { int y = i * step + minbin; - values[i] = (float(m_magnitude[x][y]) * m_factor[x]) / 65535.0; + values[i] = float(double(m_magnitude[x][y]) * m_factor[x] / 65535.0); } } } @@ -132,7 +132,7 @@ void allColumnsWritten() { } - static int getCacheSize(int width, int height, + static size_t getCacheSize(int width, int height, FFTCache::StorageType type); FFTCache::StorageType getStorageType() const { return m_storageType; }