Commit graph

198 commits

Author SHA1 Message Date
Alessio Bazzica
be1b8989d1 ExperimentalNs removed + APM not depending anymore on webrtc::Config
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}
2021-09-17 10:53:43 +00:00
Alessio Bazzica
ff7e1bad1f APM config: remove ExperimentalAgc
Bug: webrtc:5298,webrtc:7494
Change-Id: Ic9bcb702603ec7900fbe9ae38ab49dff8fe99318
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/219463
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35015}
2021-09-16 13:28:51 +00:00
Alessio Bazzica
b8a19df71c AGC2: removed unused noise estimator implementation
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}
2021-09-01 12:45:20 +00:00
Niels Möller
4f776ac7de Use make_ref_counted in AudioProcessingBuilder
Bug: webrtc:12701
Change-Id: I51ca5a54f812a1620ee2e6605c9ff67b92e2a5f8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/224547
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34725}
2021-08-11 15:40:28 +00:00
Artem Titov
cfea2182f8 Use backticks not vertical bars to denote variables in comments
Bug: webrtc:12338
Change-Id: I89c8b3a328d04203177522cbdfd9e606fd4bce4c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228246
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34696}
2021-08-10 10:40:03 +00:00
Artem Titov
0b489303d2 Use backticks not vertical bars to denote variables in comments for /modules/audio_processing
Bug: webrtc:12338
Change-Id: I85bff694dd2ead83c939c4d1945eff82e1296001
No-Presubmit: True
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227161
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34690}
2021-08-09 21:49:02 +00:00
Alessio Bazzica
42dacda82c AGC analog clipping predictor: integrate evaluator
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}
2021-06-17 16:16:53 +00:00
Alessio Bazzica
b237a87a25 AGC analog ClippingPredictor refactoring 1/2
- ClippingPredictor API and docstring changes
- Unified ClippingPredictor factory function

Bug: webrtc:12774
Change-Id: Iafaddae52addc00eb790ac165bf407a4bdd1cb52
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221540
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34279}
2021-06-14 12:21:31 +00:00
Hanna Silen
a43953a518 Add ClippingPredictor config in AudioProcessing config
Bug: webrtc:12774
Change-Id: Id8cdb6b5499a22cbca40d424cf936f81c1e7d8d7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221104
Reviewed-by: Minyue Li <minyue@webrtc.org>
Commit-Queue: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34204}
2021-06-02 16:16:25 +00:00
Hanna Silen
b8dc7fa5a6 Make AgcManagerDirect clipping parameters configurable
Bug: webrtc:12774
Change-Id: I99824b5aabe6f921a5db425dd1c1c1d4c606186c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/219681
Commit-Queue: Hanna Silen <silen@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34069}
2021-05-20 16:53:59 +00:00
Alessio Bazzica
dfc11d55af Add RTC_EXPORT to APM config structs with overloaded operators
Bug: webrtc:7494
Change-Id: I9b627709d8c5bb47d73fd7981259a95e6b51e16c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/217766
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33946}
2021-05-07 11:31:18 +00:00
Alessio Bazzica
a2efd15627 AGC2 config operator= and unit tests update
Bug: webrtc:7494
Change-Id: I7957602d60658b84175a617f9c283ea44eafe57d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/216260
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@google.com>
Cr-Commit-Position: refs/heads/master@{#33876}
2021-04-29 16:37:17 +00:00
Alessio Bazzica
d66a60597d AGC2 adaptive digital dry run mode
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}
2021-04-29 16:05:57 +00:00
Alessio Bazzica
980c4601e1 AGC2: retuning and large refactoring
- 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}
2021-04-14 19:01:01 +00:00
Alessio Bazzica
61982a7f2d AGC2 lightweight noise floor estimator
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}
2021-04-14 15:56:41 +00:00
Alessio Bazzica
841d74ea80 AGC2 periodically reset VAD state
Bug: webrtc:7494
Change-Id: I880ef3991ade4e429ccde843571f069ede149c0e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/213342
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33604}
2021-03-31 14:15:10 +00:00
Per Åhgren
db5d728878 Add refined handling of the internal scaling of the audio in APM
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}
2021-03-15 19:12:02 +00:00
Per Åhgren
652ada5029 Enabling a safe fall-back functionality for overruns in the runtime settings
Bug: b/177830919
Change-Id: I9369f6fc004ceb2b626d33b36262bc8aeabdb1a0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206988
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33371}
2021-03-03 12:06:54 +00:00
Danil Chapovalov
e904161cec Replace RTC_DEPRECATED with ABSL_DEPRECATED
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}
2021-02-22 12:53:23 +00:00
Per Åhgren
8eea117dea Make PostRuntimeSetting pure virtual
Bug: b/177830919
Change-Id: I92e30e9b65c8f851444268f0824a676044504814
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206640
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33252}
2021-02-12 22:49:43 +00:00
Alessio Bazzica
5a585952da Update AGC2 tuning
Bug: webrtc:7494
Change-Id: Ifcc5b6c846476ce7d6862fba2cb53e426b5855dc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206800
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33238}
2021-02-11 18:14:34 +00:00
Per Åhgren
0a144a705a Adding initial support for lock-less informing of muting
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}
2021-02-09 12:08:54 +00:00
Per Åhgren
68c225d76d Make 48 kHz maximum rate default for all devices
Bug: b/169918549
Change-Id: I2f4b7ced5ae6efcae3cd59c0a42610a54f5e2dc7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/203260
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33192}
2021-02-08 15:06:05 +00:00
Alessio Bazzica
42eef86c4f Remove unused code in APM
- 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}
2021-01-18 13:40:27 +00:00
Hua, Chunbo
e61a40e4ef Fix typo in audio processing header.
Bug: None
Change-Id: Ia47f8229cdfbbcfec3aa7539c587d4e1fdc4ae3a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/200926
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32974}
2021-01-14 10:59:13 +00:00
Alessio Bazzica
524f682184 SSE2 and NEON kill switches for AGC2
Bug: webrtc:7494
Change-Id: I221b717b5cf3c41b7b637e9234d1e339a0e6c7e5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/199967
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32918}
2021-01-07 11:41:28 +00:00
Per Åhgren
12dc274749 Make the static variable kChunkSizeMs constexpr
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}
2020-12-08 10:46:15 +00:00
Alessio Bazzica
253f8369bb AGC2 RNN VAD: safe SIMD optimizations scheme + AVX2 kill switch
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}
2020-12-02 10:09:24 +00:00
Alessio Bazzica
3438a9383c AGC2 config change detection fixed
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}
2020-10-14 12:18:57 +00:00
Alessio Bazzica
9a625e7aef AGC2: max output noise level now part of config
Tested: bit-exactness verified with audioproc_f

Bug: webrtc:7494
Change-Id: Ic42f09dc13560494963cdcd338a0c52a729e108d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186266
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32282}
2020-10-01 17:06:40 +00:00
Alessio Bazzica
29ef556aff AGC2: max adaptation speed now part of config
Tested: bit-exactness verified with audioproc_f

Bug: webrtc:7494
Change-Id: Ie65a2e2139cff0bd730307d06b74760e307c9568
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186264
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Minyue Li <minyue@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32277}
2020-10-01 16:15:28 +00:00
Alessio Bazzica
59f1d1e36d AGC2 adaptive digital controller config: new params
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}
2020-09-30 22:29:14 +00:00
Alessio Bazzica
1309c77a48 AGC2 adaptive digital controller config: new param
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}
2020-09-30 22:10:53 +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
Mirko Bonadei
c94650d88f Remove AudioProcessing::SetExtraOptions.
Bug: webrtc:5298
Change-Id: I28be75df69b66aa59ae91b05cb7f9afad4f55aa1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/182120
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32033}
2020-09-03 12:43:14 +00:00
Mirko Bonadei
ea8f739bce Make AudioProcessing::SetExtraOptions non pure-virtual.
Bug: webrtc:5298
Change-Id: Ib5ba81c8e333b1e7189fbb7e9e9f143579c84b8b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/182181
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32032}
2020-09-03 06:17:44 +00:00
Per Åhgren
0ade98316c Cleanup of the APM creation
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}
2020-09-02 20:28:49 +00:00
Per Åhgren
552d3e3d5e Reland "Add ability to state whether the APM output will be used"
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}
2020-08-18 12:29:32 +00:00
Erik Språng
1804b339a9 Revert "Add ability to state whether the APM output will be used"
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}
2020-08-17 14:10:08 +00:00
Per Åhgren
8be2f201ba 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}
2020-08-17 12:56:24 +00:00
Per Åhgren
09e9a83d91 Change the way that AecDumps are created in APM
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}
2020-05-11 10:33:00 +00:00
Sam Zackrisson
ab866a2ccb Remove audio playout generator from APM API
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}
2020-05-07 12:14:50 +00:00
Ivo Creusen
bb826c9142 Make echo metrics optional
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}
2020-04-29 14:29:27 +00:00
Per Åhgren
cc73ed3e70 APM: Add build flag to allow building WebRTC without APM
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}
2020-04-26 23:06:44 +00:00
Mirko Bonadei
491ff3d54c Remove AudioProcessing::UpdateHistogramsOnCallEnd.
Bug: webrtc:10198
Change-Id: I3e7a98f9b94c171e7f105883fc755e44b2e991ae
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173464
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31070}
2020-04-14 18:08:52 +00:00
Per Åhgren
fea8b94591 Reland "APM: Remove the usage of AudioFrame in the AudioProcessing interface"
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}
2020-04-14 14:11:06 +00:00
Artem Titov
7e60483915 Revert "APM: Remove the usage of AudioFrame in the AudioProcessing interface"
This reverts commit 12e2d4ddb2.

Reason for revert: Speculative revert: breaks downstream project

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}

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

Change-Id: I82729b54c74cf1362332a28a96f598d6747b53ff
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:5298
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173091
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31022}
2020-04-07 19:37:32 +00:00
Per Åhgren
12e2d4ddb2 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}
2020-04-07 13:40:58 +00:00
Per Åhgren
dc5522b4bf APM: Removing the redundant VAD output from the integer API
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}
2020-03-19 13:59:00 +00:00
Per Åhgren
2507f8cdc9 APM: Replace all remaining usage of AudioFrame outside interfaces
This CL replaces all remaining usage of AudioFrame within APM,
with the exception of the AudioProcessing interface.

The main changes are within the unittests.

Bug: webrtc:5298
Change-Id: I219cdd08f81a8679b28d9dd1359a56837945f3d4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170362
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30831}
2020-03-19 12:40:18 +00:00