Commit graph

24 commits

Author SHA1 Message Date
Florent Castelli
c3e6e3a3e8 Remove dependency on rtc_base_approved from most targets
Bug: webrtc:9838
Change-Id: Ibd0199803597eff48ca139a5cecdc3209c62c5d2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/259873
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36643}
2022-04-25 12:15:30 +00:00
Sam Zackrisson
cf7f7f9fa0 AEC3: Add hysteresis period before entering stereo processing
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}
2022-04-08 17:01:08 +00:00
Sam Zackrisson
fa07b43074 AEC3: Add fallback to mono processing if no stereo is detected for some time
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}
2022-04-08 16:43:14 +00:00
Sam Zackrisson
64cdcc0792 AEC3: Add multichannel configuration and multichannel detection
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}
2022-04-07 14:58:02 +00:00
Jakob Ivarsson
4a97d7281f Remove NetEq extra delay option.
Bug: b/156734419
Change-Id: I787e6961ad283990d633029c0cf296e10b825875
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237403
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Jakob Ivarsson <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35326}
2021-11-09 17:25:46 +00:00
Jesús de Vicente Peña
7d0203c723 AEC3: adding a milder exponential decay parameter that is used for dominant nearend regions when enabled.
Bug: webrtc:13143
Change-Id: Iedc6ff39ed5c7cd372b54a82c86354957c8852de
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/231131
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34947}
2021-09-08 11:36:50 +00:00
Gustaf Ullberg
09226fc832 Disable high-pass filtering of the AEC reference
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}
2021-02-23 07:06:11 +00:00
Sam Zackrisson
389bf0feb8 AEC3: Move option for reverb model in nonlinaer mode into AEC3 config
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}
2020-10-02 20:27:47 +00:00
Henrik Lundin
c49e9c253f Adding a delay line to NetEq's output
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}
2020-05-25 12:03:39 +00:00
Per Åhgren
8b844f21e1 AEC3: Remove parameters for the legacy filter naming
Bug: webrtc:8671
Change-Id: Ia5f8e33b9646e2b922428a72364cbbca47091579
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173092
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31030}
2020-04-08 07:34:08 +00:00
Per Åhgren
a388b75223 AEC3: Added parametrization of the comfort noise floor
Bug: webrtc:8671
Change-Id: I2431b1dd8dbe35fc8742c0640c3b35166e8ef6b7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171480
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30876}
2020-03-25 08:56:17 +00:00
Per Åhgren
9d66198d35 AEC3: Rename shadow filter
This CL renames the shadow filter in AEC3 to have the more accurate name
coarse filter.

The CL consists of 3 main initial patch sets, designed to simplify
the review:
1) Replaces "shadow" with "coarse" 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: I28d6041d0d34e85f8f8048d004b44a1a5f07bb07
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170981
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30846}
2020-03-20 15:26:14 +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
Gustaf Ullberg
f534a64047 AEC3: Sub-band nearend detector
Implements an alternative to the dominant nearend detector.

Bug: b/130016532
Change-Id: If4867d58aad036ccf4e456ef81689b8db0284f7d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159865
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29906}
2019-11-25 16:26:49 +00:00
Mirko Bonadei
86d053c2db Use source_sets in component builds and static_library in release builds.
Static libraries don't guarantee that an exported symbol gets linked
into a shared library (and in order to support Chromium's component
build mode, WebRTC needs to be linked as a shared library).

Source sets always pass all the object files to the linker.

On the flip side, source_sets link more object files in release builds
and to avoid this, this CL introduces a the GN template "rtc_library" that
expands to static_library during release builds and to source_set during
component builds.

See: https://gn.googlesource.com/gn/+/master/docs/reference.md#func_source_set

Bug: webrtc:9419
Change-Id: I4667e820c2b3fcec417becbd2034acc13e4f04fe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157168
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#29525}
2019-10-17 21:17:18 +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
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
henrika
2250b05778 Adding support for channel mixing between different channel layouts.
Two new classes are added to WebRTC from Chrome: ChannelMixer and
ChannelMixingMatrix but they are not yet utilized in the audio path for
WebRTC.

The idea is to utilize these new classes when adding support for multi-
channel encoding/decoding in WebRTC/Chrome.

Adds support for a new enumerator call webrtc::ChannelLayout and some
helper methods which maps between channel layout and number of channels.
These parts are also copied from Chrome.

Minor (cosmetic) changes are also done on the AudioFrame to prepare
for upcoming work.

Bug: webrtc:10783
Change-Id: I6cd7a13a3bc1c8bbfa19bc974c7a011d22d19197
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/141674
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28482}
2019-07-04 10:10:54 +00:00
Yves Gerey
3e70781361 [Cleanup] Add missing #include. Remove useless ones. IWYU part 2.
This is a follow-up to
https://webrtc-review.googlesource.com/c/src/+/106280.
This time the whole code base is covered.
Some files may have not been fixed though, whenever the IWYU tool
was breaking the build.

Bug: webrtc:8311
Change-Id: I2c31f552a87e887d33931d46e87b6208b1e483ef
Reviewed-on: https://webrtc-review.googlesource.com/c/111965
Commit-Queue: Yves Gerey <yvesg@google.com>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25830}
2018-11-28 18:25:07 +00:00
Sam Zackrisson
848273aa6a Revert "Increase coverage of AEC3 JSON config unit tests, fix bugs"
This reverts commit 8ee06a7b0c.

Reason for revert: ubsan triggers on config randomization

Original change's description:
> Increase coverage of AEC3 JSON config unit tests, fix bugs
> 
> The new test checks that json strings are unchanged when parsing to a
> config and back to a string. This ensures that everything in the json
> representations is parsed when created a config from the json.
> 
> This CL also adds the render_levels config substruct to the JSON parser.
> 
> Some issues were surfaced by the new test:
>  - Config validation clamping silently passed NaNs
>  - Config validation only fixed the first out-of-bounds parameter, and
>    not any subsequent ones
>  - Config validation did not check all values in the config
> 
> Bug: webrtc:9535
> Change-Id: Ie7b588731dc1fe26ba71d1eb2f177f3b3b8139e3
> Reviewed-on: https://webrtc-review.googlesource.com/c/107120
> Commit-Queue: Sam Zackrisson <saza@webrtc.org>
> Reviewed-by: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#25310}

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

Change-Id: I12d4a6e35110241c51c13eff547ee5a640d141bc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9535
Reviewed-on: https://webrtc-review.googlesource.com/c/107624
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25313}
2018-10-23 12:14:08 +00:00
Sam Zackrisson
8ee06a7b0c Increase coverage of AEC3 JSON config unit tests, fix bugs
The new test checks that json strings are unchanged when parsing to a
config and back to a string. This ensures that everything in the json
representations is parsed when created a config from the json.

This CL also adds the render_levels config substruct to the JSON parser.

Some issues were surfaced by the new test:
 - Config validation clamping silently passed NaNs
 - Config validation only fixed the first out-of-bounds parameter, and
   not any subsequent ones
 - Config validation did not check all values in the config

Bug: webrtc:9535
Change-Id: Ie7b588731dc1fe26ba71d1eb2f177f3b3b8139e3
Reviewed-on: https://webrtc-review.googlesource.com/c/107120
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25310}
2018-10-23 11:08:54 +00:00
Sam Zackrisson
a4c8514258 Add JSON parsing and corresponding ToString to EchoCanceller3Config
Bug: webrtc:9535
Change-Id: I51eaaac4009a30536444292a32938b21e69386bf
Reviewed-on: https://webrtc-review.googlesource.com/c/102980
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25083}
2018-10-10 09:17:09 +00:00
Yves Gerey
665174fdbb Reformat the WebRTC code base
Running clang-format with chromium's style guide.

The goal is n-fold:
 * providing consistency and readability (that's what code guidelines are for)
 * preventing noise with presubmit checks and git cl format
 * building on the previous point: making it easier to automatically fix format issues
 * you name it

Please consider using git-hyper-blame to ignore this commit.

Bug: webrtc:9340
Change-Id: I694567c4cdf8cee2860958cfe82bfaf25848bb87
Reviewed-on: https://webrtc-review.googlesource.com/81185
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23660}
2018-06-19 14:00:39 +00:00
Fredrik Solenberg
bbf21a3fd6 Remove dependencies on modules:module_api from AudioProcessing.
- Directly include api/audio/audio_frame.h everywhere AudioFrame is used.
- This *will* remove transient dependencies on libjpeg and a bunch of other things from the e.g. APM.
- audio_frame.h still included from module_common_types.h for backwards compatibility with clients.

Bug: webrtc:9139, webrtc:7504
Change-Id: Id96f9268c01667fbcc29a01f5c1dd25a37836897
Reviewed-on: https://webrtc-review.googlesource.com/62464
Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22845}
2018-04-12 22:05:27 +00:00