Commit graph

6 commits

Author SHA1 Message Date
Alex Loiko
5e784616e0 Make the extra seturation margin configurable.
The extra saturation margin is a setting for the SaturationProtector
in GainController2. The higher it is, the less gain GC2 will apply. In
this CL we pipe the setting up to audio_processing.h. Now the setting
can be set at a high level.

Also in this CL add a few (missing, they should have been there
already) tests for the GC2 and GC2 with saturation margin.

Bug: webrtc:7494
Change-Id: I1b61f1662e6c6a8817fd5b0e845339694bf8d50d
Reviewed-on: https://webrtc-review.googlesource.com/c/109001
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25470}
2018-11-01 15:12:11 +00:00
Yves Gerey
988cc0870b [Cleanup] Add missing #include. Remove useless ones.
This CL is the result of running include-what-you-use tool on part
of the code base (audio target and dependencies) plus manual fixes.

bug: webrtc:8311
Change-Id: I277d281ce943c3ecc1bd45fd8d83055931743604
Reviewed-on: https://webrtc-review.googlesource.com/c/106280
Commit-Queue: Yves Gerey <yvesg@google.com>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25311}
2018-10-23 11:32:56 +00:00
Alex Loiko
4bb1e4a1d5 Lower gain parameters for AGC2.
The AdaptiveAgc often boosts the signal outside of Float S16 range. It
is expected, which is why we have a limiter after it in the process
chain. But it turns out that this happens regularly even for simple
input examples. The output signal peaks can be as high as +4 dBFs for a
single speaker example (which should be easy). It leads to excessive
gain modulation by the limiter.

This CL is a new tuning designed to produce a safer gain. After this,
we shouldn't hit the saturation region of the limiter as often. But we
will still maintain a high gain.

We have a 'configurable kill-switch': the settings can be changed via
field trials WebRTC-Audio-Agc2Force(Initial|Extra)SaturationMargin.

Bug: webrtc:7494, chromium:892043
Change-Id: I5014377050c74c32ae8998282991141eae31cf58
Reviewed-on: https://webrtc-review.googlesource.com/c/102922
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25006}
2018-10-05 09:55:25 +00:00
Alex Loiko
4d01146f16 Prepare AGC2 for analog gain changes.
1. Adds support for Reset calls in AGC2. The AGC will be reset during
   analog gain changes.
2. Allows AdaptiveModeLevelEstimator to return estimates > 0. This can
   happen if the signal gain is too high. It's needed for letting the
   analog AGC know that the gain is too high.

Bug: webrtc:7494
Change-Id: I38def17c21cc01c36aaea79a2401d8c2f289407b
Reviewed-on: https://webrtc-review.googlesource.com/79360
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23805}
2018-07-02 15:25:49 +00:00
Alex Loiko
9917c4a780 Saturation Protector in AGC2.
Another submodule of the Automatic Gain Controller 2. It refines the
biased estimate of the Adaptive Mode Level Estimator. It works by
generating a delayed stream of peak levels. The delayed peaks are
compared to the level estimate.

Bug: webrtc:7494
Change-Id: If4c2c19088d1ca73fb93511dad4e1c8ccabcaf03
Reviewed-on: https://webrtc-review.googlesource.com/65461
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22732}
2018-04-04 13:07:30 +00:00
Alex Loiko
1e48e8095c Level estimation and saturation protection stub.
The level estimator (AdaptiveModeLevelEstimator) produces a biased
estimate of the speech level. In our model, we use another module
(the SaturationProtector) to compute the bias. This CL contains the
estimator and a stub of the saturation protector.

Bug: webrtc:7494
Change-Id: I0df736d0346063f544fa680b4cc84177ea548545
Reviewed-on: https://webrtc-review.googlesource.com/64820
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22641}
2018-03-28 08:41:45 +00:00