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

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

Issue 1810773003: Fixing UpdateLevel function in AEC. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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 | no next file » | 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 1b5f03fec4e7a255f25c681218bbb7470ebc0770..4de7812a528c4b24edfbb07ec868e799d79a6b49 100644
--- a/webrtc/modules/audio_processing/aec/aec_core.cc
+++ b/webrtc/modules/audio_processing/aec/aec_core.cc
@@ -568,12 +568,12 @@ static float CalculatePower(const float* in, size_t num_samples) {
return energy / num_samples;
}
-static void UpdateLevel(PowerLevel* level, float energy) {
- level->sfrsum += energy;
+static void UpdateLevel(PowerLevel* level, float power) {
+ level->sfrsum += power;
level->sfrcounter++;
if (level->sfrcounter > subCountLen) {
- level->framelevel = level->sfrsum / (subCountLen * PART_LEN);
+ level->framelevel = level->sfrsum / subCountLen;
level->sfrsum = 0;
level->sfrcounter = 0;
if (level->framelevel > 0) {
@@ -600,11 +600,7 @@ static void UpdateMetrics(AecCore* aec) {
const float actThresholdClean = 40.0f;
const float safety = 0.99995f;
- // To make noisePower consistent with the legacy code, a factor of
- // 2.0f / PART_LEN2 is applied to noisyPower, since the legacy code uses
- // the energy of a frame as the audio levels, while the new code uses a
- // a per-sample energy (i.e., power).
- const float noisyPower = 300000.0f * 2.0f / PART_LEN2;
+ const float noisyPower = 300000.0f;
float actThreshold;
float echo, suppressedEcho;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698