Commit graph

1404 commits

Author SHA1 Message Date
Alessio Bazzica
2076af4673 APM: InputVolumeController tests simplified
Bug: webrtc:7494
Change-Id: I8f622b950aed8f1d5c42fcb8eb0c37c86532b6fe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/285440
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38757}
2022-11-29 12:45:46 +00:00
Sam Zackrisson
06cba44d7a WebRTC APM: Add missing channel format check
The check was lost  in CL https://webrtc-review.googlesource.com/c/src/+/276920

Bug: webrtc:5298
Change-Id: Ic5f072ebef4ad0bdef5446cad0536728b4ad610e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/284560
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38746}
2022-11-28 18:19:06 +00:00
Hanna Silen
27fed4513f InputVolumeController: Make speech_probability non-optional
Make the argument speech_probability non-optional in
InputVolumeController::Process() and
MonoInputVolumeController::Process().

Additional clean-up: Remove the flag enabled in the
config. Add unit tests for MonoInputVolumeController.

Bug: webrtc:7494
Change-Id: Ie28af77dc628bf71d09ce1ff033d39031f77a21e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/283700
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38710}
2022-11-22 15:19:02 +00:00
Alessio Bazzica
79beaa7f38 APM tests: check that the applied input volume is recommended
when volume emulation is used or when neither an input volume
controller nor volume emulation are used.

This CL adds 3 tests, 2 of which currently fail because APM
behaves in an undesired way. In [1] the behavior is fixed and
the tests are enabled.

A DCHECK in `AudioProcessingImpl::set_stream_analog_level` has
been removed since a more robust behavior can be obtained - namely,
that expected in the disabled unit tests added in this CL.

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

Bug: webrtc:14581
Change-Id: I29d2c000cd1baf90606487afd9a4042e6f487834
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/281184
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38696}
2022-11-21 10:35:23 +00:00
Alessio Bazzica
78b466a0d1 AGC1: remove unused field trial WebRTC-UseLegacyDigitalGainApplier
Bug: webrtc:14685
Change-Id: I7c9e07c56f20bd9c4b8848787d0b6e4f9785af60
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/283764
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38687}
2022-11-18 21:58:04 +00:00
Rashad Sookram
4deb88c596 Clean up diff 2022-11-18 15:39:11 -05:00
Hanna Silen
bf28277774 InputVolumeController: Add configurable speech probability aggregation
Make speech probability threshold configurable by replacing
kSpeechProbabilitySilenceThreshold with speech_probability_threshold in
InputVolumeController::Config.

Make the processing more robust against outliers in speech probability
estimaton by computing an aggregate speech activity over a speech
segment. In MonoInputVolumeController::Process(), use the passed
non-empty speech probabilities to compute the speech activity over the
speech segment and only allow updates for segments with a high enough
ratio of speech frames. Pass RMS error and speech probability for every
frame in Process(): If rms_error_dbfs is empty, volume updates are not
allowed; if speech_probability is empty, the frame counts as a non-
speech frame.

Remove startup_min_volume from the config since it's no longer used
after https://webrtc-review.googlesource.com/c/src/+/282821.

Bug: webrtc:7494
Change-Id: I0ab81b03371496315348f552133aa9909bd36f26
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/283523
Commit-Queue: Hanna Silen <silen@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38685}
2022-11-18 19:37:05 +00:00
Alessio Bazzica
dd18f9f8c2 APM: remove WebRTC.Audio.ApmRuntimeSettingCannotEnqueue
The histogram definition is removed in crrev.com/c/4030265.

Bug: chromium:1272685
Change-Id: Id689cf4324ca17bef8a7d07d58d8534bae7b2178
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/283664
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38683}
2022-11-18 14:55:22 +00:00
Sam Zackrisson
5dd548261f APM: Signal error on unsupported sample rates
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}
2022-11-17 12:12:04 +00:00
Alessio Bazzica
408f0be5c2 APM: remove WebRTC.Audio.Agc.DigitalGain* histograms from AGC1
Bug: chromium:1308676
Change-Id: Ib8d8f78a9ee9ac424495017455a5bc6aa400d8ca
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/283663
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38661}
2022-11-17 11:10:44 +00:00
Rashad Sookram
5c49cd217c Fix post-merge errors 2022-11-16 17:17:11 -05:00
Hanna Silen
52b0ef7926 InputVolumeController: Make input volume update wait frames configurable
Replace kUpdateInputVolumeWaitFrames with
update_input_volume_wait_frames in InputVolumeController::Config.

Also, fix an off-by-one error in the frame count to give a better
readability for non-zero wait frames. Now
update_input_volume_wait_frames_ = 100 allows updates every 100 frames
instead of every 101 frames. Effectively, this makes
update_input_volume_wait_frames = 0 and 1 to behave similarly (i.e.,
they now both allow updates after every frame).

Bug: webrtc:7494
Change-Id: I597f7e88895a4dcd365dc6dee526acb9d971b2fc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/282863
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38648}
2022-11-16 13:48:54 +00:00
Rashad Sookram
2e9c66e1b1 Finish resolving merge conflicts 2022-11-11 19:10:59 -05:00
Rashad Sookram
bd151651d3 Merge in M108 2022-11-11 17:02:35 -05:00
Hanna Silen
e82d2a1773 InputVolumeController: Use clipped_level_min in clipping prediction
Replace the use of MonoInputController::min_mic_level() with
MonoInputVolumeController::clipped_level_min() when estimating input
volume adjustment from clipping prediction. The adjustment is later
capped in MonoInputVolumeController::HandleClipping() using
clipped_level_min_ so no audio changes are expected from this change.

Bug: webrtc:7494
Change-Id: Ie26d0aa5cce3eeef06f70a281504889519bb5aca
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/282840
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38593}
2022-11-09 13:15:17 +00:00
Alessio Bazzica
7f2d4afc40 APM: mirror "remove unused field trial" in InputVolumeController
See https://webrtc-review.googlesource.com/c/src/+/278781

Bug: webrtc:7494
Change-Id: I800a93d321bd8c8c7a71b856e151158ec2655d8a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/282822
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38592}
2022-11-09 13:12:24 +00:00
Alessio Bazzica
90c08d0b2e APM: mirror "unusued min startup volume param removed" CL in AGC2
See https://webrtc-review.googlesource.com/c/src/+/278787

Bug: webrtc:7494
Change-Id: Ie8ad8acc1d2e373d59d943282701e3483e980806
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/282821
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38588}
2022-11-09 11:40:50 +00:00
Hanna Silen
347038bdb8 InputVolumeController: Clean up the class definition
Remove function declarations, members, and friend tests that are
no longer used. Reorder the member variables.

Bug: webrtc:7494
Change-Id: I8c24e2f4b9d9846e6d3fef4e2c998aa26f49f8c9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/282180
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38570}
2022-11-07 17:22:32 +00:00
Hanna Silen
8a8de9be3b InputVolumeController: Replace speech level target and max digital gain
Replace the use of speech level target and digital gain maximum with speech level target range parameters.

Bug: webrtc:7494
Change-Id: I703756c5a3fbd330ed585e3f5b4ac3141d9ea6e2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280943
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38563}
2022-11-07 14:54:50 +00:00
Hanna Silen
dd34a482d9 InputVolumeController: Hardcode some digital gain parameters
In InputVolumeController/MonoInputVolumeController, set
min_digital_gain_db_ and disable_digital_adaptive_ to fixed values
ahead of replacing speech level target as well as digital gain
minimum and maximum with target range parameters.

In InputVolumeController, remove digital_adaptive_follows and
min_digital_gain_db from the config as they are no longer needed.

Bug: webrtc:7494
Change-Id: I1378b6e182224c41038c6d8c649e7a28961f73d4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280962
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38554}
2022-11-04 11:28:44 +00:00
Hanna Silen
49a6097e95 InputVolumeController: Modify unit tests ahead of RMS error changes
Modify unit tests ahead of changes that will replace the minimum
digital gain with a fixed value 0 and always enable digital gain
compensation.

Bug: webrtc:7494
Change-Id: I9df95667b831d5b68e70aaba22f631b398edf8e2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280960
Commit-Queue: Hanna Silen <silen@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38553}
2022-11-04 09:39:29 +00:00
Hanna Silen
87d391f748 InputVolumeController: Rename override constants/arguments/tests
Rename constants and arguments reflecting the old naming with RMS error
overriding the error calculated by the analog AGC. Rename the related
unit tests and helper functions.

Bug: webrtc:7494
Change-Id: I9a1d972e9ff7ab5cdd43ca3568379d511801adee
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280481
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38552}
2022-11-04 08:43:20 +00:00
Hanna Silen
92d66be163 MonoInputVolumeController: Refactor Process()
Bug: webrtc:7494
Change-Id: I609b5875ba3dbbee84aa3d481f3f359c964e6373
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280480
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38549}
2022-11-03 20:38:32 +00:00
Hanna Silen
d7cfbe3843 Add support for InputVolumeController in GainController2
Add InputVolumeController as a member in GainController2 (not created
by default). Add a method GainController2::Analyze() to update the
applied input volume and run the pre-processing steps in
InputVolumeController. Add a call InputVolumeController::Process() in
GainController2::Process().

Bug: webrtc:7494
Change-Id: Idf4111ac5e19a620b6421c7f23fd642f169c7b5a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/279822
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38548}
2022-11-03 18:32:55 +00:00
Hanna Silen
9f06ef1cc3 Implement InputVolumeController
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}
2022-11-02 11:31:59 +00:00
Hanna Silen
7587755d29 Copy AgcManagerDirect files to agc2 and rename the classes
Copy AgcManagerDirect files from agc to agc2. Rename the newly
created files and classes ahead of refactoring. Add a build
target.

This change is done to enable creating a class
InputVolumeController based on AgcManagerDirect. The added
temporary dependency on files in agc will be removed
in https://webrtc-review.googlesource.com/c/src/+/278625.

The exact copy of the files happened in the 1st patchset and it
has been verified as follows:

Checksum check:
```
$ git checkout main && git pull
# Go back to the tree state before [1] landed
$ git new-branch tmp
$ git reset --hard 2235776597
$ cd modules/audio_processing/agc/
$ md5 agc_manager_direct*
MD5 (agc_manager_direct.cc) = e661481a85f72596cae4599b62907f5b
MD5 (agc_manager_direct.h) = bf68280e2d0f689b4ebcd665b5db6052
MD5 (agc_manager_direct_unittest.cc) = 6bf0bf45ff5e940b1a3bb37154f09269
```

Patchset 1 (see [2])
```
$ cd modules/audio_processing/agc2/
$ md5 input_volume_controlle*
MD5 (input_volume_controller.cc) = e661481a85f72596cae4599b62907f5b
MD5 (input_volume_controller.h) = bf68280e2d0f689b4ebcd665b5db6052
MD5 (input_volume_controller_unittest.cc) = 6bf0bf45ff5e940b1a3bb37154f09269
```

[1] https://webrtc-review.googlesource.com/c/src/+/278781
[2] https://webrtc-review.googlesource.com/c/src/+/278624/1

Bug: webrtc:7494
Change-Id: I7804da899d18adf556b089c76a567ce27c299a62
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278624
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38512}
2022-10-31 15:58:11 +00:00
Jesús de Vicente Peña
b24ebc535b pre echo delay: adding different options for detecting pre echoes.
Bug: webrtc:14205
Change-Id: I9de13c8525914278a2961bd1193b1ce2472c8c02
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280900
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Jesus de Vicente Pena <devicentepena@webrtc.org>
Reviewed-by: Lionel Koenig <lionelk@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38511}
2022-10-31 15:55:29 +00:00
Jesús de Vicente Peña
bb4ccf8495 Pre echo delay estimator: Explicitly considering the initial region when updating the pre echo delay histogram.
Bug: webrtc:14205
Change-Id: Iaa075a52c07ab87fe21da7c40be806c7f80f0e32
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280540
Reviewed-by: Lionel Koenig <lionelk@webrtc.org>
Reviewed-by: Lionel Koenig <lionelk@google.com>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Jesus de Vicente Pena <devicentepena@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38489}
2022-10-28 07:02:58 +00:00
Alessio Bazzica
fbe5d7c3d4 Reland "APM: log both applied and recommended input volume stats"
This is a reland of commit 8d7273357d

Root cause:
audioproc_f doesn't call `metrics::Enable()` and therefore the stats
reporter crashed when `metrics::HistogramFactoryGetCountsLinear()`
returned a nullptr.

Bug fix:
Added `InputVolumeStatsReporter::cannot_log_stats_`, a const flag
that is set to true if any histogram factory returns a nullptr.
When true, the class does nothing.

This CL also includes other code readability improvements that were
not part of the original CL.

Original change's description:
> APM: log both applied and recommended input volume stats
>
> This CL replaces the existing `WebRTC.Audio.ApmAnalogGain.*` stats
> with `WebRTC.Audio.Apm.AppliedInputVolume.*` and adds the
> `WebRTC.Audio.Apm.RecommendedInputVolume.*` stats.
>
> Bug: webrtc:7494
> Change-Id: I70be710d20b1589fc814cbce3d3329ac1500686f
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280220
> Reviewed-by: Hanna Silen <silen@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#38468}

Bug: webrtc:7494
Change-Id: I8373d16beb06b84f439d2c2274ededea7c5e95b0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280661
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38484}
2022-10-27 14:40:40 +00:00
Alessio Bazzica
c34a8c19c6 Reland "APM: rename AnalogGainStatsReporter to InputVolumeStatsReporter"
This reverts commit 6a18f06bd0.

Reason for revert: reverted by mistake

Original change's description:
> Revert "APM: rename `AnalogGainStatsReporter` to `InputVolumeStatsReporter`"
>
> This reverts commit b5319fabee.
>
> Reason for revert: audioproc_f crash 
>
> Original change's description:
> > APM: rename `AnalogGainStatsReporter` to `InputVolumeStatsReporter`
> >
> > Adopt the new naming convention, which replaces "analog gain" and
> > "mic level" with "input volume", in the input volume stats reporter.
> >
> > Bug: webrtc:7494
> > Change-Id: Ia24876151f51dd1dcc4e4f9db56c64d11ae3b442
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/279840
> > Reviewed-by: Hanna Silen <silen@webrtc.org>
> > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#38467}
>
> Bug: webrtc:7494
> Change-Id: Ia943a57c93fc77eb8450fab17961e60774e10f02
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280600
> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Auto-Submit: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#38478}

Bug: webrtc:7494
Change-Id: I204133460dc119142f87695effce45e04426519f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280582
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38479}
2022-10-26 16:35:34 +00:00
Alessio Bazzica
6a18f06bd0 Revert "APM: rename AnalogGainStatsReporter to InputVolumeStatsReporter"
This reverts commit b5319fabee.

Reason for revert: audioproc_f crash 

Original change's description:
> APM: rename `AnalogGainStatsReporter` to `InputVolumeStatsReporter`
>
> Adopt the new naming convention, which replaces "analog gain" and
> "mic level" with "input volume", in the input volume stats reporter.
>
> Bug: webrtc:7494
> Change-Id: Ia24876151f51dd1dcc4e4f9db56c64d11ae3b442
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/279840
> Reviewed-by: Hanna Silen <silen@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#38467}

Bug: webrtc:7494
Change-Id: Ia943a57c93fc77eb8450fab17961e60774e10f02
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280600
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Auto-Submit: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38478}
2022-10-26 13:29:27 +00:00
Alessio Bazzica
35b3c63ba4 Revert "APM: log both applied and recommended input volume stats"
This reverts commit 8d7273357d.

Reason for revert: revert needed to land https://webrtc-review.googlesource.com/c/src/+/280600

Original change's description:
> APM: log both applied and recommended input volume stats
>
> This CL replaces the existing `WebRTC.Audio.ApmAnalogGain.*` stats
> with `WebRTC.Audio.Apm.AppliedInputVolume.*` and adds the
> `WebRTC.Audio.Apm.RecommendedInputVolume.*` stats.
>
> Bug: webrtc:7494
> Change-Id: I70be710d20b1589fc814cbce3d3329ac1500686f
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280220
> Reviewed-by: Hanna Silen <silen@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#38468}

Bug: webrtc:7494
Change-Id: I4a2acfd5a983d9397932b2879cfa057deaf0eb2b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280581
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Auto-Submit: Alessio Bazzica <alessiob@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#38476}
2022-10-26 13:27:01 +00:00
Alessio Bazzica
d89dff767c AGC2: prepare to move speech level estimator into GainController2
- build target isolated
- `AdaptiveModeLevelEstimator` renamed to `SpeechLevelEstimator`

Bug: webrtc:7494
Change-Id: If16caec2269b2ed1b2ee27c3687a8f8875f55c8c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280441
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38469}
2022-10-25 16:15:07 +00:00
Alessio Bazzica
8d7273357d APM: log both applied and recommended input volume stats
This CL replaces the existing `WebRTC.Audio.ApmAnalogGain.*` stats
with `WebRTC.Audio.Apm.AppliedInputVolume.*` and adds the
`WebRTC.Audio.Apm.RecommendedInputVolume.*` stats.

Bug: webrtc:7494
Change-Id: I70be710d20b1589fc814cbce3d3329ac1500686f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280220
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38468}
2022-10-25 14:02:22 +00:00
Alessio Bazzica
b5319fabee APM: rename AnalogGainStatsReporter to InputVolumeStatsReporter
Adopt the new naming convention, which replaces "analog gain" and
"mic level" with "input volume", in the input volume stats reporter.

Bug: webrtc:7494
Change-Id: Ia24876151f51dd1dcc4e4f9db56c64d11ae3b442
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/279840
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38467}
2022-10-25 13:57:55 +00:00
Alessio Bazzica
d226c5731d APM: move AnalogGainStatsReporter to AGC2
Bug: webrtc:7494
Change-Id: Ifb924e6eda47dd96a591a0b55b1e7fcfdbbbbe18
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280222
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38464}
2022-10-25 08:35:02 +00:00
Hanna Silen
335a4e4e1f GainController2: Remove the unused method Initialize
Bug: webrtc:7494
Change-Id: I46a808116abefc6d7d2dd3b954fc1fba7d6f8a90
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280040
Commit-Queue: Hanna Silen <silen@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38455}
2022-10-24 09:49:26 +00:00
Lionel Koenig
9707f579ae delay estrimator: Enable looking for early reverberation
Enable by default the look for the first echo.

Bug: webrtc:14205
Change-Id: Iae904679c1432f3a0766263907cf376903685b97
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278043
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Commit-Queue: Lionel Koenig <lionelk@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38452}
2022-10-24 08:35:52 +00:00
Alessio Bazzica
7afd698e0e APM AgcManagerDirect: unusued min startup volume param removed
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}
2022-10-17 16:51:38 +00:00
Alessio Bazzica
9ea538185a APM: remove min startup volume parameter usage in the APM tests
The parameter is unused and it will be removed in [1]. This CL
isolates the necessary unit test changes from [1].

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

Bug: webrtc:7494
Change-Id: Ic1179d335926fba8ff1b65b494b538cf849724bb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/279100
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38416}
2022-10-17 13:33:28 +00:00
Alessio Bazzica
488f669724 APM: remove kClippedLevelMin from audio_processing.h
Bug: webrtc:7494
Change-Id: I91ed3b82592d9801b113ca72a2b2221b5abf20a3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278788
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38389}
2022-10-13 15:01:37 +00:00
Lionel Koenig
dff98498a5 Remove duplicated dump data
Bug: None
Change-Id: I289810a3deb40b3f2ce1941e385f91fbdb13e288
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/279000
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Lionel Koenig <lionelk@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38377}
2022-10-13 06:47:50 +00:00
Sam Zackrisson
129f40718c Reland: AEC3: clarify render delay controller metrics
This CL:
- makes it easier to understand the (nontrivial) metric interpretation
- corrects the computation of BufferDelay to use 0 for absent delay
- deletes metric MaxSkewShiftCount, unused since https://webrtc-review.googlesource.com/c/src/+/119701
- updates the unit test to directly test metric reporting

Corresponding update to histograms.xml:
https://crrev.com/c/3944909

Previous revert:
https://webrtc-review.googlesource.com/c/src/+/279040
This CL is identical to the original, except:
- the test is updated to spam fewer EXPECT_EQ failures on failure (EXPECT_EQs moved out of inner loop)
- the test not resets metrics (metrics::Reset()) at the beginning, like other histogram tests

Bug: webrtc:8671, chromium:1349051
Change-Id: Ie802e1f9d03a22ff7018f522a63b19e0b6eec2e8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/279046
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38376}
2022-10-13 06:46:29 +00:00
Alessio Bazzica
601b2f5e8c AgcManagerDirect tests: fix NonEmptyRmsErrorOverrideHasEffect
- Set the initial input volume to that forced by startup min volume
  since the latter is removed in a follow-up CL
- Remove unwanted expectations

Bug: webrtc:7494
Change-Id: I2df28f5bfaf4e592dfeae5e03b157268473cc822
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278784
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38370}
2022-10-12 14:51:42 +00:00
Mirko Bonadei
b2b627701c Revert "AEC3: clarify render delay controller metrics"
This reverts commit fd745d3e3c.

Reason for revert: Breaks downstream projects.

Original change's description:
> AEC3: clarify render delay controller metrics
>
> This CL:
> - makes it easier to understand the (nontrivial) metric interpretation
> - corrects the computation of BufferDelay to use 0 for absent delay
> - deletes metric MaxSkewShiftCount, unused since https://webrtc-review.googlesource.com/c/src/+/119701
> - updates the unit test to directly test metric reporting
>
> Corresponding update to histograms.xml:
> https://crrev.com/c/3944909
>
> Bug: webrtc:8671, chromium:1349051
> Change-Id: If73b6fca4de7343bff2c53f72cedda458d36c599
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278782
> Commit-Queue: Sam Zackrisson <saza@webrtc.org>
> Reviewed-by: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#38362}

Bug: webrtc:8671, chromium:1349051
Change-Id: I1e2bd0f91acb67532e21f5d2f8526a398711a413
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/279040
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38367}
2022-10-12 13:42:31 +00:00
Alessio Bazzica
db955f0f13 APM: remove unused field trial in AgcManagerDirect
The removed field trial was added in
https://webrtc-review.googlesource.com/c/src/+/160708.

Bug: webrtc:7494
Change-Id: I1abe51ea086342666a0420d5c10ddea87810aa26
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278781
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38366}
2022-10-12 12:47:43 +00:00
Sam Zackrisson
fd745d3e3c AEC3: clarify render delay controller metrics
This CL:
- makes it easier to understand the (nontrivial) metric interpretation
- corrects the computation of BufferDelay to use 0 for absent delay
- deletes metric MaxSkewShiftCount, unused since https://webrtc-review.googlesource.com/c/src/+/119701
- updates the unit test to directly test metric reporting

Corresponding update to histograms.xml:
https://crrev.com/c/3944909

Bug: webrtc:8671, chromium:1349051
Change-Id: If73b6fca4de7343bff2c53f72cedda458d36c599
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278782
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38362}
2022-10-12 09:30:32 +00:00
Mirko Bonadei
9d9c2d5795 Make header files self contained.
This CL adds #includes to header files in order to make them
self contained after the preprocessor pass.

Bug: b/251890128
Change-Id: I81c3ba38fb8ab8a2bbd151ba99aa871fae9f1b1b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278422
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38327}
2022-10-08 08:38:36 +00:00
Hanna Silen
b37a9c5f88 Remove ClippingPredictorEvaluator
Bug: webrtc:7494
Change-Id: Idba27a5dbe72726f9e1469e955c5958558d93a4b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278403
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38321}
2022-10-07 13:50:04 +00:00
Hanna Silen
3609a5aeb6 AgcManagerDirect: Remove clipping_predictor_evaluator_
Remove the evaluation of clipping prediction. The result is not used.

Bug: webrtc:7494
Change-Id: I18d2c1f50ed675a9653d518095f69ed263a34041
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278361
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38320}
2022-10-07 13:30:56 +00:00
Hanna Silen
cfc3eb1a92 AgcManagerDirect: Remove logging of metrics from ClippingPredictorEvaluator
Remove logging of:
 - WebRTC.Audio.Agc.ClippingPredictor.PredictionInterval
 - WebRTC.Audio.Agc.ClippingPredictor.F1Score
 - WebRTC.Audio.Agc.ClippingPredictor.Precision
 - WebRTC.Audio.Agc.ClippingPredictor.Recall

Bug: webrtc:7494
Change-Id: I52e271f592370c172b8913664936f13a517f8d34
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278380
Commit-Queue: Hanna Silen <silen@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38319}
2022-10-07 13:25:54 +00:00
Hanna Silen
a098fcdb3d AgcManagerDirect: Add a mechanism for RMS error override
Add passing optional speech level and speech probability to Process().
This enables computing an override for the RMS error from
Agc::GetRmsErrorDb(). Currently no speech level or probability are
passed outside the tests and no override happens elsewhere.

Bug: webrtc:7494
Change-Id: I0a7b1204aa51bcde8588963a5af023410405e83d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/277560
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38318}
2022-10-07 13:07:36 +00:00
Hanna Silen
767898c048 Add SpeechProbabilityBuffer
Add a buffer class to store speech probabilities and to estimate speech
activity. Follows the implementation of speech activity computation in
LoudnessHistogram but uses floats for computations.

Bug: webrtc:7494
Change-Id: I6ee72ec52919904ea4e1fbe51d61993aa7813c9f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/277801
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38309}
2022-10-06 11:23:03 +00:00
Hanna Silen
09c292f84d AdaptiveDigitalGainController: Add method GetSpeechLevelDbfsIfConfident
Bug: webrtc:7494
Change-Id: I18d8ee4e50f6fd901f29e4591ff12759018d070d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/277381
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38303}
2022-10-05 13:44:10 +00:00
Hanna Silen
cfbda697ec ClippingPredictor/Evaluator/LevelBuffer and GainMap: Move to agc2
Bug: webrtc:7494
Change-Id: If88795fe34a73faa267a9c0bd5250e36455d4d81
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/277741
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38296}
2022-10-05 08:35:42 +00:00
Hanna Silen
56b3a00d52 MonoAgc: Move error computation outside UpdateGain
Bug: webrtc:7494
Change-Id: If95f44bf404316b8fadf28e3fd01a25f87c96a5b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/277625
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38282}
2022-10-03 19:59:40 +00:00
Sam Zackrisson
5ed1752843 APM: Fix benign race in MaybeInitializeCapture()
MaybeInitializeCapture may overwrite the render configuration of a concurrent render reinitialization, leading to a second render reinitialization on the next render processing call.

See bug description for details.

Tested: Verified bitexactness offline (single-threaded) on a large number of aecdumps.
Bug: webrtc:14495
Change-Id: I9b70b454ce1c27859c3414c9c9ec89b7bbe35559
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/277380
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38241}
2022-09-29 09:30:03 +00:00
Byoungchan Lee
6c2ac2ea6b Fix math involving enums in C++20
(-Wdeprecated-anon-enum-enum-conversion)
- Replace enum with constexpr if necessary.
- Merge multiple definitions for H.264 NalDefs and FuDefs and apply
  constexpr.

Bug: chromium:1284275
Change-Id: I4a4d95ed6aba258e7c19c3ae6251c8b78caf84ec
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276561
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#38215}
2022-09-27 06:55:31 +00:00
Artem Titov
7fee2f7908 Migrate CallSimulator to the new perf metrics logging API
Bug: b/246095034
Change-Id: I613f702d2f469b6bc8d1634f8dda40d444ff7cf2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276632
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38213}
2022-09-26 19:37:51 +00:00
Hanna Silen
c69188d15a AudioProcessingImpl: Add input volume unit tests
Bug: webrtc:7494
Change-Id: I5a32359cacfb7cd6b610ae13b95f92283c761362
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/275500
Commit-Queue: Hanna Silen <silen@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38132}
2022-09-20 15:29:59 +00:00
Alessio Bazzica
e56e3650f2 AgcManagerDirectTestHelper simplified and API contract compliant
Main changes:
- `AgcManagerDirectTestHelper::FirstProcess()` replaced by
  `CallAgcSequence()`, which is API contract compliant
- `ExpectCheckVolumeAndReset()`, `SetVolumeAndProcess()` and
  `ExpectInitialize() `removed
- TODOs added for the next batch of improvements
- `AgcManagerDirectTestHelper::mock_agc` now using `NiceMock`
- `AgcManagerDirect::(AnalyzePre)Process()` now receives a
  const ref
- `AnalyzePreProcess(const float* const*,size_t )` removed

Bug: webrtc:7494
Change-Id: Ie5bbaa590586dd806b30494fb00ca9c742c241e2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/273490
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38056}
2022-09-11 08:30:46 +00:00
Alessio Bazzica
533e461228 APM: make recommended_stream_analog_level() a trivial getter
The current design of the modified getter is error-prone since the
returned value changes meaning based on when (which point in the code)
the getter is called - namely, before `ProcessStream()` is called the
getter returns the stream analog level, after it returns the
recommended level.

Plus, the new implementation, which essentially returns a local
member, removes the risks that the non-trivial implementation
is computationally expensive.

Bug: webrtc:7494, b/241923537
Change-Id: I6714444df27bcc055ae693974ecd1f77f79e6ec0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271580
Reviewed-by: Hanna Silen <silen@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38055}
2022-09-10 08:54:36 +00:00
Alessio Bazzica
fcf1af3049 APM: add AudioProcessingImpl::capture_::applied_input_volume(_changed)
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}
2022-09-09 17:36:05 +00:00
Alessio Bazzica
0c0c602653 APM: refactor emulated input volume for capture level adjustment
Switching to an AGC implementation agnostic solution for the input
volume emulation functionality offered by the
`capture_levels_adjuster` sub-module.

This CL also fixes a (silent) bug due to which, when the input
volume is emulated via the capture adjuster sub-module, AGC2
reads an incorrect value for the applied input volume.

Tested: audioproc_f with `--analog_mic_gain_emulation 1` used
to verify bit-exactness for one Wav file and one AEC dump for
which the input volume varies.

Bug: webrtc:7494, b/241923537
Change-Id: Ide3085f9a5dfd85888ad812ebd56faa175fb2ba7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/273902
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38053}
2022-09-09 16:38:26 +00:00
Alessio Bazzica
a5aaedb327 Fix AudioProcessingImplTest tests on analog gain changes
`EchoControllerObservesAnalogAgc1EchoPathGainChange` is incorrect
since it does not call `set_stream_analog_level()`,
`ProcessCapture()` and `recommended_stream_analog_level()`
according to the contract.

`EchoControllerObservesNoDigitalAgc2EchoPathGainChange` is
useless since AGC2 doesn't have any analog controller at the
moment and the test is not written to explictly trigger digital
gain adaptations.

Bug: webrtc:7494, b/241923537
Change-Id: I56203c736448ec060077b00b57e98cd4c29fa737
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271541
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38052}
2022-09-09 15:31:35 +00:00
Alessio Bazzica
3153b363cd AEC dump Stream::level renamed
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}
2022-09-09 14:39:35 +00:00
Alessio Bazzica
b190ca9e70 Disable Analog AGC based on the APM config
Fixing a bug due to which the analog controller could not be disabled.
AudioProcessing::Config::GainController1::AnalogGainController::enabled
was ignored and therefore `recommended_stream_analog_level_locked()` in
APM was returning the level recommended by `AgcManagerDirect`.

When the analog controller is disabled, `stream_analog_level()` now
returns the last value set via `set_stream_analog_level()`.
However, the analog controller code is still running and, in particular,
the existing metrics are reported as if the controller were enabled.
This choice was made to reduce the risks of adding bugs in the digital
compression gain selection part, which is tied to the analog
controller. The metric drawback will be solved in a follow-up CL.

Additional changes:
- log `WebRTC.Audio.GainController.Analog.Enabled` when
AGC1 is created or when its config changes
- first step to replace "analog level" with "input volume"

Bug: webrtc:7909, b/180019868
Change-Id: I28ce9556dd98f3dd9ad546799406c55478730435
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/270663
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38044}
2022-09-09 10:34:58 +00:00
landrey
d13686a26b Remove unneeded semicolon
Followup for https://webrtc-review.googlesource.com/c/src/+/268840

This semicolon breaks presubmit tests for chromium to webrtc roll: https://webrtc-review.googlesource.com/c/src/+/273621/

Bug: None
Change-Id: I5e603736da1976e38f0186422716d1b0dba5d2de
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/273700
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Auto-Submit: Andrey Logvin <landrey@google.com>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37965}
2022-08-31 09:29:44 +00:00
Hanna Silen
2635b8e0d2 AgcManagerDirect: Add logging of startup_min_volume
Bug: webrtc:7494
Change-Id: I4dc4134e6d5bfac84d41a1563c0ca04043b40ecf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/273489
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37954}
2022-08-30 14:56:12 +00:00
Rashad Sookram
9ed4194e49
Update to 5005 (M102) (#86) 2022-08-24 11:07:33 -04:00
Markus Handell
2cfc1af78a Update rtc::Event::Wait call sites to use TimeDelta.
Bug: webrtc:14366
Change-Id: I949c1d26f030696b18153afef977633c9a5bd4cf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/272003
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37835}
2022-08-19 10:07:28 +00:00
Ali Tofigh
f3592cb2a2 Adopt absl::string_view in modules/audio_processing/
Bug: webrtc:13579
Change-Id: Idb05a64cfd16aed68d40cd427a6b516caa5e2077
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269387
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37800}
2022-08-16 13:49:14 +00:00
Alessio Bazzica
85a126ec5d ApmTest.VerifyDebugDump(Int|Float) more insightful with failures
Instead of showing individual byte differences, this CL detects
differences in the expected and actual byte streams of the evaluated
AEC dump and, if detected, parses the `audioproc::Event` proto lite
messages and calls EXPECT_EQ() for a subset of individual (sub-)fields.

Note that messages are parsed only if the byte streams of each message
pair do not match, so with no failures the test runs at no extra cost.
Plus, the the added funcionality can only be enabled for local
debugging by flipping the `kDumpWhenExpectMessageEqFails` flag - a
code change cannot land if the flag is set to true.

Note that `MessageDifferencer` (see [1]) could not be used because
it is not implemented for `MessageLite` protos.

[1] https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.util.message_differencer

Bug: b/241923537
Change-Id: I8e0eda3b1ecfe06945b6dad5ee8871f8200d76d7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/270922
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37765}
2022-08-12 12:42:43 +00:00
Ali Tofigh
e2d829cf77 Remove unnecessary overload
Bug: webrtc:13579
Change-Id: Ib8e9f3fb085718a140b5a6199cb75e7da22e4fe5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271202
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37747}
2022-08-11 12:34:32 +00:00
Ali Tofigh
980ad0cd64 Remove unnecessary overloads of AudioProcessing::CreateAndAttachAecDump()
Bug: webrtc:13579
Change-Id: I2e121b5fd30de4ac1813483f00a51184ff861760
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269623
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37723}
2022-08-09 13:32:59 +00:00
Sam Zackrisson
3bd444ffdb Clarify and extend test support for certain sample rates in audio processing
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}
2022-08-03 14:26:36 +00:00
Ali Tofigh
1fa87c44cb Adopt absl::string_view in AudioProcessing's interface
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}
2022-07-27 19:24:39 +00:00
Alessio Bazzica
d9f1208de7 AgcManagerDirect parametrized unit tests
It is now easier to fully test `AgcManagerDirect` with different values
for the used field trials. In particular, this CL adds tests for the
field trial named `WebRTC-Audio-2ndAgcMinMicLevelExperiment`.

1. `UnmutingRaisesTooLowVolume` and `MicVolumeIsLimited`
The expectations for the lowest input volume are not hard-coded anymore
since the parametrized tests use different values for the enforced
minimum.

2. `RecoveryAfterManualLevelChangeBelowMin`
The recovery behavior after manual input volume change depends on
whether the minimum input volume is overridden. When that's the case,
the minimum volume is applied immediately after the manual adjustment.
Hence, the existing test is left and a parametrized version of it has been added to test the "instant recovery" behavior. The latter test is
skipped when the minimum input volume is not overridden since that case
is covered by the existing test.

Bug: chromium:1275566
Change-Id: Ib0d4427b32b88f33138d4062b365916a3c47a406
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268900
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37577}
2022-07-20 15:44:13 +00:00
Alessio Bazzica
866caeb62c AgcManagerDirect ctor API and doc string improved
Bug: chromium:1275566
Change-Id: Iedc8f5cbbf65fbf018da9df1aaa1f8ade1bbc063
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268840
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37569}
2022-07-20 09:39:24 +00:00
Alessio Bazzica
7d4116855a AgcManagerDirect unit tests refactoring
Stop using TEST_F; that will make it easier to switch to parametric
tests that are needed to correctly test `AgcManagerDirect`.

"Avoid fixtures where reasonable."
Source: https://abseil.io/tips/122

Bug: chromium:1275566
Change-Id: I2d73a0913eb2349144f63bd17ab4d6efa245e472
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268766
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37556}
2022-07-19 12:46:42 +00:00
Bruno Pitrus
99465b1395 Add missing header to fix build error when using linux system libraries
Change-Id: I4fc04563c2cfe36fa2352f72f2ae61d47972f025
Bug: webrtc:11226
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268194
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Auto-Submit: Bruno Pitrus <brunopitrus@hotmail.com>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37555}
2022-07-19 12:25:42 +00:00
Danil Chapovalov
3e378d7efa Refactor AecDump not to rely on QueuedTask
Bug: webrtc:14245
Change-Id: Ib41765652745a247da2ae6c2ca6be714de927ca7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268185
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37542}
2022-07-18 11:07:51 +00:00
Alessio Bazzica
08480a599d Reland "AgcManagerDirect: stop enforcing min mic level override with 0 level"
This reverts commit d0a6fd239c.

Reason for revert: reland the bug fix

Original change's description:
> Revert "`AgcManagerDirect`: stop enforcing min mic level override with 0 level"
>
> This reverts commit e76daab8b3.
>
> Reason for revert: revert required to revert the parent CL
>
> Original change's description:
> > `AgcManagerDirect`: stop enforcing min mic level override with 0 level
> >
> > https://webrtc-review.googlesource.com/c/src/+/250141 introduced a bug
> > due to which the min mic level override is always enforced, if specified
> > even if the user manually adjusts the mic level to zero.
> >
> > This CL fixes that bug, the changes run behind a kill switch.
> >
> > TESTED=Test video call on Chromium on Mac; input volume not adjusted after zeroing it from the system preferences UI
> >
> > Bug: chromium:1275566
> > Change-Id: I18ce2e5970d3002b301f51f84544583c64982d57
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267844
> > Reviewed-by: Hanna Silen <silen@webrtc.org>
> > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#37460}
>
> Bug: chromium:1275566
> Change-Id: I6d22d8f3fafdc7da3814827b9b69146a506595db
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268468
> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#37515}

Bug: chromium:1275566
Change-Id: I7198587dec2a153270e8beb714e9dacccdaae806
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268544
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37530}
2022-07-15 09:43:22 +00:00
Alessio Bazzica
f3c86154d4 Revert "Min mic analog level: override minimum and behavior on Mac"
This reverts commit c9cad23274.

Reason for revert: add back field trial

Original change's description:
> Min mic analog level: override minimum and behavior on Mac
>
> This CL removes the `WebRTC-Audio-AgcMinMicLevelExperiment` field trial
> and always enables the code path behind that flag on Mac. In summary,
> the analog AGC behaves as follows on Mac:
> 1. the minimum level is overridden to 20
> 2. the minimum is applied even when clipping is detected
> 3. when the level is manually adjusted to 0, the minimum level is
>   enforced - i.e., 20
>
> Note that the 3rd property had been unintentionally added when the
> changes were added behind the aforementioned field trial. This will
> be fixed in a follow-up CL.
>
> Bug: chromium:1275566
> Change-Id: If184c4455a0780fcd94f55141af34460c152e3c3
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266488
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Reviewed-by: Hanna Silen <silen@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#37459}

Bug: chromium:1275566
Change-Id: I00a37ad9e16efc49f721558d25af16efd5f3db8c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268540
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37521}
2022-07-14 11:44:47 +00:00
Alessio Bazzica
d0a6fd239c Revert "AgcManagerDirect: stop enforcing min mic level override with 0 level"
This reverts commit e76daab8b3.

Reason for revert: revert required to revert the parent CL

Original change's description:
> `AgcManagerDirect`: stop enforcing min mic level override with 0 level
>
> https://webrtc-review.googlesource.com/c/src/+/250141 introduced a bug
> due to which the min mic level override is always enforced, if specified
> even if the user manually adjusts the mic level to zero.
>
> This CL fixes that bug, the changes run behind a kill switch.
>
> TESTED=Test video call on Chromium on Mac; input volume not adjusted after zeroing it from the system preferences UI
>
> Bug: chromium:1275566
> Change-Id: I18ce2e5970d3002b301f51f84544583c64982d57
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267844
> Reviewed-by: Hanna Silen <silen@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#37460}

Bug: chromium:1275566
Change-Id: I6d22d8f3fafdc7da3814827b9b69146a506595db
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268468
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37515}
2022-07-13 20:58:07 +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
Alessio Bazzica
e76daab8b3 AgcManagerDirect: stop enforcing min mic level override with 0 level
https://webrtc-review.googlesource.com/c/src/+/250141 introduced a bug
due to which the min mic level override is always enforced, if specified
even if the user manually adjusts the mic level to zero.

This CL fixes that bug, the changes run behind a kill switch.

TESTED=Test video call on Chromium on Mac; input volume not adjusted after zeroing it from the system preferences UI

Bug: chromium:1275566
Change-Id: I18ce2e5970d3002b301f51f84544583c64982d57
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267844
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37460}
2022-07-06 09:50:43 +00:00
Alessio Bazzica
c9cad23274 Min mic analog level: override minimum and behavior on Mac
This CL removes the `WebRTC-Audio-AgcMinMicLevelExperiment` field trial
and always enables the code path behind that flag on Mac. In summary,
the analog AGC behaves as follows on Mac:
1. the minimum level is overridden to 20
2. the minimum is applied even when clipping is detected
3. when the level is manually adjusted to 0, the minimum level is
  enforced - i.e., 20

Note that the 3rd property had been unintentionally added when the
changes were added behind the aforementioned field trial. This will
be fixed in a follow-up CL.

Bug: chromium:1275566
Change-Id: If184c4455a0780fcd94f55141af34460c152e3c3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266488
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37459}
2022-07-06 09:46:24 +00:00
Mirko Bonadei
2ad75b3956 Remove testonly from unpack_aecdump.
This CL duplicates a few lines of utility code from
//modules/audio_processing:audioproc_test_utils (which contains more
testonly things) and allows the possibility to remove testonly from
the unpack_aecdump tool.

Bug: b/237526033
Change-Id: If2e1dd4cc825429c496091cf8640c67069fb6e6f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267701
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37437}
2022-07-05 10:23:53 +00:00
Lionel Koenig
8783c678a5 delay estimator: Look for early reverberation
Look for first echo (and not only the strongest one) on the same matched
filter.

This change is bit exact with previous version when `pre_echo` is false.

Author: Jesús de Vicente Peña <devicentepena@webrtc.org>

Bug: webrtc:14205
Change-Id: I6782eaa1d690b0df78d00f6d425a85c951b2ca9d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266321
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Lionel Koenig <lionelk@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37360}
2022-06-28 15:16:03 +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
Alessio Bazzica
ac29b9c37f APM Transient Suppressor (TS): wire-up RNN VAD, TS and AGC2
When the `WebRTC-Audio-TransientSuppressorVadMode-RnnVad` field trial
is set, APM now uses (i) its RNN VAD sub-module to compute the voice
probability, (ii) that probability for TS and (iii) a temporally
delayed version of it for AGC2 (the delay introduced by TS is taken
into account).

Bug: webrtc:13663
Change-Id: Ic0f245c3f00d318c19bb01d3dbc2d5176c90f851
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266362
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37291}
2022-06-21 14:08:17 +00:00
cschuldt
c6014bcbb1 Optimize the AGC2 Biquad filter.
Bug: None
Change-Id: Idde77efd209be1687405d3f256ca52e2da640c1e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264561
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Christian Schuldt <cschuldt@google.com>
Cr-Commit-Position: refs/heads/main@{#37278}
2022-06-20 16:05:51 +00:00
Hanna Silen
0c1ad2992b AudioProcessingImpl: Add a VAD submodule
Add a VoiceActivityDetectorWrapper submodule in AudioProcessingImpl
and enable injecting speech probability into GainController2.

Bug: webrtc:13663
Change-Id: I05e13b737d085b45ac8ce76660191867c56834c2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265166
Commit-Queue: Hanna Silen <silen@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37275}
2022-06-20 10:44:41 +00:00
Niels Möller
105711e9ad Move rtc::make_ref_counted to api/
Bug: webrtc:12701
Change-Id: If49095b101c1a1763c2a44a0284c0d670cce953f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265390
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37219}
2022-06-15 09:47:38 +00:00
Niels Möller
f1d822b03b Delete variant of rtc::split that copies the output fields
Bug: webrtc:13579
Change-Id: I065a32704d48d5eed21aee0e9757cac9ecf7aa99
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261951
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Ali Tofigh <alito@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37160}
2022-06-09 08:29:33 +00:00
Gustaf Ullberg
8e87a248de Use a one-dimensional vector for Block data
Puts the whole block in contiguous memory and reduce pointer look-up.

The change has been verified to be bit-exact.

Bug: webrtc:14089
Change-Id: I264aaf764bf53a29f23249105f704b2fdbd7e51c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/263203
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36983}
2022-05-24 11:12:46 +00:00
Ivan Murashov
1e8bb67295 GCC: Avoid symbol clash in RenderBuffer
GCC fails to resolve getter for RenderBuffer::Block() because
its return type has the same name with the getter method.
Rename getter method with the prefix "Get" as guided in the
https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/blink-c++.md#Precede-setters-with-the-word-Set_use-bare-words-for-getters
"If a getter’s name collides with a type name, prefix it with “Get”."

Bug: chromium:819294, webrtc:14089
Change-Id: Ieaa3af27415eb8c39806aa8480897b47fd07baa8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/263420
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36982}
2022-05-24 10:47:56 +00:00
Gustaf Ullberg
fbfe6f08a4 AEC3: Correct high-band gain for multi-channel
The high-band gain is corrected by fixing the computation of the
low-band energy

Bug: webrtc:14108
Change-Id: I5033287de57aedcd91bb71623ca2862519ffb35b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/263201
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36972}
2022-05-23 13:09:49 +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
Jeremy Leconte
d01e692e01 Fix flakiness of CheckLogLevelUpdateStatsEmpty.
Bug: b/232719223
Change-Id: I26bdb10bb7bae89f8a99b8c4db14609ae9bfda50
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262620
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36909}
2022-05-17 11:57:35 +00:00
Tommi
7f969c0eff Ensure that an RTP audio level of 127 represents digital silence.
To quote rfc6464:
  The audio level for digital silence -- for a muted audio source, for
  example -- MUST be represented as 127 (-127 dBov), regardless of the
  dynamic range of the encoded audio format.

The behavior in webrtc is correct that digital silence is represented
with 127, but it is also possible to get a value of 127 for not quite
digitally silent audio buffer (as in, not strictly 0s).

Bug: webrtc:14029
Change-Id: I7ff8698a7e4d5c0960c667fd1cc961838e269456
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261244
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36793}
2022-05-06 07:56:39 +00:00
Peter Kasting
662d7f11d5 Fixes to support building in -std=c++20 mode.
* Structs with user-declared constructors are no longer considered
  aggregates, so remove the declarations when possible
* Types of both arguments to "==" must match to avoid "ambiguous
  function call" warning
* Various types of math involving enums are deprecated, so replace with
  constexprs where necessary
* ABSL_CONST_INIT must be used on definition as well as declaration
* volatile memory may no longer be read from and written to by the same
  operator, so replace e.g. "n++" with "n = n + 1"
* Replace an outdated check for no_unique_address support with
  __has_cpp_attribute
* std::result_of(f(x)) has been removed, replace with
  std::invoke_result(f, x)

Bug: chromium:1284275
Change-Id: I77b366ab1da7eb2c1e4c825b2714417c31ee5903
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261221
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Tomas Gunnarsson <tommi@google.com>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36786}
2022-05-05 17:15:58 +00:00
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
Florent Castelli
a30aef3dea Move event_tracer out of rtc_base_approved
Bug: webrtc:9838
Change-Id: Ic3c424729b5edd3e378c4195afe33ae5c88ad491
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/259312
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36637}
2022-04-24 14:47:40 +00:00
Sam Zackrisson
498078ce28 Remove deprecated webrtc::AudioProcessing::ResidualEchoDetector stats config
Replaced by injectable component, see discussion and PSA in attached bug.

Bug: webrtc:11539
Change-Id: I11ac4504e3d7e0d42b545ff92178674c709f586d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258680
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36612}
2022-04-22 08:37:19 +00:00
Florent Castelli
f4db351625 Move race_checker out of rtc_base_approved
Bug: webrtc:9838
Change-Id: If180abcca1ef598314de3aed70e4a6eb04f062d4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258770
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36607}
2022-04-21 14:40:06 +00:00
Florent Castelli
1cb5383d16 Move swap_queue out of rtc_base_approved
Bug: webrtc:9838
Change-Id: I7add82b13bf7411e5b1531a26ef2b87a4bdb9ab4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258768
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36601}
2022-04-21 09:50:24 +00:00
Florent Castelli
71337f387e Move random out of rtc_base_approved
Bug: webrtc:9838
Change-Id: I64a5ef18c19d446139354d04aa6cb2a76d18aad0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258762
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36572}
2022-04-19 14:00:47 +00:00
Florent Castelli
45a0599978 Remove platform_thread from //rtc_base:rtc_base_approved public_deps
While the target has a restricted visibility, since it was in rtc_base_approved
public deps, a lot of targets were able to bypass the visibility check.
So we remove the visibility restrictions and use the dependency explicitely
everywhere instead.

Bug: webrtc:8603
Change-Id: I94a03fdf7f94c54ab72081a58dd648e2cca73d17
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258944
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36566}
2022-04-18 23:12:52 +00:00
Ali Tofigh
2ab914c6ab Adopt absl::string_view in rtc_base/ (straightforward cases)
Bug: webrtc:13579
Change-Id: I240db6285abb22652242bc0b2ebe9844ec4a45f0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258723
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36561}
2022-04-17 12:11:56 +00:00
Peter Thatcher
4a2e0e5d45
Update to 4896 (M100) (#72) 2022-04-15 17:13:23 -06:00
Sam Zackrisson
4d12174ca5 AEC3: Add metrics for stereo detection code
Adds two metrics for stereo detection:
- An enum indicating whether the last 10 seconds contained persistent stereo content or not, logged every 10 seconds.
- An enum indicating whether any persistent stereo content at all has been detected, logged at the end of the AEC lifetime.

These metrics allow us to assess:
- What proportion of all audio is treated as stereo.
- What proportion of sessions encounter any significant stereo content. If this is unexpectedly high, the stereo detection code may need fine tuning.

Metrics are only logged for component lifetimes exceeding 5 seconds: This is to avoid brief AEC lifetimes due to internal resets etc within APM.

Corresponding Chrome CL for XML histogram declarations:
https://crrev.com/c/3579317

Bug: chromium:1295710
Change-Id: I93e2bf74588cf4bb2a8922dbfad079bccab01456
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258760
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36537}
2022-04-13 10:16:48 +00:00
Lionel Koenig
39ad2d868c AudioBuffer: Remove deprecated constructor
Removes webrtc::AudioBuffer deprecated constructor.

Bug: webrtc:5298
Change-Id: If8debe990c0358e58fbdc59bfdfb7e4af1f38f00
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257305
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Lionel Koenig <lionelk@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36518}
2022-04-11 10:06:07 +00:00
Sam Zackrisson
1397c4bfd9 AEC3: Handle temporary stereo content more robustly
During temporary stereo content when the AEC3 uses a mono reference signal, the signal is downmixed by averaging instead of using only the left channel.

Additionally, temporary stereo content is flagged as an echo path change.

Tested: Modified local build: Verified stereo mode entered / left in accordance with hysteresis and timeout thresholds. Verified temporary stereo detected during temporary stereo playout. Made an aecdump and inspected content.
Bug: chromium:1295710
Change-Id: I6bd53e615dfb3ec39bc1c73275b7d6d599ac7c57
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258481
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36504}
2022-04-08 17:03:34 +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
Alessio Bazzica
7efe5332f2 APM Transient Suppressor (TS): integrate VoiceProbabilityDelayUnit
This CL adds a component in the TS implementation to return a delayed
version of the voice probability values observed when `Suppress()` is
called. That is needed in order to temporally align the voice
probability values to the processed audio since TS adds algorithmic
delay.

Bug: webrtc:13663
Change-Id: I5041ace3939d2ce7ba084ae703428e66f1aa06be
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/255860
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36496}
2022-04-08 12:13:14 +00:00
Alessio Bazzica
3fcab3985c APM Transient Suppressor (TS): remove unused return values
The values returned by `TransientSuppressor::Initialize()` and by
`TransientSuppressor::Suppress()` are never used.

Bug: webrtc:13663
Change-Id: I20b8afb5a66f49e5ebaf132acf8bcd1c4292a5f8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/255822
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36492}
2022-04-08 10:08:04 +00:00
Alessio Bazzica
080006b42f APM Transient Suppressor (TS): initialization params in ctor
More robust API option that allows to fully initialize TS when created.

Bug: webrtc:13663
Change-Id: I42c38612ef772eb6d0bbde49d04ea39332a0e3c7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/255821
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36490}
2022-04-08 09:41:44 +00:00
Alessio Bazzica
0ae390fd17 APM TS: Adding VoiceProbabilityDelayUnit
Adding a delay unit to be used in the APM Transient Suppressor (TS)
sub-module through which the observerd voice probabilities are
temporally aligned to the audio processed by TS, which introduces
algorithmic delay.

Bug: webrtc:13663
Change-Id: I2136c303914580851c742d8db89478a13b06dacb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/255680
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36487}
2022-04-07 18:53:03 +00:00
Alessio Bazzica
efbe3af366 Transient Suppressor (TS): add alternative VAD modes
It is now required to specify which VAD is used to compute the speech
probability passed when `TransientSuppressor::Suppress()` is called.
In this way, it is possible to adapt parameters and/or logic of a
`TransientSuppressor` implementation to the behavior of the used
VAD. This CL also adds a "no VAD" mode option, which ignores the speech
probability argument passed when `Suppress()` and always applies mild
suppression to preserve transparency.

Finally, this CL adds a field trial to choose which VAD is used by
APM for transient suppression. Wiring the RNN VAD to TS will be done
in a follow-up CL.

Bug: webrtc:13663
Change-Id: I21ed49f91875a4ee0f04db97ea87c0dbc3db7f8a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250962
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36485}
2022-04-07 16:27:32 +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
Sam Zackrisson
04c6053f46 AEC3: Simplify the EchoCanceller3 construction
Apart from making the construction more straightforward, this change allows recreating the BlockProcessor at runtime. This is used to change parameterization at runtime in an upcoming CL [1].

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

Tested: Bitexact on a large number of aecdumps.
Bug: chromium:1295710
Change-Id: I2e0275c5c97044cb4370042633266b193c06b960
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258100
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36473}
2022-04-07 07:31:13 +00:00
Florent Castelli
dd837e28fa Remove //rtc_base:timeutils from public deps
Bug: webrtc:8603
Change-Id: Iaca9356d16275a02e8842c783f259131d72ef010
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257914
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36460}
2022-04-06 11:23:21 +00:00
Artem Titov
a529b0c0f2 Fix chromium roll: remove variables that are written but not accessed
Bug: b/228208976
Change-Id: Iee4df1249f9bc4aa2fa840c0a039543e8560c7c6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258122
Reviewed-by: Björn Terelius <terelius@google.com>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36459}
2022-04-06 09:48:20 +00:00
Florent Castelli
57aa81bce7 Remove //rtc_base:stringutils from public deps
Bug: webrtc:8603
Change-Id: Ic2dfbe28d310cb4b35983b73e895fc95e8439669
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257913
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36453}
2022-04-05 22:42:19 +00:00
Florent Castelli
e10a9f609a Remove //rtc_base:safe_conversions from public deps
Bug: webrtc:8603
Change-Id: I285ac30975039f8fe9882d1673cc8e4a615c8618
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257912
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36452}
2022-04-05 20:04:59 +00:00
Florent Castelli
33d31fbc48 Remove //rtc_base:rtc_event from public deps
Bug: webrtc:8603
Change-Id: Ib99f43043da17723c939b0fe2aa9f3e515462c93
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257911
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36450}
2022-04-05 17:34:09 +00:00
Florent Castelli
f86f6f9afd Remove //rtc_base:refcount from public deps
Bug: webrtc:8603
Change-Id: Ib27a107ae809df739492846175f0e9c4af40d21a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257910
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36447}
2022-04-05 15:32:29 +00:00
Florent Castelli
4467ad7835 Remove //rtc_base:macromagic from public deps
Bug: webrtc:8603
Change-Id: I9708df48c9bde9f86ba2d1a92a278bb0d09f3865
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257909
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36444}
2022-04-05 12:36:12 +00:00
Florent Castelli
0af55ba60d Remove //rtc_base:logging from public deps
Bug: webrtc:8603
Change-Id: I2704da8618f88032adac7ae9eb2a0f47fce4a836
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257908
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36443}
2022-04-05 10:31:19 +00:00
Florent Castelli
bddfe0215c Remove //rtc_base:atomicops from public deps
Bug: webrtc:8603
Change-Id: If1fb37e44d5ab277e16895ca50325b3a86bd135f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257907
Auto-Submit: 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@{#36432}
2022-04-04 18:25:48 +00:00
Alessio Bazzica
d7fdb95346 Remove typing detection
Motivation: never used.
Follow-up CL of https://webrtc-review.googlesource.com/c/src/+/250680.

Tested on a custom chromium build by making a video call and with
keyboard activity. The expected logs from the APM transient suppressor
sub-module were shown.

Bug: webrtc:11226
Change-Id: I4186994412dd8ba2e71ed8f9dcc9cf8f8e40fbd3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250667
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36300}
2022-03-23 10:23:54 +00:00
Alessio Bazzica
bb986cbddb APM audioproc_f: adding --override_key_pressed
Add a flag to override the key pressed state when simulating APM.

The current behavior changes as follows:
- Wav files simulation: instead of simulating continuous key press
  events only if the transient suppressor (TS) sub-module is active,
  allow to simulate the events regardless of whether TS is used;
  the default key pressed state is used if the command line flag is
  unspecified, otherwise it is overridden (either always false or
  always true)
- AEC dump simulation: instead of simulating continuous key press
  events when `--ts 2` is specified, allow to simulate the events
  regardless of whether TS is used; the state recorded in the AEC
  dump is used if the command line flag is unspecified, otherwise
  it is overridden (either always false or always true)
- The `--ts 2` option (continuous key events) is now equivalent to
  `--ts 1`.

Bug: webrtc:13663
Change-Id: I5ebe96283db73ee235ec2b2795d91d4e241a3527
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256003
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36247}
2022-03-18 10:51:37 +00:00
Hanna Silen
9524c0fa4f AgcManagerDirect: Modify clipping_predictor_evaluator_ configuration
Increase the history size of clipping_predictor_evaluator_. Use one-sample
accuracy in clipping detection for the evaluator.

Bug: webrtc:12774
Change-Id: I8c1bbfe69fe55af73ce14992e49ef7295b3ce926
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/241602
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36218}
2022-03-16 14:42:23 +00:00
Alessio Bazzica
5cd7d2aa0f audioproc_f: fix AGC1 digital adaptive flag bug
- missing negation causes the opposite behavior when
  `analog_agc_disable_digital_adaptive` is used
- flag replaced with `analog_agc_use_digital_adaptive_controller`
  which is less error-prone

Bug: webrtc:7494
Change-Id: If9e0ba4fc9e539c73269faf9096ca782620dac6d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251322
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36113}
2022-03-02 15:50:57 +00:00
Alessio Bazzica
feac97bb25 AgcManagerDirect: improve AgcMinMicLevelExperimentEnabled50 test
Also test the field trial with valid parameter and non-empty suffix.

Bug: webrtc:7494
Change-Id: I3d871b41dd71c951ac56e180b3c09cda4c3627d4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251441
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36031}
2022-02-18 17:52:01 +00:00
Alessio Bazzica
1db0a261ca Reland "Reland "Remove unused APM voice activity detection sub-module""
This reverts commit 09aaf6f7bc.

Reason for revert: downstream fixed (see https://chromium-review.googlesource.com/c/chromium/src/+/3461371)

Original change's description:
> Revert "Reland "Remove unused APM voice activity detection sub-module""
>
> This reverts commit 54d1344d98.
>
> Reason for revert: Breaks chromium roll, see 
> https://ci.chromium.org/ui/p/chromium/builders/try/linux_chromium_tsan_rel_ng/1080583/overview
>
> https://chromium-review.googlesource.com/c/chromium/src/+/3461512
>
> Original change's description:
> > Reland "Remove unused APM voice activity detection sub-module"
> >
> > This reverts commit a751f167c6.
> >
> > Reason for revert: dependency in a downstream project removed
> >
> > Original change's description:
> > > Revert "Remove unused APM voice activity detection sub-module"
> > >
> > > This reverts commit b4e06d032e.
> > >
> > > Reason for revert: breaking downstream projects
> > >
> > > Original change's description:
> > > > Remove unused APM voice activity detection sub-module
> > > >
> > > > API changes:
> > > > - webrtc::AudioProcessing::Config::VoiceDetection removed
> > > > - webrtc::AudioProcessingStats::voice_detected deprecated
> > > > - cricket::AudioOptions::typing_detection deprecated
> > > > - webrtc::StatsReport::StatsValueName::
> > > >   kStatsValueNameTypingNoiseState deprecated
> > > >
> > > > PSA: https://groups.google.com/g/discuss-webrtc/c/7X6uwmJarE0
> > > >
> > > > Bug: webrtc:11226,webrtc:11292
> > > > Change-Id: I8d008b56708cf62961b9857ec052b59fda3b41bf
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250666
> > > > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> > > > Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> > > > Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> > > > Reviewed-by: Björn Terelius <terelius@webrtc.org>
> > > > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> > > > Cr-Commit-Position: refs/heads/main@{#35975}
> > >
> > > TBR=gustaf@webrtc.org,saza@webrtc.org,alessiob@webrtc.org,terelius@webrtc.org,hta@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com
> > >
> > > Change-Id: Iee01fdb874b4e0331277f3ffe60dacaabc3859a2
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Bug: webrtc:11226,webrtc:11292
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251600
> > > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> > > Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> > > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> > > Cr-Commit-Position: refs/heads/main@{#35977}
> >
> > # Not skipping CQ checks because this is a reland.
> >
> > Bug: webrtc:11226,webrtc:11292
> > Change-Id: I2fcbc5fdade16bfe6a0f0a02841a33a598d4f2ad
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251660
> > Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#35984}
>
> TBR=mbonadei@webrtc.org,gustaf@webrtc.org,saza@webrtc.org,alessiob@webrtc.org,terelius@webrtc.org,hta@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com
>
> Change-Id: Ib308a3af2dcce85a0074ef5a4680ccec3f82712f
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:11226,webrtc:11292
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251688
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
> Auto-Submit: Henrik Boström <hbos@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35990}

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

Bug: webrtc:11226,webrtc:11292
Change-Id: Idfda6a517027ad323caf44c526a88468e5b52b65
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251762
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36012}
2022-02-16 08:41:30 +00:00
Henrik Boström
09aaf6f7bc Revert "Reland "Remove unused APM voice activity detection sub-module""
This reverts commit 54d1344d98.

Reason for revert: Breaks chromium roll, see 
https://ci.chromium.org/ui/p/chromium/builders/try/linux_chromium_tsan_rel_ng/1080583/overview

https://chromium-review.googlesource.com/c/chromium/src/+/3461512

Original change's description:
> Reland "Remove unused APM voice activity detection sub-module"
>
> This reverts commit a751f167c6.
>
> Reason for revert: dependency in a downstream project removed
>
> Original change's description:
> > Revert "Remove unused APM voice activity detection sub-module"
> >
> > This reverts commit b4e06d032e.
> >
> > Reason for revert: breaking downstream projects
> >
> > Original change's description:
> > > Remove unused APM voice activity detection sub-module
> > >
> > > API changes:
> > > - webrtc::AudioProcessing::Config::VoiceDetection removed
> > > - webrtc::AudioProcessingStats::voice_detected deprecated
> > > - cricket::AudioOptions::typing_detection deprecated
> > > - webrtc::StatsReport::StatsValueName::
> > >   kStatsValueNameTypingNoiseState deprecated
> > >
> > > PSA: https://groups.google.com/g/discuss-webrtc/c/7X6uwmJarE0
> > >
> > > Bug: webrtc:11226,webrtc:11292
> > > Change-Id: I8d008b56708cf62961b9857ec052b59fda3b41bf
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250666
> > > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> > > Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> > > Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> > > Reviewed-by: Björn Terelius <terelius@webrtc.org>
> > > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> > > Cr-Commit-Position: refs/heads/main@{#35975}
> >
> > TBR=gustaf@webrtc.org,saza@webrtc.org,alessiob@webrtc.org,terelius@webrtc.org,hta@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com
> >
> > Change-Id: Iee01fdb874b4e0331277f3ffe60dacaabc3859a2
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: webrtc:11226,webrtc:11292
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251600
> > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> > Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#35977}
>
> # Not skipping CQ checks because this is a reland.
>
> Bug: webrtc:11226,webrtc:11292
> Change-Id: I2fcbc5fdade16bfe6a0f0a02841a33a598d4f2ad
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251660
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35984}

TBR=mbonadei@webrtc.org,gustaf@webrtc.org,saza@webrtc.org,alessiob@webrtc.org,terelius@webrtc.org,hta@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: Ib308a3af2dcce85a0074ef5a4680ccec3f82712f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11226,webrtc:11292
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251688
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35990}
2022-02-14 12:25:51 +00:00
Alessio Bazzica
54d1344d98 Reland "Remove unused APM voice activity detection sub-module"
This reverts commit a751f167c6.

Reason for revert: dependency in a downstream project removed

Original change's description:
> Revert "Remove unused APM voice activity detection sub-module"
>
> This reverts commit b4e06d032e.
>
> Reason for revert: breaking downstream projects
>
> Original change's description:
> > Remove unused APM voice activity detection sub-module
> >
> > API changes:
> > - webrtc::AudioProcessing::Config::VoiceDetection removed
> > - webrtc::AudioProcessingStats::voice_detected deprecated
> > - cricket::AudioOptions::typing_detection deprecated
> > - webrtc::StatsReport::StatsValueName::
> >   kStatsValueNameTypingNoiseState deprecated
> >
> > PSA: https://groups.google.com/g/discuss-webrtc/c/7X6uwmJarE0
> >
> > Bug: webrtc:11226,webrtc:11292
> > Change-Id: I8d008b56708cf62961b9857ec052b59fda3b41bf
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250666
> > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> > Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> > Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> > Reviewed-by: Björn Terelius <terelius@webrtc.org>
> > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#35975}
>
> TBR=gustaf@webrtc.org,saza@webrtc.org,alessiob@webrtc.org,terelius@webrtc.org,hta@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com
>
> Change-Id: Iee01fdb874b4e0331277f3ffe60dacaabc3859a2
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:11226,webrtc:11292
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251600
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35977}

# Not skipping CQ checks because this is a reland.

Bug: webrtc:11226,webrtc:11292
Change-Id: I2fcbc5fdade16bfe6a0f0a02841a33a598d4f2ad
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251660
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35984}
2022-02-13 14:02:08 +00:00
Alessio Bazzica
a751f167c6 Revert "Remove unused APM voice activity detection sub-module"
This reverts commit b4e06d032e.

Reason for revert: breaking downstream projects

Original change's description:
> Remove unused APM voice activity detection sub-module
>
> API changes:
> - webrtc::AudioProcessing::Config::VoiceDetection removed
> - webrtc::AudioProcessingStats::voice_detected deprecated
> - cricket::AudioOptions::typing_detection deprecated
> - webrtc::StatsReport::StatsValueName::
>   kStatsValueNameTypingNoiseState deprecated
>
> PSA: https://groups.google.com/g/discuss-webrtc/c/7X6uwmJarE0
>
> Bug: webrtc:11226,webrtc:11292
> Change-Id: I8d008b56708cf62961b9857ec052b59fda3b41bf
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250666
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Reviewed-by: Björn Terelius <terelius@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35975}

TBR=gustaf@webrtc.org,saza@webrtc.org,alessiob@webrtc.org,terelius@webrtc.org,hta@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: Iee01fdb874b4e0331277f3ffe60dacaabc3859a2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11226,webrtc:11292
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251600
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35977}
2022-02-11 12:15:44 +00:00
Alessio Bazzica
b4e06d032e Remove unused APM voice activity detection sub-module
API changes:
- webrtc::AudioProcessing::Config::VoiceDetection removed
- webrtc::AudioProcessingStats::voice_detected deprecated
- cricket::AudioOptions::typing_detection deprecated
- webrtc::StatsReport::StatsValueName::
  kStatsValueNameTypingNoiseState deprecated

PSA: https://groups.google.com/g/discuss-webrtc/c/7X6uwmJarE0

Bug: webrtc:11226,webrtc:11292
Change-Id: I8d008b56708cf62961b9857ec052b59fda3b41bf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250666
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35975}
2022-02-11 10:47:39 +00:00
Henrik Lundin
8a9aa55561 Remove AudioProcessing::ChannelLayout
This enum is no longer needed. Also moving the last piece of code from
common.h to audio_processing_impl.h, allowing to delete common.h.

Bug: chromium:1271981, b/217349489
Change-Id: If115336c36d6d7b5845a903e421c18aebfe434ee
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251242
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35946}
2022-02-08 10:07:36 +00:00
Alessio Bazzica
c7d0e4265c AGC1: min mic level override always applied
When the minimum mic level is overridden via the field trial named
WebRTC-Audio-AgcMinMicLevelExperiment, AGC1 can still lower the gain
beyond the minimum value (namely, when clipping is observed).

This CL changes the behavior of the field trial. When specified, the
override always applies and therefore the mic level is guaranteed to
never become lower than what the field trial specifies.

Tested: RTC call in Chromium with and without --force-fieldtrials="
WebRTC-Audio-AgcMinMicLevelExperiment/Enabled-255"

Bug: chromium:1275566
Change-Id: I42ff45add54c11084f5ca6a2b95887c627c3c3aa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250141
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35914}
2022-02-04 18:01:31 +00:00
Alessio Bazzica
bab128555a Improve code quality in modules/audio_processing/agc/
- Switch from ptr+size to rtc::ArrayView
- Remove `AgcManagerDirect::sample_rate_hz_` since it's always 16 kHz
- Stop passing nullptr in agc_manager_direct_unittest.cc when
  `AgcManagerDirect::Process()` is called
- Allow to correctly run the tests added in the child CL (see [1])

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

Bug: webrtc:7494
Change-Id: I0292d7038d6510ca7c58af32b6003a1e4b121b00
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250541
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35910}
2022-02-04 15:37:21 +00:00
Henrik Lundin
64253a93dc Remove more traces of keyboard mic support from APM
The 6-parameter Initialize method is removed. The has_keyboard parameter
in the StreamConfig constructor is removed together with the underlying
member and helper functions.

Bug: chromium:1271981, b/217349489
Change-Id: I7259a114a395f74f735a9c06510c0fc0f0f008e3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250221
Reviewed-by: Sam Zackrisson <saza@google.com>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Auto-Submit: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35908}
2022-02-04 14:27:51 +00:00
Ali Tofigh
1e157a9596 Remove more top-level const from parameters in function declarations
This CL removes even more top-level const from parameters in function
declarations. This change is safe because top-level const in function
declarations (not function definitions) are ignored by the compiler
and so change is just a no-op cleanup.

Bug: webrtc:13610
Change-Id: Icf6868c27b1fdb9d9915b3a7020eb34bdcf07a09
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249989
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35866}
2022-02-01 09:15:50 +00:00
Artem Titov
6cae2d5513 Reland "Remove RTC_DISALLOW_COPY_AND_ASSIGN usages completely"
This reverts commit 3f87250a4f.

Reason for revert: Downstream is fixed

Original change's description:
> Revert "Remove RTC_DISALLOW_COPY_AND_ASSIGN usages completely"
>
> This reverts commit 5f0eb93d2a.
>
> Reason for revert: Breaks downstream project. I'm going to fix that one and create a reland of this CL after.
>
> Original change's description:
> > Remove RTC_DISALLOW_COPY_AND_ASSIGN usages completely
> >
> > Bug: webrtc:13555, webrtc:13082
> > Change-Id: Iff2cda6f516739419e97e975e03f77a98f74be03
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249260
> > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> > Reviewed-by: Artem Titov <titovartem@webrtc.org>
> > Commit-Queue: (Daniel.L) Byoungchan Lee <daniel.l@hpcnt.com>
> > Cr-Commit-Position: refs/heads/main@{#35805}
>
> TBR=hta@webrtc.org,titovartem@webrtc.org,daniel.l@hpcnt.com,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com
>
> Change-Id: I33d497f1132adfe6d151023195a388d9b7d548f9
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:13555, webrtc:13082
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249364
> Reviewed-by: Artem Titov <titovartem@webrtc.org>
> Owners-Override: Artem Titov <titovartem@webrtc.org>
> Reviewed-by: Andrey Logvin <landrey@webrtc.org>
> Reviewed-by: Björn Terelius <terelius@webrtc.org>
> Commit-Queue: Artem Titov <titovartem@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35807}

# Not skipping CQ checks because this is a reland.

Bug: webrtc:13555, webrtc:13082
Change-Id: I7ef1ef3b6e3c41b1a96014aa75f003c0fcf33949
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249365
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35814}
2022-01-27 12:55:44 +00:00
Artem Titov
3f87250a4f Revert "Remove RTC_DISALLOW_COPY_AND_ASSIGN usages completely"
This reverts commit 5f0eb93d2a.

Reason for revert: Breaks downstream project. I'm going to fix that one and create a reland of this CL after.

Original change's description:
> Remove RTC_DISALLOW_COPY_AND_ASSIGN usages completely
>
> Bug: webrtc:13555, webrtc:13082
> Change-Id: Iff2cda6f516739419e97e975e03f77a98f74be03
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249260
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Artem Titov <titovartem@webrtc.org>
> Commit-Queue: (Daniel.L) Byoungchan Lee <daniel.l@hpcnt.com>
> Cr-Commit-Position: refs/heads/main@{#35805}

TBR=hta@webrtc.org,titovartem@webrtc.org,daniel.l@hpcnt.com,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I33d497f1132adfe6d151023195a388d9b7d548f9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:13555, webrtc:13082
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249364
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Owners-Override: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Andrey Logvin <landrey@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35807}
2022-01-26 14:56:14 +00:00