comparison data/fileio/DecodingWavFileReader.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 4704e834d0f9
children 70e172e6cc59 f8e3dcbafb4d
comparison
equal deleted inserted replaced
1325:3aea4f7617bb 1326:54af1e21705c
69 } 69 }
70 70
71 sv_frame_t blockSize = 16384; 71 sv_frame_t blockSize = 16384;
72 sv_frame_t total = m_original->getFrameCount(); 72 sv_frame_t total = m_original->getFrameCount();
73 73
74 vector<float> block; 74 floatvec_t block;
75 75
76 for (sv_frame_t i = 0; i < total; i += blockSize) { 76 for (sv_frame_t i = 0; i < total; i += blockSize) {
77 77
78 sv_frame_t count = blockSize; 78 sv_frame_t count = blockSize;
79 if (i + count > total) count = total - i; 79 if (i + count > total) count = total - i;
126 } 126 }
127 127
128 sv_frame_t blockSize = 16384; 128 sv_frame_t blockSize = 16384;
129 sv_frame_t total = m_reader->m_original->getFrameCount(); 129 sv_frame_t total = m_reader->m_original->getFrameCount();
130 130
131 vector<float> block; 131 floatvec_t block;
132 132
133 for (sv_frame_t i = 0; i < total; i += blockSize) { 133 for (sv_frame_t i = 0; i < total; i += blockSize) {
134 134
135 sv_frame_t count = blockSize; 135 sv_frame_t count = blockSize;
136 if (i + count > total) count = total - i; 136 if (i + count > total) count = total - i;
149 delete m_reader->m_original; 149 delete m_reader->m_original;
150 m_reader->m_original = 0; 150 m_reader->m_original = 0;
151 } 151 }
152 152
153 void 153 void
154 DecodingWavFileReader::addBlock(const vector<float> &frames) 154 DecodingWavFileReader::addBlock(const floatvec_t &frames)
155 { 155 {
156 addSamplesToDecodeCache(frames); 156 addSamplesToDecodeCache(frames);
157 157
158 m_processed += frames.size(); 158 m_processed += frames.size();
159 159