Added flags for the adaptive analog AGC in audioproc_f.

Added back the 'agc2 level estimation' flag. Also added a flag for
moving the level measurement before AEC and NS. This is to run offline
experiments with audioproc_f.


Bug: webrtc:7494
Change-Id: I3e3ffceede7166b754130be2b707b620ba527e9f
Reviewed-on: https://webrtc-review.googlesource.com/97442
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24657}
This commit is contained in:
Alex Loiko
2018-09-10 13:59:41 +02:00
committed by Commit Bot
parent b2d7116733
commit d934244feb
8 changed files with 47 additions and 13 deletions

View File

@ -365,13 +365,15 @@ AudioProcessingImpl::AudioProcessingImpl(
constants_(config.Get<ExperimentalAgc>().startup_min_volume,
config.Get<ExperimentalAgc>().clipped_level_min,
#if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS)
false,
false,
false),
/* enabled= */ false,
/* enabled_agc2_level_estimator= */ false,
/* digital_adaptive_disabled= */ false,
/* analyze_before_aec= */ false),
#else
config.Get<ExperimentalAgc>().enabled,
config.Get<ExperimentalAgc>().enabled_agc2_level_estimator,
config.Get<ExperimentalAgc>().digital_adaptive_disabled),
config.Get<ExperimentalAgc>().digital_adaptive_disabled,
config.Get<ExperimentalAgc>().analyze_before_aec),
#endif
#if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS)
capture_(false),
@ -1221,6 +1223,13 @@ int AudioProcessingImpl::ProcessCaptureStreamLocked() {
private_submodules_->agc_manager->AnalyzePreProcess(
capture_buffer->channels()[0], capture_buffer->num_channels(),
capture_nonlocked_.capture_processing_format.num_frames());
if (constants_.use_experimental_agc_process_before_aec) {
private_submodules_->agc_manager->Process(
capture_buffer->channels()[0],
capture_nonlocked_.capture_processing_format.num_frames(),
capture_nonlocked_.capture_processing_format.sample_rate_hz());
}
}
if (submodule_states_.CaptureMultiBandSubModulesActive() &&
@ -1290,7 +1299,8 @@ int AudioProcessingImpl::ProcessCaptureStreamLocked() {
public_submodules_->voice_detection->ProcessCaptureAudio(capture_buffer);
if (constants_.use_experimental_agc &&
public_submodules_->gain_control->is_enabled()) {
public_submodules_->gain_control->is_enabled() &&
!constants_.use_experimental_agc_process_before_aec) {
private_submodules_->agc_manager->Process(
capture_buffer->split_bands_const(0)[kBand0To8kHz],
capture_buffer->num_frames_per_band(), capture_nonlocked_.split_rate);