ArrayView is an alias to std::span. This change switch to use
std::span directly instead of through the alias.
Search&Replace MakeArrayView and ArrayView with std::span
Search&Replace include "api/array_view.h" with include <span>
Remove <span> include where std::span is not mentioned in the file
Remove build dependencies on array_view target
Replace ExpectArrayViewEquality helper with ElementsAreArray matcher
in pffft_wrapper_unittest.cc
Bug: webrtc:439801349
Change-Id: I9503bc9003ee6a7e349459989b03f59a7de37ea6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/460320
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47270}
The aecdump config message requires a lot of duplication and boilerplate
in exchange for being able to read the config back at offline simulation
time. The message tends to slip out of sync with APM configuration,
missing many important parameters which hampers reproducibility.
This CL adds many recently added parameters to the dump message, and
makes the message more likely to contain future parameters as well.
This creates some redundancy with older params. They are kept in, to
maintain the ability to parse old aecdumps and to keep our existing
(limited) reproducibility with audioproc_f.
Bug: webrtc:42224259, webrtc:442444736, b:428638881
Change-Id: Ib6e57435a58b0ed417c83ecc627678adb0d0164f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/444260
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#46771}
This change removes the possibility to run AEC mobile version. AEC3 is a
suitable and better alternative.
Follow up changes will remove the actual code.
Bug: webrtc:379762006
Change-Id: I370081af9222093a09ef77076e12195392bf97cc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/442200
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Lionel Koenig <lionelk@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#46691}
This uncovered the fact that its descent into third_party was
not yet prevented; added running gclient sync -f to the script so that
changes outside our repo would be reverted.
Bug: None
Change-Id: I18f4e75c57174b765ed941a062ed00613874f324
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/441061
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#46602}
This reverts commit 7e1a12d6ff.
Reason for revert: Removed the problematic deprecation
Original change's description:
> Revert "Mark deprecated features with [[deprecated]]"
>
> This reverts commit 3cf5dc1bec.
>
> Reason for revert: Broke downstream project (Nearby)
>
> Original change's description:
> > Mark deprecated features with [[deprecated]]
> >
> > This was the result of asking Gemini
> > "Consider the interfaces in @api. There are comments that indicate that certain methods are deprecated, but the methods don't have [[deprecated]] on them. Make a CL that adds [[deprecated]] to those methods"
> >
> > followed by a few rounds of reverting and working around errors.
> >
> > Bug: None
> > Change-Id: I5d7b1f89fff01277ce96e940aa7340cdfcb728cc
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/407441
> > Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
> > Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#45623}
>
> Bug: None
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Change-Id: Ib5c58e36e94b915a01514455c8a2ad561b61a5c9
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/409000
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#45629}
Bug: None
Change-Id: If8a4e8d6ec5455d892eb3fbb3243417e1a1712b9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/408942
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#45632}
This reverts commit 3cf5dc1bec.
Reason for revert: Broke downstream project (Nearby)
Original change's description:
> Mark deprecated features with [[deprecated]]
>
> This was the result of asking Gemini
> "Consider the interfaces in @api. There are comments that indicate that certain methods are deprecated, but the methods don't have [[deprecated]] on them. Make a CL that adds [[deprecated]] to those methods"
>
> followed by a few rounds of reverting and working around errors.
>
> Bug: None
> Change-Id: I5d7b1f89fff01277ce96e940aa7340cdfcb728cc
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/407441
> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#45623}
Bug: None
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: Ib5c58e36e94b915a01514455c8a2ad561b61a5c9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/409000
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#45629}
This was the result of asking Gemini
"Consider the interfaces in @api. There are comments that indicate that certain methods are deprecated, but the methods don't have [[deprecated]] on them. Make a CL that adds [[deprecated]] to those methods"
followed by a few rounds of reverting and working around errors.
Bug: None
Change-Id: I5d7b1f89fff01277ce96e940aa7340cdfcb728cc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/407441
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#45623}
using
find modules/audio_processing/ -name "*.h" -o -name "*.cc" | grep -v "aecm_core_neon.cc" | grep -v aecm_core_mips.cc | xargs tools_webrtc/iwyu/apply-include-cleaner
followed by
tools_webrtc/gn_check_autofix.py -C out/Default/
and git cl format
Manual changes:
- changes to AECM caused linker errors. Reverted aecm/
- manual modifications in PS 9..12: https://webrtc-review.googlesource.com/c/src/+/387680/9..12
- rebase and follow-up in https://webrtc-review.googlesource.com/c/src/+/387680/14..18
- rebase and follow-up in https://webrtc-review.googlesource.com/c/src/+/387680/19..24
- moved generated debug.pb.h to protobuf_utils.h and exported
- agc2 target visibility changes
- stringstream TODOs
Bug: webrtc:42226242
Change-Id: I9b87208b90f3a7e8f179c1038e6b4dabbcbbbf3c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/387680
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Cr-Commit-Position: refs/heads/main@{#44809}
This adds support for mapping distinct channel pointers into a view and
addresses the incompatibility with AudioFrameView where we receive
externally provided channel pointers.
Mapping a single buffer for multiple channels continues to be supported,
which is how some of the internal webrtc code manages multiple channels.
The implementation does not do any heap allocations and relies on
any buffers being externally owned.
Bug: chromium:409777951
Change-Id: I9929e89884d1037c90bda1c63038af054c058c08
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/392520
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#44744}
In AudioProcessingImpl we receive externally provided channel data
that may not be byte aligned (e.g AudioBus in chromium is aligned on
a 16 byte boundary).
Bug: chromium:409777951
Change-Id: I7ad9afda6f4bbfa67cfaf2ea89a40bebf4624e8b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/392322
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#44717}
WebRTC has unified all namespaces to webrtc, and the rtc:: and cricket::
name specifiers need to be replaced with webrtc::. This was generated using
a combination of clang AST rewriting tools and sed.
This CL was uploaded by git cl split.
Bug: webrtc:42232595
Change-Id: Icbbd42ead3f100bbd85ae66084bdbe1a0b13fa95
No-Iwyu: LSC
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/386646
Auto-Submit: Evan Shrubsole <eshr@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#44407}
absl::Nonnull -> absl_nonnull, absl::Nullable -> absl_nullable,
and absl::NullabilityUnknown -> absl_nullability_unknown.
The new macros are positioned as a qualifier on the affected type,
similar to const, rather than as a templated type wrapping the affected
type.
Bug: webrtc:407433459
No-Iwyu: No regressions introduced by this CL
Change-Id: Id6b1a58296d52c86db3ae44e90849affc904d335
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/384220
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#44301}
To stress there is no intention to use each instance more than once.
Bug: webrtc:369904700
Change-Id: Id53ad804f39f8ee596ec0b45ff15393009fdfab0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366640
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43324}
This interface allows to delegate construction of AudioProcessing to
the PeerConnectionFactory where it can provide propagated field trials
Bug: webrtc:369904700
Change-Id: Ie05cd771e4a869fa5f43173e127256800ae0727f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/365320
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43233}
Using DeinterleavedView<> simplifies these two classes, so now the
classes are arguably thin wrappers on top of DeinterleavedView<> and
AudioFrameView<> can be replaced with DeinterleavedView<>.
The changes are:
* Make VectorFloatFrame not use a vector of vectors but rather
just hold a one dimensional vector of samples and leaves the mapping
into the buffer up to DeinterleavedView<>.
* Remove the `channel_ptrs_` vector which was required due to an
issue with AudioFrameView.
* AudioFrameView is now a wrapper over DeinterleavedView<>. The most
important change is to remove the `audio_samples_` pointer, which
pointed into an externally owned pointer array (in addition to
the array that holds the samples themselves). Now AudioFrameView
can be initialized without requiring such a long-lived array.
Bug: chromium:335805780
Change-Id: I8f3c23c0ac4b5a337f68e9161fc3a97271f4e87d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/352504
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42498}
Allow skipping the deinterleaving steps in PushResampler
before resampling when deinterleaved buffers already exist.
Bug: chromium:335805780
Change-Id: I2080ce2624636cb743beef78f6f08887db01120f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/352202
Reviewed-by: Per Åhgren <peah@webrtc.org>
Auto-Submit: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42438}
rtc::TaskQueue is a wrapper of TaskQueueBase providing no extra functionality in this case
Bug: webrtc:14169
Change-Id: I5eb27a5dbb16f6097a9c71c2633c807808e50c05
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/333800
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41501}
Currently the fixed digital gain is applied after the input volume
controller and before the adaptive digital one. This CL moves its
application after the adaptive digital controller and before the
limiter.
Reasons:
- This change is safe: no production config where both adaptive and
fixed digital controllers are jointly used
- More predictable behavior: when the fixed digital controller is
used after the adaptive digital controller it is easier to describe
the overall behavior - i.e., the fixed digital combined with the
limiter can be used for digital compression
- Allow to remove an unwanted temporal dependency: in a follow-up CL
the input volume controller will use the latest speech level
estimation instead of that from the previously analyzed frame; this
CL makes that change easier.
Bug: webrtc:7494
Change-Id: I2e9869081e0eba1e4f30f11ea93a973ca7fea28c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/286340
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38813}
This CL adds more explicit tests for unsupported sample rates in the WebRTC audio processing module (APM). Rates are restricted to the range [8000, 384000] Hz. Rates outside this range are handled as best as possible, depending on the format.
Tested: bitexact on a large number of aecdumps
Bug: chromium:1332484, chromium:1334991
Change-Id: I9639d03dc837e1fdff64d1f9d1fff0edc0fb299f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276920
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38663}
Implement InputVolumeController and RecommendedInputVolumeEstimator based on the copy of agc classes AgcManagerDirect and MonoAgc.
Copies of the original files created in https://webrtc-review.googlesource.com/c/src/+/278624.
Bug: webrtc:7494
Change-Id: I74acee57b0db5cc8a6b666be9ba619c6c98a1773
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278625
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Hanna Silen <silen@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38533}
Tested: Chromium built with this change; verified that the
behavior at the beginning of the call has not changed with
both low (< 12) and high (> 12) input volumes.
Bug: webrtc:7494
Change-Id: Ie184c994d46bf6fd1cb209873383b911beb766e3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278787
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38420}
The `recommended_stream_analog_level()` getter is used to retrieve
both the applied and the recommended input volume. This behavior is
error-prone since the caller must know what is returned based on
the point in the code (namely, before/after the AGC has changed
the last applied input volume into a recommended level).
This CL is a first step to make clarity on which input volume is
handled in different parts of APM. Next in the pipeline: make
`recommended_stream_analog_level()` a trivial getter that always
returns the recommended level.
Main changes:
- When `recommended_stream_analog_level()` is called but
`set_stream_analog_level()` is not called, APM logs an error
and returns a fall-back volume (which should not be applied
since, when `set_stream_analog_level()` is not called, no
external input volume is expected to be present
- When APM is used without calling the `*_stream_analog_level()`
methods (e.g., when the caller does not provide any input volume),
the recorded AEC dumps won't store `Stream::applied_input_level`
Other changes:
- Removed `AudioProcessingImpl::capture_::prev_analog_mic_level`
- Removed redundant code in `GainController2` around detecting
input volume changes (already done by APM)
- Adapted the `audioproc_f` and `unpack_aecdump` tools
- Data dumps clean-up: the applied and the recommended input
volumes are now recorded in an AGC implementation agnostic way
Bug: webrtc:7494, b/241923537
Change-Id: I3cb4a731fd9f3dc19bf6ac679b7ed8c969ea283b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271544
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38054}
Making it clear that the field is used to store the applied input
volume and not the recommended input volume.
Bug: webrtc:7494, b/241923537
Change-Id: Ib91bc1a12348f63e3a4ba6e068ed02e40786a87b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271342
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38051}
Sample rates not divisible by 100, in particular 11025 Hz and 22050 Hz, have long been used with APM in Chrome, but the support has never been stated explicitly.
This CL makes minor modifications to the APM API to clarify how rates are handled when 10 ms is not an integer number of samples. Unit tests are also extended to cover this case better.
This does not update all references to 10 ms and implicit floor(sample_rate/100) computations, but it does at least take us closer to a correct API.
Note that not all code needs to support these sample rates. For example, audio processing submodules only need to operate on the native APM rates 16000, 32000, 48000.
Bug: chromium:1332484
Change-Id: I1dad15468f6ccb9c0d4d09c5819fe87f8388d5b8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268769
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37682}
This is the first step of migrating
AudioProcessing::CreateAndAttachAecDump() from using std::string to
absl::string_view.
Bug: webrtc:13579
Change-Id: I8fc373e7ac55fd8e96bb0b01d1a30e28883ac9a2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269400
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37631}