From 9ce0c7a2d2b4e1f6f85b44dd6face675309e4f07 Mon Sep 17 00:00:00 2001 From: Alex Loiko Date: Wed, 18 Oct 2017 13:24:58 +0200 Subject: [PATCH] Improving APM fuzzer coverage. Reading the fuzzer coverage report for audio_processing_fuzzer, I noticed that AgcManagerDirect::AnalyzePreProcess was never called. That turned out to be because GainControl was never enabled. This change optionally calls 'Enable' on GainControl and 6 other public submodules of the APM. Bug: webrtc:7820 Change-Id: Iae9da16f9f14fe7d3cd3318836d0d6e131a7ac39 Reviewed-on: https://webrtc-review.googlesource.com/12924 Reviewed-by: Henrik Lundin Commit-Queue: Alex Loiko Cr-Commit-Position: refs/heads/master@{#20334} --- .../audio_processing_fuzzer_configs.cc | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/test/fuzzers/audio_processing_fuzzer_configs.cc b/test/fuzzers/audio_processing_fuzzer_configs.cc index 5c60605fa0..294090fad1 100644 --- a/test/fuzzers/audio_processing_fuzzer_configs.cc +++ b/test/fuzzers/audio_processing_fuzzer_configs.cc @@ -31,8 +31,17 @@ std::unique_ptr CreateAPM(const uint8_t** data, auto hpf = ParseBool(data, remaining_size); auto aec3 = ParseBool(data, remaining_size); + auto use_aec = ParseBool(data, remaining_size); + auto use_aecm = ParseBool(data, remaining_size); + auto use_agc = ParseBool(data, remaining_size); + auto use_ns = ParseBool(data, remaining_size); + auto use_le = ParseBool(data, remaining_size); + auto use_vad = ParseBool(data, remaining_size); + auto use_agc_limiter = ParseBool(data, remaining_size); + if (!(exp_agc && exp_ns && bf && ef && raf && da && ie && red && lc && hpf && - aec3)) { + aec3 && use_aec && use_aecm && use_agc && use_ns && use_le && use_vad && + use_agc_limiter)) { return nullptr; } @@ -60,6 +69,14 @@ std::unique_ptr CreateAPM(const uint8_t** data, apm->ApplyConfig(apm_config); + apm->echo_cancellation()->Enable(*use_aec); + apm->echo_control_mobile()->Enable(*use_aecm); + apm->gain_control()->Enable(*use_agc); + apm->noise_suppression()->Enable(*use_ns); + apm->level_estimator()->Enable(*use_le); + apm->voice_detection()->Enable(*use_vad); + apm->gain_control()->enable_limiter(*use_agc_limiter); + return apm; }