Reland "Replace the ExperimentalAgc config with the new config format"
This is a reland of f3aa6326b8e21f627b9fba72040122723251999b
Original change's description:
> Replace the ExperimentalAgc config with the new config format
>
> This CL replaces the use of the ExperimentalAgc config with
> using the new config format.
>
> Beyond that, some further changes were made to how the analog
> and digital AGCs are initialized/called. While these can be
> made in a separate CL, I believe the code changes becomes more
> clear by bundling those with the replacement of the
> ExperimentalAgc config.
>
> TBR: saza@webrtc.org
> Bug: webrtc:5298
> Change-Id: Ia19940f3abae048541e6716d0184b4caafc7d53e
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/163986
> Reviewed-by: Per Åhgren <peah@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#30149}
Bug: webrtc:5298
Change-Id: I6db03628ed3fa2ecd36544fe9181dd8244d7e2df
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165760
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30295}
diff --git a/modules/audio_processing/audio_processing_impl.h b/modules/audio_processing/audio_processing_impl.h
index ee3fb4d..af5a0f6 100644
--- a/modules/audio_processing/audio_processing_impl.h
+++ b/modules/audio_processing/audio_processing_impl.h
@@ -243,6 +243,7 @@
void InitializeHighPassFilter(bool forced_reset)
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
void InitializeVoiceDetector() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
+ void InitializeGainController1() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
void InitializeTransientSuppressor()
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
void InitializeGainController2() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
@@ -263,8 +264,6 @@
void HandleCaptureRuntimeSettings()
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
void HandleRenderRuntimeSettings() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_render_);
- void ApplyAgc1Config(const Config::GainController1& agc_config)
- RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
void EmptyQueuedRenderAudio();
void AllocateRenderQueue()
@@ -381,29 +380,12 @@
// APM constants.
const struct ApmConstants {
- ApmConstants(int agc_startup_min_volume,
- int agc_clipped_level_min,
- bool use_experimental_agc,
- bool use_experimental_agc_agc2_level_estimation,
- bool use_experimental_agc_agc2_digital_adaptive,
- bool multi_channel_render_support,
+ ApmConstants(bool multi_channel_render_support,
bool multi_channel_capture_support,
bool enforce_split_band_hpf)
- : agc_startup_min_volume(agc_startup_min_volume),
- agc_clipped_level_min(agc_clipped_level_min),
- use_experimental_agc(use_experimental_agc),
- use_experimental_agc_agc2_level_estimation(
- use_experimental_agc_agc2_level_estimation),
- use_experimental_agc_agc2_digital_adaptive(
- use_experimental_agc_agc2_digital_adaptive),
- multi_channel_render_support(multi_channel_render_support),
+ : multi_channel_render_support(multi_channel_render_support),
multi_channel_capture_support(multi_channel_capture_support),
enforce_split_band_hpf(enforce_split_band_hpf) {}
- int agc_startup_min_volume;
- int agc_clipped_level_min;
- bool use_experimental_agc;
- bool use_experimental_agc_agc2_level_estimation;
- bool use_experimental_agc_agc2_digital_adaptive;
bool multi_channel_render_support;
bool multi_channel_capture_support;
bool enforce_split_band_hpf;
@@ -435,6 +417,7 @@
size_t num_keyboard_frames = 0;
const float* keyboard_data = nullptr;
} keyboard_info;
+ int cached_stream_analog_level_ = 0;
} capture_ RTC_GUARDED_BY(crit_capture_);
struct ApmCaptureNonLockedState {