Make the extra seturation margin configurable.
The extra saturation margin is a setting for the SaturationProtector
in GainController2. The higher it is, the less gain GC2 will apply. In
this CL we pipe the setting up to audio_processing.h. Now the setting
can be set at a high level.
Also in this CL add a few (missing, they should have been there
already) tests for the GC2 and GC2 with saturation margin.
Bug: webrtc:7494
Change-Id: I1b61f1662e6c6a8817fd5b0e845339694bf8d50d
Reviewed-on: https://webrtc-review.googlesource.com/c/109001
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25470}diff --git a/modules/audio_processing/gain_controller2.h b/modules/audio_processing/gain_controller2.h
index b4727d0..b49b8d0 100644
--- a/modules/audio_processing/gain_controller2.h
+++ b/modules/audio_processing/gain_controller2.h
@@ -45,7 +45,7 @@
std::unique_ptr<ApmDataDumper> data_dumper_;
FixedGainController fixed_gain_controller_;
AudioProcessing::Config::GainController2 config_;
- AdaptiveAgc adaptive_agc_;
+ std::unique_ptr<AdaptiveAgc> adaptive_agc_;
int analog_level_ = -1;
bool adaptive_digital_mode_ = true;