Commit graph

215 commits

Author SHA1 Message Date
Alex Loiko
ed8ff64ef7 Break out Agc code from audio_processing.
Splits 'modules/audio_processing:audio_processing' target. The files
in modules/audio_processing/agc now are in targets in that folder.

Reason for doing this was to include
modules/audio_processing/agc/agc.h from another target in the
dependent CL https://webrtc-review.googlesource.com/c/src/+/86603

This could help reducing the binary size in the future.

Bug: webrtc:7494
Change-Id: I61f50ab6d5ce24d19f4097e0f3fa8b0170010887
Reviewed-on: https://webrtc-review.googlesource.com/87422
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23873}
2018-07-06 13:29:43 +00:00
Alex Loiko
64cb83bbd9 Flags and settings for AGC2 in AgcManagerDirect.
This CL adds two flags to audioproc_f. The flags control
AgcManagerDirect. The flags are
'--experimental_agc_agc2_level_estimator' and
'--experimental_agc_agc2_digital_adaptive'.

After this CL, the flags are be applied to AgcManagerDirect. The flags
have no effect in release-mode. They cause a crash in debug-mode.

In an upcoming CL, '--experimental_agc_agc2_level_estimator 1' will
replace the speech level estimation in ExperimentalAgc with that of
AGC2.

'--experimental_agc_agc2_digital_adaptive 1' will replace the digital
gain selection and application with that of AGC2.

These audioproc_f will activate both new settings:

./out/Target/audioproc_f --agc 1 --experimental_agc 1
--experimental_agc_agc2_digital_adaptive 1
--experimental_agc_agc2_level_estimator 1 --simulate_mic_gain 1
--simulated_mic_kind 2

See also https://webrtc-review.googlesource.com/c/src/+/79360

Bug: webrtc:7494
Change-Id: If0e65893dffdddb312e553787b8cedaf9a334323
Reviewed-on: https://webrtc-review.googlesource.com/86548
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23802}
2018-07-02 13:20:39 +00:00
Sam Zackrisson
db38972eda Remove nonlinear beamformer API from APM
This CL removes the remaining beamformer parts from the APM.

Bug: webrtc:9402
Change-Id: I9ab2795bd2813d17166ed0925125257b82d98a74
Reviewed-on: https://webrtc-review.googlesource.com/83340
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Minyue Li <minyue@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23694}
2018-06-21 08:49:52 +00:00
Yves Gerey
665174fdbb Reformat the WebRTC code base
Running clang-format with chromium's style guide.

The goal is n-fold:
 * providing consistency and readability (that's what code guidelines are for)
 * preventing noise with presubmit checks and git cl format
 * building on the previous point: making it easier to automatically fix format issues
 * you name it

Please consider using git-hyper-blame to ignore this commit.

Bug: webrtc:9340
Change-Id: I694567c4cdf8cee2860958cfe82bfaf25848bb87
Reviewed-on: https://webrtc-review.googlesource.com/81185
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23660}
2018-06-19 14:00:39 +00:00
Danil Chapovalov
db9f7ab9f9 Replace rtc::Optional with absl::optional in modules/audio processing
This is a no-op change because rtc::Optional is an alias to absl::optional

This CL generated by running script with parameter 'modules/audio_processing'

find $@ -type f \( -name \*.h -o -name \*.cc \) \
-exec sed -i 's|rtc::Optional|absl::optional|g' {} \+ \
-exec sed -i 's|rtc::nullopt|absl::nullopt|g' {} \+ \
-exec sed -i 's|#include "api/optional.h"|#include "absl/types/optional.h"|' {} \+

find $@ -type f -name BUILD.gn \
-exec sed -r -i 's|"(../)*api:optional"|"//third_party/abseil-cpp/absl/types:optional"|' {} \+;

git cl format

Bug: webrtc:9078
Change-Id: Id29f8de59dba704787c2c38a3d05c60827c181b0
Reviewed-on: https://webrtc-review.googlesource.com/83982
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23653}
2018-06-19 10:38:56 +00:00
Sam Zackrisson
9394f6fda1 Stop using the beamformer inside APM
Removes the usage of an injected/enabled beamformer in APM, and marks
the API parts as deprecated.
Initialization and process calls are removed, and all enabled/disabled
flags are replaced by assuming no beamforming. Additionally, an AGC test
relying on the beamformer as a VAD is removed.

Bug: webrtc:9402
Change-Id: I0d3d0b9773da083ce43c28045db9a77278f59f95
Reviewed-on: https://webrtc-review.googlesource.com/83341
Reviewed-by: Minyue Li <minyue@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23643}
2018-06-18 13:18:13 +00:00
Ivo Creusen
d1f970dc43 Change echo detector to scoped_refptr
The echo detector is currently stored as a unique_ptr, but when injecting an echo detector, a scoped_refptr makes more sense since the ownership will be shared.

Bug: webrtc:8732
Change-Id: I2180014acb84f1cd5c361864a444b7b6574520f5
Reviewed-on: https://webrtc-review.googlesource.com/83325
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23610}
2018-06-14 09:51:41 +00:00
Alex Loiko
73ec01977b Add RuntimeSettings to CustomProcessing.
CustomProcessing is the interface to injectable audio processing
submodules to AudioProcessing. This CL makes it possible to set
runtime settings on the injected render processing component.

Note that the current runtime setting handling happens on the capture
thread. Therefore, we add another SwapQueue to communicate with the
render thread.

Bug: webrtc:9138, webrtc:9262
Change-Id: I665ce2d83a2b35ca8b25cca813d2cef7bd0ba911
Reviewed-on: https://webrtc-review.googlesource.com/76123
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23236}
2018-05-15 10:03:25 +00:00
Alex Loiko
5feb30e85f Options and settings for the Pre-amplifier.
Add configuration fields for the pre-amplifier in the Audio Processing
Module. Also add flags and settings for the pre-amplifier in
audioproc_f.

Also make the setting stored in Aec Dumps. And make the setting
applied when playing back Aec Dumps in audioproc_f.

Bug: webrtc:9138
Change-Id: I4e59df200e1ebc56f06fae74ebf17d85858958a3
Reviewed-on: https://webrtc-review.googlesource.com/69560
Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22876}
2018-04-16 12:25:48 +00:00
Alessio Bazzica
c054e78f4e Send runtime settings to the Audio Processing Module (APM)
This CL includes the following changes:
- APM runtime setting (ID + float payload) and unit tests
- Swap queue of APM runtime settings used in AudioProcessingImpl
- runtime settings handler that forwards the settings to APM
  sub-modules when a message is retrieved from the queue
- Unit test placeholder to check that the pre-gain update message
  is correctly delivered

Bug: webrtc:9138
Change-Id: Id22704af15fde2b87a4431f5ce64ad1aeafc5280
Reviewed-on: https://webrtc-review.googlesource.com/69320
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22873}
2018-04-16 11:11:27 +00:00
Alex Loiko
9d2788f745 Make possible to activate adaptive AGC2 in the APM.
We update the configuration settings for AGC2. We also update their
effects. Now, 'gain_controller2.enable=true' means 'first run Adaptive
AGC2; then run AGC2 limiter'.

Previously, only the AGC2 limiter was implemented. To run that, one
had to set both 'gain_controller2.enable=true' and
'gain_controller2.enable_limiter=true'.

This setting also enables adaptive AGC2 in the test tool 'audioproc_f'.

Bug: webrtc:7494
Change-Id: I0d5dfe443f2cdc0ecf3aa4054442dab6276d284d
Reviewed-on: https://webrtc-review.googlesource.com/64990
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22669}
2018-03-29 09:42:07 +00:00
Ivo Creusen
647ef09d1e Add more parameters to the Initialize function of the echo detector.
Since the echo detector processes both the render and the capture audio streams, it needs to know the sample rates and number of channels of both.

Bug: webrtc:8732
Change-Id: Icd26e561d5dd98bd789a6dfa75f468f3fde06fee
Reviewed-on: https://webrtc-review.googlesource.com/61861
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22436}
2018-03-15 09:21:56 +00:00
Sam Zackrisson
ab1aee0be4 Reland "Deprecate the adaptive level controller"
This is a reland of 6f37ed78d9

CQ dry run OK except for missing iOS swarming bots.
NOTRY=True

Original change's description:
> Deprecate the adaptive level controller
>
> Level control handled by default-on AGC.
>
> Bug: none
> Change-Id: I405daeceece12c896d41156b649fcfd556726f77
> Reviewed-on: https://webrtc-review.googlesource.com/59682
> Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
> Reviewed-by: Alex Loiko <aleloi@webrtc.org>
> Commit-Queue: Sam Zackrisson <saza@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22305}

Bug: none
Change-Id: I0b9b8e2f3457d5efd4603efbfbbc6b84651df315
Reviewed-on: https://webrtc-review.googlesource.com/60720
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22352}
2018-03-09 09:42:13 +00:00
Sam Zackrisson
52f8188f5d Revert "Deprecate the adaptive level controller"
This reverts commit 6f37ed78d9.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Deprecate the adaptive level controller
> 
> Level control handled by default-on AGC.
> 
> Bug: none
> Change-Id: I405daeceece12c896d41156b649fcfd556726f77
> Reviewed-on: https://webrtc-review.googlesource.com/59682
> Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
> Reviewed-by: Alex Loiko <aleloi@webrtc.org>
> Commit-Queue: Sam Zackrisson <saza@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22305}

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

Change-Id: Ic52f41fcbebfd2291a51b17ac788313e1ceef163
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: none
Reviewed-on: https://webrtc-review.googlesource.com/60240
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22308}
2018-03-06 11:54:22 +00:00
Sam Zackrisson
6f37ed78d9 Deprecate the adaptive level controller
Level control handled by default-on AGC.

Bug: none
Change-Id: I405daeceece12c896d41156b649fcfd556726f77
Reviewed-on: https://webrtc-review.googlesource.com/59682
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22305}
2018-03-06 10:20:01 +00:00
Sam Zackrisson
4d3644979c Add stub draft of audio generator to APM
This provides the empty shell of an AudioGenerator class.
It is intended to be used for debugging purposes and can be inserted
into the APM much like an AecDump. It allows for playing out diagnostic
audio unaffected by codecs and network jitter, while still capturing
API interaction like in a normal call.

NOTRY=True

Bug: webrtc:8882
Change-Id: I8132afc95cdba02ab233f44e22e0a5f530710ef7
Reviewed-on: https://webrtc-review.googlesource.com/53300
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22282}
2018-03-05 09:28:52 +00:00
Christian Schuldt
f4e99dba41 Update AEC3 echo tail estimation.
Note: estimation is turned OFF if config_.ep_strength.default_len
is set >= 0 (in this case config_.ep_strength.default_len defines a
constant echo decay factor), and hence turned ON if < 0. In case the
echo tail estimation is turned ON, -config_.ep_strength.default_len is
the starting point for the estimator.

The estimation is done in two passes; first we go through all "sections"
(corresponding to chunks of length kFftLengthBy2) of the filter impulse
response to determine which sections correspond to a "stable" decay",
and then the second pass we go through each stable decay section and
estimate the decay. The actual decay estimation is based on linear
regression of the log magnitude of the squared impulse response.
A bunch of sanity checks are also performed continuously to avoid
estimation error during e.g., filter adaptation.

Bug: webrtc:8924
Change-Id: I686ce3f3e8b6b472348f8d6e01fb44c31e25145d
Reviewed-on: https://webrtc-review.googlesource.com/48440
Commit-Queue: Christian Schuldt <cschuldt@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22247}
2018-03-01 11:21:12 +00:00
Gustaf Ullberg
0efa941d2f Move EchoCanceller3Factory to api/auido
The AEC3 factory is now part of the WebRTC API.

Bug: webrtc:8844
Change-Id: If6f419b4ca0354e2d346c0e6474086e456ba747e
Reviewed-on: https://webrtc-review.googlesource.com/57141
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22204}
2018-02-27 14:09:59 +00:00
Alex Loiko
e36e8bbf6d Add FixedGainController and move GainController2 in APM.
The FixedGainController (FGC) applies a fixed gain. It will also
control the limiter. The limiter will be landed over the next several
CLs.

The GainController2 is a 'private submodule' of APM. It will control
the new automatic gain controller (AGC). It controls the AGC through
Initialize() and ApplyConfig().

This CL contains

* build changes to make modules/audio_processing/agc2 an independent
  target

* a new MutableFloatAudioFrame which is the audio interface between
  AGC2 and APM

* move of the fixed gain application from GainController2 to
  FixedGainController.

If you are a googler, there is more information in this doc:
https://docs.google.com/document/d/1RV2Doet3MZtUPAHVva61Vjo20iyd1bmmm3aR8znWpzo/edit#

Bug: webrtc:7949
Change-Id: Ief95cbbce83c3aafe54638fd2ab881c9fb8bdc3a
Reviewed-on: https://webrtc-review.googlesource.com/50440
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22046}
2018-02-16 10:56:38 +00:00
Gustaf Ullberg
fd4ce50423 Move echo_control.h to api/audio
Bug: webrtc:8844
Change-Id: I5c2406c43ade786c26e12b3c847fed8424283df0
Reviewed-on: https://webrtc-review.googlesource.com/53700
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22031}
2018-02-15 10:43:04 +00:00
Gustaf Ullberg
bffa3007b4 Move AEC3 configuration to its own file under api/audio
This is one of several small steps of separating APM and AEC3.

Bug: webrtc:8844
Change-Id: Ib6e518fec5f7566cab3823ab35fcede8433f8f4e
Reviewed-on: https://webrtc-review.googlesource.com/53142
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22028}
2018-02-15 08:03:54 +00:00
Per Åhgren
f4d1134bdc Adjusted tunings to increase AEC3 robustness against pipeline issues
Bug: chromium:810371,webrtc:8862
Change-Id: I2bfd3601c41caf608c21bec27133a175e3a7f2c5
Reviewed-on: https://webrtc-review.googlesource.com/49782
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21958}
2018-02-08 14:40:29 +00:00
Per Åhgren
29f14322d1 Improved robustness and recovery speed in AEC3 during echo path changes
This CL adds robustness in terms of echo removal and faster recovery
in order to regain echo canceller transparency after echo path changes.

The CL does:
-Improve the adaptation rate of the linear filter.
-Increase the look-window used before the linear filter has adapted.
-Decrease the effects of missed detection of residual echo.
-Increase the safety margin before allowing the suppressor gain to
increase.

Bug: chromium:804873,webrtc:8788
Change-Id: I28eedc4c8d0a4f0bc7b79c02d6d59bf00fddd566
Reviewed-on: https://webrtc-review.googlesource.com/48721
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21917}
2018-02-06 15:07:54 +00:00
Gustaf Ullberg
8e467dfa6d Move EchoControl out of audio_processing.h.
Bug: webrtc:8844
Change-Id: Id05c285e0e377774c79da8552959733f823d8bb4
Reviewed-on: https://webrtc-review.googlesource.com/47900
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21898}
2018-02-06 08:28:29 +00:00
Gustaf Ullberg
8e9252a14f AEC3 can only be activated by injection.
Removed echo_canceller3.enabled from API configuration.

Bug: webrtc:8346
Change-Id: Ie88a518c7eb37653ad9b20b18bdec6476076ccb6
Reviewed-on: https://webrtc-review.googlesource.com/27080
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21829}
2018-01-31 14:11:19 +00:00
Ivo Creusen
83bd29081c Remove the AudioProcessing::Create methods.
Due to the growing number of arguments, these functions are being replaced by the AudioProcessingBuilder class.

Bug: webrtc:8668
Change-Id: Ic3936fbd47d92eac22a857a678dca5fd8c029d8b
Reviewed-on: https://webrtc-review.googlesource.com/46241
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21826}
2018-01-31 13:09:39 +00:00
Per Åhgren
d980c57c80 Adding more conservative AEC3 suppressor behavior initially in calls
Bug: webrtc:8746
Change-Id: I47def88f8d6092fcb6b1a4bd14478e8d5ccd5320
Reviewed-on: https://webrtc-review.googlesource.com/39840
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21631}
2018-01-16 09:32:52 +00:00
Per Åhgren
a98c8074ba Added faster initial model adaptation speed in AEC3
Bug: webrtc:8746
Change-Id: Idcb65e2b1241a7da8c4a98622923e401d174b879
Reviewed-on: https://webrtc-review.googlesource.com/39506
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21619}
2018-01-15 19:29:11 +00:00
Per Åhgren
08ea5898ff Separated the AEC3 adaptive filter parameters into sub-structs
Bug: webrtc:8671
Change-Id: I02bceceb85da6db65f65c1a2366a2d5021f148ef
Reviewed-on: https://webrtc-review.googlesource.com/39502
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21617}
2018-01-15 16:48:49 +00:00
Per Åhgren
d84b3d1f3d Generalized the hysteresis behavior in the AEC3 delay estimator
This CL generalizes the hysteresis behavior on the AEC3 delay estimator
to be two-sided and easier to configure.


Bug: webrtc:8671
Change-Id: Ife21c1511416e32eb3618c81178deefe332ac1e8
Reviewed-on: https://webrtc-review.googlesource.com/39267
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21604}
2018-01-12 15:28:54 +00:00
Ivo Creusen
09fa4b04dd Make the echo detector injectable.
This adds a generic interface for an echo detector, and makes it possible to inject one into the audio processing module.

Bug: webrtc:8732
Change-Id: I30d97aeb829307b2ae9c4dbeb9a3e15ab7ec0912
Reviewed-on: https://webrtc-review.googlesource.com/38900
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21588}
2018-01-11 15:43:01 +00:00
Ivo Creusen
62337e59dd Use AudioProcessingBuilder everywhere AudioProcessing is created.
The AudioProcessingBuilder was recently introduced in https://webrtc-review.googlesource.com/c/src/+/34651 to make it easier to create APM instances. This CL replaces all calls to the old Create methods with the new AudioProcessingBuilder.

Bug: webrtc:8668
Change-Id: Ibb5f0fc0dbcc85fcf3355b01bec916f20fe0eb67
Reviewed-on: https://webrtc-review.googlesource.com/36082
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21534}
2018-01-09 13:45:20 +00:00
Ivo Creusen
5ec7e12760 Added a builder class for the AudioProcessingModule.
As the number of injectable components of the APM increases, it is become increasingly unwieldy to keep expanding the Create function with more parameters. This builder class should make it easier to inject more components in the future.

Bug: webrtc:8668
Change-Id: If91547527760486c2a4daa9696bee22ec1d7675e
Reviewed-on: https://webrtc-review.googlesource.com/34651
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21425}
2017-12-22 12:19:03 +00:00
Alex Loiko
5825aa673c Render-side pre-processing in APM.
This CL adds a way to insert a custom render-side pre-processor to
APM. The pre-processor operates in full-band mode before anything
else. Currently the render processing chain is (if everything is
enabled):

Network --> [Pre processing] --> [Band split] -->
[IntelligibilityEnhancer] --> [Echo canceller (read-only)] -->
[Band merge] --> Playout

Since the render pre processor and capture post processor have the
same interface, I renamed webrtc::PostProcessing into
webrtc::CustomProcessing.

The old APM factory method PostProcessing will be deprecated and
dependencies updated as part of webrtc:8665

NOTRY=True

Bug: webrtc:8665
Change-Id: Ia381cbf12e336d6587406a14d77243d931f69a31
Reviewed-on: https://webrtc-review.googlesource.com/29201
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21327}
2017-12-18 16:11:03 +00:00
Per Åhgren
019008bd93 Updated the behavior for the filter adaptation in echo canceller 3
This CL adjusts the filter adaptation behavior to better handle
reverberant environments and environments with poor SNR.

It furthermore updates the unittests to handle the reduced adaptation
speed.

Bug: webrtc:8661
Change-Id: I5f1b5a4a34b333bd6c643ed3727899d0838dbf90
Reviewed-on: https://webrtc-review.googlesource.com/34184
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21323}
2017-12-18 12:39:48 +00:00
Per Åhgren
b6f9e6c979 Added further ability to adjust the filter adaptation in AEC3
Bug: webrtc:8609
Change-Id: I079935bd782afc89146d98fd2248a1c6389871c9
Reviewed-on: https://webrtc-review.googlesource.com/32420
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21268}
2017-12-14 08:28:31 +00:00
Patrik Höglund
3ff90f19d3 Fix macro clash with _USE_MATH_DEFINES.
Bug: chromium:788675
Change-Id: I4840fd013a81ffe157323b0bb876d64fd60d8a19
Reviewed-on: https://webrtc-review.googlesource.com/32304
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21235}
2017-12-13 09:39:20 +00:00
Per Åhgren
477f289779 Added the ability to adjust the filter adaptation speed in AEC3
Bug: webrtc:8609
Change-Id: I90eac3948ad0b7b1b5df2585ace3783e950c05d5
Reviewed-on: https://webrtc-review.googlesource.com/31485
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21217}
2017-12-11 22:58:46 +00:00
Per Åhgren
09a718accd Added the ability to more easily adjust the filter length in AEC3
Bug: webrtc:8609
Change-Id: If060b332993c2c98d7a12608ab31f4da858b8016
Reviewed-on: https://webrtc-review.googlesource.com/28620
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21216}
2017-12-11 22:02:46 +00:00
Per Åhgren
63b494dff7 Reverted the new handling of saturated echoes in AEC3
This CL reverts the changes introduced that handles echoes in AEC3.
The revert is done to match the behavior which is in M63.

Bug: webrtc:8615,chromium:792346
Change-Id: I128ccb17dc359c7889a701a2faaaf06be40f86dd
Reviewed-on: https://webrtc-review.googlesource.com/30140
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21117}
2017-12-06 11:04:22 +00:00
Per Åhgren
8ba5861f7e Redesign of the render buffering in AEC3
This CL centralizes the render buffering in AEC3 so that all render
buffers are updated and synchronized/aligned with the render alignment
buffer.

Bug: webrtc:8597, chromium:790905
Change-Id: I8a94e5c1f27316b6100b420eec9652ea31c1a91d
Reviewed-on: https://webrtc-review.googlesource.com/25680
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20989}
2017-12-01 23:14:32 +00:00
Per Åhgren
83c4a02b76 Added metric for the delay in AEC3.
Bug: webrtc:8569
Change-Id: I659049a411654bd3a252ab29008fac467f903efd
Reviewed-on: https://webrtc-review.googlesource.com/25600
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20892}
2017-11-27 12:52:42 +00:00
Ivo Creusen
56d460902e Use the new AudioProcessing statistics everywhere.
The new interface uses optionals instead of default values, and only values that are actually used are included. To make it easy to add/remove stats in the future, the struct itself is copied around on all layers, instead of copying the values one by one. This CL also fixes a bug which caused several APM statistics to get stuck at a fixed level when there are no more receive streams (after some period where there were receive streams). Since APM doesn't know this happens, an argument was added to the GetStats call to pass this information down to APM.

Bug: webrtc:8563, b/67926135
Change-Id: I96cc008353355bb520c4523f5c5379860f73ee24
Reviewed-on: https://webrtc-review.googlesource.com/25621
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20877}
2017-11-24 18:17:39 +00:00
Gustaf Ullberg
332150d7df APM reports ERL and ERLE metrics for AEC3.
The audio processing module reports the metrics 'echo return loss'
and 'echo return loss enhancement' for AEC3.

Bug: webrtc:8533
Change-Id: I166c504adf013d6cb5d6d3c9717d0622c3454bb7
Reviewed-on: https://webrtc-review.googlesource.com/24880
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20835}
2017-11-22 15:01:47 +00:00
Ivo Creusen
ae02609645 Add parallel stats interface with optional stats to APM.
This new parallel GetStatistics function uses Optionals to indicate if stats are valid or not, and no longer relies on default values. It also takes an argument to indicate if receive streams are present, and if not several stats will not be set.

Bug: b/67926135
Change-Id: I175de1c65c414bea6ec9ca8b0b16f07cb2308d9f
Reviewed-on: https://webrtc-review.googlesource.com/17942
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20789}
2017-11-20 13:13:20 +00:00
Per Åhgren
38e2d95bda AEC3 delay estimator refactoring and introducing ability to customize
This CL refactors the delay estimator in AEC3.
Furthermore, it adds:
1. Allow for a customized delay estimator behavior to simplify
development.
2. Exposes that behavior to clear configuration settings.
3. Adds logging of the delay range supported by the delay
estimator.

Bug: webrtc:8519
Change-Id: I1764a090519a78b021b2e7de565c52a6c02c848e
Reviewed-on: https://webrtc-review.googlesource.com/21166
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20733}
2017-11-17 17:51:37 +00:00
Henrik Lundin
e3a4da9f44 AGC: Change default clipping level min to 70
The old value was 170, but experiments have shown that 70 is better.

This will let the AGC reduce the gain further when input clipping is
detected. The effect should be less clipping, but sometimes slightly
lower signals.

In Chrome, the value 70 has already been used since June (see
https://codereview.chromium.org/2928133002).

Bug: webrtc:6622, chromium:672476
Change-Id: Ie5a60bb875eef71f303b28e096b22a8cd4b449d4
Reviewed-on: https://webrtc-review.googlesource.com/20222
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20563}
2017-11-06 14:16:06 +00:00
Per Åhgren
7ddd46386a Balancing the transparency in AEC3 between saturating and low echo paths
This CL balances the NLP tradeoff in AEC3 to properly handle the cases
when the echo path is so strong that it saturates the echo and when it
is so weak that the echo is very low compared to nearend.

Bug: webrtc:8411, webrtc:8412, chromium:775653
Change-Id: I5aff74dfadd51cac1ce71b1cb935d68a5be6918d
Reviewed-on: https://webrtc-review.googlesource.com/14120
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20418}
2017-10-25 01:36:59 +00:00
Gustaf Ullberg
bd83b914c3 Separate AEC3 config from AudioProcessing::Config.
The struct containing the config for AEC3 is removed from
AudioProcessing::Config and is put in a new struct called
EchoCanceller3Config.

AEC3 should no longer be activated through
AudioProcessing::ApplyConfig. Instead an EchoCanceller3Factory
can be injected at AudioProcessing creation.

Bug: webrtc:8346
Change-Id: I27e3592e675eec3632a60c45d9e0d12514c2c567
Reviewed-on: https://webrtc-review.googlesource.com/11420
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20342}
2017-10-19 08:19:52 +00:00
Per Åhgren
1b4059e84f Transparency improvements for AEC3 during call start and after resets
This CL changes the AEC3 behavior to be more transparent when there 
is uncertainty about the amount of echo in the microphone signal.

Bug: webrtc:8398, chromium:774868
Change-Id: I88e681f8decd892f44397b753df371a1c4b90af0
Reviewed-on: https://webrtc-review.googlesource.com/10801
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20319}
2017-10-17 06:00:50 +00:00
Gustaf Ullberg
052c78d93f Removed unused AudioProcessing::Create.
Bug: webrtc:8346
Change-Id: I3f0e0727c0377c138202b25100766b3c34e6536a
Reviewed-on: https://webrtc-review.googlesource.com/9381
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20288}
2017-10-13 14:18:27 +00:00
Alessio Bazzica
270f7b5353 AGC2 dummy module: fixed gain param, APM integration, audioproc_f adaptation
In preparation of coming CLs that will add an AGC interface to make the
gain controller injectable.

This CL simplifies AGC2 (dummy sub-module of audioproc_f) since it only
implements the fixed digital mode with hard-clipping - i.e., no limiter
is used.
The AGC2 config now includes the fixed gain to apply and audioproc_f
has been adapted accordingly.
Finally, this CL slightly simplifies the AGC2 integration into APM.

This CL is a continuation of https://codereview.webrtc.org/2995043002/

Bug: webrtc:7494
Change-Id: I3d554ea4dc6208928352059feb14987edabf14c7
Reviewed-on: https://webrtc-review.googlesource.com/4661
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20278}
2017-10-13 11:05:37 +00:00
Gustaf Ullberg
002ef28272 Added EchoControlFactory interface.
The factory for EchoControl is changed from an rtc::Callback1 to an
interface. This avoids using rtc::Callback1 outside of WebRTC.
This also makes the EchoControl factory more similar to other
factories in the code base.

Bug: webrtc:8345
Change-Id: Ie61b9416ed771f8c756326736d17e339eb768469
Reviewed-on: https://webrtc-review.googlesource.com/8900
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20272}
2017-10-13 09:03:07 +00:00
Gustaf Ullberg
d8579e0133 EchoControl factory injectable in AudioProcessing.
This CL enables a factory method creating acoustic echo cancellers
that inherit EchoControl to be injected into the audio processing
module. AudioProcessing will call the factory method to create an
instance of the EchoControl subclass when needed. In the event of
sample rate changes, AudioProcessing will recreate the object using
the factory method.

Bug: webrtc:8346
Change-Id: I0c508b4d4cdb35569864cefaa0e3aea2555cc9b9
Reviewed-on: https://webrtc-review.googlesource.com/7742
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20251}
2017-10-11 14:52:06 +00:00
Per Åhgren
1f33a37565 AEC3 tunings to increase the transparency
This CL changes the tuning of AEC3 to increase the transparency.
In particular:
-The present parameters are re-tuned.
-An oversuppression factor is added in the newly added soft-knee in
 the NLP gain. The purpose of this is to avoid fluctuations in the
 residual echo.
-The dynamics of the computed gain are bounded to ensure that the 
 specified gain characteristics are realizable without echo leakage.
 This also adds robustness against echo leakage in frequency regions
 that are poorly estimated.
 This change was needed to avoid echo leakage from the above 
 tunings.

Bug: chromium:773543,webrtc:8378
Change-Id: If8acc41c1423a6a2fa6f8c4daf2735c86f0b529a
Reviewed-on: https://webrtc-review.googlesource.com/8262
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20231}
2017-10-11 07:28:09 +00:00
Per Åhgren
d309b0081d Smoothed the application of the NLP gain in AEC3
This CL adds a smooth rampup of the NLP gain in AEC3.

Bug: webrtc:8361
Change-Id: I49aa75904751ffe9150db1572271fe7a26232449
Reviewed-on: https://webrtc-review.googlesource.com/7740
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20213}
2017-10-09 22:45:29 +00:00
Per Åhgren
c65ce78027 Separated the NLP behavior in AEC3 for different echo estimates.
This CL separates the NLP gain computation for the different variants
of echo estimation. This simplifies the setting of tuning 
parameters, with resulting transparency improvements and increased
echo removal performance.

Bug: webrtc:8359
Change-Id: I9b97064396fb6f6e2f418ce534573f68694390a1
Reviewed-on: https://webrtc-review.googlesource.com/7613
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20209}
2017-10-09 13:16:37 +00:00
Per Åhgren
0f46441772 Added the ability to set the default echo path delay in AEC3.
This CL adds the ability to set a default echo path delay to use
in AEC3 when there is prior knowledge about the delay in the echo
path.


Bug: webrtc:8358
Change-Id: Ie368f9a6dec9f412e09bf0e095f89d84305045f9
Reviewed-on: https://webrtc-review.googlesource.com/7604
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20204}
2017-10-09 10:52:07 +00:00
Per Åhgren
7106d93dea General AEC3 transparency improvements
This CL adds some general AEC3 transparency improvements.

Specifically:
-A minimum for how the nearend is masking echo is added.
-A temporal smoothing constant is increased to increase the transparency.
-Parameters are surfaced to the parameter config struct.

Bug: webrtc:8360
Change-Id: I2a4881eb40f4fab53ad740c4001925f0af86bbec
Reviewed-on: https://webrtc-review.googlesource.com/7605
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20200}
2017-10-09 10:02:37 +00:00
Gustaf Ullberg
c522298e03 Added first version of the EchoControl interface, used for AEC abstraction.
Bug: webrtc:8346
Change-Id: I792a5f8eefb98388de199fea12c017759fdc6c1e
Reviewed-on: https://webrtc-review.googlesource.com/6780
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20174}
2017-10-06 07:24:43 +00:00
Per Åhgren
c007857ab9 AEC3 tunings to increase transparency
This CL fine-tunes the internal AEC3 parameters to increase the 
transparency of the nearend signal.

Bug: webrtc:8322
Change-Id: I2e35165082d88b8f2b1e8367d8ed0e29bd67b4e5
Reviewed-on: https://webrtc-review.googlesource.com/5365
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20082}
2017-10-02 14:47:25 +00:00
Sam Zackrisson
0beac583bb Add PostProcessing interface to audio processing module.
This CL adds an interface for a generic PostProcessing module that
is optionally added to the APM at construction time.

(Parenthetically this CL also adds a missing lock check to
InitializeGainController2.)

Bug: webrtc:8201
Change-Id: I7de64cf8d5335ecec450da8a961660906141d42a
Reviewed-on: https://webrtc-review.googlesource.com/1570
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19973}
2017-09-26 14:07:15 +00:00
Mirko Bonadei
7120742701 Adding NOLINT for typedefs.h and common_types.h
Now that we have moved WebRTC from src/webrtc to src/, common_types.h
and typedefs.h are triggering a cpplint error.

The cpplint complaint is:
Include the directory when naming .h files  [build/include] [4]

This CL disables the error but we have to remove these two headers
from the root directory.

NOPRESUBMIT=true

Bug: webrtc:5876
Change-Id: I08e1b69aadcc4b28ab83bf25e3819d135d41d333
Reviewed-on: https://webrtc-review.googlesource.com/1577
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Kjellander <kjellander@google.com>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19859}
2017-09-15 13:03:51 +00:00
Mirko Bonadei
92ea95e34a Fixing WebRTC after moving from src/webrtc to src/
In https://webrtc-review.googlesource.com/c/src/+/1560 we moved WebRTC
from src/webrtc to src/ (in order to preserve an healthy git history).
This CL takes care of fixing header guards, #include paths, etc...

NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
TBR=tommi@webrtc.org


Bug: chromium:611808
Change-Id: Iea91618212bee0af16aa3f05071eab8f93706578
Reviewed-on: https://webrtc-review.googlesource.com/1561
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Kjellander <kjellander@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19846}
2017-09-15 05:02:56 +00:00
Mirko Bonadei
bb547203bf Moving src/webrtc into src/.
In order to eliminate the WebRTC Subtree mirror in Chromium, 
WebRTC is moving the content of the src/webrtc directory up
to the src/ directory.

NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
TBR=tommi@webrtc.org

Bug: chromium:611808
Change-Id: Iac59c5b51b950f174119565bac87955a7994bc38
Reviewed-on: https://webrtc-review.googlesource.com/1560
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Kjellander <kjellander@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19845}
2017-09-15 04:25:06 +00:00
Renamed from webrtc/modules/audio_processing/include/audio_processing.h (Browse further)