Commit graph

234 commits

Author SHA1 Message Date
Per Åhgren
09e9a83d91 Change the way that AecDumps are created in APM
This CL changes the way that AecDumps are created in APM. Instead
of being injected, they are now created via the API.

This removes the AecDumpFactory from the API surface of APM and
makes the API more explicit.

The CL will be followed by one more CL that deprecates the usage
of the AttachAecDump API also within the audio_processing
and the fuzzer folders.

The CL also moves the aec_dump.* files from the include folder
to the aec_dump folder and changes the build files. The reasons
for this are that
1) The content of aec_dump.h is not really part of the API
   surface of APM.
2) Those files anyway needed to be moved to a separate build-
   target to avoid a circular build-file dependency caused by
   the other changes in this CL

Bug: webrtc:5298
Change-Id: I7dd6b49de76eb44158472874e1d4ae17dca9be54
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174750
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31207}
2020-05-11 10:33:00 +00:00
Sam Zackrisson
ab866a2ccb Remove audio playout generator from APM API
This API is and has always been unused.

Bug: webrtc:5298
Change-Id: If1201d37a00e387567d44a9ed8be99a157915b47
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174661
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31180}
2020-05-07 12:14:50 +00:00
Sam Zackrisson
b37e59d198 Add unittests for APM with submodule creation disabled
This introduces a function AudioProcessingImpl::SetCreateOptionalSubmodulesForTesting to simulate the exclusion of build-optional submodules, and tests of the currently only excludable submodule.

Bug: webrtc:11292
Change-Id: If492606205c9fdc669a6dce3a8989a434aeeed1f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173746
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31138}
2020-04-27 11:47:15 +00:00
Per Åhgren
cc73ed3e70 APM: Add build flag to allow building WebRTC without APM
This CL adds a build flag to allow building the non-test parts
of WebRTC without the audio processing module.
The CL also ensures that the WebRTC code correctly handles
the case when no APM is available.

Bug: webrtc:5298
Change-Id: I5c8b5d1f7115e5cce2af4c2b5ff701fa1c54e49e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171509
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31133}
2020-04-26 23:06:44 +00:00
Mirko Bonadei
491ff3d54c Remove AudioProcessing::UpdateHistogramsOnCallEnd.
Bug: webrtc:10198
Change-Id: I3e7a98f9b94c171e7f105883fc755e44b2e991ae
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173464
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31070}
2020-04-14 18:08:52 +00:00
saza
aa42ecde9a Make transient suppression optionally excludable via defines
This allows clients to exclude the transient suppression submodule from WebRTC builds, by defining WEBRTC_EXCLUDE_TRANSIENT_SUPPRESSOR.

The changes have been shown to be bitexact for a test dataset (when the flag is _not_ defined.)

No-Try: True
Bug: webrtc:11226, webrtc:11292
Change-Id: I6931c82a280a9b40a53ee1c2a9820ed9e674a9a5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171421
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30978}
2020-04-02 11:44:07 +00:00
Per Åhgren
dc5522b4bf APM: Removing the redundant VAD output from the integer API
This CL removes the redundant VAD output from the newly introduced
integer API in AudioProcessing.

Bug: webrtc:5298
Change-Id: Iad2b1b97ada7f4863139655526c110e326c6788a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170824
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30832}
2020-03-19 13:59:00 +00:00
Per Åhgren
2507f8cdc9 APM: Replace all remaining usage of AudioFrame outside interfaces
This CL replaces all remaining usage of AudioFrame within APM,
with the exception of the AudioProcessing interface.

The main changes are within the unittests.

Bug: webrtc:5298
Change-Id: I219cdd08f81a8679b28d9dd1359a56837945f3d4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170362
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30831}
2020-03-19 12:40:18 +00:00
Per Åhgren
088329fe2a Correct the storing of the processed output in aecdumps
This CL corrects an issue in the storing of the processed capture output
into aecdump recordings for the case when the integer API interface is
used.


Bug: webrtc:11441
Change-Id: I24aad47b5d62e0738d412ec270ad1db3a76aa94f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170823
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30829}
2020-03-19 10:08:36 +00:00
Per Åhgren
71652f4b66 APM: Localize/abstract the usage of AudioFrame
This CL moves the implementation of of the AudioFrame
support from the implementation of AudioProcessing
to proxy methods that map the call to the integer
stream interfaces (added in another CL).

The CL also changes the WebRTC code using the AudioFrame
interfaces to instead use the proxy methods.

This CL will be followed by one more CL that removes
the usage of the AudioFrame class from the rest of
APM (apart from the AudioProcessing API).

Bug: webrtc:5298
Change-Id: Iecb72e9fa896ebea3ac30e558489c1bac88f5891
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170110
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30812}
2020-03-17 13:55:41 +00:00
Per Åhgren
645f24cb86 APM: Replace most usages of AudioFrame with a stream interface
This CL creates a new stream interface and uses it to replace
most of the usage of AudioFrame in the non-test code.

The CL changes some of the test code as well, as the other
changes required that.

The CL will be followed by 2 more related CLs.

Bug: webrtc:5298
Change-Id: I5cfbe6079f30fc3fbf35b35fd077b6fb49c7def0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170040
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30799}
2020-03-16 11:51:47 +00:00
Sam Zackrisson
4b6ba7c207 Split out some dependencies from the monolith audio processing target
This is a first step to make the transient suppressor and voice detection optional.

Bug: webrtc:11226, webrtc:11292
Change-Id: I203125e11694a957a32bc7f98f3bec3ec8867839
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166523
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30783}
2020-03-12 21:07:08 +00:00
Sam Zackrisson
701bd172d8 Add aecdump experiment strings for injected custom processors
Bug: None
Change-Id: I41aaae454212db3a871d356e0124b868d67033b6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168683
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30544}
2020-02-18 15:53:59 +00:00
Per Åhgren
8ad9e74d62 Removing deprecated legacy noise suppressor
This CL removes the code for the deprecated legacy noise.

Bug: webrtc:5298
Change-Id: If287d8967a3079ef96bff4790afa31f37d178823
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167922
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30434}
2020-01-31 07:14:25 +00:00
Sam Zackrisson
2d31aea481 Remove unused AEC delay offset API
Bug: webrtc:5298
Change-Id: If490dba3c95b1d6aeaa7b110dd1ffc23ee7a96c9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166440
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30297}
2020-01-17 11:09:51 +00:00
Per Åhgren
0695df1a59 Reland "Replace the ExperimentalAgc config with the new config format"
This is a reland of f3aa6326b8

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}
2020-01-17 10:09:09 +00:00
Jonas Olsson
b2b2031457 Concatenate string literals at compile time.
This CL was generated by running:
git ls-files | grep ".cc" | xargs perl -i -ne 'BEGIN {undef $/}; s/("[\s\n]*<<[\s\n]*")/" "/g; print;'; git cl format

After that I manually edited modules/audio_processing/gain_controller2.cc to preserve its original
formatting.

This primary benefit of this change is a small reduction in binary size.

Bug: None
Change-Id: I689fa7ba9c717c314bb167e5d592c3c4e0871e29
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165961
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30251}
2020-01-14 14:47:48 +00:00
Yves Gerey
eb3beb8504 Revert "Replace the ExperimentalAgc config with the new config format"
This reverts commit f3aa6326b8.

Reason for revert: Breaks downstream project.

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}

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

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: webrtc:5298
Change-Id: I794d2ab4b8caa5330c5ad490ba604646a249a1c1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/164530
Reviewed-by: Yves Gerey <yvesg@google.com>
Commit-Queue: Yves Gerey <yvesg@google.com>
Cr-Commit-Position: refs/heads/master@{#30153}
2020-01-07 05:22:01 +00:00
Per Åhgren
f3aa6326b8 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}
2020-01-03 23:14:13 +00:00
Sam Zackrisson
12e319aafe Merge the preambles of the ProcessStream implementations
The two functions have a lot of shared logic and locking. This CL consolidates that into a single function.

Bug: webrtc:111235
Change-Id: Ib1c32165dbf0e212c7d4b0753bcbb5ffd05eb6fe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/163022
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30144}
2020-01-03 14:37:41 +00:00
Per Åhgren
0f14db22de Reduce for reallocations the pre-amplifier and high-pass filter
This CL ensures that the pre-amplifier and the high-pass filter
submodules are not reallocated more than needed.

Bug: webrtc:5298
Change-Id: I7ed23807d4d2d9fef0eda2e7dca9de9b0b1a4649
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/163988
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30143}
2020-01-03 14:10:21 +00:00
Sam Zackrisson
308bc646e0 Remove one acquisition of capture lock in APM AudioFrame API
This brings the two ProcessStream functions closer in implementation.
Additionally, the error checking that is currently done in the period of not holding the lock seems cheaper than releasing and reacquiring the capture lock.

Bug: webrtc:11235
Change-Id: Ib4afc68afb419fcabbb8cf08a3a2e61d2c12acda
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/163021
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30140}
2020-01-03 10:56:24 +00:00
Per Åhgren
2bd85ab039 Avoid AGC2 runtime allocation and activate it on demand
This CL ensures that the AGC2 is created and initialized only when
needed.

Apart from that, the CL also avoids a runtime-reallocation that happens
each time the setting is applied.

Bug: webrtc:5298
Change-Id: Iad9eaa05a3d0baa0788cd11b2aa17ddd8e0c509b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/163987
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30139}
2020-01-03 10:47:14 +00:00
Per Åhgren
c0734715d1 APM: Move the TransientSuppression activation to the apm_config
This CL moves the activation of the transient suppression to the APM
config.

Bug: webrtc:5298
Change-Id: Iba7975bec4654c3df8834fd5b7d1082ff53641dd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/163985
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30137}
2020-01-03 08:48:54 +00:00
Per Åhgren
cf4c872dbd APM: Make the GetStatistics call independent of the locks in APM
This CL changes the GetStatistics call in the audio processing module
(APM) to not aquire the render or capture locks in APM, while still
being thread-safe.
This change eliminates the risk of thread-priority inversion due to the
GetStatistics call.

Apart from the above the CL:
-Corrects the GetStatistics to not be const (it was const even though it
 aquired locks).
-Slightly changes the statistics reporting, so that the stats received
may be older than the most recent stats reported.

Bug: webrtc:11241
Change-Id: I00deb5507e004cbe6e4a19a8bad357491f86f4ab
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/163982
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30131}
2020-01-02 15:45:14 +00:00
Per Åhgren
2e8e1c699e Open up for do the noise suppressor analysis on the linear AEC output
This CL allows the noise suppressor to use the linear AEC output
for analysis whenever that is available. This will potentially
lower the risk that the noise suppressor estimates the noise
based on echo.
The feature is off by default.

Bug: webrtc:5298,b:132164318
Change-Id: Idc6c8e197d96209d213819d87a8fb2533b7303ec
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/162900
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30116}
2019-12-20 09:28:01 +00:00
Per Åhgren
c04242548c Make the high-pass filter operate in full-band
This CL moves the high-pass filter to run in the full-band domain
instead of the split-band domain.

Bug: webrtc:11193
Change-Id: Ie61f4a80afda11236ecbb1ad544bbd0350c7bbfd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161453
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30112}
2019-12-18 16:01:24 +00:00
Per Åhgren
ded86c1ad8 Remove remaining settings for using legacy AEC
This CL removes the remaining settings for using the legacy AEC.

It also adds a missing printout of the enforce_high_pass_filtering
parameter in the ToString method.

Bug: webrtc:11165
Change-Id: I58f0861bf1c6cd24bd83f4d3e394653b2fab3d71
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161683
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30050}
2019-12-10 10:31:07 +00:00
Per Åhgren
62ea0aaea0 Remove deprecated legacy AEC code
This CL removes the deprecated legacy AEC code.

Note that this CL should not be landed before the M80 release has been cut.

Bug: webrtc:11165
Change-Id: I59ee94526e62f702bb9fa9fa2d38c4e48f44753c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161238
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30036}
2019-12-09 10:37:49 +00:00
Per Åhgren
b810646c54 AEC3: Ensure that the high-pass filter is on whenever the AEC is active
This CL ensures that the high-pass filter is on whenever the echo
controller is on. This is important as the echo controller code assumes
that the external high-pass filter is active.

The CL also corrects the ToggleAec unit test (which started failing
after this code change).

Bug: webrtc:11159, chromium:1030179
Change-Id: Ief86eda8f7c67df1c25ac1a06d2cc0778e01196d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161228
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29998}
2019-12-04 09:38:04 +00:00
Per Åhgren
4011de012f Revert "AEC3: Ensure that the high-pass filter effect is on when AEC3 is active"
This reverts commit 3a77f93589.

Reason for revert: The change is breaking downstream tests.

Original change's description:
> AEC3: Ensure that the high-pass filter effect is on when AEC3 is active
> 
> This CL ensures that the high-pass filter is on whenever the echo
> controller is on. This is important as the echo controller code assumes
> that the external high-pass filter is active.
> 
> The CL also corrects the ToggleAec unit test (which started failing
> after this code change).
> 
> Bug: webrtc:11159,chromium:1030179
> Change-Id: Ie29db74bf3de6279a08564398d32d67d5e1569db
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161222
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29979}

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

Change-Id: I78b4e397555f50898ca42c4b32fb39cf06a2541a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11159, chromium:1030179
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161226
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29981}
2019-12-03 11:49:00 +00:00
Per Åhgren
3a77f93589 AEC3: Ensure that the high-pass filter effect is on when AEC3 is active
This CL ensures that the high-pass filter is on whenever the echo
controller is on. This is important as the echo controller code assumes
that the external high-pass filter is active.

The CL also corrects the ToggleAec unit test (which started failing
after this code change).

Bug: webrtc:11159,chromium:1030179
Change-Id: Ie29db74bf3de6279a08564398d32d67d5e1569db
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161222
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29979}
2019-12-03 11:06:08 +00:00
Per Åhgren
b2b58d84e3 AEC3: Adding default AEC3 configurations that are setup specific
This adds functionality to AEC3 to produce setup-specific
default configurations that are tailored to work well for the
number of channels at hand.

The tunings are only used for the case when no echo control factory
has been provided.

Bug: webrtc:11151,chromium:1029717
Change-Id: I1bd2d10327300c7b0f3169a52bf66700b781fd6b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161086
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29972}
2019-12-02 15:04:07 +00:00
Per Åhgren
e14cb99408 Correct/update the activation of the multi-channel processing in APM
This CL removes the experimental status of the multi-channel processing
in APM, and accordingly updates the variable naming.

It also splits the activation of multi-channel processing to be separate
for render and capture.


Bug: webrtc:10859
Change-Id: I0e5d04dcb94b6637c33d97146231b8ddddbaea39
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/160707
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29926}
2019-11-27 10:15:25 +00:00
Per Åhgren
2a6b3b1f7f Correcting the analog AGC re-initialization at device changes
This CL corrects the re-initialization behavior of the analog
AGC to work correctly when the AGC is reinitialized.

Bug: webrtc:11131
Change-Id: Ie455ba3db1aa3936cbcbb2fab023528124853284
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/160650
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29924}
2019-11-26 20:30:20 +00:00
Per Åhgren
e35b32c29f AGC: Removing unnneccessary copying and changing to using const
The changes have been shown to be bitexact on a large dataset.

Bug: webrtc:10859
Change-Id: Iedc0e9e944ebfabb717dd7fb4d2682c695da883e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159694
Reviewed-by: Benjamin Wright <benwright@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Benjamin Wright <benwright@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29883}
2019-11-22 20:14:16 +00:00
Per Åhgren
3daedb6c88 Making the Analog AGC properly support multi-channel
This CL adds proper multi-channel support to the analog AGC.

Beyond that, it prepares adding multi-channel support to the digital
AGC by removing the tight dependency between the analog and digital
AGC codes.

Bug: webrtc:10859
Change-Id: I4414ccbc3db5dbb5ae069fdf426cbd038375ca7b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159480
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29878}
2019-11-22 15:32:55 +00:00
Per Åhgren
0e3198e434 Refactoring of the analog AGC functionality to add multichannel support
This CL refactors the analog AGC functionality. In particular it:
-Breaks then tight dependency between the analog AGC and the digital
AGC implementation.
-Removes the complicated callback interface for reporting the analog
level and replaces it with an int.

Bug: webrtc:10859
Change-Id: I3572d60ab98edebbcffa25af64cc74c66f9868fc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159039
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29838}
2019-11-19 23:39:07 +00:00
Per Åhgren
c20a19cc4b Allow extracting the linear AEC output
This CL enables extracting the linear AEC output,
allowing for more straightforward
testing/development.

Bug: b/140823178
Change-Id: I14f7934008d87066b35500466cb6e6d96f811688
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153672
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29789}
2019-11-13 11:33:53 +00:00
Alessio Bazzica
7587de476b APM runtime setting: fix kPlayoutVolumeChange not dispatched
Bug: webrtc:10608
Change-Id: Ied2e8db1f9914217c6001e0da79c19e2b414056d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159560
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29755}
2019-11-11 13:54:03 +00:00
Gustaf Ullberg
2c6f373a27 Remove legacy EchoControlFactory::Create
Bug: webrtc:10913
Change-Id: I34af9abe76f5b08d7dc5c3e0281fafc14a71eed8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159031
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29741}
2019-11-08 09:58:27 +00:00
Per Åhgren
b8c1be5b6e Further AGC refactoring in preparation for adding multichannel support
Bug: webrtc:10859
Change-Id: If7d58a615a365a0b0f7b49e0cc2392b9bd5e2a0c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159028
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29736}
2019-11-07 22:44:08 +00:00
Alessio Bazzica
7c19a706b0 Audio Processing Module: add play-out audio device runtime information
Add a runtime setting that notifies play-out audio device changes.
The payload is a pair indicating a device id and its maximum play-out
volume.

kPlayoutVolumeChange is now forwarded not only to capture, but also
render (required by render_pre_processor).

Bug: webrtc:10608
Change-Id: I8997c207422c1dcd1d53775397d6290939ef3db8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159002
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29725}
2019-11-07 13:33:09 +00:00
Per Åhgren
361d1c3e5a Simplifications/refactoring of the analog AGC to make it multichannel
This CL prepares parts the analog AGC code to make it properly
multichannel.

Bug: webrtc:10859
Change-Id: I693d0d004dd2c7495ebdc60a43e9a53a441a93e0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158896
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29718}
2019-11-06 22:03:30 +00:00
Per Åhgren
4e5c709ed4 Reland "Correct AEC3 multichannel functionality activation"
This is a reland of 9dda1b3a48

Original change's description:
> Correct AEC3 multichannel functionality activation
> 
> This CL corrects the AEC3 multichannel activation
> to also work for the case when a factory is used
> for the activation.
> 
> Bug: webrtc:10913
> Change-Id: Ic2807d8bcef759261fde14447cff30633ba248dc
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158794
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29676}

Bug: webrtc:10913
Change-Id: I1cb3d0de61ea0b299158ca85433f2442c65c196f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158886
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29690}
2019-11-05 14:38:49 +00:00
Per Åhgren
1983458981 Revert "Reland "Correct AEC3 multichannel functionality activation""
This reverts commit d5a7838926.

Reason for revert: Causing errors in downstream tests.

Original change's description:
> Reland "Correct AEC3 multichannel functionality activation"
> 
> This is a reland of 9dda1b3a48
> 
> Original change's description:
> > Correct AEC3 multichannel functionality activation
> > 
> > This CL corrects the AEC3 multichannel activation
> > to also work for the case when a factory is used
> > for the activation.
> > 
> > Bug: webrtc:10913
> > Change-Id: Ic2807d8bcef759261fde14447cff30633ba248dc
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158794
> > Commit-Queue: Per Åhgren <peah@webrtc.org>
> > Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#29676}
> 
> Bug: webrtc:10913
> Change-Id: Ibfe4e8a51183390a4054514bb294c89c2ea201e9
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158880
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29685}

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

Change-Id: I6e27bc7fd1c9d4d5550fdc6ae14c39ca84fb03f8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10913
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158883
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29687}
2019-11-05 09:54:06 +00:00
Per Åhgren
d5a7838926 Reland "Correct AEC3 multichannel functionality activation"
This is a reland of 9dda1b3a48

Original change's description:
> Correct AEC3 multichannel functionality activation
> 
> This CL corrects the AEC3 multichannel activation
> to also work for the case when a factory is used
> for the activation.
> 
> Bug: webrtc:10913
> Change-Id: Ic2807d8bcef759261fde14447cff30633ba248dc
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158794
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29676}

Bug: webrtc:10913
Change-Id: Ibfe4e8a51183390a4054514bb294c89c2ea201e9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158880
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29685}
2019-11-05 09:11:23 +00:00
Per Åhgren
cc9bf6398c Revert "Correct AEC3 multichannel functionality activation"
This reverts commit 9dda1b3a48.

Reason for revert: The CL is causing downstream issues

Original change's description:
> Correct AEC3 multichannel functionality activation
> 
> This CL corrects the AEC3 multichannel activation
> to also work for the case when a factory is used
> for the activation.
> 
> Bug: webrtc:10913
> Change-Id: Ic2807d8bcef759261fde14447cff30633ba248dc
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158794
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29676}

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

Change-Id: Ic487f77f5c11485a0f25a2a1d3797d0ec956f913
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10913
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158797
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29678}
2019-11-04 08:49:30 +00:00
Per Åhgren
9dda1b3a48 Correct AEC3 multichannel functionality activation
This CL corrects the AEC3 multichannel activation
to also work for the case when a factory is used
for the activation.

Bug: webrtc:10913
Change-Id: Ic2807d8bcef759261fde14447cff30633ba248dc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158794
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29676}
2019-11-04 08:23:27 +00:00
Per Åhgren
0cbb58e046 Reland "Refactoring of the noise suppressor and adding true multichannel support"
This is a reland of 87a7b82520

Original change's description:
> Refactoring of the noise suppressor and adding true multichannel support
> 
> This CL adds proper multichannel support to the noise suppressor.
> To accomplish that in a safe way, a full refactoring of the noise
> suppressor code has been done.
> 
> Due to floating point precision, the changes made are not entirely
> bitexact. They are, however, very close to being bitexact.
> 
> As a safety measure, the former noise suppressor code is preserved
> and a kill-switch is added to allow revering to the legacy noise
> suppressor in case issues arise.
> 
> Bug: webrtc:10895, b/143344262
> Change-Id: I0b071011b23265ac12e6d4b3956499d122286657
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158407
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29646}

Bug: webrtc:10895, b/143344262
Change-Id: I236f1e67bb0baa4e30908a4cf7a8a7bb55fbced3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158747
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29663}
2019-10-31 11:56:01 +00:00
Artem Titov
4778f6ce7a Revert "Refactoring of the noise suppressor and adding true multichannel support"
This reverts commit 87a7b82520.

Reason for revert: Speculative revert. Breaks downstream projects.

Original change's description:
> Refactoring of the noise suppressor and adding true multichannel support
> 
> This CL adds proper multichannel support to the noise suppressor.
> To accomplish that in a safe way, a full refactoring of the noise
> suppressor code has been done.
> 
> Due to floating point precision, the changes made are not entirely
> bitexact. They are, however, very close to being bitexact.
> 
> As a safety measure, the former noise suppressor code is preserved
> and a kill-switch is added to allow revering to the legacy noise
> suppressor in case issues arise.
> 
> Bug: webrtc:10895, b/143344262
> Change-Id: I0b071011b23265ac12e6d4b3956499d122286657
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158407
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29646}

TBR=gustaf@webrtc.org,peah@webrtc.org

Change-Id: I4d4025bda01f484979961fe57380a705e4d78397
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10895, b/143344262
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158701
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29651}
2019-10-30 09:49:31 +00:00
Per Åhgren
87a7b82520 Refactoring of the noise suppressor and adding true multichannel support
This CL adds proper multichannel support to the noise suppressor.
To accomplish that in a safe way, a full refactoring of the noise
suppressor code has been done.

Due to floating point precision, the changes made are not entirely
bitexact. They are, however, very close to being bitexact.

As a safety measure, the former noise suppressor code is preserved
and a kill-switch is added to allow revering to the legacy noise
suppressor in case issues arise.

Bug: webrtc:10895, b/143344262
Change-Id: I0b071011b23265ac12e6d4b3956499d122286657
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158407
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29646}
2019-10-29 23:23:38 +00:00
Gustaf Ullberg
cb30726646 Remove deprecated Audio Processing APIs
This change removes the deprecated ChannelLayout versions of ProcessStream
and AnalyzeReverseStream.

Bug: webrtc:5298
Change-Id: I8a7e33e89cffac5eceecd00dfd3c96000643f51b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158529
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29641}
2019-10-29 10:07:08 +00:00
Sam Zackrisson
21bfa401dd Update APM config on RuntimeSetting pre amplifier gain change
Bug: webrtc:11045
Change-Id: I78c777632a46e1f8ebf96f4a64c4e1738184d350
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158081
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29586}
2019-10-23 12:34:35 +00:00
Gustaf Ullberg
8c51f2e9cd AnalyzeReverseStream with StreamConfig
Adding a version of AnalyzeReverseStream with audio parameters
described by StreamConfig. This is part of preparations for
multichannel APM in Chromium.

Bug: webrtc:10913
Change-Id: I7c4650eab8bd7fcdec970a7e4a8fa203f09bed9e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157897
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29573}
2019-10-22 14:27:14 +00:00
Sam Zackrisson
72cc71cd70 Harmonize APM config logging, update config ToString
It is unclear what configuration the APM is running with.
This CL helps some of that. Note that the webrtc::Config
is still not reported.

Bug: webrtc:5298
Change-Id: Icc2cf0b20634c04d567c0951a57ba6fe7aa5c5b4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157423
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29555}
2019-10-21 11:35:40 +00:00
saza
1d60052967 Delete ApmPublicSubmodules, fix ApmPrivateSubmodules, ApmSubmoduleStates
All submodule pointers are now private.

The unique_ptr to a ApmPrivateSubmodules is replaced by a direct member
object.

The main outcome of this CL is that the code is nicer.

Bug: webrtc:5298
Change-Id: Ib8ef70a35a64b875752d2a318c572d152d51487a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157440
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29539}
2019-10-18 14:23:50 +00:00
saza
0bad15f2ed Remove the noise_suppression() pointer to submodule interface
Bug: webrtc:9878
Change-Id: I356afddb56cc1957e9d0415e2723f66e0e4ac522
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/137517
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29499}
2019-10-16 11:55:15 +00:00
Sam Zackrisson
41478c7c1b Remove AudioProcessing::gain_control() getter
This change also resolves a bug in audioproc_f:
The implicit ApplyConfig calls to enable gain control settings in
aec_dump_simulator.cc:377-406 [1] are overwritten by the ApplyConfig
call on line 500 using a config from line 292.

Compared to a ToT build including a fix for that bug, these changes
are bitexact on a large number of aecdumps.

[1] https://cs.chromium.org/chromium/src/third_party/webrtc/modules/audio_processing/test/aec_dump_based_simulator.cc?l=377&rcl=8bbf9e2c6e40feb8efcbf276b43945a14d651e9b

Bug: webrtc:9878
Change-Id: Id427d34e838c999d996d58193977ac2a9198edd6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156463
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29481}
2019-10-15 09:23:16 +00:00
saza
6787f232ae Remove AudioProcessing::level_estimator() getter
The new configuration path is via AudioProcessing::ApplyConfig and
AudioProcessing::GetStatistics.

Bug: webrtc:9878
Change-Id: Ic912d67455fcef4895566edb8fef62baf62d7cfe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156440
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29454}
2019-10-11 18:08:17 +00:00
Gustaf Ullberg
3c918b1af8 Fix bypass of unnecessary resampling
This change fixes an issue with bypass of unnecessary resampling
when using ProcessStream(AudioFrame*).

Bug: b/130016532
Change-Id: I887f05d55aaa47f21164ba237cf83d0be33a1fd5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156540
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29446}
2019-10-11 11:57:36 +00:00
Gustaf Ullberg
8675eeec26 Bypass unnecessary resampling.
This change keeps the original 48 kHz signal and uses it for the
fullband processing given that the following requirements are
fulfilled:
- Input signal is 48 kHz
- Output signal is 48 kHz
- Multiband processing is performed at 32 kHz
- The multiband processing does not modify the original signal
This avoids unnecessary, lossy resampling and band merging.

Bug: b/130016532
Change-Id: I690c26faba07eab0cbff6c0a95a81d89255dd1a1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155966
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29425}
2019-10-10 08:38:41 +00:00
Gustaf Ullberg
422b9e0982 Run fullband processing at output rate on ARM
The audio processing in the band-split domain on ARM platforms
operate at a sampling frequency of 32 kHz. This CL upsamples
the signal to fullband before the "fullband processing"
if an output rate of 48 kHz is chosen.

Change-Id: I268acd33aff1fcfa4f75ba8c0fb3e16abb9f74e8
Bug: b/130016532
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155640
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29415}
2019-10-09 12:09:06 +00:00
Sam Zackrisson
0824c6f61a Delete voice_detection() pointer to submodule
The new configuration path is via AudioProcessing::ApplyConfig and
AudioProcessing::GetStatistics.

ApmTest.Process passes with unchanged reference files if
audio_processing_impl would initialize the VAD with
VoiceDetection::kLowLikelihood instead of kVeryLowLikelihood.
This was verified by testing this CL with that modification.

Bug: webrtc:9878
Change-Id: I4d08df37a07e5c72feeec02a07d6b9435f917d72
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155445
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29395}
2019-10-07 13:06:05 +00:00
Sam Zackrisson
feee1e4c36 Add flag to APM to force multichannel even with AEC3
Currently, APM fakes multichannel in two ways:
 - With injected AECs, capture processing is only performed on the left
channel. The result is copied into the other channels.
 - With multichannel render audio, all channels are mixed into one
before analysing.

This CL adds a flag to disable these behaviors, ensuring proper
multichannel processing happens throughout the APM pipeline.

Adds killswitches to separately disable render / capture multichannel.

Additionally - AEC3 currently crashes when running with multichannel.
This CL adds the missing pieces to at least have it run without
triggering any DCHECKS, including making the high pass filter properly
handle multichannel.

Bug: webrtc:10913, webrtc:10907
Change-Id: I38795bf8f312b959fcc816a056fba2c68d4e424d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/152483
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29248}
2019-09-20 06:36:12 +00:00
Mirko Bonadei
317a1f09ed Use std::make_unique instead of absl::make_unique.
WebRTC is now using C++14 so there is no need to use the Abseil version
of std::make_unique.

This CL has been created with the following steps:

git grep -l absl::make_unique | sort | uniq > /tmp/make_unique.txt
git grep -l absl::WrapUnique | sort | uniq > /tmp/wrap_unique.txt
git grep -l "#include <memory>" | sort | uniq > /tmp/memory.txt

diff --new-line-format="" --unchanged-line-format="" \
  /tmp/make_unique.txt /tmp/wrap_unique.txt | sort | \
  uniq > /tmp/only_make_unique.txt
diff --new-line-format="" --unchanged-line-format="" \
  /tmp/only_make_unique.txt /tmp/memory.txt | \
  xargs grep -l "absl/memory" > /tmp/add-memory.txt

git grep -l "\babsl::make_unique\b" | \
  xargs sed -i "s/\babsl::make_unique\b/std::make_unique/g"

git checkout PRESUBMIT.py abseil-in-webrtc.md

cat /tmp/add-memory.txt | \
  xargs sed -i \
  's/#include "absl\/memory\/memory.h"/#include <memory>/g'
git cl format
# Manual fix order of the new inserted #include <memory>

cat /tmp/only_make_unique | xargs grep -l "#include <memory>" | \
  xargs sed -i '/#include "absl\/memory\/memory.h"/d'

git ls-files | grep BUILD.gn | \
  xargs sed -i '/\/\/third_party\/abseil-cpp\/absl\/memory/d'

python tools_webrtc/gn_check_autofix.py \
  -m tryserver.webrtc -b linux_rel

# Repead the gn_check_autofix step for other platforms

git ls-files | grep BUILD.gn | \
  xargs sed -i 's/absl\/memory:memory/absl\/memory/g'
git cl format

Bug: webrtc:10945
Change-Id: I3fe28ea80f4dd3ba3cf28effd151d5e1f19aff89
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153221
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29209}
2019-09-17 15:47:29 +00:00
Per Åhgren
fcbe4071ce Adding more refined control over choice of band-splitting
This CL allows the user to have more refined control over what band
splitting-scheme is used inside the audio processing module.


Bug: webrtc:6181
Change-Id: I236c3b1f96ab80cc4ffb8c39c045c034764567a1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/152480
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29189}
2019-09-14 23:14:17 +00:00
Per Åhgren
ce202a0f98 Reland "Reland "Add core multi-channel pipeline in AEC3 This CL adds basic the basic pipeline to support multi-channel processing in AEC3.""
This is a reland of a66395e72f

Original change's description:
> Reland "Add core multi-channel pipeline in AEC3 This CL adds basic the basic pipeline to support multi-channel processing in AEC3."
> 
> This is a reland of f3a197e553
> 
> Original change's description:
> > Add core multi-channel pipeline in AEC3
> > This CL adds basic the basic pipeline to support multi-channel
> > processing in AEC3.
> > 
> > Apart from that, it removes the 8 kHz processing support in several
> > places of the AEC3 code.
> > 
> > Bug: webrtc:10913
> > Change-Id: If5b75fa325ed0071deea94a7546cb4a7adf22137
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150332
> > Commit-Queue: Per Åhgren <peah@webrtc.org>
> > Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#29017}
> 
> Bug: webrtc:10913
> Change-Id: Ifc4b13bd994cfd22dca8f8755fa5700617cc379d
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151124
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29034}

Bug: webrtc:10913
Change-Id: Id8da5666df8c86f290c73ad5dc9958199f1a7ebe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151127
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29042}
2019-09-03 06:12:32 +00:00
Per Åhgren
d112c75801 Revert "Reland "Add core multi-channel pipeline in AEC3 This CL adds basic the basic pipeline to support multi-channel processing in AEC3.""
This reverts commit a66395e72f.

Reason for revert: Breaking downstream tests

Original change's description:
> Reland "Add core multi-channel pipeline in AEC3 This CL adds basic the basic pipeline to support multi-channel processing in AEC3."
> 
> This is a reland of f3a197e553
> 
> Original change's description:
> > Add core multi-channel pipeline in AEC3
> > This CL adds basic the basic pipeline to support multi-channel
> > processing in AEC3.
> > 
> > Apart from that, it removes the 8 kHz processing support in several
> > places of the AEC3 code.
> > 
> > Bug: webrtc:10913
> > Change-Id: If5b75fa325ed0071deea94a7546cb4a7adf22137
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150332
> > Commit-Queue: Per Åhgren <peah@webrtc.org>
> > Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#29017}
> 
> Bug: webrtc:10913
> Change-Id: Ifc4b13bd994cfd22dca8f8755fa5700617cc379d
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151124
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29034}

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

Change-Id: I0e9fd154da5910d73b7a4c82e4e588f3220fd39d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10913
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151126
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29038}
2019-09-02 13:57:07 +00:00
Per Åhgren
a66395e72f Reland "Add core multi-channel pipeline in AEC3 This CL adds basic the basic pipeline to support multi-channel processing in AEC3."
This is a reland of f3a197e553

Original change's description:
> Add core multi-channel pipeline in AEC3
> This CL adds basic the basic pipeline to support multi-channel
> processing in AEC3.
> 
> Apart from that, it removes the 8 kHz processing support in several
> places of the AEC3 code.
> 
> Bug: webrtc:10913
> Change-Id: If5b75fa325ed0071deea94a7546cb4a7adf22137
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150332
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29017}

Bug: webrtc:10913
Change-Id: Ifc4b13bd994cfd22dca8f8755fa5700617cc379d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151124
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29034}
2019-09-02 12:08:27 +00:00
Ilya Nikolaevskiy
e3e30ae5c5 Revert "Add core multi-channel pipeline in AEC3"
This reverts commit f3a197e553.

Reason for revert: Speculative revert, as this may'be broken some build bots

Original change's description:
> Add core multi-channel pipeline in AEC3
> This CL adds basic the basic pipeline to support multi-channel
> processing in AEC3.
> 
> Apart from that, it removes the 8 kHz processing support in several
> places of the AEC3 code.
> 
> Bug: webrtc:10913
> Change-Id: If5b75fa325ed0071deea94a7546cb4a7adf22137
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150332
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29017}

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

Change-Id: I877d2993b9ccf024bd1d57bca1513c3e24d0bed3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10913
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150940
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29022}
2019-08-30 10:19:29 +00:00
Per Åhgren
f3a197e553 Add core multi-channel pipeline in AEC3
This CL adds basic the basic pipeline to support multi-channel
processing in AEC3.

Apart from that, it removes the 8 kHz processing support in several
places of the AEC3 code.

Bug: webrtc:10913
Change-Id: If5b75fa325ed0071deea94a7546cb4a7adf22137
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150332
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29017}
2019-08-30 08:07:27 +00:00
Per Åhgren
0aefbf0ec4 Use the AEC3 high-pass filter for the whole APM
This CL removes and replaces the legacy fixed-point high-pass filter in
APM with the floating point high-pass filter in AEC3.

Bug: webrtc:10907
Change-Id: I88cf8f622ab139e4ffa97f89a72425aa3becfc58
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150103
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28950}
2019-08-23 20:04:10 +00:00
Per Åhgren
c8626b6072 Reland "Reland Process 8 kHz audio as 16 kHz internally of the audio processing module"
This is a reland of b7b8e30cb4

Original change's description:
> Reland Process 8 kHz audio as 16 kHz internally of the audio processing module
> 
> This CL relands the code from the CL "Process 8 kHz audio as 16 kHz internally
> of the audio processing module" which by mistake was reverted via a rebase in
> another CL.
> 
> The CL changes the behavior of APM for 8 kHz so that it is internally
> processed as 16 kHz.
> 
> Bug: webrtc:10863
> Change-Id: I32a57b2d279c2134125667c19b09cfda381a33c3
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150221
> Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28944}

Bug: webrtc:10863
Change-Id: Ic626b99b099248f0d8a677dc4cfe1505e14ae7cd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150330
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28949}
2019-08-23 14:24:48 +00:00
Artem Titarenko
7c4b0c56bf Revert "Reland Process 8 kHz audio as 16 kHz internally of the audio processing module"
This reverts commit b7b8e30cb4.

Reason for revert: Broke ApmTest.Process test in internal iOS waterfall

Original change's description:
> Reland Process 8 kHz audio as 16 kHz internally of the audio processing module
> 
> This CL relands the code from the CL "Process 8 kHz audio as 16 kHz internally
> of the audio processing module" which by mistake was reverted via a rebase in
> another CL.
> 
> The CL changes the behavior of APM for 8 kHz so that it is internally
> processed as 16 kHz.
> 
> Bug: webrtc:10863
> Change-Id: I32a57b2d279c2134125667c19b09cfda381a33c3
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150221
> Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28944}

TBR=gustaf@webrtc.org,peah@webrtc.org

Change-Id: Ia49e07b0c25c49da646917516e317f1d57cc4e84
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10863
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150326
Reviewed-by: Artem Titarenko <artit@webrtc.org>
Commit-Queue: Artem Titarenko <artit@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28948}
2019-08-23 13:11:13 +00:00
Per Åhgren
b7b8e30cb4 Reland Process 8 kHz audio as 16 kHz internally of the audio processing module
This CL relands the code from the CL "Process 8 kHz audio as 16 kHz internally
of the audio processing module" which by mistake was reverted via a rebase in
another CL.

The CL changes the behavior of APM for 8 kHz so that it is internally
processed as 16 kHz.

Bug: webrtc:10863
Change-Id: I32a57b2d279c2134125667c19b09cfda381a33c3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150221
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28944}
2019-08-23 09:19:28 +00:00
Per Åhgren
d47941e018 Reland "Simplification and refactoring of the AudioBuffer code"
This is a reland of 81c0cf287c

Original change's description:
> Simplification and refactoring of the AudioBuffer code
> 
> This CL performs a major refactoring and simplification
> of the AudioBuffer code that.
> -Removes 7 of the 9 internal buffers of the AudioBuffer.
> -Avoids the implicit copying required to keep the
>  internal buffers in sync.
> -Removes all code relating to handling of fixed-point
>  sample data in the AudioBuffer.
> -Changes the naming of the class methods to reflect
>  that only floating point is handled.
> -Corrects some bugs in the code.
> -Extends the handling of internal downmixing to be
>  more generic.
> 
> Bug: webrtc:10882
> Change-Id: I12c8af156fbe366b154744a0a1b3d926bf7be572
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/149828
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28928}

Bug: webrtc:10882
Change-Id: I2ddf327e80a03468c41662ae63c619ff34f2363a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150101
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28938}
2019-08-22 10:34:05 +00:00
Steve Anton
f254e9e9e5 Revert "Simplification and refactoring of the AudioBuffer code"
This reverts commit 81c0cf287c.

Reason for revert: internal test failures

Original change's description:
> Simplification and refactoring of the AudioBuffer code
> 
> This CL performs a major refactoring and simplification
> of the AudioBuffer code that.
> -Removes 7 of the 9 internal buffers of the AudioBuffer.
> -Avoids the implicit copying required to keep the
>  internal buffers in sync.
> -Removes all code relating to handling of fixed-point
>  sample data in the AudioBuffer.
> -Changes the naming of the class methods to reflect
>  that only floating point is handled.
> -Corrects some bugs in the code.
> -Extends the handling of internal downmixing to be
>  more generic.
> 
> Bug: webrtc:10882
> Change-Id: I12c8af156fbe366b154744a0a1b3d926bf7be572
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/149828
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28928}

TBR=gustaf@webrtc.org,peah@webrtc.org

Change-Id: I2729e3ad24b3a9b40b368b84cb565c859e79b51e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10882
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150084
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28931}
2019-08-21 18:00:59 +00:00
Per Åhgren
1c602e39ce Process 8 kHz audio as 16 kHz internally of the audio processing module
This CL changes the behavior of APM for 8 kHz so that it is internally
processed as 16 kHz.


Bug: webrtc:10863
Change-Id: Ie17de6551c6e984b60534820374a49ca298f06ce
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/148800
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28929}
2019-08-21 14:21:53 +00:00
Per Åhgren
81c0cf287c Simplification and refactoring of the AudioBuffer code
This CL performs a major refactoring and simplification
of the AudioBuffer code that.
-Removes 7 of the 9 internal buffers of the AudioBuffer.
-Avoids the implicit copying required to keep the
 internal buffers in sync.
-Removes all code relating to handling of fixed-point
 sample data in the AudioBuffer.
-Changes the naming of the class methods to reflect
 that only floating point is handled.
-Corrects some bugs in the code.
-Extends the handling of internal downmixing to be
 more generic.

Bug: webrtc:10882
Change-Id: I12c8af156fbe366b154744a0a1b3d926bf7be572
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/149828
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28928}
2019-08-21 13:40:59 +00:00
Per Åhgren
928146f546 Removing all external access to the integer sample data in AudioBuffer
This CL removes all external access to the integer sample data in the
AudioBuffer class. It also removes the API in AudioBuffer that provides this.

The purpose of this is to pave the way for removing the sample
duplicating and implicit conversions between integer and floating point
sample formats which is done inside the AudioBuffer.

Bug: webrtc:10882
Change-Id: I1438b691bcef98278aef8e3c63624c367c2d12e9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/149162
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28912}
2019-08-20 08:36:47 +00:00
Per Åhgren
a1351271e6 Remove all AudioBuffer code that is not related to storing audio data
This CL moves/removes all code from the AudioBuffer that:
-Is not directly handling audio data (e.g., keytaps, VAD descisions).
-Is caching aggregated versions of the rest of the audio data.
-Is not used (or only used in testing)

Bug: webrtc:10882
Change-Id: I737deb3f692748eff30f46ad806b2c6f6292802c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/149072
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28866}
2019-08-15 13:49:29 +00:00
Jonas Olsson
a4d873786f Format almost everything.
This CL was generated by running

git ls-files | grep -P "(\.h|\.cc)$" | grep -v 'sdk/' | grep -v 'rtc_base/ssl_' | \
grep -v 'fake_rtc_certificate_generator.h' | grep -v 'modules/audio_device/win/' | \
grep -v 'system_wrappers/source/clock.cc' | grep -v 'rtc_base/trace_event.h' | \
grep -v 'modules/audio_coding/codecs/ilbc/' | grep -v 'screen_capturer_mac.h' | \
grep -v 'spl_inl_mips.h' | grep -v 'data_size_unittest.cc' | grep -v 'timestamp_unittest.cc' \
| xargs clang-format -i ; git cl format

Most of these changes are clang-format grouping and reordering includes
differently.

Bug: webrtc:9340
Change-Id: Ic83ddbc169bfacd21883e381b5181c3dd4fe8a63
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144051
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28505}
2019-07-08 13:45:15 +00:00
Oskar Sundbom
4b27648d8b Avoid the render lock in AudioProcessingImpl::ProcessStream
It seems unnecessary to lock it if not actually reinitializing.

Bug: webrtc:10205
Change-Id: Ib3292e1d640a92a7df77400aebe9583cf877f824
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/115460
Commit-Queue: Oskar Sundbom <ossu@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28060}
2019-05-24 13:24:27 +00:00
Fredrik Hernqvist
ca362855e1 Add PlayoutVolumeChange RuntimeSetting.
Add a PlayoutVolumeChange RuntimeSetting. Trigger an echo path change when the playout volume is changed.

Bug: webrtc:10608
Change-Id: I1e736b93c1865d08c7d2582f6fe00216c1e1f72e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/135746
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Fredrik Hernqvist <fhernqvist@webrtc.org>
Commit-Queue: Fredrik Hernqvist <fhernqvist@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27913}
2019-05-10 14:12:23 +00:00
Per Åhgren
d547d862d5 Remove the enable flag from AEC2 and AECM
This CL removes the redundant enable flags from AEC2 and AECM

Bug: webrtc:5298
Change-Id: Icc575abf1c368dda02ca77f057d166f1c921f662
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/135100
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27848}
2019-05-03 14:20:32 +00:00
Per Åhgren
ea4c5df366 Remove the reporting of histogram data for AEC2
This CL removes the legacy reporting of histogram data for AEC2.

Bug: webrtc:5298
Change-Id: I838e729e0fb78d28e16de0fa79ddf5c857682d65
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/135101
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27834}
2019-05-03 08:58:42 +00:00
Per Åhgren
b6e24d7f35 Only create AECm when needed
This CL ensures that the AECm is only created when needed.
The changes in the CL are bitexact when running AECm via
audioproc_f

The CL also corrects an issue where there is a risk for
AEC2 to not be correctly setup when the sample rate
changes inbetween activations.

Bug: webrtc:8671
Change-Id: Id3b33e20969b1543e28c885d47495246cfbe549d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/134216
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27800}
2019-04-29 10:51:51 +00:00
Per Åhgren
6ee75fdfcb Allow setting the AGC2 fixed gain during runtime
This CL extends the supported runtime settings in
APM to also comprise the AGC2 fixed gain.
The CL was originally created by Adam Whiteside.

Bug: webrtc:10574
Change-Id: I79b3d6501f1e202b66a9b6018f8a493a56b01f62
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/134101
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27782}
2019-04-26 10:05:45 +00:00
Per Åhgren
f204fafdb4 Only create AEC2 when needed
This CL ensures that the AEC2 is only created when needed.
The changes in the CL are bitexact when running AEC2 via
audioproc_f

Bug: webrtc:8671
Change-Id: I5f6d33e45a7031c69ac53098781635c415668e49
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/129740
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27772}
2019-04-25 14:01:12 +00:00
Sam Zackrisson
f0d1c03c31 Add replacement interface for webrtc::GainConrol
The pointer-to-submodule interfaces are being removed.
This CL:
1) introduces AudioProcessing::Config::GainController1 with most config,
2) adds functions to APM for setting and getting analog gain,
3) creates a temporary GainControlConfigProxy to support the transition
   to the new config.
4) Moves the lock references in GainControlForExperimentalAgc and
   GainControlImpl into the GainControlConfigProxy, as it becomes the
   sole AGC object with functionality exposed to the client.

Bug: webrtc:9947, webrtc:9878
Change-Id: Ic31e15e9bb26d6497a92b77874e0b6cab21ff2b2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/126485
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27316}
2019-03-27 15:19:41 +00:00
Per Åhgren
200feba1c0 Make AEC3 the default desktop AEC option in WebRTC
Bug: webrtc:10366
Change-Id: I854ed62df1da489fdab43e9157dff79b7287cacb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/125081
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26983}
2019-03-06 08:43:48 +00:00
Sam Zackrisson
421c859351 Remove crit_render_ lock from webrtc::GainControlImpl
The lock is unnecessary and potentially unsafe:
1) All gain_control accesses in AudioProcessingImpl happen - and are intended to happen - while holding the crit_capture_ lock, and all external API calls take the same lock once inside GainControlImpl.
2) If ProcessCaptureStreamLocked (locked by crit_capture) calls a gain_control function that takes crit_render, the mandated locking order (render before capture) is violated and we might get a deadlock with the render thread.

Bug: b/123456404
Change-Id: Id7a888827e347e5e1d50e2f87d90e8b68f52b7b8
Reviewed-on: https://webrtc-review.googlesource.com/c/122087
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26637}
2019-02-11 14:14:40 +00:00
Sam Zackrisson
235131303b Add noise suppression settings to AudioProcessing::Config
This Config configuration will eventually replace the AudioProcessing::noise_suppression() interface.

This also introduces a proxy NoiseSuppression, returned by AudioProcessing::noise_suppression.
Without this proxy, ApplyConfig could overwrite NS settings for clients who currently use noise_suppression(). For example, the following code will not preserve the noise suppression level:

apm->noise_suppression()->set_level(NoiseSuppression::kHigh);
auto cfg = apm->GetConfig();
apm->ApplyConfig(cfg);

The NoiseSuppression instance returned by noise_suppression() has no way to update the config inside APM, so GetConfig() will return an out-of-date config which is then re-applied. This CL adds a proxy that makes this update, by forwarding Enable() and set_level() calls to ApplyConfig().

Drive-by change: AudioProcessing::Config substructs are reordered to mirror the capture processing pipeline.

Tested: Ran ToT and this CL builds of audioproc_f and verified identical settings/aecdumps.
Bug: webrtc:9947
Change-Id: I823eade894be115c254d656562564108b2b63b1f
Reviewed-on: https://webrtc-review.googlesource.com/c/116521
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26248}
2019-01-14 16:17:19 +00:00
Steve Anton
10542f21c8 (4) Rename files to snake_case: update BUILD.gn, include paths, header guards, and DEPS entries
Mechanically generated by running this command:

tools_webrtc/do-renames.sh update all-renames.txt && git cl format

Then manually updating:

tools_webrtc/sanitizers/tsan_suppressions_webrtc.cc

Bug: webrtc:10159
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I54824cd91dada8fc3ee3d098f971bc319d477833
Reviewed-on: https://webrtc-review.googlesource.com/c/115653
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26226}
2019-01-11 17:11:39 +00:00
Sam Zackrisson
4db667be74 Add private voice detection instance to replace public voice detector
This adds a second (!) VoiceDetection instance in APM, activated via webrtc::AudioProcessing::Config and which reports its values in the webrtc::AudioProcessingStats struct.

The alternative is to reuse the existing instance, but that would require adding a proxy interface returned by AudioProcessing::voice_detection() to update the internal config of AudioProcessingImpl when calling voice_detection()->Enable().

Complexity-wise, no reasonable client will enable both interfaces simultaneously, so the footprint is negligible.

Bug: webrtc:9947
Change-Id: I7d8e28b9bf06abab8f9c6822424bdb9d803b987d
Reviewed-on: https://webrtc-review.googlesource.com/c/115243
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26101}
2018-12-27 12:00:06 +00:00
Sam Zackrisson
b24c00f02d Add AudioProcessingCaptureStats and a level estimator replacement
This adds an interface for accessing stats on the capture stream, and
adds a level estimator to report one of the stats.

Bug: webrtc:9947
Change-Id: Id472534fa2e04d46c9ab700671f620584a246afb
Reviewed-on: https://webrtc-review.googlesource.com/c/109587
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25786}
2018-11-26 15:52:14 +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
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