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

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

Issue 1454983006: Ducking fix #2: Removed the aec state as an input parameter to the FilterFar function. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@Aec_Code_Cleanup_CL
Patch Set: Corrected line alignment Created 5 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 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.c
diff --git a/webrtc/modules/audio_processing/aec/aec_core.c b/webrtc/modules/audio_processing/aec/aec_core.c
index a6b9db03da3dafa21536fe686ef773d410534139..91b55b6acd3159ee64cf3b79036d09c43aea8787 100644
--- a/webrtc/modules/audio_processing/aec/aec_core.c
+++ b/webrtc/modules/audio_processing/aec/aec_core.c
@@ -151,26 +151,30 @@ static int CmpFloat(const void* a, const void* b) {
return (*da > *db) - (*da < *db);
}
-static void FilterFar(AecCore* aec, float yf[2][PART_LEN1]) {
+static void FilterFar(int num_partitions,
+ int x_fft_buffer_block_pos,
+ float x_fft_buffer[2][kExtendedNumPartitions * PART_LEN1],
+ float h_fft_buffer[2][kExtendedNumPartitions * PART_LEN1],
+ float y_fft[2][PART_LEN1]) {
int i;
- for (i = 0; i < aec->num_partitions; i++) {
+ for (i = 0; i < num_partitions; i++) {
int j;
- int xPos = (i + aec->xfBufBlockPos) * PART_LEN1;
+ int x_pos = (i + x_fft_buffer_block_pos) * PART_LEN1;
int pos = i * PART_LEN1;
- // Check for wrap
- if (i + aec->xfBufBlockPos >= aec->num_partitions) {
- xPos -= aec->num_partitions * (PART_LEN1);
+ // Check for wrapped buffer.
+ if (i + x_fft_buffer_block_pos >= num_partitions) {
+ x_pos -= num_partitions * (PART_LEN1);
}
for (j = 0; j < PART_LEN1; j++) {
- yf[0][j] += MulRe(aec->xfBuf[0][xPos + j],
- aec->xfBuf[1][xPos + j],
- aec->wfBuf[0][pos + j],
- aec->wfBuf[1][pos + j]);
- yf[1][j] += MulIm(aec->xfBuf[0][xPos + j],
- aec->xfBuf[1][xPos + j],
- aec->wfBuf[0][pos + j],
- aec->wfBuf[1][pos + j]);
+ y_fft[0][j] += MulRe(x_fft_buffer[0][x_pos + j],
+ x_fft_buffer[1][x_pos + j],
+ h_fft_buffer[0][pos + j],
+ h_fft_buffer[1][pos + j]);
+ y_fft[1][j] += MulIm(x_fft_buffer[0][x_pos + j],
+ x_fft_buffer[1][x_pos + j],
+ h_fft_buffer[0][pos + j],
+ h_fft_buffer[1][pos + j]);
}
}
}
@@ -971,7 +975,11 @@ static void EchoSubtraction(AecCore* aec,
memset(yf, 0, sizeof(yf));
// Produce frequency domain echo estimate.
- WebRtcAec_FilterFar(aec, yf);
+ WebRtcAec_FilterFar(aec->num_partitions,
+ aec->xfBufBlockPos,
+ aec->xfBuf,
+ aec->wfBuf,
+ yf);
// Inverse fft to obtain echo estimate and error.
FrequencyToTime(yf, fft);
« 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