Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(984)

Side by Side Diff: webrtc/modules/audio_processing/audio_processing_impl.cc

Issue 2486763002: Add support to audioproc_f for running the residual echo detector and producing an echo likelihood … (Closed)
Patch Set: Initial version Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 182
183 changed |= first_update_; 183 changed |= first_update_;
184 first_update_ = false; 184 first_update_ = false;
185 return changed; 185 return changed;
186 } 186 }
187 187
188 bool AudioProcessingImpl::ApmSubmoduleStates::CaptureMultiBandSubModulesActive() 188 bool AudioProcessingImpl::ApmSubmoduleStates::CaptureMultiBandSubModulesActive()
189 const { 189 const {
190 #if WEBRTC_INTELLIGIBILITY_ENHANCER 190 #if WEBRTC_INTELLIGIBILITY_ENHANCER
191 return CaptureMultiBandProcessingActive() || 191 return CaptureMultiBandProcessingActive() ||
192 intelligibility_enhancer_enabled_ || voice_activity_detector_enabled_; 192 intelligibility_enhancer_enabled_ ||
peah-webrtc 2016/11/10 10:47:09 Great catch! I missed that when reviewing the othe
ivoc 2016/11/10 15:36:08 Good point, I will make a new CL for these changes
193 voice_activity_detector_enabled_ || residual_echo_detector_enabled_;
193 #else 194 #else
194 return CaptureMultiBandProcessingActive() || voice_activity_detector_enabled_; 195 return CaptureMultiBandProcessingActive() ||
196 voice_activity_detector_enabled_ || residual_echo_detector_enabled_;
195 #endif 197 #endif
196 } 198 }
197 199
198 bool AudioProcessingImpl::ApmSubmoduleStates::CaptureMultiBandProcessingActive() 200 bool AudioProcessingImpl::ApmSubmoduleStates::CaptureMultiBandProcessingActive()
199 const { 201 const {
200 return high_pass_filter_enabled_ || echo_canceller_enabled_ || 202 return high_pass_filter_enabled_ || echo_canceller_enabled_ ||
201 mobile_echo_controller_enabled_ || noise_suppressor_enabled_ || 203 mobile_echo_controller_enabled_ || noise_suppressor_enabled_ ||
202 beamformer_enabled_ || adaptive_gain_controller_enabled_; 204 beamformer_enabled_ || adaptive_gain_controller_enabled_;
203 } 205 }
204 206
205 bool AudioProcessingImpl::ApmSubmoduleStates::RenderMultiBandSubModulesActive() 207 bool AudioProcessingImpl::ApmSubmoduleStates::RenderMultiBandSubModulesActive()
206 const { 208 const {
207 return RenderMultiBandProcessingActive() || echo_canceller_enabled_ || 209 return RenderMultiBandProcessingActive() || echo_canceller_enabled_ ||
peah-webrtc 2016/11/10 10:47:09 You need to add "|| residual_echo_detector_enabled
ivoc 2016/11/10 15:36:08 Good point. I will add it to the other CL.
208 mobile_echo_controller_enabled_ || adaptive_gain_controller_enabled_; 210 mobile_echo_controller_enabled_ || adaptive_gain_controller_enabled_;
209 } 211 }
210 212
211 bool AudioProcessingImpl::ApmSubmoduleStates::RenderMultiBandProcessingActive() 213 bool AudioProcessingImpl::ApmSubmoduleStates::RenderMultiBandProcessingActive()
212 const { 214 const {
213 #if WEBRTC_INTELLIGIBILITY_ENHANCER 215 #if WEBRTC_INTELLIGIBILITY_ENHANCER
214 return intelligibility_enhancer_enabled_; 216 return intelligibility_enhancer_enabled_;
215 #else 217 #else
216 return false; 218 return false;
217 #endif 219 #endif
(...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after
1489 EchoCancellation::Metrics metrics; 1491 EchoCancellation::Metrics metrics;
1490 int success = public_submodules_->echo_cancellation->GetMetrics(&metrics); 1492 int success = public_submodules_->echo_cancellation->GetMetrics(&metrics);
1491 if (success == Error::kNoError) { 1493 if (success == Error::kNoError) {
1492 stats.a_nlp.Set(metrics.a_nlp); 1494 stats.a_nlp.Set(metrics.a_nlp);
1493 stats.divergent_filter_fraction = metrics.divergent_filter_fraction; 1495 stats.divergent_filter_fraction = metrics.divergent_filter_fraction;
1494 stats.echo_return_loss.Set(metrics.echo_return_loss); 1496 stats.echo_return_loss.Set(metrics.echo_return_loss);
1495 stats.echo_return_loss_enhancement.Set( 1497 stats.echo_return_loss_enhancement.Set(
1496 metrics.echo_return_loss_enhancement); 1498 metrics.echo_return_loss_enhancement);
1497 stats.residual_echo_return_loss.Set(metrics.residual_echo_return_loss); 1499 stats.residual_echo_return_loss.Set(metrics.residual_echo_return_loss);
1498 } 1500 }
1501 stats.residual_echo_likelihood =
1502 private_submodules_->residual_echo_detector->echo_likelihood();
1499 public_submodules_->echo_cancellation->GetDelayMetrics( 1503 public_submodules_->echo_cancellation->GetDelayMetrics(
1500 &stats.delay_median, &stats.delay_standard_deviation, 1504 &stats.delay_median, &stats.delay_standard_deviation,
1501 &stats.fraction_poor_delays); 1505 &stats.fraction_poor_delays);
1502 return stats; 1506 return stats;
1503 } 1507 }
1504 1508
1505 EchoCancellation* AudioProcessingImpl::echo_cancellation() const { 1509 EchoCancellation* AudioProcessingImpl::echo_cancellation() const {
1506 return public_submodules_->echo_cancellation.get(); 1510 return public_submodules_->echo_cancellation.get();
1507 } 1511 }
1508 1512
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
1823 capture_processing_format(kSampleRate16kHz), 1827 capture_processing_format(kSampleRate16kHz),
1824 split_rate(kSampleRate16kHz) {} 1828 split_rate(kSampleRate16kHz) {}
1825 1829
1826 AudioProcessingImpl::ApmCaptureState::~ApmCaptureState() = default; 1830 AudioProcessingImpl::ApmCaptureState::~ApmCaptureState() = default;
1827 1831
1828 AudioProcessingImpl::ApmRenderState::ApmRenderState() = default; 1832 AudioProcessingImpl::ApmRenderState::ApmRenderState() = default;
1829 1833
1830 AudioProcessingImpl::ApmRenderState::~ApmRenderState() = default; 1834 AudioProcessingImpl::ApmRenderState::~ApmRenderState() = default;
1831 1835
1832 } // namespace webrtc 1836 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698