Start introducing ArrayView to AudioFrame and code that flows down
from there. In this first step:
* Add `data_view()` that returns a read-only ArrayView for the
audio buffer. When AudioFrame is not initialized however, data_view()
will return a nullptr whereas the current data() method never returns
nullptr.
* Add `mutable_data()` that requires two arguments for properly setting
the samples per channel and number of channels that's required for
accurately reserving the returned mutable ArrayView.
A notable behavior change is that if the requested number of channels
is larger than supported or the calculated buffer size is too large,
the function will trigger a check.
* Add TODOs for following work.
Bug: chromium:335805780
Change-Id: I2937de800422589ebe6a3840b3caadf3d9ff8b00
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/347982
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42202}
Reasons:
- the code is no longer used in Chrome
- it is conceptually weird for WebRTC to have JSON parsing in its API
- there are concerns around the reliability of the underlying JSON library
Additionally, this CL removes the rtc_json "poisonous" attribute: the scheme is incompatible and redundant with testonly.
Bug: webrtc:1493351
Change-Id: I0b621b0e3f183df7315919d9c89242fbe387928f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/325062
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41014}
Enable by default the look for the first echo.
Bug: webrtc:14205
Change-Id: Iae904679c1432f3a0766263907cf376903685b97
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278043
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Commit-Queue: Lionel Koenig <lionelk@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38452}
Look for first echo (and not only the strongest one) on the same matched
filter.
This change is bit exact with previous version when `pre_echo` is false.
Author: Jesús de Vicente Peña <devicentepena@webrtc.org>
Bug: webrtc:14205
Change-Id: I6782eaa1d690b0df78d00f6d425a85c951b2ca9d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266321
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Lionel Koenig <lionelk@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37360}
This cl adds a forwarding header, a build target, and migrates headers
in api/ to use it.
Moving actual implementation, will follow, in
https://webrtc-review.googlesource.com/c/src/+/265390.
Bug: webrtc:12701
Change-Id: Id950725d7d054de8a83b3800b9c9a6437344de86
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265660
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37200}
Even if playout audio is only very briefly stereo, the AEC will enter stereo processing mode. To save CPU and improve AEC performance, this CL adds a hysteresis period before treating playout as stereo.
The feature is enabled by default in the AEC3 config.
Bug: chromium:1295710
Change-Id: I29116ab2e7823e25a02aa3b66a1c619f1d966d9e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258479
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36503}
If playout audio is temporarily stereo, the AEC will currently enter stereo processing mode indefinitely. To save CPU and improve AEC performance, this CL adds support for falling back to mono after a period of no stereo.
The feature is enabled by default in the AEC3 config.
Bug: chromium:1295710
Change-Id: I690b5b22f8407f950bf41f3bcaa9ca0138452157
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258421
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36502}
The features have two safety fallbacks:
- multichannel config has a killswitch WebRTC-Aec3SetupSpecificDefaultConfigDefaultsKillSwitch
- stereo detection has a killswitch WebRTC-Aec3StereoContentDetectionKillSwitch
Both features are enabled by default in the AEC3 config.
Tested: Bitexact on a large number of aecdumps.
Bug: chromium:1295710
Change-Id: I340cdc9140dacd4ca22d0911eb9f732b6cf8b226
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258129
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36482}
Important: This change does not in any way affect echo cancellation or standardized stats. The user audio experience is unchanged. Only non-standard stats are affected. Echo return loss metrics are unchanged. Residual echo likelihood {recent max} will no longer be computed by default.
Important: The echo detector is no longer enabled by default.
API change, PSA: https://groups.google.com/g/discuss-webrtc/c/mJV5cDysBDI/m/7PTPBjVHCgAJ
This CL removes the default usage of the residual echo detector in APM.
It can now only be used via injection and the helper function webrtc::CreateEchoDetector. See how the function audio_processing_unittest.cc:CreateApm() changed, for an example.
The echo detector implementation is marked poisonous, to avoid accidental dependencies.
Some cleanup is done:
- EchoDetector::PackRenderAudioBuffer is declared in one target but is defined in another target. It is not necessary to keep in the API. It is made an implementation detail, and the echo detector input is documented in the API.
- The internal state of APM is large and difficult to track. Submodule pointers that are set permanently on construction are now appropriately marked const.
Tested:
- existing + new unit tests
- audioproc_f is bitexact on a large number of aecdumps
Bug: webrtc:11539
Change-Id: I00cc2ee112fedb06451a533409311605220064d0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/239652
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35550}
Add implementation of RTC_DCHECK_NOTREACHED equal to the RTC_NOTREACHED.
The new macros will replace the old one when old one's usage will be
removed. The idea of the renaming to provide a clear signal that this
is debug build only macros and will be stripped in the production build.
Bug: webrtc:9065
Change-Id: I4c35d8b03e74a4b3fd1ae75dba2f9c05643101db
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237802
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35348}
This change improves echo canceller transparency by enabling the use
of a non-capped ERLE when computing the residual echo spectrum for
dominant nearend detection.
Experimentation has shown that the feature improves echo canceller
transparency and user ratings.
Implementation CL:
https://webrtc-review.googlesource.com/c/src/+/221920
Bug: webrtc:12870
Change-Id: I7dc66810e8300cd35321bcd5b9fae9bc3386836d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/234841
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35186}
This change enables the use of two different adaptation speeds of the
matched filter of the delay estimator of AEC3.
One speed is used when no delay has been found, and one is used after a
reliable delay has been found. The purpose is to use a slower adaptation
speed to reduce the risk of divergence during double-talk without
slowing down the search for the initial delay.
The CL prepares for experimentation by adding field trials for
controlling the two adaptation speeds.
Bug: webrtc:12775
Change-Id: I817a1ab5ded0f78d20de45edcf04c708290173fc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/219083
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34055}
The ERLE is used to estimate residual echo for echo suppression. The
ERLE is reduced during far-end offset to avoid echo leakage. When there
is a strong near-end present this can cause unnecessary transparency loss.
This change adds an ERLE estimation that does not compensate for onsets and
uses it for residual echo estimation when the suppressor considers the near-end to be dominant.
Bug: webrtc:12686
Change-Id: Ida78eeacf1f95c6e62403f86ba3f2ff055898a84
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215323
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33786}
Currently the echo canceller reference signal is high-pass filtered to
avoid the need of modeling the capture-side high-pass filter as part of
the echo path.
This can lead to the lowest frequency bins of the linear filter
diverging as there is little low-frequency content available for
training. Over time the filter can output an increasing amount of
low-frequency power, which in turn affects the filter's ability to
adapt properly.
Disabling the high-pass filtering of the echo canceller reference solves
this issue, resulting in improved filter convergence.
Bug: webrtc:12265
Change-Id: Ic526a4b1b73e1808cfcd96a8cdee801b96a27671
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/208288
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33322}
After the refined filter has been determined to perform better than
the coarse filter, and the coefficients of the coarse filters are
overwritten by the ones from the refined filter, at least 100 ms have
to pass before the adaptation of the refined filter is allowed to speed
up due to good coarse filter performance.
This change solves the vicious circle described in webrtc:12265, where
the coarse and refined filters can diverge over time.
This feature can be disabled remotely via a kill-switch. When disabled
the AEC output is bit-exact to before the change.
Bug: webrtc:12265,chromium:1155477
Change-Id: Iacd6e325e987dd8a475bb3e8163fee714c65b20a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/196501
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32801}
Avoid excessive echo suppression in frequencies above 2 kHz when
there is a dominant nearend. Calls with clock drift will not be affected
by this change as they tend to have less accurate linear filters.
Bug: webrtc:11985
Change-Id: Iddc628da5e2ba572c1b47acd87dd3be35260dca1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/188580
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32533}
This is a reland of 2978abb88c
Original change's description:
> Reduce the amount of howling reduction in AEC3
>
> This CL backs off the howling protection functionality in AEC3.
> The effect is increased transparency in some cases. No negative effects
> have been identified in the hands-on testing.
>
>
> A kill-switch is added that can be used to turn off the functionality.
>
> Bug: b/150764764
> Change-Id: I604c569c76f911799556a60bc8fd2fb43bbfe196
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186082
> Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32258}
Bug: b/150764764,chromium:1134939
Change-Id: I5eea60b35e6d09003ec2fee3865513df8bdd5823
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186260
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32304}
This adds a config parameter for reverb modelling in nonlinear mode.
The killswitch is preserved, and will have the same effect before and after this CL.
Tested: Bitexact on a large number of aecdumps both with and without WebRTC-Aec3NonlinearModeReverbKillSwitch.
Bug: webrtc:8671
Change-Id: I7b2fa92307af5316dbe895392367abb8d15f06bf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183541
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32298}
API to injecting a heavy audio processing operation into WebRTC audio capture pipeline
Bug: webrtc:12003
Change-Id: I9f6f58f468bd84efd0a9d53d703db6229a03959e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165788
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Olga Sharonova <olka@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32291}
This reverts commit 18515e2793.
Reason for revert: Continuation of previous revert https://webrtc-review.googlesource.com/c/src/+/186304
Original change's description:
> Reland "Reduce the amount of howling reduction in AEC3"
>
> This is a reland of 2978abb88c
>
> Original change's description:
> > Reduce the amount of howling reduction in AEC3
> >
> > This CL backs off the howling protection functionality in AEC3.
> > The effect is increased transparency in some cases. No negative effects
> > have been identified in the hands-on testing.
> >
> >
> > A kill-switch is added that can be used to turn off the functionality.
> >
> > Bug: b/150764764
> > Change-Id: I604c569c76f911799556a60bc8fd2fb43bbfe196
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186082
> > Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> > Commit-Queue: Per Åhgren <peah@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#32258}
>
> Bug: b/150764764
> Change-Id: I277f24eb3288ad0307e7463bad9aea6436cfe879
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186263
> Reviewed-by: Per Åhgren <peah@webrtc.org>
> Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32274}
TBR=gustaf@webrtc.org,peah@webrtc.org
Change-Id: I0596855e3bf910878aebcee90e03345d5db1105d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: b/150764764
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186269
Reviewed-by: Andrey Logvin <landrey@webrtc.org>
Commit-Queue: Andrey Logvin <landrey@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32276}
This is a reland of 2978abb88c
Original change's description:
> Reduce the amount of howling reduction in AEC3
>
> This CL backs off the howling protection functionality in AEC3.
> The effect is increased transparency in some cases. No negative effects
> have been identified in the hands-on testing.
>
>
> A kill-switch is added that can be used to turn off the functionality.
>
> Bug: b/150764764
> Change-Id: I604c569c76f911799556a60bc8fd2fb43bbfe196
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186082
> Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32258}
Bug: b/150764764
Change-Id: I277f24eb3288ad0307e7463bad9aea6436cfe879
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186263
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32274}
This reverts commit 2978abb88c.
Reason for revert: Breaks ApmTest.Process.
After trying to enable AVX2, we increased the amount of error
we tolerate (kFloatNear) and this CL introduced a regression which
makes the test fail after we reverted the enabling of AVX2 (restoring
the old tolerance).
With this CL:
../../modules/audio_processing/audio_processing_unittest.cc:1779: Failure
The difference between test->rms_dbfs_average() and rms_dbfs_average is 0.00142669677734375, which exceeds kFloatNear, where
test->rms_dbfs_average() evaluates to 52.907142639160156,
rms_dbfs_average evaluates to 52.905715942382812, and
kFloatNear evaluates to 0.00050000000000000001.
[ FAILED ] ApmTest.Process (5347 ms)
[----------] 1 test from ApmTest (5348 ms total)
[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (5350 ms total)
[ PASSED ] 0 tests.
[ FAILED ] 1 test, listed below:
[ FAILED ] ApmTest.Process
After reverting it:
[ OK ] ApmTest.Process (5345 ms)
[----------] 1 test from ApmTest (5347 ms total)
[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (5350 ms total)
[ PASSED ] 1 test.
Original change's description:
> Reduce the amount of howling reduction in AEC3
>
> This CL backs off the howling protection functionality in AEC3.
> The effect is increased transparency in some cases. No negative effects
> have been identified in the hands-on testing.
>
>
> A kill-switch is added that can be used to turn off the functionality.
>
> Bug: b/150764764
> Change-Id: I604c569c76f911799556a60bc8fd2fb43bbfe196
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186082
> Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32258}
TBR=gustaf@webrtc.org,peah@webrtc.org
Change-Id: I4723c5cd66e3046851089157ec586afab55c5ce8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: b/150764764
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186122
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32261}
This CL backs off the howling protection functionality in AEC3.
The effect is increased transparency in some cases. No negative effects
have been identified in the hands-on testing.
A kill-switch is added that can be used to turn off the functionality.
Bug: b/150764764
Change-Id: I604c569c76f911799556a60bc8fd2fb43bbfe196
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186082
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32258}
This change adds an optional delay to NetEq's output. Note, this is not
equivalent to increasing the jitter buffer with the same extra length.
Bug: b/156734419
Change-Id: I8b70b6b3bffcfd3da296ccf29853864baa03d6bb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175110
Commit-Queue: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31343}
This allows users to inject the residual echo detector, as a step toward making it an optional part of compilation.
Bug: webrtc:11292, webrtc:11539
Change-Id: I7fcc8dbaced67a82851cd6cdcbc115eb01c21fcf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174040
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31222}