Commit graph

54 commits

Author SHA1 Message Date
Sam Zackrisson
56c67555f1 AEC3: Delete render delay buffer alignment killswitch
The code has been running in Chrome since 2020 and ChromeOS since 2022 (https://crrev.com/c/3452884) without issues.

Bug: webrtc:11803
Change-Id: I0c572d362b1f52b4591c7790e11a87c1a1ad1a79
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/293342
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39316}
2023-02-15 12:57:04 +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
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
Sam Zackrisson
fa2927970e AEC3: Re-add delay headroom when precise alignment is needed
This CL adds delay headroom when an external delay estimator is used.

Tested: audioproc_f --aec=1 is bitexact on a large number of aecdumps

Bug: b/158455753
Change-Id: I56de44e841bb8162e302181c6c386ad7fbb00dee
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186703
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32323}
2020-10-06 07:54:08 +00:00
Sam Zackrisson
ff571c60a9 AEC3: Fix render delay buffer alignment issue at call start
Internal counters in the RenderDelayBuffer can slip out of sync with external counters, leading to buffer misalignment.
This CL gives the RenderDelayBuffer an opportunity to update its counters.

Tested:
Passes: modules_unittests --gtest_filter=BlockProcessor.*
Fails as expected due to new unit test: modules_unittests --gtest_filter=BlockProcessor.* --force_fieldtrials="WebRTC-Aec3RenderBufferCallCounterUpdateKillSwitch/Enabled/"

audioproc_f with default AEC settings has been verified to be bit-exact on a large number of aecdumps.

Bug: webrtc:11803
Change-Id: I9363b834c8c8c934add0335013df60bf131da4bc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180126
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31795}
2020-07-27 15:19:58 +00:00
Per Åhgren
ff0451117e AEC3: Rename main filter
This CL renames the main filter in AEC3 to have the more accurate name
refined filter.

The CL consists of 3 main initial patch sets, designed to simplify
the review:
1) Replaces "main" with "refined" and adds a fall-back functionality
to support the old filter naming.
2) Renames the files according to the new naming.
3) Performs a "git cl format"

Bug: webrtc:8671
Change-Id: Ifd0aab34e291736a2250e0986348404618630b1d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170825
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30843}
2020-03-20 13:25:01 +00:00
Sam Zackrisson
b039c30157 Reland "Change log level of AEC3 buffer info to VERBOSE"
This is a reland of 48148dc840

Original change's description:
> Change log level of AEC3 buffer info to VERBOSE
>
> Otherwise, test logs become very verbose:
> https://chrome-swarming.appspot.com/task?id=49b6fa6ac93e2310
> See linked issue.
>
> Bug: webrtc:11278
> Change-Id: I778ee4826de6c1b23d47a5d5ce302d074900ce6b
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165786
> Reviewed-by: Per Åhgren <peah@webrtc.org>
> Commit-Queue: Sam Zackrisson <saza@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#30233}

Bug: webrtc:11278, webrtc:11295
Change-Id: I8e6f11457e283c83cae5581adcacdc4d3b5431bb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167360
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30372}
2020-01-24 12:58:08 +00:00
Sam Zackrisson
3c7e4dd85f Revert "Change log level of AEC3 buffer info to VERBOSE"
This reverts commit 48148dc840.

Reason for revert: Causing tests to timeout, see bugs.webrtc.org/11295

Original change's description:
> Change log level of AEC3 buffer info to VERBOSE
> 
> Otherwise, test logs become very verbose:
> https://chrome-swarming.appspot.com/task?id=49b6fa6ac93e2310
> See linked issue.
> 
> Bug: webrtc:11278
> Change-Id: I778ee4826de6c1b23d47a5d5ce302d074900ce6b
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165786
> Reviewed-by: Per Åhgren <peah@webrtc.org>
> Commit-Queue: Sam Zackrisson <saza@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#30233}

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

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

Bug: webrtc:11278
Change-Id: I283648a6d4d58cfe7af7a646d915122207883007
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167180
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30357}
2020-01-23 10:28:25 +00:00
Sam Zackrisson
48148dc840 Change log level of AEC3 buffer info to VERBOSE
Otherwise, test logs become very verbose:
https://chrome-swarming.appspot.com/task?id=49b6fa6ac93e2310
See linked issue.

Bug: webrtc:11278
Change-Id: I778ee4826de6c1b23d47a5d5ce302d074900ce6b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165786
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30233}
2020-01-13 13:31:27 +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
Per Åhgren
ae40e19805 AEC3: Adding a configurable render signal gain
Bug: webrtc:8671
Change-Id: I405d669517382ce195065caa3147eabace5ec18a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158669
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29647}
2019-10-29 23:26:38 +00:00
Gustaf Ullberg
3cb6104864 AEC3: Support negative delay with external delay estimator
Bug: b/130016532
Change-Id: If41121e9ad95f235200c4b6b146ba8a8749daac4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158220
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29602}
2019-10-24 14:33:21 +00:00
Sam Zackrisson
98872dc556 AEC3: Update SpectrumBuffer API
- RenderBuffer::Spectrum() loses its channel argument, allowing for
  greater flexibility in passing the multi-channel spectrum data into
  functions.
- The FFT spectra lengths are made compile-time constant, rendering
  some DCHECKs obsolete.

Bug: webrtc:10913
Change-Id: Ied0c50cf72d974cfef7279fd2b9c572d049b8b16
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157104
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29528}
2019-10-18 07:01:42 +00:00
Sam Zackrisson
ffc8452730 AEC3: Add support for logging warnings on delay buffer changes
This reintroduces the WARNING log level of a previous CL [1],
via a default-off config flag.

[1] https://webrtc-review.googlesource.com/c/src/+/148528

Bug: None
Change-Id: Ica8583cbb24a1611cfc684ae02d5a0f582004024
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156566
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29489}
2019-10-15 12:16:51 +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
Sam Zackrisson
cfb9497299 Add multi-channel to FftBuffer
All channels are populated by RenderDelayBuffer. but all other
dependent modules are hardcoded to do their regular mono processing
on the first channel.

Bug: webrtc:10913
Tested: Bitexactness on a large set of aecdumps
Change-Id: I11d11aa0ad3da0f244c0ec020d2c9f0f4a735834
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151640
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29079}
2019-09-05 14:10:04 +00:00
Sam Zackrisson
f3f6159114 Rename VectorBuffer->SpectrumBuffer, MatrixBuffer->BlockBuffer, BlockBuffer->Aec2BlockBuffer
The VectorBuffer and MatrixBuffer names are too generic for their use case.

Bug: webrtc:10913
Change-Id: Ideecd0d27e07487a85a61dc6474e69733d07dcd6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151602
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29076}
2019-09-05 10:53:24 +00:00
Sam Zackrisson
a81c09d5b6 Make VectorBuffer in AEC3 multi-channel
All dependent modules are hardcoded to do their regular mono processing on the first channel.

This _almost_ makes RenderBuffer multi-channel: FftData is still only mono.

Bug: webrtc:10913
Change-Id: Id5cc34dbabfe59e1cc72a9675dc7979794e870ed
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151139
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29074}
2019-09-05 09:03:47 +00:00
Per Åhgren
ce202a0f98 Reland "Reland "Add core multi-channel pipeline in AEC3 This CL adds basic the basic pipeline to support multi-channel processing in AEC3.""
This is a reland of a66395e72f

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

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

Reason for revert: Breaking downstream tests

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

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

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

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

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

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

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

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

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

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

Bug: webrtc:10913
Change-Id: If5b75fa325ed0071deea94a7546cb4a7adf22137
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150332
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29017}
2019-08-30 08:07:27 +00:00
Gustaf Ullberg
cd277b84da AEC3: Fix computation of audio buffer delay
This change fixes a bug where the initial delay could be set incorrectly.

Bug: webrtc:10896
Change-Id: I66b2234b69c46639488f4561e973384001230861
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/149820
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28894}
2019-08-19 11:05:21 +00:00
Gustaf Ullberg
940c2b5005 AEC3: Reduce level of log messages
This change reduces the level of several non-critical log messages in
order to reduce log spamming.

Bug: webrtc:8671
Change-Id: I6faae7a2ae4eeafd18c2770208485a75ad946e20
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/148528
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28809}
2019-08-08 14:08:05 +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
8f32b6c18c AEC3: Enable usage of external delay estimator
This change makes it possible to disable AEC3's render delay
controller and delay estimator, and instead rely on an external
delay estimator. The delay is communicated via SetAudioBufferDelay.

When the feature is enabled, no echo removal will be performed
until the first delay is provided.

The delay is

Bug: b/130016532
Change-Id: I16643109d78d770ff1d2713cf247b0b9cce1bc1c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/131327
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27467}
2019-04-05 15:34:39 +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
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
53e22113fd AEC3: Kill kill-switches
"Perfection is achieved, not when there is nothing more to add,
but when there is nothing left to take away."

This CL removes the following kill-switches from AEC3
- WebRTC-Aec3DownSamplingFactor8KillSwitch
- WebRTC-Aec3NewSuppressionKillSwitch
- WebRTC-Aec3ShadowFilterJumpstartKillSwitch
- WebRTC-Aec3SlowFilterAdaptationKillSwitch
- WebRTC-Aec3SuppressorNearendAveragingKillSwitch

It also removes code paths and configuration parameters that are no
longer in use. The list of kill-switches in the audio processing
fuzzer test is updated.

The change has been tested for bit-exactness.

Bug: webrtc:8671
Change-Id: Ie0af86a14baf853548bf9c00b2b9b3bbc32c1aaa
Reviewed-on: https://webrtc-review.googlesource.com/c/105324
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@{#25120}
2018-10-11 16:11:07 +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
Gustaf Ullberg
78b1c4a487 AEC3: Delay estimator uses bandpass filtered signal with downsampling factor 8
Letting the delay estimator operate at a sampling frequency of 2 kHz
with audio between 0 and 1 kHz makes it sensitive to noisy environments.
This CL bandpass filters the 16 kHz signal before downsampling to 2 kHz
in a way that the downsampled 2 kHz signal contains audio between 1 and
2 kHz. It also sets downsampling factor 8 as default which significantly
reduces computational complexity.

Bug: webrtc:9288,chromium:846615
Change-Id: Iaf67898a1a14326cd61bb7f81c14d3c12a697c8d
Reviewed-on: https://webrtc-review.googlesource.com/78703
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23395}
2018-05-25 09:31:38 +00:00
Gustaf Ullberg
43c707ada5 AEC3: Debug dump of render decimator input/output
Bug: webrtc:9288
Change-Id: Ic270bab173e4681a102dca93a5dc8c61caa981a0
Reviewed-on: https://webrtc-review.googlesource.com/78285
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23351}
2018-05-22 15:13:59 +00:00
Per Åhgren
e05c43cc39 Remove the headroom and delay estimation feedback loop in AEC3
This CL ensures that the external audio buffer delay is correctly used
by removing the applied headroom and avoiding that the delay estimation
feedback fromt the echo remover overrules the external delay
information.

Bug: webrtc:9241,chromium:839860
Change-Id: I53cc78ace34a71994ab24a3b552f29979e2aae78
Reviewed-on: https://webrtc-review.googlesource.com/75513
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23189}
2018-05-09 12:34:26 +00:00
Gustaf Ullberg
623d281792 Correcting the use of externally reported delay in AEC3
Externally reported delay affects internal delay of the render delay buffer.

Bug: webrtc:9241,chromium:839860
Change-Id: Ia4e67eaea739e732dd6dcfec343dd7ee37ef883f
Reviewed-on: https://webrtc-review.googlesource.com/74704
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23144}
2018-05-07 13:49:28 +00:00
Gustaf Ullberg
a49eacb30a AEC3: External delay - Fix mismatch in time units
Fixes a confusion of time units (milliseconds vs blocks) of externally
reported audio delay. This fix reduces the risk of echo in the beginning
of a call.

Bug: webrtc:9241,chromium:839860
Change-Id: I534cc15d6b215a5881ae46759f573a56871170a3
Reviewed-on: https://webrtc-review.googlesource.com/74589
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23128}
2018-05-04 16:52:24 +00:00
Per Åhgren
d0fa820559 Allow AEC3 to use any externally reported audio buffer delay in AEC3
This CL adds support for using any externally reported audio buffer
delay to set the initial alignment in AEC3 which is used before the
AEC has been able to detect the delay.

Bug: chromium:834182,webrtc:9163
Change-Id: Ic71355f69b7c4d5815b78e49987043441e7908fb
Reviewed-on: https://webrtc-review.googlesource.com/70580
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22917}
2018-04-18 09:05:54 +00:00
Per Åhgren
f7ac09fca5 Changing log levels and logging of the AEC3 render buffer alignment
Bug: webrtc:8671
Change-Id: I0e626bfbed1faae91623940bc53edcc681a09ed9
Reviewed-on: https://webrtc-review.googlesource.com/64000
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22572}
2018-03-22 21:09:54 +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
b6b00dc180 Safe behavior of the initial echo removal in AEC3
This CL adds functionality to allow removal of any echo occurring
before the render and capture signals have been properly aligned.
The functionality is added in such a manner that the transparency
to nearend is maintained as much as possible.


Bug: webrtc:8883
Change-Id: I813cbbc4c48822e7dffcd9ab6233be4c222089de
Reviewed-on: https://webrtc-review.googlesource.com/49941
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22107}
2018-02-20 22:01:36 +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
08ea5898ff Separated the AEC3 adaptive filter parameters into sub-structs
Bug: webrtc:8671
Change-Id: I02bceceb85da6db65f65c1a2366a2d5021f148ef
Reviewed-on: https://webrtc-review.googlesource.com/39502
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21617}
2018-01-15 16:48:49 +00:00
Per Åhgren
b4c188de3b Added logging of the maximum observed API call jitter in AEC3
Bug: webrtc:8672
Change-Id: Ib64cca5ff5b809c4931db266a9e5a75d378504af
Reviewed-on: https://webrtc-review.googlesource.com/35021
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21550}
2018-01-10 13:33:06 +00:00
Per Åhgren
ec22e3f503 Simplified the usage of the render buffer in AEC3
Bug: webrtc:8671
Change-Id: I4af397e9f208685e4ffec2a5f92501e0d2605c42
Reviewed-on: https://webrtc-review.googlesource.com/35060
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21386}
2017-12-20 14:46:36 +00:00
Per Åhgren
2e27d1cf5e Corrected incorrect overrun event assignment in AEC3
Bug: webrtc:8637,chromium:794099
Change-Id: I46b4a7268fc03e5b3fbc93a334e07c507f78304f
Reviewed-on: https://webrtc-review.googlesource.com/32200
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21219}
2017-12-12 09:14:17 +00:00
Per Åhgren
09a718accd Added the ability to more easily adjust the filter length in AEC3
Bug: webrtc:8609
Change-Id: If060b332993c2c98d7a12608ab31f4da858b8016
Reviewed-on: https://webrtc-review.googlesource.com/28620
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21216}
2017-12-11 22:02:46 +00:00
Per Åhgren
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