Commit graph

45 commits

Author SHA1 Message Date
Florent Castelli
0afde7614d Move webrtc::AudioProcessing include to api/ folder
Bug: webrtc:15874
Change-Id: Ie8a6e031c0f0505cfe238f7d252c47e9c34408d4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/347983
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42128}
2024-04-20 07:02:50 +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
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
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
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
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
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
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
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
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
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
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
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
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
Hanna Silen
2986e6a791 AgcManagerDirect: Refine unit tests
Add unit tests `UsedClippingPredictionsProduceLowerAnalogLevels` and
`UnusedClippingPredictionsProduceEqualAnalogLevels`. These tests replace
the existing tests `EnableClippingPredictorLowersVolume` and
`EnableClippingPredictorWithUnusedPredictedStepDoesNotLowerVolume`.

Bug: webrtc:12774
Change-Id: I2f5b726d58d8afb3d3bf39a3c96fa8d3910fa9e0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/231225
Commit-Queue: Hanna Silen <silen@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34932}
2021-09-06 17:46:21 +00:00
Artem Titov
0b489303d2 Use backticks not vertical bars to denote variables in comments for /modules/audio_processing
Bug: webrtc:12338
Change-Id: I85bff694dd2ead83c939c4d1945eff82e1296001
No-Presubmit: True
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227161
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34690}
2021-08-09 21:49:02 +00:00
Hanna Silen
e7e9292fe8 Analog AGC: Add clipping rate metrics
Add a histogram WebRTC.Audio.Agc.InputClippingRate and logging of
max clipping rate in AgcManagerDirect.

Bug: webrtc:12774
Change-Id: I4a72119b65ad032fc50672e2a8fb4a4d55e1ff24
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225264
Commit-Queue: Hanna Silen <silen@webrtc.org>
Reviewed-by: Minyue Li <minyue@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34450}
2021-07-10 13:13:46 +00:00
Alessio Bazzica
42dacda82c AGC analog clipping predictor: integrate evaluator
Integrate ClippingPredictorEvaluator in AgcManagerDirect adding the
possibility to run the predictor without affecting the analog gain
adjustment process.

The evaluator is used to compute precision, recall and F1 score.
F1 score and the measured clipping prediction intervals are logged as
`WebRTC.Audio.Agc.ClippingPredictor.F1Score` and `.PredictionInterval`
histograms respectively.

Bug: webrtc:12774
Change-Id: I708dcda9321f92d5bd17ec4c36ebce1165ead57f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221921
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34327}
2021-06-17 16:16:53 +00:00
Hanna Silen
a004715d13 Integrate ClippingPredictor into AudioProcessingImpl and AgcManagerDirect
Integrate ClippingPredictor in AgcManagerDirect and
AudioProcessingImpl. Disable functionality by default.

Bug: webrtc:12774
Change-Id: Ic67a47f439c89b75066506fca8acaf636d8812f0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221100
Commit-Queue: Hanna Silen <silen@webrtc.org>
Reviewed-by: Minyue Li <minyue@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34207}
2021-06-03 02:35:05 +00:00
Hanna Silen
b8dc7fa5a6 Make AgcManagerDirect clipping parameters configurable
Bug: webrtc:12774
Change-Id: I99824b5aabe6f921a5db425dd1c1c1d4c606186c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/219681
Commit-Queue: Hanna Silen <silen@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34069}
2021-05-20 16:53:59 +00:00
Per Åhgren
0a144a705a Adding initial support for lock-less informing of muting
This CL adds the initial support for letting APM know when its output
will be used or not.
It also adds a new method for passing RuntimeInformation to APM that
returns a bool indicating the success of the passing of information.

Bug: b/177830919
Change-Id: Ic2e1b92c37241d74ca6394b785b91736ca7532aa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206061
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33201}
2021-02-09 12:08:54 +00:00
Alessio Bazzica
42eef86c4f Remove unused code in APM
- The injection of the AGC2 level estimator into `AgcManagerDirect`
  is not used anymore
- `ExperimentalAgc::enabled_agc2_level_estimator` can also be removed
- 3 ctors of `ExperimentalAgc` are unused
- `AgcManagerDirectStandaloneTest::AgcMinMicLevelExperiment` can be
  split into separate unit tests (better code clarity)

Bug: webrtc:7494
Change-Id: I5843147c38cf7cb5ee484b0a72fe13dcf363efaf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/202025
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33027}
2021-01-18 13:40:27 +00:00
Per Åhgren
645f24cb86 APM: Replace most usages of AudioFrame with a stream interface
This CL creates a new stream interface and uses it to replace
most of the usage of AudioFrame in the non-test code.

The CL changes some of the test code as well, as the other
changes required that.

The CL will be followed by 2 more related CLs.

Bug: webrtc:5298
Change-Id: I5cfbe6079f30fc3fbf35b35fd077b6fb49c7def0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170040
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30799}
2020-03-16 11:51:47 +00:00
Per Åhgren
26cc5e650f Corrected the aggregation of AGC choices and add fallback solution
This CL corrects the analog AGC code so that the levels are properly
aggregated and not only the level of the first channel is chosen.

It also adds a kill-switch to allow the aggrated level to be the maximum
level rather than the minimum level.

Bug: webrtc:10859
Change-Id: Ibf4fecb53cfaf0dc064c334112105bf26401f78d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/160708
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29931}
2019-11-27 11:57:22 +00:00
Per Åhgren
3daedb6c88 Making the Analog AGC properly support multi-channel
This CL adds proper multi-channel support to the analog AGC.

Beyond that, it prepares adding multi-channel support to the digital
AGC by removing the tight dependency between the analog and digital
AGC codes.

Bug: webrtc:10859
Change-Id: I4414ccbc3db5dbb5ae069fdf426cbd038375ca7b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159480
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29878}
2019-11-22 15:32:55 +00:00
Per Åhgren
0e3198e434 Refactoring of the analog AGC functionality to add multichannel support
This CL refactors the analog AGC functionality. In particular it:
-Breaks then tight dependency between the analog AGC and the digital
AGC implementation.
-Removes the complicated callback interface for reporting the analog
level and replaces it with an int.

Bug: webrtc:10859
Change-Id: I3572d60ab98edebbcffa25af64cc74c66f9868fc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159039
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29838}
2019-11-19 23:39:07 +00:00
Per Åhgren
b8c1be5b6e Further AGC refactoring in preparation for adding multichannel support
Bug: webrtc:10859
Change-Id: If7d58a615a365a0b0f7b49e0cc2392b9bd5e2a0c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159028
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29736}
2019-11-07 22:44:08 +00:00
Per Åhgren
7c1fb4156d Removing old scheme for dumping internal AGC diagnostic data
Bug: webrtc:5298
Change-Id: I878b370ae86805d2dd6c0d8c1c61d3ee9d8a6c1b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159020
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29730}
2019-11-07 15:45:35 +00:00
Per Åhgren
361d1c3e5a Simplifications/refactoring of the analog AGC to make it multichannel
This CL prepares parts the analog AGC code to make it properly
multichannel.

Bug: webrtc:10859
Change-Id: I693d0d004dd2c7495ebdc60a43e9a53a441a93e0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158896
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29718}
2019-11-06 22:03:30 +00:00
henrika
ebf4552c8f Adds WebRTC-Audio-AgcMinMicLevelExperiment to AGC1
Bug: webrtc:11065
Change-Id: Id07ebab7bfa12980187a5847d4f11c8a57450147
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158784
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Minyue Li <minyue@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29681}
2019-11-04 14:10:03 +00:00
Per Åhgren
928146f546 Removing all external access to the integer sample data in AudioBuffer
This CL removes all external access to the integer sample data in the
AudioBuffer class. It also removes the API in AudioBuffer that provides this.

The purpose of this is to pave the way for removing the sample
duplicating and implicit conversions between integer and floating point
sample formats which is done inside the AudioBuffer.

Bug: webrtc:10882
Change-Id: I1438b691bcef98278aef8e3c63624c367c2d12e9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/149162
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28912}
2019-08-20 08:36:47 +00:00
Steve Anton
10542f21c8 (4) Rename files to snake_case: update BUILD.gn, include paths, header guards, and DEPS entries
Mechanically generated by running this command:

tools_webrtc/do-renames.sh update all-renames.txt && git cl format

Then manually updating:

tools_webrtc/sanitizers/tsan_suppressions_webrtc.cc

Bug: webrtc:10159
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I54824cd91dada8fc3ee3d098f971bc319d477833
Reviewed-on: https://webrtc-review.googlesource.com/c/115653
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26226}
2019-01-11 17:11:39 +00:00
Alex Loiko
f3122e0efe Gain metrics for digital adaptive AGC.
We add 2 metrics for measuring applied digital gain to
AgcManagerDirect. We also add an applied gain and an estimated noise
metric to Agc2.

Chromium histogram CL is
https://chromium-review.googlesource.com/c/chromium/src/+/1170833

Bug: webrtc:7494
Change-Id: Ie40873f9e43bc7d34d8f5473cd73bd47eb84e855
Reviewed-on: https://webrtc-review.googlesource.com/93468
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24290}
2018-08-15 13:44:46 +00:00
Alex Loiko
9489c3a2ea Optionally disable digital gain control in ExperimentalAgc.
This CL adds a flag to optionally disable the digital gain control in
ExperimentalAgc. With the flag, Experimental Agc (henceforth AGC1)
only controls the adaptive analog gain. This flag can be combined to
that which activates AGC2. That way, one can enable the hybrid AGC
configuration AGC1 analog only + AGC2 fixed+adaptive digital.

Previously, there was a flag "use_agc2_digital_adaptive" in
AgcManagerDirect. Our ambition was that to activate the hybrid mode
described above with this flag. The behavior of the flag was not
implemented.

To activate the hybrid mode after this CL, set
ExperimentalAgc::digital_adaptive_disabled=true and
AudioProcessing::Config::GainController2::enabled=true.

We also add flags for these settings in audioproc_f.
Then the required settings are currently

  audioproc_f --agc2 1 --agc 1 --experimental_agc 1 \
      --experimental_agc_disable_digital_adaptive 1 \
      -i [INPUT]

Bug: webrtc:7494
Change-Id: Iea798dc3899cec83d30ba71caba787262fcaef41
Reviewed-on: https://webrtc-review.googlesource.com/89740
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24249}
2018-08-09 13:37:30 +00:00
Alex Loiko
2ffafa8244 Allow AGC2 level estimation in AgcManagerDirect.
This CL does the following:

1. Adds a new AdaptiveModeLevelEstimatorAgc implementation of the Agc
  interface. The new implementation differs from webrtc::Agc by
   1. using the AGC2 speech level estimator in
      GetRmsErrorDb. webrtc::Agc implements its own with help of
      webrtc::LoudnessHistogram.
   2. Doesn't forget its past at every GetRmsErrorDb call.
2. Makes AgcManagerDirect use AdaptiveModeLevelEstimatorAgc instead of
   webrtc::Agc if the use_agc2_level_estimation flag is set.

Bug: webrtc:7494
Change-Id: I8df3f52e322d433eb5ce5297f4236af2f1877b04
Reviewed-on: https://webrtc-review.googlesource.com/86603
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23875}
2018-07-06 14:18:18 +00:00
Alex Loiko
64cb83bbd9 Flags and settings for AGC2 in AgcManagerDirect.
This CL adds two flags to audioproc_f. The flags control
AgcManagerDirect. The flags are
'--experimental_agc_agc2_level_estimator' and
'--experimental_agc_agc2_digital_adaptive'.

After this CL, the flags are be applied to AgcManagerDirect. The flags
have no effect in release-mode. They cause a crash in debug-mode.

In an upcoming CL, '--experimental_agc_agc2_level_estimator 1' will
replace the speech level estimation in ExperimentalAgc with that of
AGC2.

'--experimental_agc_agc2_digital_adaptive 1' will replace the digital
gain selection and application with that of AGC2.

These audioproc_f will activate both new settings:

./out/Target/audioproc_f --agc 1 --experimental_agc 1
--experimental_agc_agc2_digital_adaptive 1
--experimental_agc_agc2_level_estimator 1 --simulate_mic_gain 1
--simulated_mic_kind 2

See also https://webrtc-review.googlesource.com/c/src/+/79360

Bug: webrtc:7494
Change-Id: If0e65893dffdddb312e553787b8cedaf9a334323
Reviewed-on: https://webrtc-review.googlesource.com/86548
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23802}
2018-07-02 13:20:39 +00:00
Alex Loiko
c167673c4d Add more ApmDataDumper dumps to AGC.
We dump the compression level from AgcManagerDirect.

We use the same names and structure as in
GainControlForExperimentalAgc.

This is to get Apm dump file names to match in the upcoming AGC
changes: https://webrtc-review.googlesource.com/c/src/+/79360

TBR: alessiob@webrtc.org
Bug: webrtc:7494
Change-Id: I1e6260ea48ffc43f709e4b0c97f843ad9c3d1824
Reviewed-on: https://webrtc-review.googlesource.com/86546
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23800}
2018-07-02 11:00:13 +00:00
Mirko Bonadei
92ea95e34a Fixing WebRTC after moving from src/webrtc to src/
In https://webrtc-review.googlesource.com/c/src/+/1560 we moved WebRTC
from src/webrtc to src/ (in order to preserve an healthy git history).
This CL takes care of fixing header guards, #include paths, etc...

NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
TBR=tommi@webrtc.org


Bug: chromium:611808
Change-Id: Iea91618212bee0af16aa3f05071eab8f93706578
Reviewed-on: https://webrtc-review.googlesource.com/1561
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Kjellander <kjellander@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19846}
2017-09-15 05:02:56 +00:00
Mirko Bonadei
bb547203bf Moving src/webrtc into src/.
In order to eliminate the WebRTC Subtree mirror in Chromium, 
WebRTC is moving the content of the src/webrtc directory up
to the src/ directory.

NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
TBR=tommi@webrtc.org

Bug: chromium:611808
Change-Id: Iac59c5b51b950f174119565bac87955a7994bc38
Reviewed-on: https://webrtc-review.googlesource.com/1560
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Kjellander <kjellander@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19845}
2017-09-15 04:25:06 +00:00
Renamed from webrtc/modules/audio_processing/agc/agc_manager_direct.h (Browse further)