Commit graph

126 commits

Author SHA1 Message Date
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
95059e0779 Moved the legacy noise suppressor to a separate build target
Bug: webrtc:5298
Change-Id: Ia1c5eb9d0f7b4ba578acb646e73229de63ae91fb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161441
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30089}
2019-12-13 15:26:16 +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
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
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
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
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
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
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
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
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
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
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
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
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
Artem Titov
741daaf039 Move rtc::FunctionView to the public API
Bug: webrtc:10138
Change-Id: Icc25a2a277a9608701aaddd546882366739991ca
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/127898
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27227}
2019-03-21 15:23:05 +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
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
b0ab2ce256 Reland "Remove the HighPassFilter interface"
Downstream Chromium dependencies fixed here:
https://chromium-review.googlesource.com/c/chromium/src/+/1286449

This is a reland of e2405c1a82

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

Bug: webrtc:9535
Change-Id: I0017193ad3ca1762e186f3ad79f29d33ef468202
Reviewed-on: https://webrtc-review.googlesource.com/c/106681
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25300}
2018-10-23 07:44:09 +00:00
Niklas Enbom
d895f42bfb Revert "Remove the HighPassFilter interface"
This reverts commit e2405c1a82.

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

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

Change-Id: Ieb34d5c573c4ab22eefbb54aeaa2f72844740b89
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9535
Reviewed-on: https://webrtc-review.googlesource.com/c/106421
Reviewed-by: Niklas Enbom <niklas.enbom@webrtc.org>
Commit-Queue: Niklas Enbom <niklas.enbom@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25215}
2018-10-16 15:51:45 +00:00
Sam Zackrisson
e2405c1a82 Remove the HighPassFilter interface
The functionality remains unaffected.
Filter toggling is still available via webrtc::AudioProcessing::Config.
Example:
webrtc::AudioProcessing::Config config = apm.GetConfig();
// Read settings
if (config.high_pass_filter.enabled) { ... }
// Apply setting
config.high_pass_filter.enabled = true;
apm.ApplyConfig();

Bug: webrtc:9535
Change-Id: Ib4c4b04078bbb490ebdab9721b8c7811d73777a8
Reviewed-on: https://webrtc-review.googlesource.com/c/102541
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25198}
2018-10-16 09:27:44 +00:00
saza
be490b2abe Delete deprecated AEC interfaces
They've been officially deprecated since September 4, 2018.
PSA: https://groups.google.com/forum/#!topic/discuss-webrtc/r_9n-PRUIX4

Bug: webrtc:9535
Change-Id: I294e22ae874b1edd81a0a0347755d82c5ebc61e0
Reviewed-on: https://webrtc-review.googlesource.com/c/103444
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24971}
2018-10-04 09:20:10 +00:00
Per Åhgren
d2650d1a28 AEC3: Reseting the ERLE at pre-amplifier gain changes
In this CL the ERLE estimator is reset after a pre-amplifier gain change is communicated to APM.

Bug: webrtc:9805
Change-Id: I040f344e4607e862240250f9478d06de0d58a096
Reviewed-on: https://webrtc-review.googlesource.com/103222
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24933}
2018-10-02 15:53:58 +00:00
Sam Zackrisson
cb1b55612c Use low cut filtering whenever NS or AEC are enabled
These submodules implicitly rely on low cut filtering being enabled.

This CL clarifies a distinction:
High pass filtering is a feature that users can enable, according to the WebRTC standard.
Low cut filtering is a processing effect that is applied when any of the following is active:
- high pass filter
- noise suppression
- builtin echo cancellation

Bug: webrtc:9535
Change-Id: I9474276fb11354ea3b01e65a0699f6c29263770b
Reviewed-on: https://webrtc-review.googlesource.com/102600
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24892}
2018-09-28 13:00:19 +00:00
Alex Loiko
d934244feb Added flags for the adaptive analog AGC in audioproc_f.
Added back the 'agc2 level estimation' flag. Also added a flag for
moving the level measurement before AEC and NS. This is to run offline
experiments with audioproc_f.


Bug: webrtc:7494
Change-Id: I3e3ffceede7166b754130be2b707b620ba527e9f
Reviewed-on: https://webrtc-review.googlesource.com/97442
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24657}
2018-09-10 14:16:46 +00:00
Alessio Bazzica
cc22f51988 Removing the intelligibility enhancer.
The intelligibility enhancer is always disabled and it is the only non-test
target using the lapped transform in common_audio (which we planned to remove).

Bug: webrtc:9689, webrtc:5298
Change-Id: Ida65d3aa11ac366471e7e5cbc053108b376c67d8
Reviewed-on: https://webrtc-review.googlesource.com/96460
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24504}
2018-08-30 21:29:57 +00:00
Valeriia Nemychnikova
f06eb57a2f Adding CustomAudioAnalyzer interface in APM.
CustomAudioAnalyzer is an interface of a component into APM that
reads AudioBuffer without changing it.
The APM sub-module is optional. It operates in full band.
As described in the comments, it is an experimental interface which
may be changed in the nearest future.

Change-Id: I21edf729d97947529256407b10fa4b5219bb2bf5
Bug: webrtc:9678
Reviewed-on: https://webrtc-review.googlesource.com/96560
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Valeriia Nemychnikova <valeriian@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24481}
2018-08-29 10:12:26 +00:00
Sam Zackrisson
2a959d96c9 Revert "Add one-stop-shop for built-in AEC toggling in APM"
This reverts commit 771b50ca0b.

Reason for revert: Introduces error-prone config.

Original change's description:
> Add one-stop-shop for built-in AEC toggling in APM
> 
> This does not change what AEC functionality is available.
> However, a client that only uses this interface - and not the submodule
> pointer accessors - gets simpler code, and is guaranteed not to run any
> two AECs in tandem.
> 
> The submodule interface EchoControlMobile is being deprecated in
> https://webrtc-review.googlesource.com/c/src/+/89392
> 
> Bug: webrtc:9535
> Change-Id: Id9326074e566be6d8768010fc421c457beff402c
> Reviewed-on: https://webrtc-review.googlesource.com/89386
> Commit-Queue: Sam Zackrisson <saza@webrtc.org>
> Reviewed-by: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#24066}

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

Change-Id: I43283a1b22538a4caa77313499989146b2ce67f1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9535
Reviewed-on: https://webrtc-review.googlesource.com/90060
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24067}
2018-07-23 14:48:17 +00:00
Sam Zackrisson
771b50ca0b Add one-stop-shop for built-in AEC toggling in APM
This does not change what AEC functionality is available.
However, a client that only uses this interface - and not the submodule
pointer accessors - gets simpler code, and is guaranteed not to run any
two AECs in tandem.

The submodule interface EchoControlMobile is being deprecated in
https://webrtc-review.googlesource.com/c/src/+/89392

Bug: webrtc:9535
Change-Id: Id9326074e566be6d8768010fc421c457beff402c
Reviewed-on: https://webrtc-review.googlesource.com/89386
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24066}
2018-07-23 14:12:26 +00:00
Per Åhgren
88cf0501f3 AEC3: Adding explicit handling of microphone gain changes
This CL re-activates the explicit handling of microphone
gain changes in the AEC3 code. The implementation is done
beneath a kill-switch so that when that switch is active
the changes in this CL are bitexact.


Bug: webrtc:9526,chromium:863826
Change-Id: I58e93d8bc0bce7bec91e102de9891ad48ebc55d8
Reviewed-on: https://webrtc-review.googlesource.com/88620
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23986}
2018-07-16 16:02:07 +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
Sam Zackrisson
af998e2fdc Remove non-API beamformer references
This removes beamformer references from audioproc_f, some non-beamformer tests, and a few other bits and bobs.
The beamformer is, after this, very decoupled from the remaining APM code.

Bug: webrtc:9402
Change-Id: Iaafc95517013d7a17723ef2329f17b5e09069bc9
Reviewed-on: https://webrtc-review.googlesource.com/83983
Reviewed-by: Minyue Li <minyue@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23649}
2018-06-19 08:29:24 +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
Alessio Bazzica
33444dc835 APM pre-gain sub-module: code improvements.
- No need to have a unique ptr for the swap queue
- Remove default case from the switch in
  AudioProcessingImpl::HandleRuntimeSettings()

Bug: webrtc:9138
Change-Id: I346ba1db6510b5caa637510298b67ead07197b81
Reviewed-on: https://webrtc-review.googlesource.com/71164
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22958}
2018-04-20 12:53:53 +00:00
Fredrik Solenberg
104ad0b62b Remove stale dependencies from APM static lib target:
- protobuf library
- file_wrapper.h

These appear to have been left behind during the AecDump refactoring.
After this CL, APM no longer depends on zlib by default! :)

Bug: webrtc:9139
Change-Id: I12a8df2a17a575515b9c07165825f0879c4e15eb
Reviewed-on: https://webrtc-review.googlesource.com/70762
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22923}
2018-04-18 17:00:05 +00:00
Alex Loiko
b5c9a79e68 Activate the pre-amplifier in AudioProcessing.
It's a module for applying a gain to the capture signal.
The gain is the first processing step in APM.

After this CL, these two features work:
* The PreAmplifier can be activated with
  AudioProcessing::Config::pre_amplifier
* The PreApmlifier can be controlled after APM creation by
  AudioProcessing::SetRuntimeSetting.

What's left is a change to AecDumps and to AecDump-replay.

NOTRY=True # 1-line change, tests just passed.

Bug: webrtc:9138
Change-Id: I85b3af511695b0a9cec2eed6fee7f05080305e1d
Reviewed-on: https://webrtc-review.googlesource.com/69811
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22881}
2018-04-16 14:36:49 +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
Karl Wiberg
6a4d411023 Move file_wrapper.h to rtc_base/system/
This moves it from an API directory (system_wrappers/include/) to a
non-API directory, which is exactly what we want for utilities like
this.

BUG=webrtc:8445

Change-Id: I440974da4d347b09ff042478720d7983056b62b9
Reviewed-on: https://webrtc-review.googlesource.com/21226
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22579}
2018-03-23 11:17:15 +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
Per Åhgren
1373582148 Add offline logging of the system delay for AEC3
Bug: webrtc:8671
Change-Id: I8c1801673d9da05c4c5d5385ad455de4d225fff3
Reviewed-on: https://webrtc-review.googlesource.com/52100
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22018}
2018-02-14 12:21:03 +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
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
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
Gustaf Ullberg
ce045acd94 Enable Echo Control at injection.
Echo Control is enabled in capture_nonlocked_ when injected.
Renamed echo_canceller3_enabled to echo_controller_enabled.

Bug: webrtc:8346
Change-Id: Icf441f07ce64719358841544da7579feeb7cfdbb
Reviewed-on: https://webrtc-review.googlesource.com/10808
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20311}
2017-10-16 13:28:37 +00:00
Gustaf Ullberg
8eb9c7d838 Added EchoCanceller3Factory.
Added EchoCanceller3Factory that implements EchoControlFactory and can
be used for injecting EchoCanceller3 into Audio Processing Module.

Renamed InitializeEchoCanceller3 to InitializeEchoController.

Bug: webrtc:8346
Change-Id: I47078da6a49aca1ee41f6a9d5b7b8e91bb5c11a3
Reviewed-on: https://webrtc-review.googlesource.com/9220
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20299}
2017-10-14 07:38:32 +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
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
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/audio_processing_impl.h (Browse further)