Commit graph

569 commits

Author SHA1 Message Date
Alessio Bazzica
ecf6315a7f AGC2 adaptive digital: remove unnecessary flag.
Bug: webrtc:7494
Change-Id: I03d854ab082cb8fcf3f01a431c06496f93d3063b
Reviewed-on: https://webrtc-review.googlesource.com/c/111601
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25729}
2018-11-21 15:01:28 +00:00
Alessio Bazzica
8da7b350cf AGC2 adaptive digital false by default
Avoid that the client code relies on the adaptive digital mode being
enabled by default (error prone).

Bug: webrtc:7494
Change-Id: I765fecf535cf31a2163e10595a42520473c233b6
Reviewed-on: https://webrtc-review.googlesource.com/c/111586
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25728}
2018-11-21 14:20:15 +00:00
Alessio Bazzica
4bc60452f7 Add output directory option for audioproc_f data dump files.
Bug: webrtc:10000
Change-Id: Iac21f826e78d6cb339c68fdeeedf9fe39920ac31
Reviewed-on: https://webrtc-review.googlesource.com/c/110904
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25713}
2018-11-20 13:30:24 +00:00
Alessio Bazzica
68170388f4 APM audioproc_f: flag for AGC2 adaptive level estimator.
Bug: webrtc:7494
Change-Id: I603211570a0a46d8884749dab887cd572827cca6
Reviewed-on: https://webrtc-review.googlesource.com/c/110250
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25708}
2018-11-20 12:50:23 +00:00
Jesús de Vicente Peña
44974e143c AEC3: Adding a correction factor for the Erle estimation that depends on the portion of the filter that is currently in use.
In this CL a more precise estimation of the Erle is introduced. This is done by creating different estimators that are specialized in different regions of the linear filter. An estimation of which regions were used for generating the current echo estimate is performed and used for selecting the right Erle estimator.

Bug: webrtc:9961
Change-Id: Iba6eb24596c067c3c66d40df590be379d3e1bb7b
Reviewed-on: https://webrtc-review.googlesource.com/c/109400
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Jesus de Vicente Pena <devicentepena@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25707}
2018-11-20 12:28:05 +00:00
Alessio Bazzica
dd886082c5 AGC2 flags: remove deprecated fields.
Downstream projects adapted, clean up.

Bug: webrtc:7494
Change-Id: I019b8dd79c6bc55c900fb5595d5e2ee8aa0a2400
Reviewed-on: https://webrtc-review.googlesource.com/c/110865
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25656}
2018-11-15 13:47:24 +00:00
Per Åhgren
1724a80e2d AEC3: Turn off the specific suppressor mode for stationary render
Bug: webrtc:9998,chromium:905291
Change-Id: I0e9f029227349dcde280895d905e90cc90f3e072
Reviewed-on: https://webrtc-review.googlesource.com/c/110902
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25640}
2018-11-14 15:45:47 +00:00
Alessio Bazzica
1e2542f593 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}
2018-11-13 14:32:13 +00:00
Per Åhgren
a33c89510f AEC3: Corrected erroneous if-statement that always returned true
Bug: webrtc:8671
Change-Id: I040943abd6b70a8392a88b234df518e958dd077b
Reviewed-on: https://webrtc-review.googlesource.com/c/110722
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25617}
2018-11-13 11:53:47 +00:00
Alex Loiko
20f60f0dc6 Fuzzer crash in AGC2.
Gain specified by fuzzer in APM config was too high.

Bug: chromium:901661
Change-Id: Id3ea8d23a4284a35c827bb16125902d84e37ca1e
Reviewed-on: https://webrtc-review.googlesource.com/c/110604
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Jonas Olsson <jonasolsson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25594}
2018-11-12 12:16:47 +00:00
Alessio Bazzica
b768e8800f Reland "Isolating APM API build target: making :api an actual target."
This reverts commit 61c6e5643e.

Reason for revert: downstream projects prepared for this change

Original change's description:
> Revert "Isolating APM API build target: making :api an actual target."
> 
> This reverts commit a7f77a7c05.
> 
> Reason for revert: breaking downstream
> 
> Original change's description:
> > Isolating APM API build target: making :api an actual target.
> > 
> > This CL is part of a refactoring work to unblock other CLs
> > that would generate a circular dependency when including
> > modules/audio_processing. It will also allow to easily move
> > the APM interface part under //api.
> > 
> > More in detail, this change moves the APM interface files from
> > the build target modules/audio_processing to
> > modules/audio_processing:api. It also adds :api as dependency
> > where needed.
> > 
> > Bug: webrtc:9535
> > Change-Id: I72829e22d08ba4d75985f0421e6e8bf0216ebecd
> > Reviewed-on: https://webrtc-review.googlesource.com/c/109501
> > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> > Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
> > Reviewed-by: Niels Moller <nisse@webrtc.org>
> > Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#25539}
> 
> TBR=saza@webrtc.org,alessiob@webrtc.org,kwiberg@webrtc.org,nisse@webrtc.org,kthelgason@webrtc.org
> 
> Change-Id: I974c6237311e7c06970aa62e5f6940f3aa80113d
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:9535
> Reviewed-on: https://webrtc-review.googlesource.com/c/109820
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#25540}

TBR=saza@webrtc.org,alessiob@webrtc.org,kwiberg@webrtc.org,nisse@webrtc.org,kthelgason@webrtc.org

Change-Id: Ic8ed4cc3baf43d639ce13cae256c007728c3ad92
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9535
Reviewed-on: https://webrtc-review.googlesource.com/c/109884
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25547}
2018-11-07 14:30:06 +00:00
Alessio Bazzica
61c6e5643e Revert "Isolating APM API build target: making :api an actual target."
This reverts commit a7f77a7c05.

Reason for revert: breaking downstream

Original change's description:
> Isolating APM API build target: making :api an actual target.
> 
> This CL is part of a refactoring work to unblock other CLs
> that would generate a circular dependency when including
> modules/audio_processing. It will also allow to easily move
> the APM interface part under //api.
> 
> More in detail, this change moves the APM interface files from
> the build target modules/audio_processing to
> modules/audio_processing:api. It also adds :api as dependency
> where needed.
> 
> Bug: webrtc:9535
> Change-Id: I72829e22d08ba4d75985f0421e6e8bf0216ebecd
> Reviewed-on: https://webrtc-review.googlesource.com/c/109501
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#25539}

TBR=saza@webrtc.org,alessiob@webrtc.org,kwiberg@webrtc.org,nisse@webrtc.org,kthelgason@webrtc.org

Change-Id: I974c6237311e7c06970aa62e5f6940f3aa80113d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9535
Reviewed-on: https://webrtc-review.googlesource.com/c/109820
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25540}
2018-11-07 11:28:03 +00:00
Alessio Bazzica
a7f77a7c05 Isolating APM API build target: making :api an actual target.
This CL is part of a refactoring work to unblock other CLs
that would generate a circular dependency when including
modules/audio_processing. It will also allow to easily move
the APM interface part under //api.

More in detail, this change moves the APM interface files from
the build target modules/audio_processing to
modules/audio_processing:api. It also adds :api as dependency
where needed.

Bug: webrtc:9535
Change-Id: I72829e22d08ba4d75985f0421e6e8bf0216ebecd
Reviewed-on: https://webrtc-review.googlesource.com/c/109501
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25539}
2018-11-07 10:34:51 +00:00
Niels Möller
7b3c76b44f Reland "Delete rtc::Pathname"
This is a reland of 6b9dec0d16

Original change's description:
> Delete rtc::Pathname
> 
> Bug: webrtc:6424
> Change-Id: Iec01dc5dd1426d4558983b828b67af872107d723
> Reviewed-on: https://webrtc-review.googlesource.com/c/108400
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#25479}

Bug: webrtc:6424
Change-Id: Ic7b42d435ffd8b93f603acebe68e8a92366bb197
Reviewed-on: https://webrtc-review.googlesource.com/c/109561
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25537}
2018-11-07 09:57:55 +00:00
Niels Möller
c572ff3c71 Add default constructor for rtc::Event
Bug: webrtc:9962
Change-Id: Icaa91e657e6881fcb1553f354c07866109a0ea68
Reviewed-on: https://webrtc-review.googlesource.com/c/109500
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25535}
2018-11-07 08:57:50 +00:00
Per Åhgren
dc98b9b975 AEC3: Corrected include
Bug: webrtc:8671
Change-Id: I3267c4d48cb52cc7bf305ecd7ec3f3a6222276be
Reviewed-on: https://webrtc-review.googlesource.com/c/109569
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25529}
2018-11-06 18:57:19 +00:00
Gustaf Ullberg
020e583291 AEC3: Compensate comfort noise level for loss due to filter bank
The analysis and synthesis windowing cause loss of power when
cross-fading the noise where frames are completely uncorrelated
(generated with random phase).

This CL also removes duplicate code and enables platform specific
optimizations for ARM in the comfort noise generation.

Bug: webrtc:9967,chromium:902262
Change-Id: Iffd59b301876442079d4a5f2c7fac55a3522397c
Reviewed-on: https://webrtc-review.googlesource.com/c/109581
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25526}
2018-11-06 16:17:02 +00:00
Gustaf Ullberg
83b00f020e AEC3: Computation of comfort noise gains from suppression gains
This change corrects the computation of the comfort noise gains.

Previously the comfort noise gain of band k, CG_k, was computed
from suppression gain of band k, SG_k, as:
CG_k = 1 - SG_k

But since the two signals are uncorrelated (the comfort noise
is randomly generated), the correct gain to maintain power is:
CG_k = sqrt(1 - SG_k^2).

Bug: webrtc:9967,chromium:902262
Change-Id: I393495742163d5e658bca4ab2f7a5067ab15af01
Reviewed-on: https://webrtc-review.googlesource.com/c/109580
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25525}
2018-11-06 16:10:52 +00:00
Alessio Bazzica
277b6ea850 Isolating APM API build target: adding dummy :api target.
This CL is part of a refactoring work to unblock other CLs
that would generate a circular dependency when including
modules/audio_processing. It will also allow to easily move
the APM interface part under //api.

More in detail, this change adds a dummy build target named :api
in modules/audio_processing. It is needed to adapt the downstream
projects before the APM interface files are moved to the :api target.

A follow up CL will make :api an actual target and will remove
the interface files from :audio_processing.

Bug: webrtc:9535
Change-Id: Ifb4e1a0ac7e482a8a089ef858d7e9a91f974e51f
Reviewed-on: https://webrtc-review.googlesource.com/c/109585
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25523}
2018-11-06 14:44:31 +00:00
Sam Zackrisson
63ada787b5 Remove outdated TODO
Bug: webrtc:9535
Change-Id: I8f7a719eb9f32a91f45620453568e5f7d2264de8
Reviewed-on: https://webrtc-review.googlesource.com/c/109461
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25511}
2018-11-06 08:39:16 +00:00
Sam Zackrisson
c22f551842 Remove locks from AECM and move it into private_submodules_
This drops the locks and annotations in EchoControlMobileImpl,
now that the interface is no longer externally accessible.

Additionally, SetEchoPath and GetEchoPath (with surrounding code) is
removed. They are unused.

Bug: webrtc:9929
Change-Id: Ibc6751754614ed39836f6ee6835d7b53dedd828c
Reviewed-on: https://webrtc-review.googlesource.com/c/109025
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25504}
2018-11-05 16:25:09 +00:00
Qingsi Wang
2039ee7dce Revert "Delete rtc::Pathname"
This reverts commit 6b9dec0d16.

Reason for revert: speculative revert for breaking internal projects

Original change's description:
> Delete rtc::Pathname
> 
> Bug: webrtc:6424
> Change-Id: Iec01dc5dd1426d4558983b828b67af872107d723
> Reviewed-on: https://webrtc-review.googlesource.com/c/108400
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#25479}

TBR=kwiberg@webrtc.org,nisse@webrtc.org

Change-Id: I3129a81a1d8e36b3e6c67572410bdc478ec4d5e9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:6424
Reviewed-on: https://webrtc-review.googlesource.com/c/109201
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25490}
2018-11-02 16:30:24 +00:00
Niels Möller
6b9dec0d16 Delete rtc::Pathname
Bug: webrtc:6424
Change-Id: Iec01dc5dd1426d4558983b828b67af872107d723
Reviewed-on: https://webrtc-review.googlesource.com/c/108400
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25479}
2018-11-02 08:34:39 +00:00
Alessio Bazzica
3e4c77f1c1 Fix AGC2 fixed-adaptive gain controllers order.
This CL refactors AGC2 and fixes the order with which the fixed
and the adaptive digital gain controllers are applied - i.e., fixed
first, then adaptive and finally limiter.

FixedGainController has been removed since we need to split the
processing done by the gain applier and the limiter.
Also, GainApplier and Limiter are easy enough to be used without
a wrapper and a wrapper would need 2 separated calls in the right
order - i.e., error prone.

FrameCombiner in audio mixer has been adapted and now only uses the
limiter (which is what is needed since no gain is applied).

The unit tests for FixedGainController have been moved to
gain_controller2_unittests. They have been re-adapted and
ChangeFixedGainShouldBeFastAndTimeInvariant has been re-tuned.

Bug: webrtc:7494
Change-Id: I4d7daeae917257ac019a645b74deba6642f77322
Reviewed-on: https://webrtc-review.googlesource.com/c/108624
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25477}
2018-11-01 20:35:36 +00:00
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
Sam Zackrisson
281276301c Remove deprecated AudioProcessing::GetStatistics function
Additionally, AudioProcessing::GetStatistics(bool) is made pure
virtual and the default implementation in AudioProcessing is removed.

Deprecation PSA:
https://groups.google.com/forum/#!msg/discuss-webrtc/NgqEPvkNuDE/7HtwnMmADgAJ

Bug: webrtc:9947, webrtc:8572
Change-Id: I123402bf7d6c49f3613154c469b818109d8fad43
Reviewed-on: https://webrtc-review.googlesource.com/c/108783
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25463}
2018-11-01 11:21:15 +00:00
Sam Zackrisson
7f4dfa4106 Remove locks from AEC2 and move it into private_submodules_
This drops the locks and annotations in EchoCancellationImpl,
now that the interface is no longer externally accessible.


Bug: webrtc:9929
Change-Id: I401256f523340cbabce23a5914ab28ce44179935
Reviewed-on: https://webrtc-review.googlesource.com/c/108602
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25460}
2018-11-01 08:40:16 +00:00
Per Åhgren
8b7d206d37 AEC3: Decrease latency until the delay has been detected
This CL utilizes the existing, but unused, ability to set
different histogram thresholds for early and late delay
estimation. It does so by tuning the parameters for these.

On top of that, some corrections are added to correctly
handle resets and the use of the hysteresis thresholds.

Bug: webrtc:19886,chromium:896334
Change-Id: I950ac107c124541af8f02b4403f477dda71cc1a1
Reviewed-on: https://webrtc-review.googlesource.com/c/106706
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25443}
2018-10-31 07:29:48 +00:00
Alessio Bazzica
746d46bec9 AGC2: renaming GainCurveApplier to Limiter.
Bug: webrtc:7494
Change-Id: I3dcfb864fd63dbf3f3e7345f8f4cac6c86987e8b
Reviewed-on: https://webrtc-review.googlesource.com/c/108581
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25436}
2018-10-30 16:00:18 +00:00
Niels Möller
2c16cc61c2 Replace some usage of EventWrapper with rtc::Event.
Bug: webrtc:3380
Change-Id: Id33b19bf107273e6f838aa633784db73d02ae2c2
Reviewed-on: https://webrtc-review.googlesource.com/c/107888
Reviewed-by: Henrik Grunell <henrikg@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25407}
2018-10-29 09:37:24 +00:00
Per Åhgren
370bae466c APM: Adding more explicit handling of failures in the json config data
This CL creates a new API for the parser of APM json config that
that provides an explicit way for the user to know when there has
been an issue in the parsing of the json config data.

Bug: webrtc:9921
Change-Id: Idd8f40529f40ab6871efb5b356c0fd2cea21b7d9
Reviewed-on: https://webrtc-review.googlesource.com/c/107841
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25355}
2018-10-25 10:31:54 +00:00
Per Åhgren
7a95e0fcf4 APM: Add ability to turn on/off dumping of internal data
This CL modifies the internal data logging and the audioproc_f tool
to allow controlling that via the command line, rather than solely via a
build flag. The logging of internal data is by default off.

Bug: webrtc:5298
Change-Id: I96d1b4f990582938527b9039d6c2ecbb6f76e9ca
Reviewed-on: https://webrtc-review.googlesource.com/c/107713
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25352}
2018-10-25 09:03:53 +00:00
Per Åhgren
f0c449e3ff APM: Correct includes required for the data dumping functionality
Bug: webrtc:5298
Change-Id: Ia8b8e6a308f1812216651efaf0e2249e9d0cbfd8
Reviewed-on: https://webrtc-review.googlesource.com/c/107631
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25327}
2018-10-24 07:38:28 +00:00
Per Åhgren
700b4a4e65 AEC3: Allow limiting dominant nearend to the non-initial phase
This CL allows control over the dominant nearend functionality so that
it is not active during the initial phase, when estimates are less
certain.

Bug: webrtc:9906,chromium:898273
Change-Id: I5f61dac806ec3b1ebc1a3ec72f0a16d07a67f14a
Reviewed-on: https://webrtc-review.googlesource.com/c/107632
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25326}
2018-10-24 07:15:49 +00:00
Alessio Bazzica
087e9bed41 AGC2 Limiter class renamed.
Limiter has been renamed to LimiterDbGainCurve, which is a more correct name
and will allow in a follow-up CL to reuse the Limiter name for GainCurveApplier.
This is done to allow to use the limiter without instancing the fixed digital
gain controller and then to fix an AGC2 issue (namely, fixed gain applied after
the adaptive one).

Bug: webrtc:7494
Change-Id: Icd7050e3e51b832bfbf35e5cc61109215c5b1ca6
Reviewed-on: https://webrtc-review.googlesource.com/c/106901
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25322}
2018-10-23 15:20:52 +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
Sam Zackrisson
b0ab2ce256 Reland "Remove the HighPassFilter interface"
Downstream Chromium dependencies fixed here:
https://chromium-review.googlesource.com/c/chromium/src/+/1286449

This is a reland of e2405c1a82

Original change's description:
> Remove the HighPassFilter interface
>
> The functionality remains unaffected.
> Filter toggling is still available via webrtc::AudioProcessing::Config.
> Example:
> webrtc::AudioProcessing::Config config = apm.GetConfig();
> // Read settings
> if (config.high_pass_filter.enabled) { ... }
> // Apply setting
> config.high_pass_filter.enabled = true;
> apm.ApplyConfig();
>
> Bug: webrtc:9535
> Change-Id: Ib4c4b04078bbb490ebdab9721b8c7811d73777a8
> Reviewed-on: https://webrtc-review.googlesource.com/c/102541
> Commit-Queue: Sam Zackrisson <saza@webrtc.org>
> Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
> Reviewed-by: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#25198}

Bug: webrtc:9535
Change-Id: I0017193ad3ca1762e186f3ad79f29d33ef468202
Reviewed-on: https://webrtc-review.googlesource.com/c/106681
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25300}
2018-10-23 07:44:09 +00:00
Gustaf Ullberg
c9f9b8711f AEC3: Improve dominant nearend detection
This change makes the dominant nearend detection more accurate.
- The hangover is increased not leave nearend state between words.
- The SNR requirement is increased to not enter nearend state without
  speech activity.
- An early exit mechanism has been added to leave nearend state quickly
  when the echo is strong.

Bug: chromium:897701,webrtc:9897
Change-Id: I9e0f3e6ecb80eee1c0c917d4835f110555f74acf
Reviewed-on: https://webrtc-review.googlesource.com/c/107347
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25299}
2018-10-23 07:05:46 +00:00
Jesús de Vicente Peña
c98849cf92 AEC3: changes the signal used for deciding when to update the erle so the reverb render signal is now used
In this CL we change the signal that controls the updates of the ERLE estimator. Until now, the render signal was used which is not optimum for reverberant signals. In this CL, a reverberation has been added to the the render signal and this new signal has been used for controlling when to update the ERLE estimator.

Bug: webrtc:9873
Change-Id: I0ebea3fc208f97aa237af015ba543015d49ed978
Reviewed-on: https://webrtc-review.googlesource.com/c/105660
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Jesus de Vicente Pena <devicentepena@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25285}
2018-10-22 10:30:12 +00:00
Mirko Bonadei
2dfa998be2 Reland "Prefix flag macros with WEBRTC_."
This is a reland of 5ccdc1331f

Original change's description:
> Prefix flag macros with WEBRTC_.
>
> Macros defined in rtc_base/flags.h are intended to be used to define
> flags in WebRTC's binaries (e.g. tests).
>
> They are currently not prefixed and this could cause problems with
> downstream clients since these names are quite common.
>
> This CL adds the 'WEBRTC_' prefix to them.
>
> Generated with:
>
> for x in DECLARE DEFINE; do
>   for y in bool int float string FLAG; do
>     git grep -l "\b$x\_$y\b" | \
>     xargs sed -i "s/\b$x\_$y\b/WEBRTC_$x\_$y/g"
>   done
> done
> git cl format
>
> Bug: webrtc:9884
> Change-Id: I7b524762b6a3e5aa5b2fc2395edd3e1a0fe72591
> Reviewed-on: https://webrtc-review.googlesource.com/c/106682
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#25270}

TBR=kwiberg@webrtc.org

Bug: webrtc:9884
Change-Id: I5ba5368a231a334d135ed5e6fd7a279629ced8a3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/107161
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25277}
2018-10-19 15:06:43 +00:00
Mirko Bonadei
c538fc77b0 Revert "Prefix flag macros with WEBRTC_."
This reverts commit 5ccdc1331f.

Reason for revert: Breaks downstream project.

Original change's description:
> Prefix flag macros with WEBRTC_.
> 
> Macros defined in rtc_base/flags.h are intended to be used to define
> flags in WebRTC's binaries (e.g. tests).
> 
> They are currently not prefixed and this could cause problems with
> downstream clients since these names are quite common.
> 
> This CL adds the 'WEBRTC_' prefix to them.
> 
> Generated with:
> 
> for x in DECLARE DEFINE; do
>   for y in bool int float string FLAG; do
>     git grep -l "\b$x\_$y\b" | \
>     xargs sed -i "s/\b$x\_$y\b/WEBRTC_$x\_$y/g"
>   done
> done
> git cl format
> 
> Bug: webrtc:9884
> Change-Id: I7b524762b6a3e5aa5b2fc2395edd3e1a0fe72591
> Reviewed-on: https://webrtc-review.googlesource.com/c/106682
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#25270}

TBR=mbonadei@webrtc.org,kwiberg@webrtc.org

Change-Id: Ia79cd6066ecfd1511c34f1b30fd423e560ed6854
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9884
Reviewed-on: https://webrtc-review.googlesource.com/c/107160
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25276}
2018-10-19 15:04:13 +00:00
Mirko Bonadei
5ccdc1331f Prefix flag macros with WEBRTC_.
Macros defined in rtc_base/flags.h are intended to be used to define
flags in WebRTC's binaries (e.g. tests).

They are currently not prefixed and this could cause problems with
downstream clients since these names are quite common.

This CL adds the 'WEBRTC_' prefix to them.

Generated with:

for x in DECLARE DEFINE; do
  for y in bool int float string FLAG; do
    git grep -l "\b$x\_$y\b" | \
    xargs sed -i "s/\b$x\_$y\b/WEBRTC_$x\_$y/g"
  done
done
git cl format

Bug: webrtc:9884
Change-Id: I7b524762b6a3e5aa5b2fc2395edd3e1a0fe72591
Reviewed-on: https://webrtc-review.googlesource.com/c/106682
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25270}
2018-10-19 10:55:20 +00:00
Per Åhgren
65faede3b0 AEC3: Introduce partial adaptive filter resets at echo path changes
With this CL, the main and shadow filters are no longer fully reset to
0 as the delay changes. This allows for more robust echo removal for
some scenarios.

Bug: webrtc:9879,chromium:895838
Change-Id: I859aa3df3ae41648bc8efde01ec2e2a5cb392279
Reviewed-on: https://webrtc-review.googlesource.com/c/106345
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25251}
2018-10-18 10:46:06 +00:00
Per Åhgren
1ffee36cb9 AEC3: Remove ERLE uncertainty code that has no effect
Removing code that has no audible effect.

Bug: webrtc:8671
Change-Id: Ibd7d0d19d760ae16b09285498c2ee09b42eb5968
Reviewed-on: https://webrtc-review.googlesource.com/c/106301
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25250}
2018-10-18 10:08:27 +00:00
Niklas Enbom
d895f42bfb Revert "Remove the HighPassFilter interface"
This reverts commit e2405c1a82.

Reason for revert: Breaks Chrome compile: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8932502586827763408/+/steps/compile__with_patch_/0/stdout 
Original change's description:
> Remove the HighPassFilter interface
> 
> The functionality remains unaffected.
> Filter toggling is still available via webrtc::AudioProcessing::Config.
> Example:
> webrtc::AudioProcessing::Config config = apm.GetConfig();
> // Read settings
> if (config.high_pass_filter.enabled) { ... }
> // Apply setting
> config.high_pass_filter.enabled = true;
> apm.ApplyConfig();
> 
> Bug: webrtc:9535
> Change-Id: Ib4c4b04078bbb490ebdab9721b8c7811d73777a8
> Reviewed-on: https://webrtc-review.googlesource.com/c/102541
> Commit-Queue: Sam Zackrisson <saza@webrtc.org>
> Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
> Reviewed-by: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#25198}

TBR=solenberg@webrtc.org,saza@webrtc.org,peah@webrtc.org

Change-Id: Ieb34d5c573c4ab22eefbb54aeaa2f72844740b89
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9535
Reviewed-on: https://webrtc-review.googlesource.com/c/106421
Reviewed-by: Niklas Enbom <niklas.enbom@webrtc.org>
Commit-Queue: Niklas Enbom <niklas.enbom@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25215}
2018-10-16 15:51:45 +00:00
Per Åhgren
3e7b7b154b AEC3: Changes to initial behavior and handling of saturated echo
This CL introduces two related changes
1) It changes the way that the AEC3 determines whether the linear
filter is sufficiently good for its output to be used. The new scheme
achieves this much earlier than what was done in the legacy scheme.
2) It changes the way that saturated echo is and handled so that the
impact of the nearend speech is lower.

Bug: webrtc:9835,webrtc:9843,chromium:895435,chromium:895431
Change-Id: I0b493676886e2134205e9992bbe4badac7e414cc
Reviewed-on: https://webrtc-review.googlesource.com/c/104380
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25208}
2018-10-16 13:22:44 +00:00
Sam Zackrisson
e2405c1a82 Remove the HighPassFilter interface
The functionality remains unaffected.
Filter toggling is still available via webrtc::AudioProcessing::Config.
Example:
webrtc::AudioProcessing::Config config = apm.GetConfig();
// Read settings
if (config.high_pass_filter.enabled) { ... }
// Apply setting
config.high_pass_filter.enabled = true;
apm.ApplyConfig();

Bug: webrtc:9535
Change-Id: Ib4c4b04078bbb490ebdab9721b8c7811d73777a8
Reviewed-on: https://webrtc-review.googlesource.com/c/102541
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25198}
2018-10-16 09:27:44 +00:00
Gustaf Ullberg
11539f0b29 AEC3: Simplify render buffering
This CL simplifies the buffering of render data. Instead of making assumptions
about the worst possible platform, it leverages recent improvements in
the delay estimator to quickly adapt when the conditions change.

Pros:
- No capture delay, delay is found ~200 ms faster.
- Cleaner code that makes the concept of delay more clear.
- Allows for removal of one matched filter because of the jitter headroom
removal.

Cons:
- Delay estimator needs to re-adapt when the call jitter increases.

The code can be deactivated by a kill switch. When the kill switch is
pulled the CL is bit exact.

Bug: webrtc:9726,chromium:895338
Change-Id: Ie2f9c8c5ce5b5a4510b4bdb95db2b970b57cd5d0
Reviewed-on: https://webrtc-review.googlesource.com/c/96920
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25169}
2018-10-15 13:31:50 +00:00
Jesús de Vicente Peña
74cd1ef9f5 AEC3: Enabling by default the use of the stationarity properties at render at init
In this CL the use of the stationarity properties at init is set to true by default.

Bug: webrtc:9865, chromium:894439
Change-Id: I716ce0d792a50616dc38cc0ba6f2c702549a81cc
Reviewed-on: https://webrtc-review.googlesource.com/c/105303
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Jesus de Vicente Pena <devicentepena@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25123}
2018-10-11 16:14:22 +00:00
Yves Gerey
499bc6c5d0 Fix race conditions for ReofferDoesNotCallOnTrack test.
This CL extend critical sections to incorporate:
 * private_submodules_->echo_controller
 * config_

As a side benefit, it prevents weird interleaving where configuration
could have been changed in the middle of GetStatistics methods.

Bug: webrtc:9841
Change-Id: I0de5e756a684c2ff1be4effccf8c0f3d3175e3b9
Reviewed-on: https://webrtc-review.googlesource.com/c/105142
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Yves Gerey <yvesg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25121}
2018-10-11 16:12:12 +00:00