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

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

Issue 1936203002: Made the method PartitionDelay independent of the AEC state. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@RefactorAec3_CL
Patch Set: Rebase 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 26e40cc561ffd7f520c66cb8603ba6009b7a816c..e0ed4ae0245506e5514523abdfdab08538c2885e 100644
--- a/webrtc/modules/audio_processing/aec/aec_core.cc
+++ b/webrtc/modules/audio_processing/aec/aec_core.cc
@@ -329,7 +329,9 @@ static void OverdriveAndSuppress(float overdrive_scaling,
}
}
-static int PartitionDelay(const AecCore* aec) {
+static int PartitionDelay(int num_partitions,
+ float h_fft_buf[2]
+ [kExtendedNumPartitions * PART_LEN1]) {
// Measures the energy in each filter partition and returns the partition with
// highest energy.
// TODO(bjornv): Spread computational cost by computing one partition per
@@ -338,13 +340,13 @@ static int PartitionDelay(const AecCore* aec) {
int i;
int delay = 0;
- for (i = 0; i < aec->num_partitions; i++) {
+ for (i = 0; i < num_partitions; i++) {
int j;
int pos = i * PART_LEN1;
float wfEn = 0;
for (j = 0; j < PART_LEN1; j++) {
- wfEn += aec->wfBuf[0][pos + j] * aec->wfBuf[0][pos + j] +
- aec->wfBuf[1][pos + j] * aec->wfBuf[1][pos + j];
+ wfEn += h_fft_buf[0][pos + j] * h_fft_buf[0][pos + j] +
+ h_fft_buf[1][pos + j] * h_fft_buf[1][pos + j];
}
if (wfEn > wfEnMax) {
@@ -1053,7 +1055,7 @@ static void EchoSuppression(AecCore* aec,
aec->delayEstCtr++;
if (aec->delayEstCtr == delayEstInterval) {
aec->delayEstCtr = 0;
- aec->delayIdx = WebRtcAec_PartitionDelay(aec);
+ aec->delayIdx = WebRtcAec_PartitionDelay(aec->num_partitions, aec->wfBuf);
}
// Use delayed far.
« 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