AGC2: adding level estimation option (RMS or peak-based).

This CL makes possible to choose the level estimation for the adaptive
digital GC of AGC2. The options are RMS (default and currently used
estimator) and peak-based (already computed, but not used).

Besides adding the new AGC2 config param for the level estimator, this CL
also refactors the config class by making it more structured.

Bug: webrtc:7494
Change-Id: I20eb558ca50f13536aa7bdea08d21de3b630f8bc
Reviewed-on: https://webrtc-review.googlesource.com/c/110144
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25620}
This commit is contained in:
Alessio Bazzica
2018-11-13 14:44:15 +01:00
committed by Commit Bot
parent 44ca9a392a
commit 1e2542f593
12 changed files with 169 additions and 44 deletions

View File

@ -351,9 +351,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;
apm_config.gain_controller2.fixed_digital.gain_db =
settings_.agc2_fixed_gain_db;
if (settings_.agc2_use_adaptive_gain) {
apm_config.gain_controller2.adaptive_digital_mode =
apm_config.gain_controller2.adaptive_digital.enabled =
*settings_.agc2_use_adaptive_gain;
}
}