Mercurial > hg > svcore
comparison data/fft/FFTFileCacheWriter.cpp @ 1038:cc27f35aa75c cxx11
Introducing the signed 64-bit frame index type, and fixing build failures from inclusion of -Wconversion with -Werror. Not finished yet.
author | Chris Cannam |
---|---|
date | Tue, 03 Mar 2015 15:18:24 +0000 |
parents | 59e7fe1b1003 |
children |
comparison
equal
deleted
inserted
replaced
1037:bf0e5944289b | 1038:cc27f35aa75c |
---|---|
38 m_fileBase(fileBase), | 38 m_fileBase(fileBase), |
39 m_storageType(storageType), | 39 m_storageType(storageType), |
40 m_factorSize(storageType == FFTCache::Compact ? 2 : 1), | 40 m_factorSize(storageType == FFTCache::Compact ? 2 : 1), |
41 m_mfc(new MatrixFile | 41 m_mfc(new MatrixFile |
42 (fileBase, MatrixFile::WriteOnly, | 42 (fileBase, MatrixFile::WriteOnly, |
43 storageType == FFTCache::Compact ? sizeof(uint16_t) : sizeof(float), | 43 int((storageType == FFTCache::Compact) ? sizeof(uint16_t) : sizeof(float)), |
44 width, height * 2 + m_factorSize)) | 44 width, height * 2 + m_factorSize)) |
45 { | 45 { |
46 #ifdef DEBUG_FFT_FILE_CACHE_WRITER | 46 #ifdef DEBUG_FFT_FILE_CACHE_WRITER |
47 cerr << "FFTFileCacheWriter: storage type is " << (storageType == FFTCache::Compact ? "Compact" : storageType == FFTCache::Polar ? "Polar" : "Rectangular") << ", size " << width << "x" << height << endl; | 47 cerr << "FFTFileCacheWriter: storage type is " << (storageType == FFTCache::Compact ? "Compact" : storageType == FFTCache::Polar ? "Polar" : "Rectangular") << ", size " << width << "x" << height << endl; |
48 #endif | 48 #endif |
173 setNormalizationFactorToWritebuf(factor); | 173 setNormalizationFactorToWritebuf(factor); |
174 | 174 |
175 m_mfc->setColumnAt(x, m_writebuf); | 175 m_mfc->setColumnAt(x, m_writebuf); |
176 } | 176 } |
177 | 177 |
178 int | 178 size_t |
179 FFTFileCacheWriter::getCacheSize(int width, int height, | 179 FFTFileCacheWriter::getCacheSize(int width, int height, |
180 FFTCache::StorageType type) | 180 FFTCache::StorageType type) |
181 { | 181 { |
182 return (height * 2 + (type == FFTCache::Compact ? 2 : 1)) * width * | 182 return (height * 2 + (type == FFTCache::Compact ? 2 : 1)) * width * |
183 (type == FFTCache::Compact ? sizeof(uint16_t) : sizeof(float)) + | 183 (type == FFTCache::Compact ? sizeof(uint16_t) : sizeof(float)) + |