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

Unified Diff: webrtc/modules/audio_processing/aec/aec_core.cc

Issue 1943753002: Separated the functionalities in the OverdriveAndSuppress method in the AEC into two methods (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@RefactorAec5_CL
Patch Set: Added const specifier to local pointer Created 4 years, 7 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/aec/aec_core_internal.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_processing/aec/aec_core.cc
diff --git a/webrtc/modules/audio_processing/aec/aec_core.cc b/webrtc/modules/audio_processing/aec/aec_core.cc
index 0168a3d227e9753f091a5ede51c5d82bb62cca22..2cd39749ac687404c975812c756e6fd920b164b9 100644
--- a/webrtc/modules/audio_processing/aec/aec_core.cc
+++ b/webrtc/modules/audio_processing/aec/aec_core.cc
@@ -131,7 +131,8 @@ enum { kPrefBandSize = 24 };
WebRtcAecFilterFar WebRtcAec_FilterFar;
WebRtcAecScaleErrorSignal WebRtcAec_ScaleErrorSignal;
WebRtcAecFilterAdaptation WebRtcAec_FilterAdaptation;
-WebRtcAecOverdriveAndSuppress WebRtcAec_OverdriveAndSuppress;
+WebRtcAecOverdrive WebRtcAec_Overdrive;
+WebRtcAecSuppress WebRtcAec_Suppress;
WebRtcAecComputeCoherence WebRtcAec_ComputeCoherence;
WebRtcAecUpdateCoherenceSpectra WebRtcAec_UpdateCoherenceSpectra;
WebRtcAecStoreAsComplex WebRtcAec_StoreAsComplex;
@@ -307,19 +308,21 @@ static void FilterAdaptation(
}
}
-static void OverdriveAndSuppress(float overdrive_scaling,
- float hNl[PART_LEN1],
- const float hNlFb,
- float efw[2][PART_LEN1]) {
- int i;
- for (i = 0; i < PART_LEN1; i++) {
+static void Overdrive(float overdrive_scaling,
+ const float hNlFb,
+ float hNl[PART_LEN1]) {
+ for (int i = 0; i < PART_LEN1; ++i) {
// Weight subbands
if (hNl[i] > hNlFb) {
hNl[i] = WebRtcAec_weightCurve[i] * hNlFb +
(1 - WebRtcAec_weightCurve[i]) * hNl[i];
}
hNl[i] = powf(hNl[i], overdrive_scaling * WebRtcAec_overDriveCurve[i]);
+ }
+}
+static void Suppress(const float hNl[PART_LEN1], float efw[2][PART_LEN1]) {
+ for (int i = 0; i < PART_LEN1; ++i) {
// Suppress error signal
efw[0][i] *= hNl[i];
efw[1][i] *= hNl[i];
@@ -1157,7 +1160,8 @@ static void EchoSuppression(AecCore* aec,
0.9f * aec->overdrive_scaling + 0.1f * aec->overDrive;
}
- WebRtcAec_OverdriveAndSuppress(aec->overdrive_scaling, hNl, hNlFb, efw);
+ WebRtcAec_Overdrive(aec->overdrive_scaling, hNlFb, hNl);
+ WebRtcAec_Suppress(hNl, efw);
// Add comfort noise.
ComfortNoise(aec, efw, comfortNoiseHband, aec->noisePow, hNl);
@@ -1477,7 +1481,8 @@ AecCore* WebRtcAec_CreateAec(int instance_count) {
WebRtcAec_FilterFar = FilterFar;
WebRtcAec_ScaleErrorSignal = ScaleErrorSignal;
WebRtcAec_FilterAdaptation = FilterAdaptation;
- WebRtcAec_OverdriveAndSuppress = OverdriveAndSuppress;
+ WebRtcAec_Overdrive = Overdrive;
+ WebRtcAec_Suppress = Suppress;
WebRtcAec_ComputeCoherence = ComputeCoherence;
WebRtcAec_UpdateCoherenceSpectra = UpdateCoherenceSpectra;
WebRtcAec_StoreAsComplex = StoreAsComplex;
« no previous file with comments | « no previous file | webrtc/modules/audio_processing/aec/aec_core_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698