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

Unified Diff: webrtc/modules/audio_processing/audio_processing_impl.cc

Issue 2112553003: Compensate for the LevelController gain in the IntelligibilityEnhancer (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebasing Created 4 years, 6 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_processing/audio_processing_impl.cc
diff --git a/webrtc/modules/audio_processing/audio_processing_impl.cc b/webrtc/modules/audio_processing/audio_processing_impl.cc
index b0433efa8cb3045214195ea62981524cfdffb2a5..afeebba4e5774ed40c9056eaec163663c2b6b3bf 100644
--- a/webrtc/modules/audio_processing/audio_processing_impl.cc
+++ b/webrtc/modules/audio_processing/audio_processing_impl.cc
@@ -728,8 +728,12 @@ int AudioProcessingImpl::ProcessStreamLocked() {
int gain_db = public_submodules_->gain_control->is_enabled() ?
public_submodules_->gain_control->compression_gain_db() :
0;
+ float gain = std::pow(10.f, gain_db / 20.f);
+ gain *= capture_nonlocked_.level_controller_enabled ?
+ private_submodules_->level_controller->GetLastGain() :
+ 1.f;
public_submodules_->intelligibility_enhancer->SetCaptureNoiseEstimate(
- public_submodules_->noise_suppression->NoiseEstimate(), gain_db);
+ public_submodules_->noise_suppression->NoiseEstimate(), gain);
}
// Ensure that the stream delay was set before the call to the
« no previous file with comments | « no previous file | webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698