Optionally disable digital adaptive AGC2.
The AGC2 is enabled by flipping
AudioProcessing::Config::GainController2::enabled. The flag enables
both AdaptiveAgc and FixedGainController. Before this CL, there was no
way(*) to only enable the FixedGainController. After this CL, it's
also possible to flip the setting
|AudioProcessing::Config::GainController2::adaptive_digital_mode|. The
default is |true|, which is the previous behavior.
* Except for instantiating and setting it up outside of the APM like
it's done in the AudioMixer.
Bug: webrtc:7494
Change-Id: I506e93b6687221ac467f083fa8db3d45c98c1b83
Reviewed-on: https://webrtc-review.googlesource.com/95426
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Per Ã…hgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24432}
diff --git a/modules/audio_processing/include/audio_processing.h b/modules/audio_processing/include/audio_processing.h
index 9c750f0..22fa92d 100644
--- a/modules/audio_processing/include/audio_processing.h
+++ b/modules/audio_processing/include/audio_processing.h
@@ -273,12 +273,15 @@
float fixed_gain_factor = 1.f;
} pre_amplifier;
- // Enables the next generation AGC functionality. This feature
- // replaces the standard methods of gain control in the previous
- // AGC. This functionality is currently only partially
- // implemented.
+ // Enables the next generation AGC functionality. This feature replaces the
+ // standard methods of gain control in the previous AGC. Enabling this
+ // submodule enables an adaptive digital AGC followed by a limiter. By
+ // setting |fixed_gain_db|, the limiter can be turned into a compressor that
+ // first applies a fixed gain. The adaptive digital AGC can be turned off by
+ // setting |adaptive_digital_mode=false|.
struct GainController2 {
bool enabled = false;
+ bool adaptive_digital_mode = true;
float fixed_gain_db = 0.f;
} gain_controller2;