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

Unified Diff: webrtc/modules/audio_processing/aec3/main_filter_update_gain_unittest.cc

Issue 2974583004: Transparency improvements in the echo canceller 3 (Closed)
Patch Set: Corrected wrong echo estimate vector in unittest Created 3 years, 5 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
Index: webrtc/modules/audio_processing/aec3/main_filter_update_gain_unittest.cc
diff --git a/webrtc/modules/audio_processing/aec3/main_filter_update_gain_unittest.cc b/webrtc/modules/audio_processing/aec3/main_filter_update_gain_unittest.cc
index fc33e12a6c7f33d06d8ec1add73e1bf0a1bea20b..6e8a80b532a95090eb0a4f0b0c356962198cecc8 100644
--- a/webrtc/modules/audio_processing/aec3/main_filter_update_gain_unittest.cc
+++ b/webrtc/modules/audio_processing/aec3/main_filter_update_gain_unittest.cc
@@ -55,7 +55,8 @@ void RunFilterUpdateTest(int num_blocks_to_process,
std::vector<float> y(kBlockSize, 0.f);
AecState aec_state(0.f);
RenderSignalAnalyzer render_signal_analyzer;
- std::array<float, kFftLength> s;
+ std::array<float, kFftLength> s_scratch;
+ std::array<float, kBlockSize> s;
FftData S;
FftData G;
SubtractorOutput output;
@@ -96,18 +97,21 @@ void RunFilterUpdateTest(int num_blocks_to_process,
// Apply the main filter.
main_filter.Filter(render_buffer, &S);
- fft.Ifft(S, &s);
- std::transform(y.begin(), y.end(), s.begin() + kFftLengthBy2,
+ fft.Ifft(S, &s_scratch);
+ std::transform(y.begin(), y.end(), s_scratch.begin() + kFftLengthBy2,
e_main.begin(),
[&](float a, float b) { return a - b * kScale; });
std::for_each(e_main.begin(), e_main.end(),
[](float& a) { a = rtc::SafeClamp(a, -32768.f, 32767.f); });
fft.ZeroPaddedFft(e_main, &E_main);
+ for (size_t k = 0; k < kBlockSize; ++k) {
+ s[k] = kScale * s_scratch[k + kFftLengthBy2];
+ }
// Apply the shadow filter.
shadow_filter.Filter(render_buffer, &S);
- fft.Ifft(S, &s);
- std::transform(y.begin(), y.end(), s.begin() + kFftLengthBy2,
+ fft.Ifft(S, &s_scratch);
+ std::transform(y.begin(), y.end(), s_scratch.begin() + kFftLengthBy2,
e_shadow.begin(),
[&](float a, float b) { return a - b * kScale; });
std::for_each(e_shadow.begin(), e_shadow.end(),
@@ -131,8 +135,9 @@ void RunFilterUpdateTest(int num_blocks_to_process,
// Update the delay.
aec_state.HandleEchoPathChange(EchoPathVariability(false, false));
aec_state.Update(main_filter.FilterFrequencyResponse(),
+ main_filter.FilterImpulseResponse(),
rtc::Optional<size_t>(), render_buffer, E2_main, Y2, x[0],
- false);
+ s, false);
}
std::copy(e_main.begin(), e_main.end(), e_last_block->begin());
« no previous file with comments | « webrtc/modules/audio_processing/aec3/echo_remover.cc ('k') | webrtc/modules/audio_processing/aec3/residual_echo_estimator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698