OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 |
11 #include "webrtc/modules/audio_processing/residual_echo_detector.h" | 11 #include "webrtc/modules/audio_processing/residual_echo_detector.h" |
12 | 12 |
13 #include <algorithm> | 13 #include <algorithm> |
14 #include <numeric> | 14 #include <numeric> |
15 | 15 |
| 16 #include "webrtc/base/atomicops.h" |
| 17 #include "webrtc/base/logging.h" |
16 #include "webrtc/modules/audio_processing/audio_buffer.h" | 18 #include "webrtc/modules/audio_processing/audio_buffer.h" |
17 #include "webrtc/modules/audio_processing/logging/apm_data_dumper.h" | 19 #include "webrtc/modules/audio_processing/logging/apm_data_dumper.h" |
18 #include "webrtc/rtc_base/atomicops.h" | |
19 #include "webrtc/rtc_base/logging.h" | |
20 #include "webrtc/system_wrappers/include/metrics.h" | 20 #include "webrtc/system_wrappers/include/metrics.h" |
21 | 21 |
22 namespace { | 22 namespace { |
23 | 23 |
24 float Power(rtc::ArrayView<const float> input) { | 24 float Power(rtc::ArrayView<const float> input) { |
25 if (input.size() == 0) { | 25 if (input.size() == 0) { |
26 return 0.f; | 26 return 0.f; |
27 } | 27 } |
28 return std::inner_product(input.begin(), input.end(), input.begin(), 0.f) / | 28 return std::inner_product(input.begin(), input.end(), input.begin(), 0.f) / |
29 input.size(); | 29 input.size(); |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 | 195 |
196 void ResidualEchoDetector::PackRenderAudioBuffer( | 196 void ResidualEchoDetector::PackRenderAudioBuffer( |
197 AudioBuffer* audio, | 197 AudioBuffer* audio, |
198 std::vector<float>* packed_buffer) { | 198 std::vector<float>* packed_buffer) { |
199 packed_buffer->clear(); | 199 packed_buffer->clear(); |
200 packed_buffer->insert(packed_buffer->end(), audio->channels_f()[0], | 200 packed_buffer->insert(packed_buffer->end(), audio->channels_f()[0], |
201 audio->channels_f()[0] + audio->num_frames()); | 201 audio->channels_f()[0] + audio->num_frames()); |
202 } | 202 } |
203 | 203 |
204 } // namespace webrtc | 204 } // namespace webrtc |
OLD | NEW |