Thanks to the elimination of `ExperimentalNs`, there is no need anymore
to pass `webrtc::Config` to build APM.
Hence, `AudioProcessingBuilder::Create(const webrtc::Config&)` is also
removed.
Bug: webrtc:5298
Change-Id: I0a3482376a7753434486fe564681f7b9f83939c5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232128
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35025}
This CL also includes the following changes:
- `AudioProcessing::Config::GainController2::noise_estimator`
deprecated
- `EnergyToDbfs()` optimized by removing unnecessary `sqrt`
- Unit test minor fix, incorrect type was used
Bug: webrtc:7494
Change-Id: I88a6672d6f7cd03fcf6a3031883522d256880140
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/230940
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34893}
Integrate ClippingPredictorEvaluator in AgcManagerDirect adding the
possibility to run the predictor without affecting the analog gain
adjustment process.
The evaluator is used to compute precision, recall and F1 score.
F1 score and the measured clipping prediction intervals are logged as
`WebRTC.Audio.Agc.ClippingPredictor.F1Score` and `.PredictionInterval`
histograms respectively.
Bug: webrtc:12774
Change-Id: I708dcda9321f92d5bd17ec4c36ebce1165ead57f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221921
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34327}
Add the option to run the adaptive digital controller of AGC2 without
side-effects - i.e., no gain applied.
Tested: adapation verified during a video call in chromium
Bug: webrtc:7494
Change-Id: I4776f6012907d76a17a3bca89991da97dc38657f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215964
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33875}
- Bug fix: the desired initial gain quickly dropped to 0 dB hence
starting a call with a too low level
- New tuning to make AGC2 more robust to VAD mistakes
- Smarter max gain increase speed: to deal with an increased threshold
of adjacent speech frames, the gain applier temporarily allows a
faster gain increase to deal with a longer time spent waiting for
enough speech frames in a row to be observed
- Saturation protector isolated from `AdaptiveModeLevelEstimator` to
simplify the unit tests for the latter (non bit-exact change)
- AGC2 adaptive digital config: unnecessary params deprecated
- Code readability improvements
- Data dumps clean-up and better naming
Bug: webrtc:7494
Change-Id: I4e36059bdf2566cc2a7e1a7e95b7430ba9ae9844
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215140
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33736}
The current noise level estimator has a bug due to which the estimated
level decays to the lower bound in a few seconds when speech is observed.
Instead of fixing the current implementation, which is based on a
stationarity classifier, an alternative, lightweight, noise floor
estimator has been added and tuned for AGC2.
Tested on several AEC dumps including HW mute, music and fast talking.
Bug: webrtc:7494
Change-Id: Iae4cff9fc955a716878f830957e893cd5bc59446
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/214133
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33733}
This CL adds functionality that allows adjusting the audio levels
internally in APM. The main purpose of the functionality is to allow
APM to optionally be moved to an integration that does not provide an
analog gain to control, and the implementation of this has been
tailored specifically to meet the requirements for that.
More specifically, this CL does
-Add a new variant of the pre-amplifier gain that is intended to replace
the pre-amplifier gain (but at the moment can coexist with that). The
main differences with the pre-amplifier gain is that an attenuating
gain is allowed, the gain is applied jointly with any emulated analog
gain, and that its packaging fits better with the post gain.
-Add an emulation of an analog microphone gain. The emulation is
designed to match the analog mic gain functionality in Chrome OS (which
is digital) but should be usable also on other platforms.
-Add a post-gain which is applied after all processing has been applied.
The purpose of this gain is for it to work well with the integration
in ChromeOS, and be used to compensate for the offset that there is
applied on some USB audio devices.
Bug: b/177830918
Change-Id: I0f312996e4088c9bd242a713a703eaaeb17f188a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/209707
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33466}
This remove webrtc-specific macro that has no reason to be webrtc specific
ABSL_DEPRECATED takes a message parameter encouraging to write text how class or function is deprecated.
Bug: webrtc:12484
Change-Id: I89f1398f91dacadc37f7db469dcd985e3724e444
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/208282
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33314}
This CL adds the initial support for letting APM know when its output
will be used or not.
It also adds a new method for passing RuntimeInformation to APM that
returns a bool indicating the success of the passing of information.
Bug: b/177830919
Change-Id: Ic2e1b92c37241d74ca6394b785b91736ca7532aa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206061
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33201}
- The injection of the AGC2 level estimator into `AgcManagerDirect`
is not used anymore
- `ExperimentalAgc::enabled_agc2_level_estimator` can also be removed
- 3 ctors of `ExperimentalAgc` are unused
- `AgcManagerDirectStandaloneTest::AgcMinMicLevelExperiment` can be
split into separate unit tests (better code clarity)
Bug: webrtc:7494
Change-Id: I5843147c38cf7cb5ee484b0a72fe13dcf363efaf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/202025
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33027}
This CL makes the static variable kChunkSizeMs constexpr to avoid
potential issues on some compilers.
Bug: None
Change-Id: I8e2b1819561ec96fb17d3899af95405cc36a6097
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/196640
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32795}
In preparation for adding AVX2 code, a safe scheme to support
different SIMD optimizations is added.
Safety features:
- AVX2 kill switch to stop using it even if supported by the
architecture
- struct indicating the available CPU features propagated from
AGC2 to each component; in this way
- better control over the unit tests
- no need to propagate individual kill switches but just
set to false features that are turned off
Note that (i) this CL does not change the performance of the RNN VAD
and (ii) no AVX2 optimization is added yet.
Bug: webrtc:10480
Change-Id: I0e61f3311ecd140f38369cf68b6e5954f3dc1f5a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/193140
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32739}
AGC2 is correctly (re)initialized when its config changes.
This CL also improves the `AudioProcessingImpl::ApplyConfig`
readability by defining operator!= also for the AGC1 config.
Bug: webrtc:7494
Change-Id: I62068de32c941e6b18d4618c656f569647042345
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/187120
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32402}
This CL adds and wires up the following parameters:
- VAD probability attack used in `VadLevelAnalyzer`
- Adjacent spech frames threshold used in `AdaptiveModeLevelEstimator`
- Initial saturation margin used in `AdaptiveModeLevelEstimator`
The deprecated ctor in `AdaptiveModeLevelEstimator` is removed.
Tested: bit-exactness verified with audioproc_f
Bug: webrtc:7494
Change-Id: Idf94aaadba1476757f845e696bfb47ff6252d5f0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186048
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32265}
This CL adds and wires up a parameter (namely, adjacent speech
frames threshold) used in `AdaptiveDigitalGainApplier`.
Tested: bit-exactness verified with audioproc_f
Bug: webrtc:7494
Change-Id: I751cd91f08a6e98ee20f767c8df0ed121c8d4b68
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186049
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32264}
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}
This CL removes the possibility that APM cannot be created, i.e., that
the create method can return nullptr. That was already the case
implicitly but this CL makes that behavior explicit.
Bug: webrtc:5298
Change-Id: I2706ea538c9d1b4bcd65faecab637640a209a4dc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183101
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32029}
This is a reland of 8be2f201ba
Original change's description:
> Add ability to state whether the APM output will be used
>
> This CL adds the ability for the surrounding code to state that the
> APM output will not be used. The intended usecase for this is to allow
> APM to run at a lower complexity when the endpoint is muted.
> When APM has been informed that the output will not be used, it can
> turn off code that is needed only for ensuring that the output audio
> will sound good.
>
> Bug: b/154437967,b/163802450
> Change-Id: I8e22989e35354372e96191d15da44beb9d1b26ae
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181200
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31949}
Bug: b/154437967
Bug: b/163802450
Change-Id: Ia77a9e43f913929d1afa72212f1ea6c192d0e519
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181887
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31957}
This reverts commit 8be2f201ba.
Reason for revert: Breaks downstream
Original change's description:
> Add ability to state whether the APM output will be used
>
> This CL adds the ability for the surrounding code to state that the
> APM output will not be used. The intended usecase for this is to allow
> APM to run at a lower complexity when the endpoint is muted.
> When APM has been informed that the output will not be used, it can
> turn off code that is needed only for ensuring that the output audio
> will sound good.
>
> Bug: b/154437967,b/163802450
> Change-Id: I8e22989e35354372e96191d15da44beb9d1b26ae
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181200
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31949}
TBR=alessiob@webrtc.org,peah@webrtc.org
Change-Id: I1e56dafbbfa6ea69cccbbb5cdc2b1e2a6c122c11
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: b/154437967
Bug: b/163802450
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181884
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31953}
This CL adds the ability for the surrounding code to state that the
APM output will not be used. The intended usecase for this is to allow
APM to run at a lower complexity when the endpoint is muted.
When APM has been informed that the output will not be used, it can
turn off code that is needed only for ensuring that the output audio
will sound good.
Bug: b/154437967,b/163802450
Change-Id: I8e22989e35354372e96191d15da44beb9d1b26ae
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181200
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31949}
This CL changes the way that AecDumps are created in APM. Instead
of being injected, they are now created via the API.
This removes the AecDumpFactory from the API surface of APM and
makes the API more explicit.
The CL will be followed by one more CL that deprecates the usage
of the AttachAecDump API also within the audio_processing
and the fuzzer folders.
The CL also moves the aec_dump.* files from the include folder
to the aec_dump folder and changes the build files. The reasons
for this are that
1) The content of aec_dump.h is not really part of the API
surface of APM.
2) Those files anyway needed to be moved to a separate build-
target to avoid a circular build-file dependency caused by
the other changes in this CL
Bug: webrtc:5298
Change-Id: I7dd6b49de76eb44158472874e1d4ae17dca9be54
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174750
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31207}
This API is and has always been unused.
Bug: webrtc:5298
Change-Id: If1201d37a00e387567d44a9ed8be99a157915b47
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174661
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31180}
This makes it optional for an echo detector to report metrics through
the getStats interface.
Bug: webrtc:11539
Change-Id: I1fef93b7bf534637b69c16971d38709b3e849a08
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174100
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31146}
This CL adds a build flag to allow building the non-test parts
of WebRTC without the audio processing module.
The CL also ensures that the WebRTC code correctly handles
the case when no APM is available.
Bug: webrtc:5298
Change-Id: I5c8b5d1f7115e5cce2af4c2b5ff701fa1c54e49e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171509
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31133}
This is a reland of 12e2d4ddb2
Original change's description:
> APM: Remove the usage of AudioFrame in the AudioProcessing interface
>
> This CL removes the AudioFrame-based APIs from the AudioProcessing
> interface.
>
> Bug: webrtc:5298
> Change-Id: Iab470b26b10e06dcf29c543851ae0085bc5b66f0
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/172939
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31016}
Bug: webrtc:5298
Change-Id: I70e6d59afc3716ee6109d8b9dc384abc71c93624
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173476
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31066}
This CL removes the AudioFrame-based APIs from the AudioProcessing
interface.
Bug: webrtc:5298
Change-Id: Iab470b26b10e06dcf29c543851ae0085bc5b66f0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/172939
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31016}
This CL removes the redundant VAD output from the newly introduced
integer API in AudioProcessing.
Bug: webrtc:5298
Change-Id: Iad2b1b97ada7f4863139655526c110e326c6788a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170824
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30832}