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" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 residual_echo_estimator_.Estimate(output_selector_.UseSubtractorOutput(), | 175 residual_echo_estimator_.Estimate(output_selector_.UseSubtractorOutput(), |
176 aec_state_, render_buffer, S2_linear, Y2, | 176 aec_state_, render_buffer, S2_linear, Y2, |
177 &R2); | 177 &R2); |
178 | 178 |
179 // Estimate the comfort noise. | 179 // Estimate the comfort noise. |
180 cng_.Compute(aec_state_, Y2, &comfort_noise, &high_band_comfort_noise); | 180 cng_.Compute(aec_state_, Y2, &comfort_noise, &high_band_comfort_noise); |
181 | 181 |
182 // A choose and apply echo suppression gain. | 182 // A choose and apply echo suppression gain. |
183 suppression_gain_.GetGain(E2, R2, cng_.NoiseSpectrum(), | 183 suppression_gain_.GetGain(E2, R2, cng_.NoiseSpectrum(), |
184 aec_state_.SaturatedEcho(), x, y->size(), | 184 aec_state_.SaturatedEcho(), x, y->size(), |
185 &high_bands_gain, &G); | 185 aec_state_.ForcedZeroGain(), &high_bands_gain, &G); |
186 suppression_filter_.ApplyGain(comfort_noise, high_band_comfort_noise, G, | 186 suppression_filter_.ApplyGain(comfort_noise, high_band_comfort_noise, G, |
187 high_bands_gain, y); | 187 high_bands_gain, y); |
188 | 188 |
189 // Update the metrics. | 189 // Update the metrics. |
190 metrics_.Update(aec_state_, cng_.NoiseSpectrum(), G); | 190 metrics_.Update(aec_state_, cng_.NoiseSpectrum(), G); |
191 | 191 |
192 // Debug outputs for the purpose of development and analysis. | 192 // Debug outputs for the purpose of development and analysis. |
193 data_dumper_->DumpRaw("aec3_N2", cng_.NoiseSpectrum()); | 193 data_dumper_->DumpRaw("aec3_N2", cng_.NoiseSpectrum()); |
194 data_dumper_->DumpRaw("aec3_suppressor_gain", G); | 194 data_dumper_->DumpRaw("aec3_suppressor_gain", G); |
195 data_dumper_->DumpWav("aec3_output", | 195 data_dumper_->DumpWav("aec3_output", |
(...skipping 23 matching lines...) Expand all Loading... |
219 aec_state_.SaturatedCapture() ? 1 : 0); | 219 aec_state_.SaturatedCapture() ? 1 : 0); |
220 } | 220 } |
221 | 221 |
222 } // namespace | 222 } // namespace |
223 | 223 |
224 EchoRemover* EchoRemover::Create(int sample_rate_hz) { | 224 EchoRemover* EchoRemover::Create(int sample_rate_hz) { |
225 return new EchoRemoverImpl(sample_rate_hz); | 225 return new EchoRemoverImpl(sample_rate_hz); |
226 } | 226 } |
227 | 227 |
228 } // namespace webrtc | 228 } // namespace webrtc |
OLD | NEW |