mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-20 00:57:49 +01:00
Hooked up the control of the adaptive AGC2 mode in audioproc_f
This CL adds the ability to toggle the AGC2 adaptive digital mode in audioproc_f Bug: webrtc:5298 Change-Id: If1567d8c87f88992dff89253edb293a56cee0a73 Reviewed-on: https://webrtc-review.googlesource.com/c/103361 Reviewed-by: Alex Loiko <aleloi@webrtc.org> Commit-Queue: Per Åhgren <peah@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24954}
This commit is contained in:
parent
5c25010c86
commit
e4d23b1adf
3 changed files with 10 additions and 0 deletions
|
@ -918,6 +918,10 @@ void AudioProcessingSimulator::CreateAudioProcessor() {
|
|||
if (settings_.use_agc2) {
|
||||
apm_config.gain_controller2.enabled = *settings_.use_agc2;
|
||||
apm_config.gain_controller2.fixed_gain_db = settings_.agc2_fixed_gain_db;
|
||||
if (settings_.agc2_use_adaptive_gain) {
|
||||
apm_config.gain_controller2.adaptive_digital_mode =
|
||||
*settings_.agc2_use_adaptive_gain;
|
||||
}
|
||||
}
|
||||
if (settings_.use_pre_amplifier) {
|
||||
apm_config.pre_amplifier.enabled = *settings_.use_pre_amplifier;
|
||||
|
|
|
@ -73,6 +73,7 @@ struct SimulationSettings {
|
|||
absl::optional<int> agc_target_level;
|
||||
absl::optional<bool> use_agc_limiter;
|
||||
absl::optional<int> agc_compression_gain;
|
||||
absl::optional<bool> agc2_use_adaptive_gain;
|
||||
float agc2_fixed_gain_db;
|
||||
float pre_amplifier_gain_factor;
|
||||
absl::optional<int> vad_likelihood;
|
||||
|
|
|
@ -139,6 +139,9 @@ DEFINE_int(agc_limiter,
|
|||
DEFINE_int(agc_compression_gain,
|
||||
kParameterNotSpecifiedValue,
|
||||
"Specify the AGC compression gain (0-90)");
|
||||
DEFINE_float(agc2_enable_adaptive_gain,
|
||||
kParameterNotSpecifiedValue,
|
||||
"Activate (1) or deactivate(0) the AGC2 adaptive gain");
|
||||
DEFINE_float(agc2_fixed_gain_db, 0.f, "AGC2 fixed gain (dB) to apply");
|
||||
DEFINE_float(pre_amplifier_gain_factor,
|
||||
1.f,
|
||||
|
@ -269,6 +272,8 @@ SimulationSettings CreateSettings() {
|
|||
SetSettingIfFlagSet(FLAG_agc_limiter, &settings.use_agc_limiter);
|
||||
SetSettingIfSpecified(FLAG_agc_compression_gain,
|
||||
&settings.agc_compression_gain);
|
||||
SetSettingIfFlagSet(FLAG_agc2_enable_adaptive_gain,
|
||||
&settings.agc2_use_adaptive_gain);
|
||||
settings.agc2_fixed_gain_db = FLAG_agc2_fixed_gain_db;
|
||||
settings.pre_amplifier_gain_factor = FLAG_pre_amplifier_gain_factor;
|
||||
SetSettingIfSpecified(FLAG_vad_likelihood, &settings.vad_likelihood);
|
||||
|
|
Loading…
Reference in a new issue