Commit graph

45 commits

Author SHA1 Message Date
Florent Castelli
8037fc6ffa Migrate absl::optional to std::optional
Bug: webrtc:342905193
No-Try: True
Change-Id: Icc968be43b8830038ea9a1f5f604307220457807
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361021
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42911}
2024-09-02 12:16:47 +00:00
Sam Zackrisson
129f40718c Reland: AEC3: clarify render delay controller metrics
This CL:
- makes it easier to understand the (nontrivial) metric interpretation
- corrects the computation of BufferDelay to use 0 for absent delay
- deletes metric MaxSkewShiftCount, unused since https://webrtc-review.googlesource.com/c/src/+/119701
- updates the unit test to directly test metric reporting

Corresponding update to histograms.xml:
https://crrev.com/c/3944909

Previous revert:
https://webrtc-review.googlesource.com/c/src/+/279040
This CL is identical to the original, except:
- the test is updated to spam fewer EXPECT_EQ failures on failure (EXPECT_EQs moved out of inner loop)
- the test not resets metrics (metrics::Reset()) at the beginning, like other histogram tests

Bug: webrtc:8671, chromium:1349051
Change-Id: Ie802e1f9d03a22ff7018f522a63b19e0b6eec2e8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/279046
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38376}
2022-10-13 06:46:29 +00:00
Mirko Bonadei
b2b627701c Revert "AEC3: clarify render delay controller metrics"
This reverts commit fd745d3e3c.

Reason for revert: Breaks downstream projects.

Original change's description:
> AEC3: clarify render delay controller metrics
>
> This CL:
> - makes it easier to understand the (nontrivial) metric interpretation
> - corrects the computation of BufferDelay to use 0 for absent delay
> - deletes metric MaxSkewShiftCount, unused since https://webrtc-review.googlesource.com/c/src/+/119701
> - updates the unit test to directly test metric reporting
>
> Corresponding update to histograms.xml:
> https://crrev.com/c/3944909
>
> Bug: webrtc:8671, chromium:1349051
> Change-Id: If73b6fca4de7343bff2c53f72cedda458d36c599
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278782
> Commit-Queue: Sam Zackrisson <saza@webrtc.org>
> Reviewed-by: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#38362}

Bug: webrtc:8671, chromium:1349051
Change-Id: I1e2bd0f91acb67532e21f5d2f8526a398711a413
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/279040
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38367}
2022-10-12 13:42:31 +00:00
Sam Zackrisson
fd745d3e3c AEC3: clarify render delay controller metrics
This CL:
- makes it easier to understand the (nontrivial) metric interpretation
- corrects the computation of BufferDelay to use 0 for absent delay
- deletes metric MaxSkewShiftCount, unused since https://webrtc-review.googlesource.com/c/src/+/119701
- updates the unit test to directly test metric reporting

Corresponding update to histograms.xml:
https://crrev.com/c/3944909

Bug: webrtc:8671, chromium:1349051
Change-Id: If73b6fca4de7343bff2c53f72cedda458d36c599
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278782
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38362}
2022-10-12 09:30:32 +00:00
Stephan Hartmann
cb56277a17 libstdc++: add missing atomic include for std::atomic
Bug: chromium:957519
Change-Id: I93242198ef8277d5f4d6044fb565d3126768b514
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268187
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37504}
2022-07-12 09:23:26 +00:00
Lionel Koenig
8783c678a5 delay estimator: Look for early reverberation
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}
2022-06-28 15:16:03 +00:00
Niels Möller
7a66900683 Delete rtc_base/atomic_ops.h
Bug: webrtc:9305
Change-Id: I3e8b0db03b84b5361d63db31ee23e6db3deabfe4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266497
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37348}
2022-06-28 08:32:13 +00:00
Gustaf Ullberg
d3ead1a942 AEC3: 'Block' class
This change adds a Block class to reduce the need for std::vector<std::vector<std::vector<float>>>. This make the code
easier to read and less error prone.

It also enables future changes to the underlying data structure of a
block. For instance, the data of all bands and channels could be stored
in a single vector.

The change has been verified to be bit-exact.

Bug: webrtc:14089
Change-Id: Ied9a78124c0bbafe0e912017aef91f7c311de2ae
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262252
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36968}
2022-05-23 09:53:46 +00:00
Niels Möller
de95329daa Delete macros RTC_DISALLOW_ASSIGN and RTC_DISALLOW_IMPLICIT_CONSTRUCTORS
The former was unused, the latter is replaced with the explicit C++11
deletions. The related RTC_DISALLOW_COPY_AND_ASSIGN is left for now,
it is used in a lot more places.

Bug: None
Change-Id: I49503e7f2b9ff43c6285f8695833479bbc18c380
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185500
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32224}
2020-09-29 10:19:20 +00:00
Per Åhgren
6a05bb1b12 AEC3: Add signal dependent mixing before alignment
This CL adds code for doing signal-dependent downmixing
before the delay estimation in the multichannel case.

As part of the CL, the unittests of the render delay
controller are corrected. However, as that caused some of
them to fail, the CL (for now) as well disables the failing
test.

Bug: webrtc:11153,chromium:1029740, webrtc:11161
Change-Id: I0b765c28fa5e547aabd6dfbd24b626ff9a16346f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161045
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29980}
2019-12-03 11:30:48 +00:00
Gustaf Ullberg
ee84d39fce AEC3: Downmix multichannel signals before delay estimation
Multichannel signals are downmixed to mono before decimation and
delay estimation. This is useful when not all channels play
audio content. The feature can be toggled in the AEC3 configuration.

Bug: webrtc:10913
Change-Id: I7d40edf7732bb51fec69e7f3ca063d821c5069c4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151762
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29126}
2019-09-10 08:16:07 +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
Gustaf Ullberg
1107cab646 Remove the ability for EchoRemover to override the render vs capture alignment
This change removes the (unused) ability of EchoRemover overriding
the delay of the RenderDelayController. The change is tested for
bit-exactness.

Bug: webrtc:8671
Change-Id: I188ef740f1437de64ffe236d07a7dcd4128192c2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130518
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27414}
2019-04-02 14:04:38 +00:00
Gustaf Ullberg
9249fbf3a6 AEC3: Redesign delay headroom
This change reduces the risk of echo due to noise in the headroom
of the linear filter.

Changes:
- Use shorter delay headroom
- Delay headroom is specified in samples (not blocks)
- No hysteresis limit when delay is reduced

Bug: chromium:119942,webrtc:10341
Change-Id: I708e80e26d541dff8ca04b6da2d346a1d59cbfcb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/126420
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27126}
2019-03-14 11:04:47 +00:00
Gustaf Ullberg
68d6d44197 AEC3: Remove remaining kill-switches
This CL concludes the post-launch removal of kill-switches is AEC3.

Kill-switches removed:
WebRTC-Aec3AdaptErleOnLowRenderKillSwitch
WebRTC-Aec3AgcGainChangeResponseKillSwitch
WebRTC-Aec3BoundedNearendKillSwitch
WebRTC-Aec3EarlyShadowFilterJumpstartKillSwitch
WebRTC-Aec3EnableAdaptiveEchoReverbEstimation
WebRTC-Aec3EnforceSkewHysteresis1
WebRTC-Aec3EnforceSkewHysteresis2
WebRTC-Aec3FilterAnalyzerPreprocessorKillSwitch
WebRTC-Aec3MisadjustmentEstimatorKillSwitch
WebRTC-Aec3OverrideEchoPathGainKillSwitch
WebRTC-Aec3RapidAgcGainRecoveryKillSwitch
WebRTC-Aec3ResetErleAtGainChangesKillSwitch
WebRTC-Aec3ShadowFilterBoostedJumpstartKillSwitch
WebRTC-Aec3ShadowFilterJumpstartKillSwitch
WebRTC-Aec3SmoothSignalTransitionsKillSwitch
WebRTC-Aec3SmoothUpdatesTailFreqRespKillSwitch
WebRTC-Aec3SoftTransparentModeKillSwitch
WebRTC-Aec3StandardNonlinearReverbModelKillSwitch
WebRTC-Aec3StrictDivergenceCheckKillSwitch
WebRTC-Aec3UseOffsetBlocks
WebRTC-Aec3UseStationarityPropertiesKillSwitch
WebRTC-Aec3UtilizeShadowFilterOutputKillSwitch
WebRTC-Aec3ZeroExternalDelayHeadroomKillSwitch
WebRTC-Aec3FilterQualityStateKillSwitch
WebRTC-Aec3NewSaturationBehaviorKillSwitch
WebRTC-Aec3GainLimiterDeactivationKillSwitch
WebRTC-Aec3EnableErleUpdatesDuringReverbKillSwitch

The change has been tested for bit-exactness.

Bug: webrtc:8671
Change-Id: I42816b9d1c875cec0347034c6e2ed4ff5db6ec0f
Reviewed-on: https://webrtc-review.googlesource.com/c/119942
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26443}
2019-01-29 10:31:45 +00:00
Gustaf Ullberg
99ec6f39b9 AEC3: Remove unused kill-switches from AdjustConfig
Kill-switches removed:
WebRTC-Aec3UseShortDelayEstimatorWindow
WebRTC-Aec3ReverbBasedOnRenderKillSwitch
WebRTC-Aec3ReverbModellingKillSwitch
WebRTC-Aec3EnableUnityInitialRampupGain
WebRTC-Aec3EnableUnityNonZeroRampupGain
WebRTC-Aec3ShortReverbKillSwitch
WebRTC-Aec3NewFilterParamsKillSwitch
WebRTC-Aec3EnableLegacyDominantNearend
WebRTC-Aec3UseLegacyNormalSuppressorTuning
WebRTC-Aec3UseStationarityProperties
WebRTC-Aec3UseStationarityPropertiesAtInit
WebRTC-Aec3EarlyDelayDetectionKillSwitch

The change is tested for bit-exactness.

Bug: webrtc:8671
Change-Id: Ic7638002c0ca1bc5fc911e048285134c4df5d134
Reviewed-on: https://webrtc-review.googlesource.com/c/119921
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26403}
2019-01-25 13:37:13 +00:00
Gustaf Ullberg
e47433f017 AEC3: Remove legacy render buffering
This CL removes the legacy, no longer used, render buffering code. It
also removes four unused parameters from the AEC3 config. The change
is tested for bit-exactness.

Bug: webrtc:8671
Change-Id: I2bb6cb7a1097863f228767d757d551c00593bb00
Reviewed-on: https://webrtc-review.googlesource.com/c/119701
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26399}
2019-01-25 08:31:12 +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
Gustaf Ullberg
777cf26328 AEC3: Clockdrift detection
This change introduces a clockdrift detector operating on the estimated
delay of the echo path delay estimator. Each time the delay estimate
changes it is compared to previous estimates. If the estimates are
slowly increasing or decreasing, clockdrift is detected.

Four different patterns are considered clockdrift:
- k, k+1, k+2, k+3
- k, k+2, k+1, k+3
- k, k-1, k-2, k-3
- k, k-2, k-1, k-3

A delay estimate history matching the three last elements in one of the
patterns is considered probable clockdrift. Matching all four elements
is considered verified clockdrift.

If the delay is constant for some time after clockdrift is detected the
clockdrift detector will revert to no detected clockdrift.

The level of clockdrift is reported via an UMA histogram.

Bug: webrtc:10014
Change-Id: I1cce4d593e101a8b3fa99df6935e59b4243cb97a
Reviewed-on: https://webrtc-review.googlesource.com/c/111381
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25758}
2018-11-22 16:02:44 +00:00
Per Åhgren
8b7d206d37 AEC3: Decrease latency until the delay has been detected
This CL utilizes the existing, but unused, ability to set
different histogram thresholds for early and late delay
estimation. It does so by tuning the parameters for these.

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

Bug: webrtc:19886,chromium:896334
Change-Id: I950ac107c124541af8f02b4403f477dda71cc1a1
Reviewed-on: https://webrtc-review.googlesource.com/c/106706
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25443}
2018-10-31 07:29:48 +00:00
Yves Gerey
988cc0870b [Cleanup] Add missing #include. Remove useless ones.
This CL is the result of running include-what-you-use tool on part
of the code base (audio target and dependencies) plus manual fixes.

bug: webrtc:8311
Change-Id: I277d281ce943c3ecc1bd45fd8d83055931743604
Reviewed-on: https://webrtc-review.googlesource.com/c/106280
Commit-Queue: Yves Gerey <yvesg@google.com>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25311}
2018-10-23 11:32:56 +00:00
Gustaf Ullberg
d7b0c46bd9 Avoid incorrect filter alignment due to call skew detection
Bug: chromium:892040,webrtc:9816
Change-Id: I46e8b2de61eedf67e235fcea8f3b9e85f690e64f
Reviewed-on: https://webrtc-review.googlesource.com/c/103661
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24982}
2018-10-04 11:43:58 +00:00
Danil Chapovalov
db9f7ab9f9 Replace rtc::Optional with absl::optional in modules/audio processing
This is a no-op change because rtc::Optional is an alias to absl::optional

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

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

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

git cl format

Bug: webrtc:9078
Change-Id: Id29f8de59dba704787c2c38a3d05c60827c181b0
Reviewed-on: https://webrtc-review.googlesource.com/83982
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23653}
2018-06-19 10:38:56 +00:00
Per Åhgren
2d9a3b1aba Increasing the API call skew hysteresis limit in AEC3
This CL increases the allowed variations in the API call skew limit in
AEC3.

Bug: webrtc:9283,chromium:888042
Change-Id: Ib5e784c6f3dcf1bf3a2cbfe2b1559953db9227a8
Reviewed-on: https://webrtc-review.googlesource.com/77430
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23305}
2018-05-18 13:39:26 +00:00
Per Åhgren
5c532d3774 Robustification of the echo suppression behavior during headset usage.
This CL robustifies the echo removal behavior when headsets are used.
In particular it:
-Introduces a secondary, more refined alignment when no alignment can
be found using the delay estimator.
-Changes decision logic for when to use the linear filter output.
-Changes the decision logic for when to be transparent.
-Changes the way that the transparent mode works.
-Makes the nonlinear mode less aggressive.
-Removes the detector for non-audible echoes.
-Makes the attenuation when there are signals with strong narrowband
characteristics more mild in scenarios with low render.

Furthermore the CL:
-Removes the input of external echo leakage information.


Bug: webrtc:9047,chromium:824111,webrtc:8314,webrtc:8671,webrtc:5201,webrtc:5919
Change-Id: Ied1fe0c0a35d3c31b47606ed2db319a73644d406
Reviewed-on: https://webrtc-review.googlesource.com/60866
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22548}
2018-03-22 00:23:23 +00:00
Per Åhgren
8447e91429 Add a hysteresis for the API call skew detection to better handle jittery platforms
Bug: webrtc:8954,chromium:817313
Change-Id: I940d52ac96e5bddf886d47be089a1991ae24b51b
Reviewed-on: https://webrtc-review.googlesource.com/58640
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22228}
2018-02-28 14:02:43 +00:00
Per Åhgren
d8243fa6b3 Adding reporting and logging for events of call API skew shifts
Bug: webrtc:8887
Change-Id: I8a73afcd85815f4167ab47bd625f264747c06f8e
Reviewed-on: https://webrtc-review.googlesource.com/53066
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22193}
2018-02-26 23:57:23 +00:00
Per Åhgren
39f491eb4e Moved and simplifed the AEC3 API call skew estimator and added tests
This CL moves the AEC3 API call skew estimator into a separate file.
This has the advantage that it can more easily be tested.
The CL also simplifies the code and adds unittests.

Bug: webrtc:8671
Change-Id: I19bc31ca5666cdc87a1ed14770ef20ead1b5b80d
Reviewed-on: https://webrtc-review.googlesource.com/55860
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22144}
2018-02-22 00:52:10 +00:00
Per Åhgren
3ab308f869 Inform the AEC3 echo remover about the status of the estimated delay
This CL adds functionality for passing the information about the
estimated delay to the echo remover in AEC3.
The CL also adds information about how long ago the delay changed,
and how long ago the delay estimate was updated.

Bug: webrtc:8671
Change-Id: If274ffe0465eb550f3e186d0599c6dc6fef7f5e8
Reviewed-on: https://webrtc-review.googlesource.com/55261
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22137}
2018-02-21 17:08:36 +00:00
Gustaf Ullberg
3646f973c2 AEC3 includes echo_canceller3_config.h directly
Avoid including audio_processing.h from within AEC3.

Bug: webrtc:8844
Change-Id: I02c475c2fb84e2c24eac86baac3c7edaa08bebc0
Reviewed-on: https://webrtc-review.googlesource.com/53065
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22029}
2018-02-15 08:30:14 +00:00
Per Åhgren
fdd4400ef4 Removed hysteresis in the delay estimation offset
Bug: chromium:811658,webrtc:8879
Change-Id: I9e67fd9aaae4b85e344b9b40ca6bcf9a8fe1eec1
Reviewed-on: https://webrtc-review.googlesource.com/52480
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22002}
2018-02-13 14:29:23 +00:00
Per Åhgren
4712776bf4 Leveraging the skew in API call order to a boost AEC3 signal realignment
This CL resets the AEC3 realignment functionality when a significant
and persistent skew in the number of render and capture API calls is
detected.

Bug: chromium:811658,webrtc:8879
Change-Id: Ib5c727b38f427da2a7d25eac7c939a17bdaabe74
Reviewed-on: https://webrtc-review.googlesource.com/52260
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21997}
2018-02-13 12:52:58 +00:00
Per Åhgren
a76ef9d0b4 Robustify the faster alignment in AEC3 to avoid resets
The faster AEC3 alignment introduced recently may in
cases cause the alignment (and the AEC3) to repeatedly
reset. This CL avoids these resets by handling buffer
issues (which are triggering the resets) separately
during the initial coarse alignment phase.



Change-Id: Idf5e2ffda2591906da8060d03ec8ca73cdaedf53
Bug: webrtc:8798,chromium:805815
Reviewed-on: https://webrtc-review.googlesource.com/43480
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21758}
2018-01-25 09:57:31 +00:00
Per Åhgren
0eef9c0c61 Increasing the speed of the initial alignment in AEC3
This CL increases the speech of the initial alignment in AEC3 by
loosening the requirements on the accuracy of the initial estimates.

Bug: webrtc:8784, chromium:804270
Change-Id: I86e2d97830843524090a1cf877965739f66dc058
Reviewed-on: https://webrtc-review.googlesource.com/40660
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21728}
2018-01-22 20:50:39 +00:00
Per Åhgren
d84b3d1f3d Generalized the hysteresis behavior in the AEC3 delay estimator
This CL generalizes the hysteresis behavior on the AEC3 delay estimator
to be two-sided and easier to configure.


Bug: webrtc:8671
Change-Id: Ife21c1511416e32eb3618c81178deefe332ac1e8
Reviewed-on: https://webrtc-review.googlesource.com/39267
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21604}
2018-01-12 15:28:54 +00:00
Per Åhgren
de22a17b43 Removed usage of the the redundant the render alignment headroom in AEC3
Bug: webrtc:8671
Change-Id: I1b7b1bc2f4677bbd375fc206c166b4b9fed3efce
Reviewed-on: https://webrtc-review.googlesource.com/35220
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21392}
2017-12-20 17:27:26 +00:00
Per Åhgren
c59a576c86 Corrections of the render buffering scheme in AEC3 to ensure causality
This CL modifies the refactored render buffering scheme in AEC3
so that:
-A non-causal state can never occur which means that situations with
 nonrecoverable echo should not occur.
-For a stable audio pipeline with a predefined API call jitter,
 render overruns and underruns can never occur.

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

Bug: webrtc:8597, chromium:790905
Change-Id: I8a94e5c1f27316b6100b420eec9652ea31c1a91d
Reviewed-on: https://webrtc-review.googlesource.com/25680
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20989}
2017-12-01 23:14:32 +00:00
Oskar Sundbom
aa8b67da9d Optional: Use nullopt and implicit construction in /modules/audio_processing
Changes places where we explicitly construct an Optional to instead use
nullopt or the requisite value type only.

This CL was uploaded by git cl split.

R=henrik.lundin@webrtc.org

Bug: None
Change-Id: I733a83f702fe11884d229a1713cfac952727bde8
Reviewed-on: https://webrtc-review.googlesource.com/23601
Commit-Queue: Oskar Sundbom <ossu@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20786}
2017-11-20 10:19:30 +00:00
Per Åhgren
38e2d95bda AEC3 delay estimator refactoring and introducing ability to customize
This CL refactors the delay estimator in AEC3.
Furthermore, it adds:
1. Allow for a customized delay estimator behavior to simplify
development.
2. Exposes that behavior to clear configuration settings.
3. Adds logging of the delay range supported by the delay
estimator.

Bug: webrtc:8519
Change-Id: I1764a090519a78b021b2e7de565c52a6c02c848e
Reviewed-on: https://webrtc-review.googlesource.com/21166
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20733}
2017-11-17 17:51:37 +00:00
Gustaf Ullberg
bd83b914c3 Separate AEC3 config from AudioProcessing::Config.
The struct containing the config for AEC3 is removed from
AudioProcessing::Config and is put in a new struct called
EchoCanceller3Config.

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

Bug: webrtc:8346
Change-Id: I27e3592e675eec3632a60c45d9e0d12514c2c567
Reviewed-on: https://webrtc-review.googlesource.com/11420
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20342}
2017-10-19 08:19:52 +00:00
Per Åhgren
0f46441772 Added the ability to set the default echo path delay in AEC3.
This CL adds the ability to set a default echo path delay to use
in AEC3 when there is prior knowledge about the delay in the echo
path.


Bug: webrtc:8358
Change-Id: Ie368f9a6dec9f412e09bf0e095f89d84305045f9
Reviewed-on: https://webrtc-review.googlesource.com/7604
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20204}
2017-10-09 10:52:07 +00:00
Per Åhgren
930021d465 Eliminating the risk of sustained echo during capture data loss in AEC3.
This CL adds an offset to the delay estimation used in AEC3 for 
determining the alignment between the render and capture signals.
This ensures that there is no possibility for the capture loss to 
cause the delay estimation to miss aligning the signals.

BUG=webrtc:8247, chromium:765242

Change-Id: I526dc7971b13425a28e99d69168fd3722a4cfdae
Reviewed-on: https://webrtc-review.googlesource.com/1232
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19871}
2017-09-15 21:24:46 +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/aec3/render_delay_controller.cc (Browse further)