AGC2: GainController::ApplyConfig removed

When `AudioProcessingImpl::ApplyConfig()` is called, AGC2 is initialized
and then the new config is applied. That is error prone and for example
breaks bit exactness in [1].

Changes:
- `GainController2` must be created by passing configuration,
  sample rate and number of channels
- `GainController2::ApplyConfig()` removed

Bit exactness verified with audioproc_f on a collection of AEC dumps
and Wav files (42 recordings in total).

[1] https://webrtc-review.googlesource.com/c/src/+/234587.

Bug: webrtc:7494
Change-Id: I251e03603394a4fc8769b9b5c197a157893676a9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/235060
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35206}
This commit is contained in:
Alessio Bazzica
2021-10-14 12:14:21 +02:00
committed by WebRTC LUCI CQ
parent 2625529cb1
commit 389010438d
6 changed files with 142 additions and 133 deletions

View File

@ -267,7 +267,7 @@ class AudioProcessingImpl : public AudioProcessing {
void InitializeEchoController()
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_render_, mutex_capture_);
// Initializations of capture-only submodules, requiring the capture lock
// Initializations of capture-only sub-modules, requiring the capture lock
// already acquired.
void InitializeHighPassFilter(bool forced_reset)
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_capture_);
@ -275,7 +275,10 @@ class AudioProcessingImpl : public AudioProcessing {
void InitializeGainController1() RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_capture_);
void InitializeTransientSuppressor()
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_capture_);
void InitializeGainController2() RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_capture_);
// Initializes the `GainController2` sub-module. If the sub-module is enabled
// and `config_has_changed` is true, recreates the sub-module.
void InitializeGainController2(bool config_has_changed)
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_capture_);
void InitializeNoiseSuppressor() RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_capture_);
void InitializeCaptureLevelsAdjuster()
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_capture_);