peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 10 | #include "modules/audio_processing/aec3/echo_remover.h" |
peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 11 | |
peah | 86afe9d | 2017-04-06 15:45:32 -0700 | [diff] [blame] | 12 | #include <math.h> |
peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 13 | #include <algorithm> |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 14 | #include <memory> |
| 15 | #include <numeric> |
| 16 | #include <string> |
peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 17 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 18 | #include "api/array_view.h" |
| 19 | #include "modules/audio_processing/aec3/aec3_common.h" |
| 20 | #include "modules/audio_processing/aec3/aec_state.h" |
| 21 | #include "modules/audio_processing/aec3/comfort_noise_generator.h" |
| 22 | #include "modules/audio_processing/aec3/echo_path_variability.h" |
| 23 | #include "modules/audio_processing/aec3/echo_remover_metrics.h" |
| 24 | #include "modules/audio_processing/aec3/fft_data.h" |
| 25 | #include "modules/audio_processing/aec3/output_selector.h" |
| 26 | #include "modules/audio_processing/aec3/render_buffer.h" |
| 27 | #include "modules/audio_processing/aec3/render_delay_buffer.h" |
| 28 | #include "modules/audio_processing/aec3/residual_echo_estimator.h" |
| 29 | #include "modules/audio_processing/aec3/subtractor.h" |
| 30 | #include "modules/audio_processing/aec3/suppression_filter.h" |
| 31 | #include "modules/audio_processing/aec3/suppression_gain.h" |
| 32 | #include "modules/audio_processing/logging/apm_data_dumper.h" |
| 33 | #include "rtc_base/atomicops.h" |
| 34 | #include "rtc_base/constructormagic.h" |
peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 35 | |
| 36 | namespace webrtc { |
| 37 | |
| 38 | namespace { |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 39 | |
| 40 | void LinearEchoPower(const FftData& E, |
| 41 | const FftData& Y, |
| 42 | std::array<float, kFftLengthBy2Plus1>* S2) { |
| 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]) + |
| 45 | (Y.im[k] - E.im[k]) * (Y.im[k] - E.im[k]); |
| 46 | } |
| 47 | } |
| 48 | |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 49 | // Class for removing the echo from the capture signal. |
peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 50 | class EchoRemoverImpl final : public EchoRemover { |
| 51 | public: |
Per Åhgren | 5c532d3 | 2018-03-22 00:29:25 +0100 | [diff] [blame] | 52 | EchoRemoverImpl(const EchoCanceller3Config& config, int sample_rate_hz); |
peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 53 | ~EchoRemoverImpl() override; |
| 54 | |
Gustaf Ullberg | 332150d | 2017-11-22 14:17:39 +0100 | [diff] [blame] | 55 | void GetMetrics(EchoControl::Metrics* metrics) const override; |
| 56 | |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 57 | // Removes the echo from a block of samples from the capture signal. The |
| 58 | // supplied render signal is assumed to be pre-aligned with the capture |
| 59 | // signal. |
Per Åhgren | de22a17 | 2017-12-20 18:00:51 +0100 | [diff] [blame] | 60 | void ProcessCapture(const EchoPathVariability& echo_path_variability, |
Alex Loiko | 890988c | 2017-08-31 10:25:48 +0200 | [diff] [blame] | 61 | bool capture_signal_saturation, |
Per Åhgren | 5c532d3 | 2018-03-22 00:29:25 +0100 | [diff] [blame] | 62 | const rtc::Optional<DelayEstimate>& external_delay, |
Per Åhgren | c59a576 | 2017-12-11 21:34:19 +0100 | [diff] [blame] | 63 | RenderBuffer* render_buffer, |
Alex Loiko | 890988c | 2017-08-31 10:25:48 +0200 | [diff] [blame] | 64 | std::vector<std::vector<float>>* capture) override; |
peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 65 | |
Per Åhgren | 5c532d3 | 2018-03-22 00:29:25 +0100 | [diff] [blame] | 66 | // Returns the internal delay estimate in blocks. |
| 67 | rtc::Optional<int> Delay() const override { |
| 68 | return aec_state_.InternalDelay(); |
| 69 | } |
| 70 | |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 71 | // Updates the status on whether echo leakage is detected in the output of the |
| 72 | // echo remover. |
| 73 | void UpdateEchoLeakageStatus(bool leakage_detected) override { |
| 74 | echo_leakage_detected_ = leakage_detected; |
| 75 | } |
peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 76 | |
| 77 | private: |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 78 | static int instance_count_; |
Gustaf Ullberg | bd83b91 | 2017-10-18 12:32:42 +0200 | [diff] [blame] | 79 | const EchoCanceller3Config config_; |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 80 | const Aec3Fft fft_; |
| 81 | std::unique_ptr<ApmDataDumper> data_dumper_; |
| 82 | const Aec3Optimization optimization_; |
peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 83 | const int sample_rate_hz_; |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 84 | Subtractor subtractor_; |
| 85 | SuppressionGain suppression_gain_; |
| 86 | ComfortNoiseGenerator cng_; |
| 87 | SuppressionFilter suppression_filter_; |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 88 | RenderSignalAnalyzer render_signal_analyzer_; |
| 89 | OutputSelector output_selector_; |
| 90 | ResidualEchoEstimator residual_echo_estimator_; |
| 91 | bool echo_leakage_detected_ = false; |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 92 | AecState aec_state_; |
peah | e985b3f | 2017-02-28 22:08:53 -0800 | [diff] [blame] | 93 | EchoRemoverMetrics metrics_; |
Per Åhgren | a98c807 | 2018-01-15 19:17:16 +0100 | [diff] [blame] | 94 | bool initial_state_ = true; |
peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 95 | |
| 96 | RTC_DISALLOW_COPY_AND_ASSIGN(EchoRemoverImpl); |
| 97 | }; |
| 98 | |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 99 | int EchoRemoverImpl::instance_count_ = 0; |
| 100 | |
Gustaf Ullberg | bd83b91 | 2017-10-18 12:32:42 +0200 | [diff] [blame] | 101 | EchoRemoverImpl::EchoRemoverImpl(const EchoCanceller3Config& config, |
| 102 | int sample_rate_hz) |
peah | 8cee56f | 2017-08-24 22:36:53 -0700 | [diff] [blame] | 103 | : config_(config), |
| 104 | fft_(), |
aleloi | 88b82b5 | 2017-02-23 06:27:03 -0800 | [diff] [blame] | 105 | data_dumper_( |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 106 | new ApmDataDumper(rtc::AtomicOps::Increment(&instance_count_))), |
| 107 | optimization_(DetectOptimization()), |
| 108 | sample_rate_hz_(sample_rate_hz), |
Per Åhgren | 09a718a | 2017-12-11 22:28:45 +0100 | [diff] [blame] | 109 | subtractor_(config, data_dumper_.get(), optimization_), |
peah | 8cee56f | 2017-08-24 22:36:53 -0700 | [diff] [blame] | 110 | suppression_gain_(config_, optimization_), |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 111 | cng_(optimization_), |
peah | 697a590 | 2017-06-30 07:06:10 -0700 | [diff] [blame] | 112 | suppression_filter_(sample_rate_hz_), |
Per Åhgren | 971de07 | 2018-03-14 23:23:47 +0100 | [diff] [blame] | 113 | render_signal_analyzer_(config_), |
peah | 8cee56f | 2017-08-24 22:36:53 -0700 | [diff] [blame] | 114 | residual_echo_estimator_(config_), |
| 115 | aec_state_(config_) { |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 116 | RTC_DCHECK(ValidFullBandRate(sample_rate_hz)); |
peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 117 | } |
| 118 | |
| 119 | EchoRemoverImpl::~EchoRemoverImpl() = default; |
| 120 | |
Gustaf Ullberg | 332150d | 2017-11-22 14:17:39 +0100 | [diff] [blame] | 121 | void EchoRemoverImpl::GetMetrics(EchoControl::Metrics* metrics) const { |
| 122 | // Echo return loss (ERL) is inverted to go from gain to attenuation. |
| 123 | metrics->echo_return_loss = -10.0 * log10(aec_state_.ErlTimeDomain()); |
| 124 | metrics->echo_return_loss_enhancement = |
| 125 | 10.0 * log10(aec_state_.ErleTimeDomain()); |
| 126 | } |
| 127 | |
peah | cf02cf1 | 2017-04-05 14:18:07 -0700 | [diff] [blame] | 128 | void EchoRemoverImpl::ProcessCapture( |
peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 129 | const EchoPathVariability& echo_path_variability, |
| 130 | bool capture_signal_saturation, |
Per Åhgren | 5c532d3 | 2018-03-22 00:29:25 +0100 | [diff] [blame] | 131 | const rtc::Optional<DelayEstimate>& external_delay, |
Per Åhgren | c59a576 | 2017-12-11 21:34:19 +0100 | [diff] [blame] | 132 | RenderBuffer* render_buffer, |
peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 133 | std::vector<std::vector<float>>* capture) { |
Per Åhgren | ec22e3f | 2017-12-20 15:20:37 +0100 | [diff] [blame] | 134 | const std::vector<std::vector<float>>& x = render_buffer->Block(0); |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 135 | std::vector<std::vector<float>>* y = capture; |
Per Åhgren | c59a576 | 2017-12-11 21:34:19 +0100 | [diff] [blame] | 136 | RTC_DCHECK(render_buffer); |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 137 | RTC_DCHECK(y); |
| 138 | RTC_DCHECK_EQ(x.size(), NumBandsForRate(sample_rate_hz_)); |
| 139 | RTC_DCHECK_EQ(y->size(), NumBandsForRate(sample_rate_hz_)); |
| 140 | RTC_DCHECK_EQ(x[0].size(), kBlockSize); |
| 141 | RTC_DCHECK_EQ((*y)[0].size(), kBlockSize); |
| 142 | const std::vector<float>& x0 = x[0]; |
| 143 | std::vector<float>& y0 = (*y)[0]; |
| 144 | |
peah | 86afe9d | 2017-04-06 15:45:32 -0700 | [diff] [blame] | 145 | data_dumper_->DumpWav("aec3_echo_remover_capture_input", kBlockSize, &y0[0], |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 146 | LowestBandRate(sample_rate_hz_), 1); |
peah | 86afe9d | 2017-04-06 15:45:32 -0700 | [diff] [blame] | 147 | data_dumper_->DumpWav("aec3_echo_remover_render_input", kBlockSize, &x0[0], |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 148 | LowestBandRate(sample_rate_hz_), 1); |
peah | 2910357 | 2017-07-11 02:54:02 -0700 | [diff] [blame] | 149 | data_dumper_->DumpRaw("aec3_echo_remover_capture_input", y0); |
| 150 | data_dumper_->DumpRaw("aec3_echo_remover_render_input", x0); |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 151 | |
| 152 | aec_state_.UpdateCaptureSaturation(capture_signal_saturation); |
| 153 | |
| 154 | if (echo_path_variability.AudioPathChanged()) { |
| 155 | subtractor_.HandleEchoPathChange(echo_path_variability); |
peah | 86afe9d | 2017-04-06 15:45:32 -0700 | [diff] [blame] | 156 | aec_state_.HandleEchoPathChange(echo_path_variability); |
Per Åhgren | 5f1a31c | 2018-03-08 15:54:41 +0100 | [diff] [blame] | 157 | suppression_gain_.SetInitialState(true); |
Per Åhgren | a98c807 | 2018-01-15 19:17:16 +0100 | [diff] [blame] | 158 | initial_state_ = true; |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 159 | } |
| 160 | |
| 161 | std::array<float, kFftLengthBy2Plus1> Y2; |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 162 | std::array<float, kFftLengthBy2Plus1> R2; |
| 163 | std::array<float, kFftLengthBy2Plus1> S2_linear; |
| 164 | std::array<float, kFftLengthBy2Plus1> G; |
peah | 86afe9d | 2017-04-06 15:45:32 -0700 | [diff] [blame] | 165 | float high_bands_gain; |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 166 | FftData Y; |
| 167 | FftData comfort_noise; |
| 168 | FftData high_band_comfort_noise; |
| 169 | SubtractorOutput subtractor_output; |
Per Åhgren | d20639f | 2018-01-11 10:29:49 +0100 | [diff] [blame] | 170 | FftData& E_main_nonwindowed = subtractor_output.E_main_nonwindowed; |
| 171 | auto& E2_main = subtractor_output.E2_main_nonwindowed; |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 172 | auto& E2_shadow = subtractor_output.E2_shadow; |
| 173 | auto& e_main = subtractor_output.e_main; |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 174 | |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 175 | // Analyze the render signal. |
Per Åhgren | 5c532d3 | 2018-03-22 00:29:25 +0100 | [diff] [blame] | 176 | render_signal_analyzer_.Update(*render_buffer, |
| 177 | aec_state_.FilterDelayBlocks()); |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 178 | |
| 179 | // Perform linear echo cancellation. |
Per Åhgren | a98c807 | 2018-01-15 19:17:16 +0100 | [diff] [blame] | 180 | if (initial_state_ && !aec_state_.InitialState()) { |
| 181 | subtractor_.ExitInitialState(); |
Per Åhgren | 5f1a31c | 2018-03-08 15:54:41 +0100 | [diff] [blame] | 182 | suppression_gain_.SetInitialState(false); |
Per Åhgren | a98c807 | 2018-01-15 19:17:16 +0100 | [diff] [blame] | 183 | initial_state_ = false; |
| 184 | } |
Per Åhgren | 5c532d3 | 2018-03-22 00:29:25 +0100 | [diff] [blame] | 185 | |
| 186 | // If the delay is known, use the echo subtractor. |
Per Åhgren | c59a576 | 2017-12-11 21:34:19 +0100 | [diff] [blame] | 187 | subtractor_.Process(*render_buffer, y0, render_signal_analyzer_, aec_state_, |
peah | 86afe9d | 2017-04-06 15:45:32 -0700 | [diff] [blame] | 188 | &subtractor_output); |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 189 | |
| 190 | // Compute spectra. |
Per Åhgren | d20639f | 2018-01-11 10:29:49 +0100 | [diff] [blame] | 191 | fft_.ZeroPaddedFft(y0, Aec3Fft::Window::kRectangular, &Y); |
| 192 | LinearEchoPower(E_main_nonwindowed, Y, &S2_linear); |
Per Åhgren | 8ba5861 | 2017-12-01 23:01:44 +0100 | [diff] [blame] | 193 | Y.Spectrum(optimization_, Y2); |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 194 | |
| 195 | // Update the AEC state information. |
Per Åhgren | 5c532d3 | 2018-03-22 00:29:25 +0100 | [diff] [blame] | 196 | aec_state_.Update(external_delay, subtractor_.FilterFrequencyResponse(), |
peah | 2910357 | 2017-07-11 02:54:02 -0700 | [diff] [blame] | 197 | subtractor_.FilterImpulseResponse(), |
Per Åhgren | 5c532d3 | 2018-03-22 00:29:25 +0100 | [diff] [blame] | 198 | subtractor_.ConvergedFilter(), subtractor_.DivergedFilter(), |
| 199 | *render_buffer, E2_main, Y2, subtractor_output.s_main); |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 200 | |
| 201 | // Choose the linear output. |
Per Åhgren | 5c532d3 | 2018-03-22 00:29:25 +0100 | [diff] [blame] | 202 | data_dumper_->DumpWav("aec3_output_linear2", kBlockSize, &e_main[0], |
| 203 | LowestBandRate(sample_rate_hz_), 1); |
| 204 | output_selector_.FormLinearOutput(aec_state_.UseLinearFilterOutput(), e_main, |
| 205 | y0); |
| 206 | |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 207 | data_dumper_->DumpWav("aec3_output_linear", kBlockSize, &y0[0], |
| 208 | LowestBandRate(sample_rate_hz_), 1); |
peah | 2910357 | 2017-07-11 02:54:02 -0700 | [diff] [blame] | 209 | data_dumper_->DumpRaw("aec3_output_linear", y0); |
Per Åhgren | 5c532d3 | 2018-03-22 00:29:25 +0100 | [diff] [blame] | 210 | const auto& E2 = aec_state_.UseLinearFilterOutput() ? E2_main : Y2; |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 211 | |
| 212 | // Estimate the residual echo power. |
Per Åhgren | c59a576 | 2017-12-11 21:34:19 +0100 | [diff] [blame] | 213 | residual_echo_estimator_.Estimate(aec_state_, *render_buffer, S2_linear, Y2, |
peah | 86afe9d | 2017-04-06 15:45:32 -0700 | [diff] [blame] | 214 | &R2); |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 215 | |
| 216 | // Estimate the comfort noise. |
| 217 | cng_.Compute(aec_state_, Y2, &comfort_noise, &high_band_comfort_noise); |
| 218 | |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 219 | // A choose and apply echo suppression gain. |
Per Åhgren | 7ddd463 | 2017-10-25 02:59:45 +0200 | [diff] [blame] | 220 | suppression_gain_.GetGain(E2, R2, cng_.NoiseSpectrum(), |
| 221 | render_signal_analyzer_, aec_state_, x, |
| 222 | &high_bands_gain, &G); |
peah | 86afe9d | 2017-04-06 15:45:32 -0700 | [diff] [blame] | 223 | suppression_filter_.ApplyGain(comfort_noise, high_band_comfort_noise, G, |
| 224 | high_bands_gain, y); |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 225 | |
peah | e985b3f | 2017-02-28 22:08:53 -0800 | [diff] [blame] | 226 | // Update the metrics. |
| 227 | metrics_.Update(aec_state_, cng_.NoiseSpectrum(), G); |
| 228 | |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 229 | // Debug outputs for the purpose of development and analysis. |
peah | 2910357 | 2017-07-11 02:54:02 -0700 | [diff] [blame] | 230 | data_dumper_->DumpWav("aec3_echo_estimate", kBlockSize, |
| 231 | &subtractor_output.s_main[0], |
| 232 | LowestBandRate(sample_rate_hz_), 1); |
| 233 | data_dumper_->DumpRaw("aec3_output", y0); |
peah | 14c11a4 | 2017-07-11 06:13:43 -0700 | [diff] [blame] | 234 | data_dumper_->DumpRaw("aec3_narrow_render", |
| 235 | render_signal_analyzer_.NarrowPeakBand() ? 1 : 0); |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 236 | data_dumper_->DumpRaw("aec3_N2", cng_.NoiseSpectrum()); |
| 237 | data_dumper_->DumpRaw("aec3_suppressor_gain", G); |
| 238 | data_dumper_->DumpWav("aec3_output", |
| 239 | rtc::ArrayView<const float>(&y0[0], kBlockSize), |
| 240 | LowestBandRate(sample_rate_hz_), 1); |
| 241 | data_dumper_->DumpRaw("aec3_using_subtractor_output", |
Per Åhgren | 5c532d3 | 2018-03-22 00:29:25 +0100 | [diff] [blame] | 242 | aec_state_.UseLinearFilterOutput() ? 1 : 0); |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 243 | data_dumper_->DumpRaw("aec3_E2", E2); |
| 244 | data_dumper_->DumpRaw("aec3_E2_main", E2_main); |
| 245 | data_dumper_->DumpRaw("aec3_E2_shadow", E2_shadow); |
| 246 | data_dumper_->DumpRaw("aec3_S2_linear", S2_linear); |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 247 | data_dumper_->DumpRaw("aec3_Y2", Y2); |
Per Åhgren | c59a576 | 2017-12-11 21:34:19 +0100 | [diff] [blame] | 248 | data_dumper_->DumpRaw("aec3_X2", render_buffer->Spectrum(0)); |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 249 | data_dumper_->DumpRaw("aec3_R2", R2); |
| 250 | data_dumper_->DumpRaw("aec3_erle", aec_state_.Erle()); |
| 251 | data_dumper_->DumpRaw("aec3_erl", aec_state_.Erl()); |
Per Åhgren | 5c532d3 | 2018-03-22 00:29:25 +0100 | [diff] [blame] | 252 | data_dumper_->DumpRaw("aec3_filter_delay", aec_state_.FilterDelayBlocks()); |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 253 | data_dumper_->DumpRaw("aec3_capture_saturation", |
| 254 | aec_state_.SaturatedCapture() ? 1 : 0); |
| 255 | } |
peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 256 | |
| 257 | } // namespace |
| 258 | |
Gustaf Ullberg | bd83b91 | 2017-10-18 12:32:42 +0200 | [diff] [blame] | 259 | EchoRemover* EchoRemover::Create(const EchoCanceller3Config& config, |
| 260 | int sample_rate_hz) { |
peah | 697a590 | 2017-06-30 07:06:10 -0700 | [diff] [blame] | 261 | return new EchoRemoverImpl(config, sample_rate_hz); |
peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 262 | } |
| 263 | |
| 264 | } // namespace webrtc |