OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
161 TickTime processing_start_time; | 161 TickTime processing_start_time; |
162 TickInterval accumulated_time; | 162 TickInterval accumulated_time; |
163 int num_chunks = 0; | 163 int num_chunks = 0; |
164 | 164 |
165 const StreamConfig input_config = { | 165 const StreamConfig input_config = { |
166 in_file.sample_rate(), in_buf.num_channels(), | 166 in_file.sample_rate(), in_buf.num_channels(), |
167 }; | 167 }; |
168 const StreamConfig output_config = { | 168 const StreamConfig output_config = { |
169 out_file.sample_rate(), out_buf.num_channels(), | 169 out_file.sample_rate(), out_buf.num_channels(), |
170 }; | 170 }; |
171 const StreamConfig reverse_input_config = { | 171 |
172 in_rev_file->sample_rate(), in_rev_file->num_channels(), | 172 StreamConfig reverse_input_config = {}; |
173 }; | 173 StreamConfig reverse_output_config = {}; |
174 const StreamConfig reverse_output_config = { | 174 if (process_reverse) { |
175 out_rev_file->sample_rate(), out_rev_file->num_channels(), | 175 StreamConfig reverse_input_config = {in_rev_file->sample_rate(), |
Andrew MacDonald
2015/08/21 17:31:33
This redeclaration is a bug of course; fixed here:
| |
176 }; | 176 in_rev_file->num_channels()}; |
177 StreamConfig reverse_output_config = {out_rev_file->sample_rate(), | |
178 out_rev_file->num_channels()}; | |
179 } | |
177 while (in_file.ReadSamples(in_interleaved.size(), | 180 while (in_file.ReadSamples(in_interleaved.size(), |
178 &in_interleaved[0]) == in_interleaved.size()) { | 181 &in_interleaved[0]) == in_interleaved.size()) { |
179 // Have logs display the file time rather than wallclock time. | 182 // Have logs display the file time rather than wallclock time. |
180 trace_to_stderr.SetTimeSeconds(num_chunks * 1.f / kChunksPerSecond); | 183 trace_to_stderr.SetTimeSeconds(num_chunks * 1.f / kChunksPerSecond); |
181 FloatS16ToFloat(&in_interleaved[0], in_interleaved.size(), | 184 FloatS16ToFloat(&in_interleaved[0], in_interleaved.size(), |
182 &in_interleaved[0]); | 185 &in_interleaved[0]); |
183 Deinterleave(&in_interleaved[0], in_buf.num_frames(), | 186 Deinterleave(&in_interleaved[0], in_buf.num_frames(), |
184 in_buf.num_channels(), in_buf.channels()); | 187 in_buf.num_channels(), in_buf.channels()); |
185 if (process_reverse) { | 188 if (process_reverse) { |
186 in_rev_file->ReadSamples(in_rev_interleaved.size(), | 189 in_rev_file->ReadSamples(in_rev_interleaved.size(), |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
228 execution_time_ms * 1.f / num_chunks); | 231 execution_time_ms * 1.f / num_chunks); |
229 } | 232 } |
230 return 0; | 233 return 0; |
231 } | 234 } |
232 | 235 |
233 } // namespace webrtc | 236 } // namespace webrtc |
234 | 237 |
235 int main(int argc, char* argv[]) { | 238 int main(int argc, char* argv[]) { |
236 return webrtc::main(argc, argv); | 239 return webrtc::main(argc, argv); |
237 } | 240 } |
OLD | NEW |