OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2017 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 #include "webrtc/modules/audio_processing/aec3/echo_remover.h" | 10 #include "webrtc/modules/audio_processing/aec3/echo_remover.h" |
11 | 11 |
12 #include <math.h> | 12 #include <math.h> |
13 #include <algorithm> | 13 #include <algorithm> |
14 #include <memory> | 14 #include <memory> |
15 #include <numeric> | 15 #include <numeric> |
16 #include <string> | 16 #include <string> |
17 | 17 |
18 #include "webrtc/base/array_view.h" | |
19 #include "webrtc/base/atomicops.h" | |
20 #include "webrtc/base/constructormagic.h" | |
21 #include "webrtc/modules/audio_processing/aec3/aec3_common.h" | 18 #include "webrtc/modules/audio_processing/aec3/aec3_common.h" |
22 #include "webrtc/modules/audio_processing/aec3/aec_state.h" | 19 #include "webrtc/modules/audio_processing/aec3/aec_state.h" |
23 #include "webrtc/modules/audio_processing/aec3/comfort_noise_generator.h" | 20 #include "webrtc/modules/audio_processing/aec3/comfort_noise_generator.h" |
24 #include "webrtc/modules/audio_processing/aec3/echo_path_variability.h" | 21 #include "webrtc/modules/audio_processing/aec3/echo_path_variability.h" |
25 #include "webrtc/modules/audio_processing/aec3/echo_remover_metrics.h" | 22 #include "webrtc/modules/audio_processing/aec3/echo_remover_metrics.h" |
26 #include "webrtc/modules/audio_processing/aec3/fft_data.h" | 23 #include "webrtc/modules/audio_processing/aec3/fft_data.h" |
27 #include "webrtc/modules/audio_processing/aec3/output_selector.h" | 24 #include "webrtc/modules/audio_processing/aec3/output_selector.h" |
28 #include "webrtc/modules/audio_processing/aec3/render_buffer.h" | 25 #include "webrtc/modules/audio_processing/aec3/render_buffer.h" |
29 #include "webrtc/modules/audio_processing/aec3/render_delay_buffer.h" | 26 #include "webrtc/modules/audio_processing/aec3/render_delay_buffer.h" |
30 #include "webrtc/modules/audio_processing/aec3/residual_echo_estimator.h" | 27 #include "webrtc/modules/audio_processing/aec3/residual_echo_estimator.h" |
31 #include "webrtc/modules/audio_processing/aec3/subtractor.h" | 28 #include "webrtc/modules/audio_processing/aec3/subtractor.h" |
32 #include "webrtc/modules/audio_processing/aec3/suppression_filter.h" | 29 #include "webrtc/modules/audio_processing/aec3/suppression_filter.h" |
33 #include "webrtc/modules/audio_processing/aec3/suppression_gain.h" | 30 #include "webrtc/modules/audio_processing/aec3/suppression_gain.h" |
34 #include "webrtc/modules/audio_processing/logging/apm_data_dumper.h" | 31 #include "webrtc/modules/audio_processing/logging/apm_data_dumper.h" |
| 32 #include "webrtc/rtc_base/array_view.h" |
| 33 #include "webrtc/rtc_base/atomicops.h" |
| 34 #include "webrtc/rtc_base/constructormagic.h" |
35 | 35 |
36 namespace webrtc { | 36 namespace webrtc { |
37 | 37 |
38 namespace { | 38 namespace { |
39 | 39 |
40 void LinearEchoPower(const FftData& E, | 40 void LinearEchoPower(const FftData& E, |
41 const FftData& Y, | 41 const FftData& Y, |
42 std::array<float, kFftLengthBy2Plus1>* S2) { | 42 std::array<float, kFftLengthBy2Plus1>* S2) { |
43 for (size_t k = 0; k < E.re.size(); ++k) { | 43 for (size_t k = 0; k < E.re.size(); ++k) { |
44 (*S2)[k] = (Y.re[k] - E.re[k]) * (Y.re[k] - E.re[k]) + | 44 (*S2)[k] = (Y.re[k] - E.re[k]) * (Y.re[k] - E.re[k]) + |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 | 226 |
227 } // namespace | 227 } // namespace |
228 | 228 |
229 EchoRemover* EchoRemover::Create( | 229 EchoRemover* EchoRemover::Create( |
230 const AudioProcessing::Config::EchoCanceller3& config, | 230 const AudioProcessing::Config::EchoCanceller3& config, |
231 int sample_rate_hz) { | 231 int sample_rate_hz) { |
232 return new EchoRemoverImpl(config, sample_rate_hz); | 232 return new EchoRemoverImpl(config, sample_rate_hz); |
233 } | 233 } |
234 | 234 |
235 } // namespace webrtc | 235 } // namespace webrtc |
OLD | NEW |