Removed the updating of the padding data buffer in the AEC3 FFT

This CL removes the updating of the buffered data used to to pad the
64 sample blocks to 128 samples FFTs. As that padding was used
incorrectly in one place this resolves an important issue.


Bug: webrtc:9159,chromium:833801,webrtc:9206
Change-Id: Ie6830878ebec6130b61d4e7e3169357f2e253073
Reviewed-on: https://webrtc-review.googlesource.com/73240
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23059}
This commit is contained in:
Per Åhgren 2018-04-27 14:22:37 +02:00 committed by Commit Bot
parent 033050c50f
commit 658ad8816b
3 changed files with 4 additions and 4 deletions

View File

@ -98,7 +98,7 @@ void Aec3Fft::ZeroPaddedFft(rtc::ArrayView<const float> x,
}
void Aec3Fft::PaddedFft(rtc::ArrayView<const float> x,
rtc::ArrayView<float> x_old,
rtc::ArrayView<const float> x_old,
Window window,
FftData* X) const {
RTC_DCHECK(X);
@ -110,7 +110,6 @@ void Aec3Fft::PaddedFft(rtc::ArrayView<const float> x,
case Window::kRectangular:
std::copy(x_old.begin(), x_old.end(), fft.begin());
std::copy(x.begin(), x.end(), fft.begin() + x_old.size());
std::copy(x.begin(), x.end(), x_old.begin());
break;
case Window::kHanning:
RTC_NOTREACHED();

View File

@ -51,14 +51,14 @@ class Aec3Fft {
// Concatenates the kFftLengthBy2 values long x and x_old before computing the
// Fft. After that, x is copied to x_old.
void PaddedFft(rtc::ArrayView<const float> x,
rtc::ArrayView<float> x_old,
rtc::ArrayView<const float> x_old,
FftData* X) const {
PaddedFft(x, x_old, Window::kRectangular, X);
}
// Padded Fft using a time-domain window.
void PaddedFft(rtc::ArrayView<const float> x,
rtc::ArrayView<float> x_old,
rtc::ArrayView<const float> x_old,
Window window,
FftData* X) const;

View File

@ -199,6 +199,7 @@ TEST(Aec3Fft, PaddedFft) {
std::for_each(x_ref.begin(), x_ref.end(), [](float& a) { a *= 64.f; });
fft.PaddedFft(x_in, x_old, &X);
std::copy(x_in.begin(), x_in.end(), x_old.begin());
fft.Ifft(X, &x_out);
for (size_t j = 0; j < x_out.size(); ++j) {