Commit graph

1233 commits

Author SHA1 Message Date
Alessio Bazzica
ea89f2a447 RNN VAD: pitch search optimizations (part 3)
`ComputeSlidingFrameSquareEnergies()` which computes the energy of a
sliding 20 ms frame in the pitch buffer has been switched from backward
to forward.

The benchmark has shown a slight improvement (about +6x).

This change is not bit exact but all the tolerance tests still pass
except for one single case in `RnnVadTest,PitchSearchWithinTolerance`
for which the tolerance has been slightly increased. Note that the pitch
estimation is still bit-exact.

Benchmarked as follows:
```
out/release/modules_unittests \
  --gtest_filter=*RnnVadTest.DISABLED_RnnVadPerformance* \
  --gtest_also_run_disabled_tests --logs
```

Results:

      | baseline             | this CL
------+----------------------+------------------------
run 1 | 22.8319 +/- 1.46554  | 22.087 +/- 0.552932
      | 389.367x             | 402.499x
------+----------------------+------------------------
run 2 | 22.4286 +/- 0.726449 | 22.216 +/- 0.916222
      | 396.369x             | 400.162x
------+----------------------+------------------------
run 2 | 22.5688 +/- 0.831341 | 22.4902 +/- 1.04881
      | 393.906x             | 395.283x

Bug: webrtc:10480
Change-Id: I1fd54077a32e25e46196c8e18f003cd0ffd503e1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/191703
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32572}
2020-11-10 10:18:58 +00:00
Alessio Bazzica
2f7d1c62e2 RNN VAD: pitch search optimizations (part 2)
This CL brings a large improvement to the VAD by precomputing the
energy for the sliding frame `y` in the pitch buffer instead of
computing them twice in two different places. The realtime factor
has improved by about +16x.

There is room for additional improvement (TODOs added), but that will
be done in a follow up CL since the change won't be bit-exact and
careful testing is needed.

Benchmarked as follows:
```
out/release/modules_unittests \
  --gtest_filter=*RnnVadTest.DISABLED_RnnVadPerformance* \
  --gtest_also_run_disabled_tests --logs
```

Results:

      | baseline             | this CL
------+----------------------+------------------------
run 1 | 23.568 +/- 0.990788  | 22.8319 +/- 1.46554
      | 377.207x             | 389.367x
------+----------------------+------------------------
run 2 | 23.3714 +/- 0.857523 | 22.4286 +/- 0.726449
      | 380.379x             | 396.369x
------+----------------------+------------------------
run 2 | 23.709 +/- 1.04477   | 22.5688 +/- 0.831341
      | 374.963x             | 393.906x

Bug: webrtc:10480
Change-Id: I599a4dda2bde16dc6c2f42cf89e96afbd4630311
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/191484
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32571}
2020-11-10 00:18:46 +00:00
Alessio Bazzica
9da3e177fd RNN VAD: pitch search optimizations (part 1)
TL;DR this CL improves efficiency and includes several code
readability improvements mainly triggered by the comments to
patch set #10.

Highlights:
- Split `FindBestPitchPeriods()` into 12 and 24 kHz versions
  to hard-code the input size and simplify the 24 kHz version
- Loop in `ComputePitchPeriod48kHz()` (new name for
  `RefinePitchPeriod48kHz()`) removed since the lags for which
  we need to compute the auto correlation are a few
- `ComputePitchGainThreshold()` was only used in unit tests; it's been
  moved into the anon ns and the test removed

This CL makes `ComputePitchPeriod48kHz()` is about 10% faster (measured
with https://webrtc-review.googlesource.com/c/src/+/191320/4/modules/audio_processing/agc2/rnn_vad/pitch_search_internal_unittest.cc).
The realtime factor has improved by about +14%.

Benchmarked as follows:
```
out/release/modules_unittests \
  --gtest_filter=*RnnVadTest.DISABLED_RnnVadPerformance* \
  --gtest_also_run_disabled_tests --logs
```

Results:

      | baseline             | this CL
------+----------------------+------------------------
run 1 | 24.0231 +/- 0.591016 | 23.568 +/- 0.990788
      | 370.06x              | 377.207x
------+----------------------+------------------------
run 2 | 24.0485 +/- 0.957498 | 23.3714 +/- 0.857523
      | 369.67x              | 380.379x
------+----------------------+------------------------
run 2 | 25.4091 +/- 2.6123   | 23.709 +/- 1.04477
      | 349.875x             | 374.963x

Bug: webrtc:10480
Change-Id: I9a3e9164b2442114b928de506c92a547c273882f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/191320
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32568}
2020-11-09 16:12:10 +00:00
Karl Wiberg
c95b939667 Introduce RTC_CHECK_NOTREACHED(), an always-checking RTC_NOTREACHED()
And use it in a few places that were using RTC_CHECK(false) or FATAL()
to do the exact same job. There should be no change in behavior.

Bug: none
Change-Id: I36d5e6bcf35fd41534e08a8c879fa0811b4f1967
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/191963
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32567}
2020-11-09 10:47:55 +00:00
Alessio Bazzica
0b10f4605e APM RuntimeSetting: record bool histogram when enqueuing a setting fails
Adding a stat to keep track of how frequently APM runtime settings
cannot be successfully enqueued.

Defined in
https://chromium-review.googlesource.com/c/chromium/src/+/2495180.

Bug: webrtc:9138
Change-Id: I33a9105e6fe513a9d0cbb8917a5d576fe47eaa94
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/190144
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32546}
2020-11-04 09:42:59 +00:00
Gustaf Ullberg
7e4ad828d6 Increased high frequency transparency
Avoid excessive echo suppression in frequencies above 2 kHz when
there is a dominant nearend. Calls with clock drift will not be affected
by this change as they tend to have less accurate linear filters.

Bug: webrtc:11985
Change-Id: Iddc628da5e2ba572c1b47acd87dd3be35260dca1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/188580
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32533}
2020-11-02 10:42:10 +00:00
Mirko Bonadei
8cc6695652 Reformat python files checked by pylint (part 1/2).
After recently changing .pylintrc (see [1]) we discovered that
the presubmit check always checks all the python files when just
one python file gets updated.

This CL moves all these files one step closer to what the linter
wants.

Autogenerated with:

# Added all the files under pylint control to ~/Desktop/to-reformat
cat ~/Desktop/to-reformat | xargs sed -i '1i\\'
git cl format --python --full

This is part 1 out of 2. The second part will fix function names and
will not be automated.

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

No-Presubmit: True
Bug: webrtc:12114
Change-Id: Idfec4d759f209a2090440d0af2413a1ddc01b841
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/190980
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32530}
2020-10-30 10:13:11 +00:00
Alessio Bazzica
f622ba725e AGC2 RNN VAD size_t -> int
Motivation: read "On Unsigned Integers" section in
https://google.github.io/styleguide/cppguide.html#Integer_Types

Plus, improved readability by getting rid of a bunch of
`static_cast<int>`s.

Bug: webrtc:10480
Change-Id: I911aa8cd08f5ccde4ee6f23534240d1faa84cdea
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/190880
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32524}
2020-10-29 21:15:50 +00:00
Alessio Bazzica
842b675304 RNN VAD: Pitch periods as integers and for-if-break optimization
This CL includes two changes:
1. the type for (inverted) lags and pitch periods changed from
   size_t to int to reduce the chance of bugs with pitch period
   manipulations
2. CheckLowerPitchPeriodsAndComputePitchGain() is optimized by
   replacing an unnecessary if statement inside the loop with the
   predetermined number of loops

Bug: webrtc:10480
Change-Id: I38432699254b37a2c0111279c28be8dc65b87e9b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139252
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Fredrik Hernqvist <fhernqvist@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32521}
2020-10-29 19:45:17 +00:00
Fabien Vallée
f8b5bfeaf2 Fix "control reaches end of non-void function" warnings
"warning: control reaches end of non-void function [-Wreturn-type]"
Reported by gcc (8.3)

In all the reported cases, the end of function is never actually
reached. Add RTC_CHECK(false) to ensure the compiler is aware that
this path is a dead-end.

Bug: webrtc:12008
Change-Id: I7f816fde3d1897ed2774057c7e05da66e1895e60
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/189784
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Fabien VALLÉE <fabien.vallee@netgem.com>
Cr-Commit-Position: refs/heads/master@{#32503}
2020-10-27 10:22:23 +00:00
Alessio Bazzica
0fb0eb3e80 RNN VAD: LP residual optimized (part 4)
This CL removes the circular shift to compute the convolution in
`ComputeLpResidual()`, which is now 4x faster (benchmarked with the
`RnnVadTest.DISABLED_ComputeLpResidualBenchmark` unit test).

Note that the `RnnVadTest.LpResidualPipelineBitExactness` unit test
is still passing.

Bug: webrtc:10480
Change-Id: Ia7767d9b57378c12c8ff31f58fea03905be5c5de
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/189964
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32491}
2020-10-26 12:04:46 +00:00
Alessio Bazzica
1925402ed8 RNN VAD: LP residual optimized (part 3)
Use hard-coded constants previously computed at runtime within a loop in
`DenoiseAutoCorrelation`.

Note that the `RnnVadTest.LpResidualPipelineBitExactness` unit test
is still passing.

Bug: webrtc:10480
Change-Id: I02c2fff7dc7153ea2ab8a27cad8a479a0f029996
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/189963
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32489}
2020-10-26 10:46:16 +00:00
Alessio Bazzica
024d0157ab RNN VAD: LP residual optimized (part 2)
The cross-correlation function in the anonimous namespace of
lp_residual.cc is used once as to compute auto-correlation coefficients.
Hence, it can be simplified (and renamed).

Note that the `RnnVadTest.LpResidualPipelineBitExactness` unit test
is still passing.

Bug: webrtc:10480
Change-Id: Ie769e42907c15572172a8ad1a34e82ce60c4a386
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/189962
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32464}
2020-10-21 15:20:29 +00:00
Alessio Bazzica
5d13d61193 RNN VAD: LP residual optimized (part 1)
Use hard-coded constants previously computed at runtime within a loop in
`ComputeAndPostProcessLpcCoefficients`.

Note that the `RnnVadTest.LpResidualPipelineBitExactness` unit test
is still passing.

Bug: webrtc:10480
Change-Id: Iaec178c56937449c3fe9af881354d19cc8c47c7d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/189961
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32462}
2020-10-21 12:58:05 +00:00
Gustaf Ullberg
7481ba01d1 AEC3: Prevent transparent mode from leaking low volume echo
This change makes the transparent mode classifier consider filter
convergence also for microphone signals with very low volume. This is
in order to prevent entering transparent mode when there is low, but
audible, echo.

Furthermore, the suppression gain during transparent mode is restored
to avoid leaks when the echo is too low to be reliably detected by
filter convergence.

Bug: webrtc:10232, chromium:1140452
Change-Id: Idd4f40c4aee7c20baa444afaa5ec604eb65bcfd0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/189786
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32461}
2020-10-21 11:19:55 +00:00
Sam Zackrisson
7bc3356fbc AEC3: Stop reporting obsolete metrics
These metrics are no longer in use:
WebRTC.Audio.EchoCanceller.ActiveRender
WebRTC.Audio.EchoCanceller.ErleBand*
WebRTC.Audio.EchoCanceller.ErlBand*

Corresponding CL to mark obsolete in histograms.xml:
https://chromium-review.googlesource.com/c/chromium/src/+/2485059

Bug: chromium:1140067,chromium:1140071,chromium:1140073
Change-Id: Icb79b540f340a596c178f352363b30dc7b885251
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/189783
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32449}
2020-10-20 11:54:48 +00:00
Alessio Bazzica
3438a9383c AGC2 config change detection fixed
AGC2 is correctly (re)initialized when its config changes.
This CL also improves the `AudioProcessingImpl::ApplyConfig`
readability by defining operator!= also for the AGC1 config.

Bug: webrtc:7494
Change-Id: I62068de32c941e6b18d4618c656f569647042345
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/187120
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32402}
2020-10-14 12:18:57 +00:00
Alessio Bazzica
0c83e15c6b Move AGC2 config ToString to the right place and update Validate()
The APM config to string mapping must be in one place (namely,
in `audio_processing.cc`). This CL moves the AGC2 config to string
impl to the right place.

This CL also updates `GainController2::Validate()` and adds the
missing unit tests for the parameters that have recently been added.

Stack buffer size in `AudioProcessing::Config::ToString()` increased
because of the extra params. Syntax near `multi_channel_capture` fixed.
Output string format verified with a JS linter.

Bug: webrtc:7494
Change-Id: I692e1549b7d40c970d88a14c8e83da16325fb54c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/187080
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Minyue Li <minyue@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32400}
2020-10-14 12:00:54 +00:00
Sam Zackrisson
fa2927970e AEC3: Re-add delay headroom when precise alignment is needed
This CL adds delay headroom when an external delay estimator is used.

Tested: audioproc_f --aec=1 is bitexact on a large number of aecdumps

Bug: b/158455753
Change-Id: I56de44e841bb8162e302181c6c386ad7fbb00dee
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186703
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32323}
2020-10-06 07:54:08 +00:00
Alessio Bazzica
eacbd972ab AGC2 logs
- Now every 10s
- Also logging estimated speech+noise level
- Also logging via RTC_LOG

Bug: webrtc:7494
Change-Id: Ib60a74d319d29c8f6ae4ea6dae8f2bca687c4c25
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186780
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32316}
2020-10-05 15:34:52 +00:00
Per Åhgren
f9f53316f5 Reland "Reduce the amount of howling reduction in AEC3"
This is a reland of 2978abb88c

Original change's description:
> Reduce the amount of howling reduction in AEC3
>
> This CL backs off the howling protection functionality in AEC3.
> The effect is increased transparency in some cases. No negative effects
> have been identified in the hands-on testing.
>
>
> A kill-switch is added that can be used to turn off the functionality.
>
> Bug: b/150764764
> Change-Id: I604c569c76f911799556a60bc8fd2fb43bbfe196
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186082
> Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32258}

Bug: b/150764764,chromium:1134939
Change-Id: I5eea60b35e6d09003ec2fee3865513df8bdd5823
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186260
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32304}
2020-10-03 23:28:33 +00:00
Per Åhgren
a43178c871 Reland "Activating AVX2 support by default"
This is a reland of ad148272b8

Original change's description:
> Activating AVX2 support by default
>
> This CL activates the newly added AVX2 support by default.
> The activation is done beneath a kill-switch.
>
> Beyond the above, the CL also changes an incorrect DCHECK_GT
> to a DCHECK_GE.
>
> Bug: webrtc:11663
> Change-Id: I231ccb2f5efabf74cd8190411daa954b2b94a2a0
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183042
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32193}

Bug: webrtc:11663, chromium:1134234
Change-Id: I0cb34cf08d4d14bc3aee055254493c9c9ee8faa0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186401
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32303}
2020-10-03 22:37:13 +00:00
Sam Zackrisson
389bf0feb8 AEC3: Move option for reverb model in nonlinaer mode into AEC3 config
This adds a config parameter for reverb modelling in nonlinear mode.
The killswitch is preserved, and will have the same effect before and after this CL.

Tested: Bitexact on a large number of aecdumps both with and without WebRTC-Aec3NonlinearModeReverbKillSwitch.
Bug: webrtc:8671
Change-Id: I7b2fa92307af5316dbe895392367abb8d15f06bf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183541
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32298}
2020-10-02 20:27:47 +00:00
Alessio Bazzica
ab4a49259c GainController2::ToString updated
New params have recently been added, but ToString() was not updated.

Bug: webrtc:7494
Change-Id: I2115ccb08d29e860a658284d096e48da17daaedd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186267
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32283}
2020-10-01 17:31:00 +00:00
Alessio Bazzica
9a625e7aef AGC2: max output noise level now part of config
Tested: bit-exactness verified with audioproc_f

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

Bug: webrtc:7494
Change-Id: Ie65a2e2139cff0bd730307d06b74760e307c9568
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186264
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Minyue Li <minyue@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32277}
2020-10-01 16:15:28 +00:00
Andrey Logvin
dba4db5668 Revert "Reland "Reduce the amount of howling reduction in AEC3""
This reverts commit 18515e2793.

Reason for revert: Continuation of previous revert https://webrtc-review.googlesource.com/c/src/+/186304

Original change's description:
> Reland "Reduce the amount of howling reduction in AEC3"
>
> This is a reland of 2978abb88c
>
> Original change's description:
> > Reduce the amount of howling reduction in AEC3
> >
> > This CL backs off the howling protection functionality in AEC3.
> > The effect is increased transparency in some cases. No negative effects
> > have been identified in the hands-on testing.
> >
> >
> > A kill-switch is added that can be used to turn off the functionality.
> >
> > Bug: b/150764764
> > Change-Id: I604c569c76f911799556a60bc8fd2fb43bbfe196
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186082
> > Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> > Commit-Queue: Per Åhgren <peah@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#32258}
>
> Bug: b/150764764
> Change-Id: I277f24eb3288ad0307e7463bad9aea6436cfe879
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186263
> Reviewed-by: Per Åhgren <peah@webrtc.org>
> Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32274}

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

Change-Id: I0596855e3bf910878aebcee90e03345d5db1105d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: b/150764764
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186269
Reviewed-by: Andrey Logvin <landrey@webrtc.org>
Commit-Queue: Andrey Logvin <landrey@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32276}
2020-10-01 14:48:58 +00:00
Per Åhgren
18515e2793 Reland "Reduce the amount of howling reduction in AEC3"
This is a reland of 2978abb88c

Original change's description:
> Reduce the amount of howling reduction in AEC3
>
> This CL backs off the howling protection functionality in AEC3.
> The effect is increased transparency in some cases. No negative effects
> have been identified in the hands-on testing.
>
>
> A kill-switch is added that can be used to turn off the functionality.
>
> Bug: b/150764764
> Change-Id: I604c569c76f911799556a60bc8fd2fb43bbfe196
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186082
> Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32258}

Bug: b/150764764
Change-Id: I277f24eb3288ad0307e7463bad9aea6436cfe879
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186263
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32274}
2020-10-01 13:44:23 +00:00
Andrey Logvin
082fac73be Revert "Reland "Activating AVX2 support by default""
This reverts commit a0ad0bbf8f.

Reason for revert: Speculative revert. I suspect it breaks downstream project

Original change's description:
> Reland "Activating AVX2 support by default"
>
> This is a reland of ad148272b8
>
> Original change's description:
> > Activating AVX2 support by default
> >
> > This CL activates the newly added AVX2 support by default.
> > The activation is done beneath a kill-switch.
> >
> > Beyond the above, the CL also changes an incorrect DCHECK_GT
> > to a DCHECK_GE.
> >
> > Bug: webrtc:11663
> > Change-Id: I231ccb2f5efabf74cd8190411daa954b2b94a2a0
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183042
> > Commit-Queue: Per Åhgren <peah@webrtc.org>
> > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> > Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#32193}
>
> Bug: webrtc:11663
> Change-Id: Ib41dc1d1c5865f2828699c462939d15d5562df47
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186262
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32270}

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

Change-Id: I1305fad8d19ba0bd69a38b9e2959af54f900535d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11663
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186304
Reviewed-by: Andrey Logvin <landrey@webrtc.org>
Commit-Queue: Andrey Logvin <landrey@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32273}
2020-10-01 13:39:07 +00:00
Per Åhgren
a0ad0bbf8f Reland "Activating AVX2 support by default"
This is a reland of ad148272b8

Original change's description:
> Activating AVX2 support by default
>
> This CL activates the newly added AVX2 support by default.
> The activation is done beneath a kill-switch.
>
> Beyond the above, the CL also changes an incorrect DCHECK_GT
> to a DCHECK_GE.
>
> Bug: webrtc:11663
> Change-Id: I231ccb2f5efabf74cd8190411daa954b2b94a2a0
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183042
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32193}

Bug: webrtc:11663
Change-Id: Ib41dc1d1c5865f2828699c462939d15d5562df47
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186262
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32270}
2020-10-01 12:19:19 +00:00
Alessio Bazzica
59f1d1e36d AGC2 adaptive digital controller config: new params
This CL adds and wires up the following parameters:
- VAD probability attack used in `VadLevelAnalyzer`
- Adjacent spech frames threshold used in `AdaptiveModeLevelEstimator`
- Initial saturation margin used in `AdaptiveModeLevelEstimator`

The deprecated ctor in `AdaptiveModeLevelEstimator` is removed.

Tested: bit-exactness verified with audioproc_f

Bug: webrtc:7494
Change-Id: Idf94aaadba1476757f845e696bfb47ff6252d5f0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186048
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32265}
2020-09-30 22:29:14 +00:00
Alessio Bazzica
1309c77a48 AGC2 adaptive digital controller config: new param
This CL adds and wires up a parameter (namely, adjacent speech
frames threshold) used in `AdaptiveDigitalGainApplier`.

Tested: bit-exactness verified with audioproc_f

Bug: webrtc:7494
Change-Id: I751cd91f08a6e98ee20f767c8df0ed121c8d4b68
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186049
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32264}
2020-09-30 22:10:53 +00:00
Alessio Bazzica
87b86acde9 AGC2: gain increase allowed once enough adjacent speech frames observed
Make the digital adaptive gain applier more robust to VAD false
positives. Achieved by allowing a gain increase only if enough adjacent
speech frames are observed.

Tested:
- Bit-exactness verified with audioproc_f
- If `kDefaultDigitalGainApplierAdjacentSpeechFramesThreshold` == 2
  then not bit-exact

Bug: webrtc:7494
Change-Id: I3bab5a449aaf0ef1a64b671b413ba2ddb4688cd2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186042
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32263}
2020-09-30 22:04:33 +00:00
Mirko Bonadei
aa3d3b4793 Revert "Reduce the amount of howling reduction in AEC3"
This reverts commit 2978abb88c.

Reason for revert: Breaks ApmTest.Process.

After trying to enable AVX2, we increased the amount of error
we tolerate (kFloatNear) and this CL introduced a regression which
makes the test fail after we reverted the enabling of AVX2 (restoring
the old tolerance).

With this CL:
../../modules/audio_processing/audio_processing_unittest.cc:1779: Failure
The difference between test->rms_dbfs_average() and rms_dbfs_average is 0.00142669677734375, which exceeds kFloatNear, where
test->rms_dbfs_average() evaluates to 52.907142639160156,
rms_dbfs_average evaluates to 52.905715942382812, and
kFloatNear evaluates to 0.00050000000000000001.

[  FAILED  ] ApmTest.Process (5347 ms)
[----------] 1 test from ApmTest (5348 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (5350 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] ApmTest.Process

After reverting it:

[       OK ] ApmTest.Process (5345 ms)
[----------] 1 test from ApmTest (5347 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (5350 ms total)
[  PASSED  ] 1 test.

Original change's description:
> Reduce the amount of howling reduction in AEC3
>
> This CL backs off the howling protection functionality in AEC3.
> The effect is increased transparency in some cases. No negative effects
> have been identified in the hands-on testing.
>
>
> A kill-switch is added that can be used to turn off the functionality.
>
> Bug: b/150764764
> Change-Id: I604c569c76f911799556a60bc8fd2fb43bbfe196
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186082
> Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32258}

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

Change-Id: I4723c5cd66e3046851089157ec586afab55c5ce8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: b/150764764
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186122
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32261}
2020-09-30 19:00:37 +00:00
Per Åhgren
80907be915 Revert "Activating AVX2 support by default"
This reverts commit ad148272b8.

Reason for revert: Speculative revert to investigate test failures

Original change's description:
> Activating AVX2 support by default
>
> This CL activates the newly added AVX2 support by default.
> The activation is done beneath a kill-switch.
>
> Beyond the above, the CL also changes an incorrect DCHECK_GT
> to a DCHECK_GE.
>
> Bug: webrtc:11663
> Change-Id: I231ccb2f5efabf74cd8190411daa954b2b94a2a0
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183042
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32193}

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

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

Bug: webrtc:11663
Change-Id: Ibb019e8c702dce45ebf47f1c1e8db19069b4964d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186081
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32259}
2020-09-30 15:30:04 +00:00
Per Åhgren
2978abb88c Reduce the amount of howling reduction in AEC3
This CL backs off the howling protection functionality in AEC3.
The effect is increased transparency in some cases. No negative effects
have been identified in the hands-on testing.


A kill-switch is added that can be used to turn off the functionality.

Bug: b/150764764
Change-Id: I604c569c76f911799556a60bc8fd2fb43bbfe196
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186082
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32258}
2020-09-30 15:21:34 +00:00
Gustaf Ullberg
d324a79a85 Remove unused enums and members
Bug: webrtc:8671
Change-Id: Id0d7042a824c20d0f8a9b7a01c3a0274ef04cdf0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185815
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32256}
2020-09-30 14:34:44 +00:00
Alessio Bazzica
57ad54332b AGC2 Saturation Protector always on
Tested: bit-exactness verified with audioproc_f

Bug: webrtc:7494
Change-Id: I9f6c22c097b15c83a68e9fbc256abd161626df93
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185816
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32255}
2020-09-30 14:04:54 +00:00
Alessio Bazzica
d5e6f413ab AGC2 AdaptiveDigitalGainApplier and AdaptiveAgc code improvements
This CL was written in preparation for the next CL in the chain and
it contains the following changes:
- SignalWithLevels -> AdaptiveDigitalGainApplier::FrameInfo
- Frame view removed from AdaptiveDigitalGainApplier::FrameInfo
- AdaptiveDigitalGainApplier::Process now gets side info as const& to
  avoid unnecessary copies
- AdaptiveAgc::Process: `last_audio_level` renamed to `limiter_envelope`
  to better reflect what that actually is
- Missing class/method docstrings added

Tested: bit-exactness verified with audioproc_f

Bug: webrtc:7494
Change-Id: Ie25dcd389d6eed74ea9a65f0720eeb8f20f0096b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186040
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32251}
2020-09-30 13:15:38 +00:00
Alessio Bazzica
8845f7e32b AGC2 AdaptiveModeLevelEstimator min consecutive speech frames (3/3)
This is the last CL needed to add a new `AdaptiveModeLevelEstimator`
feature that makes AGC2 more robus to VAD mistakes: the level estimator
discards estimation updates when too few consecutive speech frames are
observed.

This CL adds a second state property to hold temporary updates and a
counter for consecutive speech frames. When enough speech frames are
observed, the reliable state is updated; otherwise, the temporary state
is discarded.

The default for `AdaptiveModeLevelEstimator::min_consecutive_speech_frames_`
is 1, which means that the new feature is disabled.

Tested:
- Bit-exactness verified with audioproc_f
- Not bit-exact if `min_consecutive_speech_frames_` set to 10

Bug: webrtc:7494
No-Try: True
Change-Id: I0daa00e90c27c418c00baec39fb8eacd26eed858
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185125
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32250}
2020-09-30 13:08:08 +00:00
Alessio Bazzica
9cf3ea0ab2 AGC2 AdaptiveModeLevelEstimator: minor code improvements
- State -> LevelEstimatorState
- Mark two methods as const
- Call DumpDebugData() in one place
- DumpDebugData: don't check if data dumper is provided
- Add LevelEstimatorState::operator==

The changes will reduce clutter in follow up CL.

Note: this CL breaks the chain of 3 CLs titled
"AGC2 AdaptiveModeLevelEstimator min consecutive speech frames".

Bug: webrtc:7494
Change-Id: If39ce4b787069bef4af910d718cdfae3af1784a4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185811
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32247}
2020-09-30 10:31:30 +00:00
Alessio Bazzica
307fab9e02 AGC2 AdaptiveModeLevelEstimator: cache last level estimate
`AdaptiveModeLevelEstimator::last_level_dbfs_` doesn't need to be optional.

Note: this CL breaks the chain of 3 CLs titled
"AGC2 AdaptiveModeLevelEstimator min consecutive speech frames".

Bug: webrtc:7494
Change-Id: Id5b409ca5cb5f11ed132c861b7995b9721e167bb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185809
Reviewed-by: Minyue Li <minyue@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32237}
2020-09-29 15:45:22 +00:00
Alessio Bazzica
435f279433 AGC2 remove incorrect field trial parsing functions
The AGC2 params must be exposed via
`AudioProcessing::Config::GainController2` and the Finch params must
be parsed in blink (see [1]).

Note: this CL breaks the chain of 3 CLs titled
"AGC2 AdaptiveModeLevelEstimator min consecutive speech frames".

[1] https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/modules/mediastream/media_stream_audio_processor.cc;l=593-596?q=HybridAgc&start=11

Bug: webrtc:7494
Change-Id: Ie7bd1bef1d6caf7d2b20600a1626c12171b67c82
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185044
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Minyue Li <minyue@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32230}
2020-09-29 13:33:15 +00:00
Alessio Bazzica
56f63c3e7e AGC2 AdaptiveModeLevelEstimator min consecutive speech frames (2/3)
This is the second CL needed to add a new `AdaptiveModeLevelEstimator`
feature that makes AGC2 more robus to VAD mistakes: the level estimator
discards estimation updates when too few consecutive speech frames are
observed.

In this CL, the `SaturationProtector` class has been replaced by a
struct that define the state and two functions to change it.
This is done in order to use the saturation protector state in
`AdaptiveModeLevelEstimator::State` and will allow to add a
temporary state in `AdaptiveModeLevelEstimator` (see the child CL).

Tested: Bit-exactness verified with audioproc_f

Bug: webrtc:7494
Change-Id: Ic5ecd1e174010656ed20664ef7b7e5798ebb7978
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185041
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32226}
2020-09-29 11:02:10 +00:00
Niels Möller
de95329daa Delete macros RTC_DISALLOW_ASSIGN and RTC_DISALLOW_IMPLICIT_CONSTRUCTORS
The former was unused, the latter is replaced with the explicit C++11
deletions. The related RTC_DISALLOW_COPY_AND_ASSIGN is left for now,
it is used in a lot more places.

Bug: None
Change-Id: I49503e7f2b9ff43c6285f8695833479bbc18c380
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185500
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32224}
2020-09-29 10:19:20 +00:00
Gustaf Ullberg
46be80d349 Remove echo suppression in transparent mode
This change completely disables the use of suppression
when operating in transparent mode.

It also removes the following field trials:
* WebRTC-Aec3UseLowEarlyReflectionsTransparentModeGain
* WebRTC-Aec3UseLowLateReflectionsTransparentModeGain

Bug: webrtc:11985
Change-Id: I1c75efdad2d9c9d0a1aced86bf0278fc96616ea1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185402
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32223}
2020-09-29 09:35:09 +00:00
Per Åhgren
e5d669ed28 Reland "Activating AVX2 support by default"
This is a reland of ad148272b8

Original change's description:
> Activating AVX2 support by default
>
> This CL activates the newly added AVX2 support by default.
> The activation is done beneath a kill-switch.
>
> Beyond the above, the CL also changes an incorrect DCHECK_GT
> to a DCHECK_GE.
>
> Bug: webrtc:11663
> Change-Id: I231ccb2f5efabf74cd8190411daa954b2b94a2a0
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183042
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32193}

Bug: webrtc:11663
Change-Id: I669435c2f4e451ee0766d809443484f2dde09d8d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185482
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32200}
2020-09-25 14:46:20 +00:00
Alessio Bazzica
cd92b0be9a AGC2 AdaptiveModeLevelEstimator min consecutive speech frames (1/3)
This is the first CL needed to add a new `AdaptiveModeLevelEstimator`
feature that makes AGC2 more robus to VAD mistakes: the level estimator
discards estimation updates when too few consecutive speech frames are
observed.

In this CL, the state of the estimator is defined in a separate struct
so that in a follow-up CL a new member of that type can be added to
hold a temporary state (that can be either confirmed or discarded).

Tested: Bit-exactness verified with audioproc_f

Bug: webrtc:7494
Change-Id: Ic2ea5ed63c493b9f3a79f19e7f5eaecaa6808ace
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/184931
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Minyue Li <minyue@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32199}
2020-09-25 14:04:57 +00:00
Alessio Bazzica
c1ece012cb AGC2 VAD probability: instant decay / slow attack
Feature added to gain robustness to occasional VAD speech probability
spikes. In such a case, the attack process reduces the chance that the
smoothed values are greater than the speech threshold.

Bug: webrtc:7494
Change-Id: I6babe5afe30ea3dea021181a19d86bb74b33a98c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185046
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32198}
2020-09-25 14:03:17 +00:00
Per Åhgren
9ccbe17abb Revert "Activating AVX2 support by default"
This reverts commit ad148272b8.

Reason for revert: Causing test failures downstream.

Original change's description:
> Activating AVX2 support by default
>
> This CL activates the newly added AVX2 support by default.
> The activation is done beneath a kill-switch.
>
> Beyond the above, the CL also changes an incorrect DCHECK_GT
> to a DCHECK_GE.
>
> Bug: webrtc:11663
> Change-Id: I231ccb2f5efabf74cd8190411daa954b2b94a2a0
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183042
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32193}

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

Change-Id: If2287a0a4b37931ce5f85baae093a66b19d0a78b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11663
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185481
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32196}
2020-09-25 12:13:46 +00:00
Alessio Bazzica
530781d03f AGC2 VadWithLevel(::LevelAndProbability) renamed + injectable VAD
Refactoring CL to improve names and allow to inject a VAD into
`VadLevelAnalyzer` (new name for `VadWithLevel`).

The injectable VAD is needed to inject a mock VAD and write better
unit tests as new features are going to be added to the class.

Bug: webrtc:7494
Change-Id: Ic0cea1e86a19a82533bd40fa04c061be3c44f068
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185180
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Minyue Li <minyue@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32195}
2020-09-25 12:11:12 +00:00
Per Åhgren
ad148272b8 Activating AVX2 support by default
This CL activates the newly added AVX2 support by default.
The activation is done beneath a kill-switch.

Beyond the above, the CL also changes an incorrect DCHECK_GT
to a DCHECK_GE.

Bug: webrtc:11663
Change-Id: I231ccb2f5efabf74cd8190411daa954b2b94a2a0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183042
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32193}
2020-09-25 11:30:22 +00:00
Gustaf Ullberg
39a3f081c1 Disable transparent mode when ERL is bounded
A bounded ERL disables all TransparentMode implementations.

Bug: webrtc:10232
Change-Id: I5a3641b356c2abf42cd6d055cee4007327528a41
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185301
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32187}
2020-09-24 20:53:09 +00:00
Alessio Bazzica
9e81182f8e RNN VAD build file refactoring: split into separate (private) targets
First step to only expose the relevant RNN VAD API to AGC2.

Bug: webrtc:7494
Change-Id: I7f11f6eebded124c30cabd64963c8e3ccc35e58f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185124
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32185}
2020-09-24 14:33:14 +00:00
Gustaf Ullberg
afef7a74a7 HMM based transparent mode classifier
This change introduces a new Hidden Markov Model based classifier for
AEC3's 'transparent mode'. Transparent mode is used with
headsets/headphones where the speaker signal does not leak into the
microphone signal.

The current classifier suffers from two problems:
1. It sometimes takes a long time to enter transparent mode.
2. Sometimes transparent mode is left (and it once again takes a long
time to re-enter).

Both problems have a severe effect on AEC transparency.

The new classifier enters transparent mode quicker and is less likely
to exit transparent mode when there is no echo. This improves the
audio experience when using headset/headphones.

Another (minor) benefit of this change is that when transparent mode
is disabled no classifier is run (or even created) saving some memory
and CPU cycles.

Bug: webrtc:10232
Change-Id: I509af0e22b59463aeaead53c78c35be1e97fe8c3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/184500
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32182}
2020-09-24 08:25:50 +00:00
Alessio Bazzica
1922fb0ec3 AGC2 saturation protector: extra margin added by level estimator
In preparation for a coming refactoring CL, the (fixed) extra saturation
margin is now applied into `AdaptiveModeLevelEstimator`.

This CL also improves the unit tests by hard-coding its saturation
params instead of reading them from a field trial.
This reduces the chances of making the test flaky if a default value
changes.

Tested: Bit-exactness verified with audioproc_f

Bug: webrtc:7494
Change-Id: I6765def9887a2f4e55b04d929af754cfecbb1626
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/184927
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Minyue Li <minyue@webrtc.org>
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32172}
2020-09-23 11:33:37 +00:00
Alessio Bazzica
736ff83e69 AGC2 saturation protector: simplify interface and impl
- Passing the speech peak power instead of VAD data
- The private class SaturationProtector::PeakEnveloper has been removed
- Added `initial_saturation_margin_db_` parameter to correctly
  initialize `last_margin_` (renamed to `margin_db_`)
- Member names have been fixed and/or shortened for better readability

Tested: Bit-exactness verified with audioproc_f

Bug: webrtc:7494
Change-Id: I6cad2974397319737c8ac201d44311bf16275f28
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/184925
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32168}
2020-09-23 07:56:44 +00:00
Alessio Bazzica
10f6eadd48 AGC2 Saturation Protector: switch to ring buffer
Even if small, the peak delay buffer copies N-1 elements for each frame
whereas a ring buffer is copy-free and scales better if the buffer size
increases.

Tested: Bit-exactness verified with audioproc_f

Bug: webrtc:7494
Change-Id: If8c33877b7ab1d881a0606e222b26857a82fff69
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/184920
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32165}
2020-09-22 19:34:04 +00:00
Per Åhgren
2f0f93a0c9 Add explicit initialization for the FilterAnalyzer in AEC3
This CL adds explicit initialization of the FilterAnalyzer in AEC3.
While the current code never uses any fields before they are initialized,
it makes sense to be on the safe side and add initialization during
construction.

Bug: webrtc:11918
Change-Id: I467c4c8b8d6dd859a1b216baef28ac1e9d3f76c2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183764
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32069}
2020-09-10 10:50:43 +00:00
Mirko Bonadei
bef022bde0 Refactor cpu_features_wrapper.h functions from C to C++.
As mentioned on https://webrtc-review.googlesource.com/c/src/+/183380,
then relanded as https://webrtc-review.googlesource.com/c/src/+/183444,
functions in cpu_features_wrapper.h should be refactored to use
C++ features like namespaces and drop the WebRtc_ prefix.

Bug: None
Change-Id: I3e83e1668f9bf48a5d8e85d809f006666b7fa45e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183445
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32045}
2020-09-07 08:44:24 +00:00
Mirko Bonadei
66e7338617 Reland "Merge cpu_features build targets into //system_wrappers."
This is a reland of 2b242d8fba

Original change's description:
> Merge cpu_features build targets into //system_wrappers.
>
> Before this CL, functions declared in cpu_features_wrapper.h where
> not defined in the same build target, causing brittle builds that
> might fail at link time if the binary was not depending on
> //system_wrappers (the target with the definitions), violating [1].
>
> This CL moves everything into //system_wrappers and also moves
> cpu_features_wrapper.h definitions from C to C++ (in order to be able
> to add the definitions to a C++ build target like //system_wrappers).
>
> [1] - https://webrtc.googlesource.com/src/+/refs/heads/master/style-guide.md#h-cc-pairs
>
> Bug: None
> Change-Id: I5a0009cddb17206b19f2a71eeba722faacc4bcae
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183380
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32039}

TBR=kwiberg@webrtc.org

Bug: None
Change-Id: I1695b9a34d3ec20c50c1202a745f64fac58edef0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183444
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32042}
2020-09-06 10:38:23 +00:00
Mirko Bonadei
d156a0d061 Revert "Merge cpu_features build targets into //system_wrappers."
This reverts commit 2b242d8fba.

Reason for revert: Breaks downstream project.

Original change's description:
> Merge cpu_features build targets into //system_wrappers.
> 
> Before this CL, functions declared in cpu_features_wrapper.h where
> not defined in the same build target, causing brittle builds that
> might fail at link time if the binary was not depending on
> //system_wrappers (the target with the definitions), violating [1].
> 
> This CL moves everything into //system_wrappers and also moves
> cpu_features_wrapper.h definitions from C to C++ (in order to be able
> to add the definitions to a C++ build target like //system_wrappers).
> 
> [1] - https://webrtc.googlesource.com/src/+/refs/heads/master/style-guide.md#h-cc-pairs
> 
> Bug: None
> Change-Id: I5a0009cddb17206b19f2a71eeba722faacc4bcae
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183380
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32039}

TBR=mbonadei@webrtc.org,kwiberg@webrtc.org

Change-Id: I4daa7582e55a0343eef72f08ed023c73e0b6456b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183443
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32040}
2020-09-05 21:18:40 +00:00
Mirko Bonadei
2b242d8fba Merge cpu_features build targets into //system_wrappers.
Before this CL, functions declared in cpu_features_wrapper.h where
not defined in the same build target, causing brittle builds that
might fail at link time if the binary was not depending on
//system_wrappers (the target with the definitions), violating [1].

This CL moves everything into //system_wrappers and also moves
cpu_features_wrapper.h definitions from C to C++ (in order to be able
to add the definitions to a C++ build target like //system_wrappers).

[1] - https://webrtc.googlesource.com/src/+/refs/heads/master/style-guide.md#h-cc-pairs

Bug: None
Change-Id: I5a0009cddb17206b19f2a71eeba722faacc4bcae
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183380
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32039}
2020-09-05 20:43:27 +00:00
Mirko Bonadei
c94650d88f Remove AudioProcessing::SetExtraOptions.
Bug: webrtc:5298
Change-Id: I28be75df69b66aa59ae91b05cb7f9afad4f55aa1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/182120
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32033}
2020-09-03 12:43:14 +00:00
Mirko Bonadei
ea8f739bce Make AudioProcessing::SetExtraOptions non pure-virtual.
Bug: webrtc:5298
Change-Id: Ib5ba81c8e333b1e7189fbb7e9e9f143579c84b8b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/182181
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32032}
2020-09-03 06:17:44 +00:00
Per Åhgren
0ade98316c Cleanup of the APM creation
This CL removes the possibility that APM cannot be created, i.e., that
the create method can return nullptr. That was already the case
implicitly but this CL makes that behavior explicit.


Bug: webrtc:5298
Change-Id: I2706ea538c9d1b4bcd65faecab637640a209a4dc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183101
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32029}
2020-09-02 20:28:49 +00:00
Zhaoliang Ma
e537e9ca13 aec3: Support AVX2/FMA intrinsics in AEC3
Bug: webrtc:11663
Change-Id: Ib75eb616ef0cb62698b0d96af7ebe42e93825222
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/179006
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32023}
2020-09-01 11:58:16 +00:00
Per Åhgren
0796b58a7e Removing call to deprecated SetExtraOptions method
Bug: webrtc:5298
Change-Id: If81d74727bb231f6e61b1647cc7b80ef13107b62
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/182121
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31972}
2020-08-20 16:13:12 +00:00
Per Åhgren
552d3e3d5e Reland "Add ability to state whether the APM output will be used"
This is a reland of 8be2f201ba

Original change's description:
> Add ability to state whether the APM output will be used
> 
> This CL adds the ability for the surrounding code to state that the
> APM output will not be used. The intended usecase for this is to allow
> APM to run at a lower complexity when the endpoint is muted.
> When APM has been informed that the output will not be used, it can
> turn off code that is needed only for ensuring that the output audio
> will sound good.
> 
> Bug: b/154437967,b/163802450
> Change-Id: I8e22989e35354372e96191d15da44beb9d1b26ae
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181200
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31949}

Bug: b/154437967
Bug: b/163802450
Change-Id: Ia77a9e43f913929d1afa72212f1ea6c192d0e519
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181887
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31957}
2020-08-18 12:29:32 +00:00
Erik Språng
1804b339a9 Revert "Add ability to state whether the APM output will be used"
This reverts commit 8be2f201ba.

Reason for revert: Breaks downstream

Original change's description:
> Add ability to state whether the APM output will be used
> 
> This CL adds the ability for the surrounding code to state that the
> APM output will not be used. The intended usecase for this is to allow
> APM to run at a lower complexity when the endpoint is muted.
> When APM has been informed that the output will not be used, it can
> turn off code that is needed only for ensuring that the output audio
> will sound good.
> 
> Bug: b/154437967,b/163802450
> Change-Id: I8e22989e35354372e96191d15da44beb9d1b26ae
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181200
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31949}

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

Change-Id: I1e56dafbbfa6ea69cccbbb5cdc2b1e2a6c122c11
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: b/154437967
Bug: b/163802450
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181884
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31953}
2020-08-17 14:10:08 +00:00
Per Åhgren
8be2f201ba Add ability to state whether the APM output will be used
This CL adds the ability for the surrounding code to state that the
APM output will not be used. The intended usecase for this is to allow
APM to run at a lower complexity when the endpoint is muted.
When APM has been informed that the output will not be used, it can
turn off code that is needed only for ensuring that the output audio
will sound good.

Bug: b/154437967,b/163802450
Change-Id: I8e22989e35354372e96191d15da44beb9d1b26ae
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181200
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31949}
2020-08-17 12:56:24 +00:00
Sam Zackrisson
ff571c60a9 AEC3: Fix render delay buffer alignment issue at call start
Internal counters in the RenderDelayBuffer can slip out of sync with external counters, leading to buffer misalignment.
This CL gives the RenderDelayBuffer an opportunity to update its counters.

Tested:
Passes: modules_unittests --gtest_filter=BlockProcessor.*
Fails as expected due to new unit test: modules_unittests --gtest_filter=BlockProcessor.* --force_fieldtrials="WebRTC-Aec3RenderBufferCallCounterUpdateKillSwitch/Enabled/"

audioproc_f with default AEC settings has been verified to be bit-exact on a large number of aecdumps.

Bug: webrtc:11803
Change-Id: I9363b834c8c8c934add0335013df60bf131da4bc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180126
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31795}
2020-07-27 15:19:58 +00:00
Markus Handell
3d2210876e Remove unused critical section includes.
Bug: webrtc:11567
Change-Id: Ic5e43c51ce06c0619adc265d12ad4bef73a9df76
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/179521
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31745}
2020-07-16 13:52:28 +00:00
Markus Handell
0df0faefd5 Migrate modules/audio_coding, audio_mixer/ and audio_processing/ to webrtc::Mutex.
Bug: webrtc:11567
Change-Id: I03b78bd2e411e9bcca199f85e4457511826cd17e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176745
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31649}
2020-07-07 14:35:58 +00:00
Brian Sheedy
8e144aa33f Remove WebRTC usage of //third_party/pymock
Removes usage of Chromium's //third_party/pymock in favor of the version
provided by vpython. This is so that the third_party version can
eventually be removed.

TBR=aleloi@webrtc.org

Bug: chromium:1094489
Change-Id: I68511e11ed1e517c2b6d3bb832090a3c27e480e5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/177921
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Alex Loiko <aleloi@google.com>
Cr-Commit-Position: refs/heads/master@{#31568}
2020-06-25 18:01:30 +00:00
Mirko Bonadei
2dcf348011 Use absl_deps in order to preapre to the Abseil component build release.
Bug: webrtc:1046390
Change-Id: Ia35545599de23b1a2c2d8be2d53469af7ac16f1d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176502
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31463}
2020-06-08 12:59:40 +00:00
Per Åhgren
80b301255e Reland "Change to using the new Ooura constructor"
This is a reland of a6c70741e7

Original change's description:
> Change to using the new Ooura constructor
> 
> 
> Bug: b/155316201
> Change-Id: I40000e30df7a495a0937885abea19caeb599e00a
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176378
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31411}

Bug: b/155316201
Change-Id: Iba9748509d66b9ad4b210be83d515db684c5d5e0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176410
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31422}
2020-06-03 12:27:14 +00:00
Stephan Hartmann
3ca2836f70 IWYU: size_t is defined in stddef.h
This required for gcc-10.

Bug: None
Change-Id: Iba3ff0881005cb2ae4574e47284a1b881594de86
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176361
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31417}
2020-06-03 08:43:50 +00:00
Per Åhgren
43ccfecdb7 Remove unused instance of Ooura FFT
Bug: b/155316201
Change-Id: I29a2dcf620091665b6d48820022fac3a3b672c04
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176405
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31414}
2020-06-03 00:33:54 +00:00
Alex Glaznev
955e9039ea Revert "Change to using the new Ooura constructor"
This reverts commit a6c70741e7.

Reason for revert: breaks TAP build

Original change's description:
> Change to using the new Ooura constructor
> 
> 
> Bug: b/155316201
> Change-Id: I40000e30df7a495a0937885abea19caeb599e00a
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176378
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31411}

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

Change-Id: Id8149889fddf96276cc15f37686ef9d1190c5c94
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: b/155316201
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176420
Reviewed-by: Alex Glaznev <glaznev@webrtc.org>
Commit-Queue: Alex Glaznev <glaznev@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31413}
2020-06-02 22:28:07 +00:00
Per Åhgren
a6c70741e7 Change to using the new Ooura constructor
Bug: b/155316201
Change-Id: I40000e30df7a495a0937885abea19caeb599e00a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176378
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31411}
2020-06-02 14:38:58 +00:00
Tommi
a5e07cc3db Rename more death test to *DeathTest
Bug: webrtc:11577
Change-Id: If45e322fed3f2935e64c9e4d7e8c096eccc53ac4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176140
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31362}
2020-05-26 20:27:34 +00:00
Danil Chapovalov
704fb55255 In common_audio/ and modules/audio_* replace mock macros with unified MOCK_METHOD macro
Bug: webrtc:11564
Change-Id: Ib0ffce4de50a13b018926f6ea2865a2ec2fb2ec7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175621
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31333}
2020-05-20 13:17:31 +00:00
Per Åhgren
e9cd6177eb Add ability for audioproc_f to operate on any AudioProcessing object.
This CL extends the WebRTC testing API to allow audioproc_f -based
testing using a pre-created AudioProcessing object. This is an
important feature to allow testing any AudioProcessing objects
that are injected into WebRTC.

Beyond adding this, the CL also changes the simulation code to
operate on a scoped_refptr<AudioProcessing> object instead of a
std::unique<AudioProcessing> object

Bug: webrtc:5298
Change-Id: I70179f19518fc583ad0101bd59c038478a3cc23d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175568
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31319}
2020-05-19 11:37:18 +00:00
Tommi
909f3a5339 Rename several more tests that use EXPECT_DEATH to *DeathTest.
Bug: webrtc:11577
Change-Id: I0397ee933464496e4885bb0f8030f3d669e5e612
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175641
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31309}
2020-05-18 16:10:04 +00:00
Tommi
da357a9495 Rename EchoPathDelayEstimator to EchoPathDelayEstimatorDeathTest.
...for the NullDataDumper, WrongCaptureBlockSize and
DISABLED_WrongRenderBlockSize tests. This is to avoid creation
of additional threads on Mac, which can cause issues on asan bots.

Bug: webrtc:11577
Change-Id: I4e6a64d47ec3b0a0e0018b19a0486208ba7e6ae2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175600
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31307}
2020-05-18 14:27:14 +00:00
Markus Handell
02ba1d252e AudioProcessingImpl: remove lock recursions.
This change removes lock recursions and adds thread annotations.

Bug: webrtc:11567
Change-Id: Ibefb49bb5b865cb0bb33e4580d34d9837fb41bff
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175121
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31260}
2020-05-14 14:53:58 +00:00
Per Åhgren
09e9a83d91 Change the way that AecDumps are created in APM
This CL changes the way that AecDumps are created in APM. Instead
of being injected, they are now created via the API.

This removes the AecDumpFactory from the API surface of APM and
makes the API more explicit.

The CL will be followed by one more CL that deprecates the usage
of the AttachAecDump API also within the audio_processing
and the fuzzer folders.

The CL also moves the aec_dump.* files from the include folder
to the aec_dump folder and changes the build files. The reasons
for this are that
1) The content of aec_dump.h is not really part of the API
   surface of APM.
2) Those files anyway needed to be moved to a separate build-
   target to avoid a circular build-file dependency caused by
   the other changes in this CL

Bug: webrtc:5298
Change-Id: I7dd6b49de76eb44158472874e1d4ae17dca9be54
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174750
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31207}
2020-05-11 10:33:00 +00:00
Sam Zackrisson
ab866a2ccb Remove audio playout generator from APM API
This API is and has always been unused.

Bug: webrtc:5298
Change-Id: If1201d37a00e387567d44a9ed8be99a157915b47
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174661
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31180}
2020-05-07 12:14:50 +00:00
Ivo Creusen
bb826c9142 Make echo metrics optional
This makes it optional for an echo detector to report metrics through
the getStats interface.

Bug: webrtc:11539
Change-Id: I1fef93b7bf534637b69c16971d38709b3e849a08
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174100
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31146}
2020-04-29 14:29:27 +00:00
Sam Zackrisson
b37e59d198 Add unittests for APM with submodule creation disabled
This introduces a function AudioProcessingImpl::SetCreateOptionalSubmodulesForTesting to simulate the exclusion of build-optional submodules, and tests of the currently only excludable submodule.

Bug: webrtc:11292
Change-Id: If492606205c9fdc669a6dce3a8989a434aeeed1f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173746
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31138}
2020-04-27 11:47:15 +00:00
Per Åhgren
cc73ed3e70 APM: Add build flag to allow building WebRTC without APM
This CL adds a build flag to allow building the non-test parts
of WebRTC without the audio processing module.
The CL also ensures that the WebRTC code correctly handles
the case when no APM is available.

Bug: webrtc:5298
Change-Id: I5c8b5d1f7115e5cce2af4c2b5ff701fa1c54e49e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171509
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31133}
2020-04-26 23:06:44 +00:00
Mirko Bonadei
146137adee Merge OOURA BUILD.gn files.
No-Tree-Checks: True
No-Try: True
Bug: webrtc:11509
Change-Id: If66483a02085396e231986e39ef0dafcdd3f4bed
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173740
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31114}
2020-04-21 09:06:37 +00:00
Mirko Bonadei
f0d64a5f9b Reland "Unify OOURA implementations in one directory."
This is a reland of 09b439c6f7

Original change's description:
> Unify OOURA implementations in one directory.
>
> This CL moves the two OOURA implementations present in the WebRTC tree
> in one place.
>
> No functional change is expected.
>
> TBR=kwiberg@webrtc.org
>
> No-Try: True
> Bug: webrtc:11509
> Change-Id: I330a9ec57e3dc65c9c8b43edd4bb295c55920efa
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173682
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31106}

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

No-Tree-Checks: True
No-Try: True
Bug: webrtc:11509
Change-Id: Ifc28b0380062ab5aad5c498700aa3cc7f9c7802c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173720
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31111}
2020-04-20 16:08:19 +00:00
Mirko Bonadei
ed005be788 Revert "Unify OOURA implementations in one directory."
This reverts commit 09b439c6f7.

Reason for revert: Breaks downstream project. Will reland tomorrow.

Original change's description:
> Unify OOURA implementations in one directory.
> 
> This CL moves the two OOURA implementations present in the WebRTC tree
> in one place.
> 
> No functional change is expected.
> 
> TBR=kwiberg@webrtc.org
> 
> No-Try: True
> Bug: webrtc:11509
> Change-Id: I330a9ec57e3dc65c9c8b43edd4bb295c55920efa
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173682
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31106}

TBR=mbonadei@webrtc.org,peah@webrtc.org,kwiberg@webrtc.org

Change-Id: I41acf34aef6497adfa7750223acbcc3725db6feb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11509
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173706
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31107}
2020-04-19 09:59:52 +00:00
Mirko Bonadei
09b439c6f7 Unify OOURA implementations in one directory.
This CL moves the two OOURA implementations present in the WebRTC tree
in one place.

No functional change is expected.

TBR=kwiberg@webrtc.org

No-Try: True
Bug: webrtc:11509
Change-Id: I330a9ec57e3dc65c9c8b43edd4bb295c55920efa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173682
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31106}
2020-04-18 17:52:53 +00:00
Mirko Bonadei
491ff3d54c Remove AudioProcessing::UpdateHistogramsOnCallEnd.
Bug: webrtc:10198
Change-Id: I3e7a98f9b94c171e7f105883fc755e44b2e991ae
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173464
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31070}
2020-04-14 18:08:52 +00:00
Per Åhgren
fea8b94591 Reland "APM: Remove the usage of AudioFrame in the AudioProcessing interface"
This is a reland of 12e2d4ddb2

Original change's description:
> APM: Remove the usage of AudioFrame in the AudioProcessing interface
> 
> This CL removes the AudioFrame-based APIs from the AudioProcessing
> interface.
> 
> Bug: webrtc:5298
> Change-Id: Iab470b26b10e06dcf29c543851ae0085bc5b66f0
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/172939
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31016}

Bug: webrtc:5298
Change-Id: I70e6d59afc3716ee6109d8b9dc384abc71c93624
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173476
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31066}
2020-04-14 14:11:06 +00:00
Per Åhgren
8b844f21e1 AEC3: Remove parameters for the legacy filter naming
Bug: webrtc:8671
Change-Id: Ia5f8e33b9646e2b922428a72364cbbca47091579
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173092
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31030}
2020-04-08 07:34:08 +00:00
Artem Titov
7e60483915 Revert "APM: Remove the usage of AudioFrame in the AudioProcessing interface"
This reverts commit 12e2d4ddb2.

Reason for revert: Speculative revert: breaks downstream project

Original change's description:
> APM: Remove the usage of AudioFrame in the AudioProcessing interface
> 
> This CL removes the AudioFrame-based APIs from the AudioProcessing
> interface.
> 
> Bug: webrtc:5298
> Change-Id: Iab470b26b10e06dcf29c543851ae0085bc5b66f0
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/172939
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31016}

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

Change-Id: I82729b54c74cf1362332a28a96f598d6747b53ff
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:5298
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173091
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31022}
2020-04-07 19:37:32 +00:00
Per Åhgren
12e2d4ddb2 APM: Remove the usage of AudioFrame in the AudioProcessing interface
This CL removes the AudioFrame-based APIs from the AudioProcessing
interface.

Bug: webrtc:5298
Change-Id: Iab470b26b10e06dcf29c543851ae0085bc5b66f0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/172939
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31016}
2020-04-07 13:40:58 +00:00
Per Åhgren
80e5216a11 AEC3: Adding field-trial-based overrides for transparency parameters
This CL adds several field-trial-based overrides for parameters related
to AEC transparency.

The changes have been shown to be bitexact for a test dataset.

Bug: webrtc:11487,chromium:1067597
Change-Id: Ica9613db74240687fc85efe059874ef8c20aa7d5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/172844
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31007}
2020-04-06 14:05:28 +00:00
Per Åhgren
d9c51142bd AEC3: Add additional transparency-related killswitches
This CL adds two kill-switches to the AEC3 code to be used as
safe fallbacks to increase AEC transparency.

The changes have been shown to be bitexact for a test dataset.

Bug: webrtc:11487,chromium:1067597
Change-Id: I7f9f78db4964990bcdfa9adae6ef36a56bce7224
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/172840
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30998}
2020-04-03 16:25:35 +00:00
saza
aa42ecde9a Make transient suppression optionally excludable via defines
This allows clients to exclude the transient suppression submodule from WebRTC builds, by defining WEBRTC_EXCLUDE_TRANSIENT_SUPPRESSOR.

The changes have been shown to be bitexact for a test dataset (when the flag is _not_ defined.)

No-Try: True
Bug: webrtc:11226, webrtc:11292
Change-Id: I6931c82a280a9b40a53ee1c2a9820ed9e674a9a5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171421
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30978}
2020-04-02 11:44:07 +00:00
saza
0cf99ce865 Support forcing field trial in audioproc_f simulator
This allows the user to run audioproc_f with various field trials set.
The approach is copied from test/test_main_lib.cc.

Tested:
1. Verified bitexactness vs ToT audioproc_f on a large dataset of aecdumps
2. Ran it with flags --aec=1 --force_fieldtrials="WebRTC-Aec3ClampInstQualityToZeroKillSwitch/Enabled/WebRTC-Aec3ClampInstQualityToOneKillSwitch/Enabled/" and verified in GDB that the AEC3 config was changed accordingly.


No-Try: True
Bug: webrtc:5298
Change-Id: I70eec7777f70893b36af33794a5842f67d56af31
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/172623
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30976}
2020-04-02 11:14:59 +00:00
Sam Zackrisson
01c107e37a Correct int16 audio frame setup in audioproc_f
Currently, audioproc_f crashes on a DCHECK as the data vector of Int16Frame is not resized.

Bug: webrtc:5298
Change-Id: I897cf0fce07e0ed2c0a365a965fa50fd3d8ddd18
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/172624
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30969}
2020-04-02 04:05:02 +00:00
Per Åhgren
d8d09c3c5a AEC3: Add transparency-related killswitches
This CL adds a number of kill-switches to the AEC3 code to be used as
safe fallbacks to increase AEC transparency.

The changes have been shown to be bitexact for a test dataset.

Bug: webrtc:11475,chromium:1066836
Change-Id: Ibebcbbfbbd958cb6fcc6993247e3030fa65b582c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/172600
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30964}
2020-04-01 17:32:36 +00:00
Per Åhgren
4b425aeef9 AEC3: Correct peak index at filter size reductions
Bug: chromium:1061933
Change-Id: I70745b82de1d8878d4a789c86af6a44e652c3e9e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/172420
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30947}
2020-03-31 12:23:40 +00:00
Mirko Bonadei
b913198b83 Fix msvc bots build.
This started to happen after turning on "gn analyze" on trybots. It
looks like this code was never built on MSVC trybots.

This CL tries to avoid the type deduction.

Error:
quality_assessment/sound_level.cc(103):
    error C3535: cannot deduce type for 'const auto *' from '_FwdIt'
    with
      [
          _FwdIt=std::_Array_iterator<int16_t,1440>
      ]

Bug: webrtc:11262
Change-Id: Iea7cf2ec62f1d0edfcf6ceac169c92050339d3c4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/172088
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30933}
2020-03-29 21:04:55 +00:00
Per Åhgren
a388b75223 AEC3: Added parametrization of the comfort noise floor
Bug: webrtc:8671
Change-Id: I2431b1dd8dbe35fc8742c0640c3b35166e8ef6b7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171480
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30876}
2020-03-25 08:56:17 +00:00
Mirko Bonadei
f1df04b094 Fix -Wunreachable-code on Linux.
Starting from [1] the toolchain has started to enforce
-Wunreachable-code on Linux, this CL fixes the issues that are preventing
the Chromium roll into WebRTC.

Error example at [2].

[1] - https://chromium-review.googlesource.com/c/chromium/src/+/2093537
[2] - https://ci.chromium.org/p/webrtc/builders/try/linux_rel/34282?

Bug: webrtc:11448
Change-Id: I96e8901ae80c44d69143ed8d972e250b6b926a7d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171500
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30858}
2020-03-23 20:51:37 +00:00
Sam Zackrisson
7eab0a820f Split RMS level measurement utility from APM
This moves rms_level.* into a separate build target.

Bug: webrtc:11226
Change-Id: I94ceacd1ec65dda48f5d19b22ba2625d13543e08
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170323
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30856}
2020-03-23 16:54:22 +00:00
Alex Henrie
ab835fe86e Fix bad frees in error paths of WebRtcAecm_Create
The error paths free the memory referenced by each pointer in the
struct, but if the pointers are not initialized, random memory belonging
to other parts of the program could be freed instead. Zero out the
entire struct as soon as it is allocated to ensure that nothing is freed
if there is nothing to free.

Bug: webrtc:11446
Change-Id: I8a2985d1388477339351aa03107ee68925372d49
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171121
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30852}
2020-03-21 23:01:47 +00:00
Per Åhgren
e7175c9a09 Ensured that all files in APM are using the webrtc namespace
This CL adds namespaces to those files remaining within APM that do not
have any such.

BUG=webrtc:5298

Change-Id: I710b3d2a3644bea9d4bdffef0d77883b30303338
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171111
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30850}
2020-03-20 17:33:28 +00:00
Per Åhgren
be36db1024 AECM: Added namespaces
This CL adds namespaces to AECM.

Bug: webrtc:5298
Change-Id: Ibb124ef9eb46c4bd762847b6763b37a6eeb85433
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171105
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30849}
2020-03-20 17:07:18 +00:00
Per Åhgren
5b139d6f9b APM: Change the AGC C code to be built as C++ code
This CL changes so that the AGC legacy C code is built as C++.

The CL also
-removes #defines from the header files.
-adds namespaces
-removes unused code.

To simplify the review, the CL is partitioned into different patchsets
where each comprising of one step in the modification of the code
(e.g., patch set 1 performs the renaming of the .c files to .cc).

Bug: webrtc:5298
Change-Id: I362b17bde91142b2f2166acba4f2f888efd50fa1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171064
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30847}
2020-03-20 16:08:25 +00:00
Per Åhgren
9d66198d35 AEC3: Rename shadow filter
This CL renames the shadow filter in AEC3 to have the more accurate name
coarse filter.

The CL consists of 3 main initial patch sets, designed to simplify
the review:
1) Replaces "shadow" with "coarse" and adds a fall-back functionality
to support the old filter naming.
2) Renames the files according to the new naming.
3) Performs a "git cl format"

Bug: webrtc:8671
Change-Id: I28d6041d0d34e85f8f8048d004b44a1a5f07bb07
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170981
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30846}
2020-03-20 15:26:14 +00:00
Per Åhgren
ff0451117e AEC3: Rename main filter
This CL renames the main filter in AEC3 to have the more accurate name
refined filter.

The CL consists of 3 main initial patch sets, designed to simplify
the review:
1) Replaces "main" with "refined" and adds a fall-back functionality
to support the old filter naming.
2) Renames the files according to the new naming.
3) Performs a "git cl format"

Bug: webrtc:8671
Change-Id: Ifd0aab34e291736a2250e0986348404618630b1d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170825
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30843}
2020-03-20 13:25:01 +00:00
Sam Zackrisson
0a1e65e9be Add empty placeholder target for rms_level.*
A follow-up CL will move the rms_level.* files into the new target.

Bug: webrtc:11226
Change-Id: I59579b026346f627c0a2739d25f90c12bffbf248
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171102
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30840}
2020-03-20 12:06:56 +00:00
Per Åhgren
dc5522b4bf APM: Removing the redundant VAD output from the integer API
This CL removes the redundant VAD output from the newly introduced
integer API in AudioProcessing.

Bug: webrtc:5298
Change-Id: Iad2b1b97ada7f4863139655526c110e326c6788a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170824
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30832}
2020-03-19 13:59:00 +00:00
Per Åhgren
2507f8cdc9 APM: Replace all remaining usage of AudioFrame outside interfaces
This CL replaces all remaining usage of AudioFrame within APM,
with the exception of the AudioProcessing interface.

The main changes are within the unittests.

Bug: webrtc:5298
Change-Id: I219cdd08f81a8679b28d9dd1359a56837945f3d4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170362
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30831}
2020-03-19 12:40:18 +00:00
Per Åhgren
088329fe2a Correct the storing of the processed output in aecdumps
This CL corrects an issue in the storing of the processed capture output
into aecdump recordings for the case when the integer API interface is
used.


Bug: webrtc:11441
Change-Id: I24aad47b5d62e0738d412ec270ad1db3a76aa94f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170823
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30829}
2020-03-19 10:08:36 +00:00
Per Åhgren
71652f4b66 APM: Localize/abstract the usage of AudioFrame
This CL moves the implementation of of the AudioFrame
support from the implementation of AudioProcessing
to proxy methods that map the call to the integer
stream interfaces (added in another CL).

The CL also changes the WebRTC code using the AudioFrame
interfaces to instead use the proxy methods.

This CL will be followed by one more CL that removes
the usage of the AudioFrame class from the rest of
APM (apart from the AudioProcessing API).

Bug: webrtc:5298
Change-Id: Iecb72e9fa896ebea3ac30e558489c1bac88f5891
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170110
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30812}
2020-03-17 13:55:41 +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
Sam Zackrisson
4b6ba7c207 Split out some dependencies from the monolith audio processing target
This is a first step to make the transient suppressor and voice detection optional.

Bug: webrtc:11226, webrtc:11292
Change-Id: I203125e11694a957a32bc7f98f3bec3ec8867839
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166523
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30783}
2020-03-12 21:07:08 +00:00
Mirko Bonadei
2d525fe9bd Fix compile all in debug mode.
This CL fixes the build for the meta taret "all"
(ninja -C out/Debug all).

More interestingly fixes cascaded_biquad_filter_unittest.cc which
seems not to be run at the moment.

Bug: webrtc:11411
Change-Id: I3d5f83c3898cca96aff8fbdad97d7b48caa9fffa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/169858
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30722}
2020-03-09 12:05:02 +00:00
Per Åhgren
1883d3e231 Optimizations and refactoring of the APM 3-band split filter
This CL refactors and optimizes the 3-band split-filter in APM, which
is a very computationally complex component.

Beyond optimizing the code, the filter coefficients are also quantized
to avoid denormals.

The changes reduces the complexity of the split filter by about 30-50%.

The CL has been tested for bitexactness on a number of aecdump
recordings.

(the CL also removes the now unused code for the sparse_fir_filter)

Bug: webrtc:6181
Change-Id: If45f8d1f189c6812ccb03721156c77eb68181211
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168189
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30592}
2020-02-24 13:19:14 +00:00
Mirko Bonadei
4a14f4997c Remove wildcard ownership for build files.
No-Try: True
Bug: webrtc:10381
Change-Id: I852d9a2da7e0c5c12f508a1c788b0b5753503aba
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168769
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30558}
2020-02-19 14:05:46 +00:00
Mirko Bonadei
e52115a33e Remove inactive OWNERS.
No-Try: True
Bug: webrtc:10381
Change-Id: I3b56c74d913a47e4297518005b0cb19de8fafbff
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168421
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30556}
2020-02-19 13:37:36 +00:00
Sam Zackrisson
701bd172d8 Add aecdump experiment strings for injected custom processors
Bug: None
Change-Id: I41aaae454212db3a871d356e0124b868d67033b6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168683
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30544}
2020-02-18 15:53:59 +00:00
Per Åhgren
0618cbc989 AEC3: Avoid heap-allocations in sums of the values in nested vectors
This CL avoids the head-allocations done in a sum of the squared values
in a nested vector.

Bug: webrtc:11361, chromium:1052086
Change-Id: I698b855bdd54df2147ef3b6d5e3d401401228d76
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168543
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30520}
2020-02-13 21:53:26 +00:00
Per Åhgren
8ad9e74d62 Removing deprecated legacy noise suppressor
This CL removes the code for the deprecated legacy noise.

Bug: webrtc:5298
Change-Id: If287d8967a3079ef96bff4790afa31f37d178823
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167922
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30434}
2020-01-31 07:14:25 +00:00
Per Åhgren
5dca3f1336 Add floating point support for writing and reading wav files
This CL adds support for reading and writing floating point
wav files in WebRTC. It also updates the former wav handling
code as well as adds some simplifications.

Beyond this, the CL also adds support in the APM data_dumper
and in the audioproc_f tool for using the floating point wav
format.

Bug: webrtc:11307
Change-Id: I2ea33fd12f590b6031ac85f75708f6cc88a266b4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/162902
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30423}
2020-01-30 13:38:19 +00:00
Per Åhgren
260c788d77 AEC3: Added multi-channel support for the capture delay functionality
This CL adds the missing support for multi-channel in the code that
provides an optional and configurable delay to be added to the
microphone signal.

The CL also makes the creation of the delay object conditional on the
need for that support (this is important since this adds a significant
heap memory footprint)

Bug: webrtc:11314,chromium:1045910
Change-Id: I92d577e31af830945fe9d5ca2032000aad4266be
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167525
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30392}
2020-01-28 15:39:26 +00:00
Jonas Olsson
6c9bc396e9 Cleanup log formatting in modules/audio_processing
Bug: None
Change-Id: I47177530d8a85d7b2f143081de71f5a3bf8ec354
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166041
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30379}
2020-01-27 09:42:56 +00:00
Sam Zackrisson
b039c30157 Reland "Change log level of AEC3 buffer info to VERBOSE"
This is a reland of 48148dc840

Original change's description:
> Change log level of AEC3 buffer info to VERBOSE
>
> Otherwise, test logs become very verbose:
> https://chrome-swarming.appspot.com/task?id=49b6fa6ac93e2310
> See linked issue.
>
> Bug: webrtc:11278
> Change-Id: I778ee4826de6c1b23d47a5d5ce302d074900ce6b
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165786
> Reviewed-by: Per Åhgren <peah@webrtc.org>
> Commit-Queue: Sam Zackrisson <saza@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#30233}

Bug: webrtc:11278, webrtc:11295
Change-Id: I8e6f11457e283c83cae5581adcacdc4d3b5431bb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167360
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30372}
2020-01-24 12:58:08 +00:00
Sam Zackrisson
b18c4eb0a9 Add parameterization for three multi channel AEC3 unit tests
Bug: webrtc:11295
Change-Id: I478aa02908c494cf9609db00021438a59a132b66
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167202
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30370}
2020-01-24 12:26:46 +00:00
Sam Zackrisson
3c7e4dd85f Revert "Change log level of AEC3 buffer info to VERBOSE"
This reverts commit 48148dc840.

Reason for revert: Causing tests to timeout, see bugs.webrtc.org/11295

Original change's description:
> Change log level of AEC3 buffer info to VERBOSE
> 
> Otherwise, test logs become very verbose:
> https://chrome-swarming.appspot.com/task?id=49b6fa6ac93e2310
> See linked issue.
> 
> Bug: webrtc:11278
> Change-Id: I778ee4826de6c1b23d47a5d5ce302d074900ce6b
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165786
> Reviewed-by: Per Åhgren <peah@webrtc.org>
> Commit-Queue: Sam Zackrisson <saza@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#30233}

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

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

Bug: webrtc:11278
Change-Id: I283648a6d4d58cfe7af7a646d915122207883007
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167180
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30357}
2020-01-23 10:28:25 +00:00
Per Åhgren
39c8350613 Reduce the complexity of the multichannel echo subtractor test
This CL reduces the complexity of the Subtractor.ConvergenceMultiChannel
test by
1. Slightly reducing the amount of tested combinations for the non-debug
   mode.
2. Drastically reduce the amount of tested combinations for the debug
   mode.


Bug: webrtc:11295
Change-Id: I56bfa4a1463d26e5217b6a4d7f2ef54de7aab512
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166529
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30343}
2020-01-22 11:39:07 +00:00
Mirko Bonadei
ccbe95fd8a Reformat GN files.
`gn format` recently [1] changed its formatting behavior
for deps, source, and a few other elements when they
are assigned (with =) single-element lists to be consistent
with the formatting of updates (with +=) with single-element.

Now that we've rolled in a GN binary with the change,
reformat all files so that people don't get presubmit
warnings due to this.

CL generated with:
$ git ls-files | grep BUILD.gn | xargs gn format
$ gn format build_overrides/build.gni
$ gn format build_overrides/gtest.gni
$ gn format modules/audio_coding/audio_coding.gni
$ gn format webrtc.gni
$ gn format .gn

Plus a few manual changes to add exceptions for
"public_deps" (after changing these lines the presubmit
started to complain).

[1] - https://gn-review.googlesource.com/c/gn/+/6860

Bug: webrtc:11302
Change-Id: Iac29d23c1618ebef925c972e2891cd9f4e8cd613
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166882
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30334}
2020-01-21 12:13:11 +00:00
Sam Zackrisson
2d31aea481 Remove unused AEC delay offset API
Bug: webrtc:5298
Change-Id: If490dba3c95b1d6aeaa7b110dd1ffc23ee7a96c9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166440
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30297}
2020-01-17 11:09:51 +00:00
Per Åhgren
0695df1a59 Reland "Replace the ExperimentalAgc config with the new config format"
This is a reland of f3aa6326b8

Original change's description:
> Replace the ExperimentalAgc config with the new config format
> 
> This CL replaces the use of the ExperimentalAgc config with
> using the new config format.
> 
> Beyond that, some further changes were made to how the analog
> and digital AGCs are initialized/called. While these can be
> made in a separate CL, I believe the code changes becomes more
> clear by bundling those with the replacement of the
> ExperimentalAgc config.
> 
> TBR: saza@webrtc.org
> Bug: webrtc:5298
> Change-Id: Ia19940f3abae048541e6716d0184b4caafc7d53e
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/163986
> Reviewed-by: Per Åhgren <peah@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#30149}

Bug: webrtc:5298
Change-Id: I6db03628ed3fa2ecd36544fe9181dd8244d7e2df
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165760
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30295}
2020-01-17 10:09:09 +00:00
Patrik Höglund
6ca908f48c Shorten the fir filter adapt test quite a bit.
The test is likely timing out on iOS simulator (see bug). Maybe I'm
going a bit overboard here :) if you want to keep all the cases I
removed, you can run some cases in one test method and the others in
another test method. Are the cases I removed particularly important?

Bug: webrtc:11284
Change-Id: I8f2e8830f931594c3471d1c20a2654e258b9fcf0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166169
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30277}
2020-01-16 09:12:26 +00:00
Jonas Olsson
b2b2031457 Concatenate string literals at compile time.
This CL was generated by running:
git ls-files | grep ".cc" | xargs perl -i -ne 'BEGIN {undef $/}; s/("[\s\n]*<<[\s\n]*")/" "/g; print;'; git cl format

After that I manually edited modules/audio_processing/gain_controller2.cc to preserve its original
formatting.

This primary benefit of this change is a small reduction in binary size.

Bug: None
Change-Id: I689fa7ba9c717c314bb167e5d592c3c4e0871e29
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165961
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30251}
2020-01-14 14:47:48 +00:00
Sam Zackrisson
ecc5b93b13 AEC3: Restrict default logging of some delay changes to VERBOSE
It leads to overly verbose test output. Example:
https://chromium-swarm.appspot.com/task?id=49bc386e0545ef10

Bug: webrtc:11278
Change-Id: I4a1c565f3aab94d98910722b23dcadc5fcde602a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165962
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30249}
2020-01-14 12:52:47 +00:00
Sam Zackrisson
48148dc840 Change log level of AEC3 buffer info to VERBOSE
Otherwise, test logs become very verbose:
https://chrome-swarming.appspot.com/task?id=49b6fa6ac93e2310
See linked issue.

Bug: webrtc:11278
Change-Id: I778ee4826de6c1b23d47a5d5ce302d074900ce6b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165786
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30233}
2020-01-13 13:31:27 +00:00
Yves Gerey
eb3beb8504 Revert "Replace the ExperimentalAgc config with the new config format"
This reverts commit f3aa6326b8.

Reason for revert: Breaks downstream project.

Original change's description:
> Replace the ExperimentalAgc config with the new config format
> 
> This CL replaces the use of the ExperimentalAgc config with
> using the new config format.
> 
> Beyond that, some further changes were made to how the analog
> and digital AGCs are initialized/called. While these can be
> made in a separate CL, I believe the code changes becomes more
> clear by bundling those with the replacement of the
> ExperimentalAgc config.
> 
> TBR: saza@webrtc.org
> Bug: webrtc:5298
> Change-Id: Ia19940f3abae048541e6716d0184b4caafc7d53e
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/163986
> Reviewed-by: Per Åhgren <peah@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#30149}

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

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

Bug: webrtc:5298
Change-Id: I794d2ab4b8caa5330c5ad490ba604646a249a1c1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/164530
Reviewed-by: Yves Gerey <yvesg@google.com>
Commit-Queue: Yves Gerey <yvesg@google.com>
Cr-Commit-Position: refs/heads/master@{#30153}
2020-01-07 05:22:01 +00:00
Per Åhgren
f3aa6326b8 Replace the ExperimentalAgc config with the new config format
This CL replaces the use of the ExperimentalAgc config with
using the new config format.

Beyond that, some further changes were made to how the analog
and digital AGCs are initialized/called. While these can be
made in a separate CL, I believe the code changes becomes more
clear by bundling those with the replacement of the
ExperimentalAgc config.

TBR: saza@webrtc.org
Bug: webrtc:5298
Change-Id: Ia19940f3abae048541e6716d0184b4caafc7d53e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/163986
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30149}
2020-01-03 23:14:13 +00:00
Sam Zackrisson
12e319aafe Merge the preambles of the ProcessStream implementations
The two functions have a lot of shared logic and locking. This CL consolidates that into a single function.

Bug: webrtc:111235
Change-Id: Ib1c32165dbf0e212c7d4b0753bcbb5ffd05eb6fe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/163022
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30144}
2020-01-03 14:37:41 +00:00
Per Åhgren
0f14db22de Reduce for reallocations the pre-amplifier and high-pass filter
This CL ensures that the pre-amplifier and the high-pass filter
submodules are not reallocated more than needed.

Bug: webrtc:5298
Change-Id: I7ed23807d4d2d9fef0eda2e7dca9de9b0b1a4649
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/163988
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30143}
2020-01-03 14:10:21 +00:00
Sam Zackrisson
308bc646e0 Remove one acquisition of capture lock in APM AudioFrame API
This brings the two ProcessStream functions closer in implementation.
Additionally, the error checking that is currently done in the period of not holding the lock seems cheaper than releasing and reacquiring the capture lock.

Bug: webrtc:11235
Change-Id: Ib4afc68afb419fcabbb8cf08a3a2e61d2c12acda
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/163021
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30140}
2020-01-03 10:56:24 +00:00
Per Åhgren
2bd85ab039 Avoid AGC2 runtime allocation and activate it on demand
This CL ensures that the AGC2 is created and initialized only when
needed.

Apart from that, the CL also avoids a runtime-reallocation that happens
each time the setting is applied.

Bug: webrtc:5298
Change-Id: Iad9eaa05a3d0baa0788cd11b2aa17ddd8e0c509b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/163987
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30139}
2020-01-03 10:47:14 +00:00
Per Åhgren
c0734715d1 APM: Move the TransientSuppression activation to the apm_config
This CL moves the activation of the transient suppression to the APM
config.

Bug: webrtc:5298
Change-Id: Iba7975bec4654c3df8834fd5b7d1082ff53641dd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/163985
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30137}
2020-01-03 08:48:54 +00:00
Per Åhgren
29fec66c77 AEC3: Remove metrics that are not used for analysis
Bug: webrtc:8671
Change-Id: I12a6584a70e2b56e0926c07999c919272499c255
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/163981
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30134}
2020-01-02 16:23:43 +00:00
Per Åhgren
cf4c872dbd APM: Make the GetStatistics call independent of the locks in APM
This CL changes the GetStatistics call in the audio processing module
(APM) to not aquire the render or capture locks in APM, while still
being thread-safe.
This change eliminates the risk of thread-priority inversion due to the
GetStatistics call.

Apart from the above the CL:
-Corrects the GetStatistics to not be const (it was const even though it
 aquired locks).
-Slightly changes the statistics reporting, so that the stats received
may be older than the most recent stats reported.

Bug: webrtc:11241
Change-Id: I00deb5507e004cbe6e4a19a8bad357491f86f4ab
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/163982
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30131}
2020-01-02 15:45:14 +00:00
Per Åhgren
2e8e1c699e Open up for do the noise suppressor analysis on the linear AEC output
This CL allows the noise suppressor to use the linear AEC output
for analysis whenever that is available. This will potentially
lower the risk that the noise suppressor estimates the noise
based on echo.
The feature is off by default.

Bug: webrtc:5298,b:132164318
Change-Id: Idc6c8e197d96209d213819d87a8fb2533b7303ec
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/162900
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30116}
2019-12-20 09:28:01 +00:00
Per Åhgren
9136abb45a AEC3: Ensure that the data size in the reverb computer is not fixed
This CL ensures that the no data vectors in the reverb computer code
are fixed. This allows arbitrary long filters to be used, and ensures
that a minimum required heap size is used.

Bug: webrtc:8671
Change-Id: I7085ed262a3f5965d796270434b6578f4030606e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/162661
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30115}
2019-12-19 16:35:56 +00:00
Per Åhgren
c04242548c Make the high-pass filter operate in full-band
This CL moves the high-pass filter to run in the full-band domain
instead of the split-band domain.

Bug: webrtc:11193
Change-Id: Ie61f4a80afda11236ecbb1ad544bbd0350c7bbfd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161453
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30112}
2019-12-18 16:01:24 +00:00
Per Åhgren
95059e0779 Moved the legacy noise suppressor to a separate build target
Bug: webrtc:5298
Change-Id: Ia1c5eb9d0f7b4ba578acb646e73229de63ae91fb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161441
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30089}
2019-12-13 15:26:16 +00:00
Harald Alvestrand
977b265702 Reduce some logging at INFO level by moving log statements
from LS_INFO to LS_VERBOSE.

By default, unit tests run with logging at info level.
A random run today produced more than 70.000 lines of
output. This CL would reduce that by approximately 15.000.

Bug: none
Change-Id: Ie62708cebf109510a2443aa5ab5c4e645ffc6707
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161950
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30077}
2019-12-12 21:54:06 +00:00
Daniel Johansson
89aaedac12 Move audioproc_f to rtc_tools.
The motivation in https://webrtc-review.googlesource.com/c/src/+/32340/3 applies here as well. We
would like to use this tool downstream.

Bug: None
Change-Id: Id5b23f792679ab9c07294bfb8e53119c423044b1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161681
Commit-Queue: Daniel Johansson <dajo@webrtc.org>
Reviewed-by: Daniel Johansson <dajo@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30051}
2019-12-10 12:08:56 +00:00
Per Åhgren
ded86c1ad8 Remove remaining settings for using legacy AEC
This CL removes the remaining settings for using the legacy AEC.

It also adds a missing printout of the enforce_high_pass_filtering
parameter in the ToString method.

Bug: webrtc:11165
Change-Id: I58f0861bf1c6cd24bd83f4d3e394653b2fab3d71
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161683
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30050}
2019-12-10 10:31:07 +00:00
Ying Wang
ef3998ffd1 Add directive to make webrtc metrics optional.
Bug: webrtc:11144
Change-Id: I4e75e6aec033784685de3670e880bb9f2b6ee8d2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161043
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Ying Wang <yinwa@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30040}
2019-12-09 13:55:50 +00:00
Per Åhgren
62ea0aaea0 Remove deprecated legacy AEC code
This CL removes the deprecated legacy AEC code.

Note that this CL should not be landed before the M80 release has been cut.

Bug: webrtc:11165
Change-Id: I59ee94526e62f702bb9fa9fa2d38c4e48f44753c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161238
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30036}
2019-12-09 10:37:49 +00:00
Yves Gerey
1fce3f8e55 Remove custom constructors for AudioProcessing::Config.
This CL follows the "Rule of zero".

Those constructors made no sense compared to default generated ones,
since all members are POD.
They were introduced to quiet a memory sanitizer warning,
which apparently was misleading.

As a bonus, the struct is now movable.

Bug: webrtc:11180, webrtc:9855
Change-Id: Iff9fd950bec8040bc6e7e7ece33cc49c5f453f5d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161381
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Yves Gerey <yvesg@google.com>
Cr-Commit-Position: refs/heads/master@{#30023}
2019-12-06 06:49:04 +00:00
Per Åhgren
2512604705 Adding a copy constructor for the Config in AudioProcessing
Bug: webrtc:11180
Change-Id: I4621f83c0441fda55d0f81606174c004668dd6c6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161325
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30015}
2019-12-05 13:58:20 +00:00
Per Åhgren
b810646c54 AEC3: Ensure that the high-pass filter is on whenever the AEC is active
This CL ensures that the high-pass filter is on whenever the echo
controller is on. This is important as the echo controller code assumes
that the external high-pass filter is active.

The CL also corrects the ToggleAec unit test (which started failing
after this code change).

Bug: webrtc:11159, chromium:1030179
Change-Id: Ief86eda8f7c67df1c25ac1a06d2cc0778e01196d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161228
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29998}
2019-12-04 09:38:04 +00:00
Per Åhgren
3c2679f1bb Disable unittest that takes too long to finish
Bug: webrtc:11161
Change-Id: Ic8de7ce07fabc251bc6269a0ecab33bdb1b22280
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161235
Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29991}
2019-12-03 17:27:55 +00:00
Per Åhgren
bcce4530d4 AEC3: Add flag for requiring a high pass filter effect before the AEC
Bug: webrtc:11159, chromium:1030179
Change-Id: Ic6b686a36efa433156a66252394fa551b8ed1837
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161227
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29986}
2019-12-03 15:34:04 +00:00
Per Åhgren
4011de012f Revert "AEC3: Ensure that the high-pass filter effect is on when AEC3 is active"
This reverts commit 3a77f93589.

Reason for revert: The change is breaking downstream tests.

Original change's description:
> AEC3: Ensure that the high-pass filter effect is on when AEC3 is active
> 
> This CL ensures that the high-pass filter is on whenever the echo
> controller is on. This is important as the echo controller code assumes
> that the external high-pass filter is active.
> 
> The CL also corrects the ToggleAec unit test (which started failing
> after this code change).
> 
> Bug: webrtc:11159,chromium:1030179
> Change-Id: Ie29db74bf3de6279a08564398d32d67d5e1569db
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161222
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29979}

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

Change-Id: I78b4e397555f50898ca42c4b32fb39cf06a2541a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11159, chromium:1030179
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161226
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29981}
2019-12-03 11:49:00 +00:00
Per Åhgren
6a05bb1b12 AEC3: Add signal dependent mixing before alignment
This CL adds code for doing signal-dependent downmixing
before the delay estimation in the multichannel case.

As part of the CL, the unittests of the render delay
controller are corrected. However, as that caused some of
them to fail, the CL (for now) as well disables the failing
test.

Bug: webrtc:11153,chromium:1029740, webrtc:11161
Change-Id: I0b765c28fa5e547aabd6dfbd24b626ff9a16346f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161045
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29980}
2019-12-03 11:30:48 +00:00
Per Åhgren
3a77f93589 AEC3: Ensure that the high-pass filter effect is on when AEC3 is active
This CL ensures that the high-pass filter is on whenever the echo
controller is on. This is important as the echo controller code assumes
that the external high-pass filter is active.

The CL also corrects the ToggleAec unit test (which started failing
after this code change).

Bug: webrtc:11159,chromium:1030179
Change-Id: Ie29db74bf3de6279a08564398d32d67d5e1569db
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161222
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29979}
2019-12-03 11:06:08 +00:00
Per Åhgren
b2b58d84e3 AEC3: Adding default AEC3 configurations that are setup specific
This adds functionality to AEC3 to produce setup-specific
default configurations that are tailored to work well for the
number of channels at hand.

The tunings are only used for the case when no echo control factory
has been provided.

Bug: webrtc:11151,chromium:1029717
Change-Id: I1bd2d10327300c7b0f3169a52bf66700b781fd6b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161086
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29972}
2019-12-02 15:04:07 +00:00
Per Åhgren
cf20519262 AEC3: Correct the number of render channels in the echo audibility code
Bug: webrtc:11150,chromium:1029707
Change-Id: I4d43bfcd52871a45e7608158bf19c32523976f55
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161085
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29971}
2019-12-02 13:13:11 +00:00
Per Åhgren
b144c58973 Remove deprecated setting for activating multichannel processing
Bug: webrtc:10859
Change-Id: I86cae6a9b765bc807c00632ec7d743b754941f81
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/160780
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29966}
2019-12-02 07:47:53 +00:00
Artem Titov
9dc209a23a Add ability to disable detailed error message in RTC_CHECKs
Bug: webrtc:11133
Change-Id: I989654f1fb97b476a17956d69ee374406439ea8f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/160653
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29952}
2019-11-28 17:51:00 +00:00
Per Åhgren
9750e84d7a AEC3:Turning off default downmix in surround alignment
This CL changes the downmixing of the input to the delay estimation
for surround/stereo signals to be off by default.

A kill-switch is also added for enforcing the downmix to be on.

Bug: webrtc:10913
Change-Id: I1030fef593ba56416deeb13b80d2f3812bffb9ed
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161012
Commit-Queue: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29951}
2019-11-28 17:44:40 +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
17e4c58318 Adding parametrization of the AEC3 howling mitigation behavior
Bug: webrtc:8671,b/145243047
Change-Id: If5bcbb66b72278b901a990cb9d6e11e42c9ac592
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/160781
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29930}
2019-11-27 11:56:17 +00:00
Per Åhgren
e14cb99408 Correct/update the activation of the multi-channel processing in APM
This CL removes the experimental status of the multi-channel processing
in APM, and accordingly updates the variable naming.

It also splits the activation of multi-channel processing to be separate
for render and capture.


Bug: webrtc:10859
Change-Id: I0e5d04dcb94b6637c33d97146231b8ddddbaea39
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/160707
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29926}
2019-11-27 10:15:25 +00:00
Per Åhgren
2a6b3b1f7f Correcting the analog AGC re-initialization at device changes
This CL corrects the re-initialization behavior of the analog
AGC to work correctly when the AGC is reinitialized.

Bug: webrtc:11131
Change-Id: Ie455ba3db1aa3936cbcbb2fab023528124853284
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/160650
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29924}
2019-11-26 20:30:20 +00:00
Per Åhgren
27bd76bcb2 DCHECKing for deprecated 8kHz support in AGC and changing fuzzer
This CL adds a DCHECK for the deprecated 8 kHz rate in APM.
It also updates the agc fuzzer code to properly do band-split on
the signals, and not send 8 kHz signals into the AGC.

Bug: chromium:1028092,chromium:1028172
Change-Id: I1e7c8d721834310e94b0e21efea07f75da837cab
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/160600
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29914}
2019-11-26 11:10:54 +00:00
Gustaf Ullberg
f534a64047 AEC3: Sub-band nearend detector
Implements an alternative to the dominant nearend detector.

Bug: b/130016532
Change-Id: If4867d58aad036ccf4e456ef81689b8db0284f7d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159865
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29906}
2019-11-25 16:26:49 +00:00
Per Åhgren
77dc19905d Changed the digital AGC1 gain to properly support multichannel
Beyond making the digital AGC1 code properly support
multichannel, this CL also
-Removes deprecated debug logging code.
-Converts the gain application to be fully in floating point
 which
--Is less computationally complex.
--Does not quantize the samples to 16 bit before applying the
  gains.

Bug: webrtc:10859
Change-Id: I6020ba8ae7e311dfc93a72783a2bb68d935f90c5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159861
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29886}
2019-11-23 08:42:59 +00:00
Per Åhgren
e35b32c29f AGC: Removing unnneccessary copying and changing to using const
The changes have been shown to be bitexact on a large dataset.

Bug: webrtc:10859
Change-Id: Iedc0e9e944ebfabb717dd7fb4d2682c695da883e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159694
Reviewed-by: Benjamin Wright <benwright@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Benjamin Wright <benwright@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29883}
2019-11-22 20:14:16 +00:00
Sam Zackrisson
9cb06610d2 Add multi-channel support to AECM
AECM only supports up to two capture channels, this CL extends it to arbitrary channel counts.

Bug: webrtc:10859
Change-Id: Id56ca633cd9de706fa1254bfa8153de88de0ef70
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/160340
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29880}
2019-11-22 17:16:53 +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
c20a19cc4b Allow extracting the linear AEC output
This CL enables extracting the linear AEC output,
allowing for more straightforward
testing/development.

Bug: b/140823178
Change-Id: I14f7934008d87066b35500466cb6e6d96f811688
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153672
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29789}
2019-11-13 11:33:53 +00:00
Mirko Bonadei
d4002a733d RTC_EXPORT missing symbols for Chromium's component build.
This CL adds a dependecy on rtc_base/system:rtc_export to rtc_event but
only when built as part of Chromium (since rtc::Event should not be
used outside of WebRTC).

It also adds other missing RTC_EXPORTS.

Bug: webrtc:9419
Change-Id: Ib338004a5404a6b3c7929e146c29ad42572632cc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159692
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29781}
2019-11-12 21:50:01 +00:00
Alessio Bazzica
7587de476b APM runtime setting: fix kPlayoutVolumeChange not dispatched
Bug: webrtc:10608
Change-Id: Ied2e8db1f9914217c6001e0da79c19e2b414056d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159560
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29755}
2019-11-11 13:54:03 +00:00
Gustaf Ullberg
2c6f373a27 Remove legacy EchoControlFactory::Create
Bug: webrtc:10913
Change-Id: I34af9abe76f5b08d7dc5c3e0281fafc14a71eed8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159031
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29741}
2019-11-08 09:58:27 +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
b49aec5f85 Correcting the AGC saturation detection for multichannel input
This CL changes the AGC saturation detection so that saturations only
in one mic channel is counted equally bad as saturations in more than
one channel.

Bug: webrtc:10859
Change-Id: I3cf9fce17c2dd51a70365cc408fe6276944b4b19
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159021
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29731}
2019-11-07 16:03:51 +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
Alessio Bazzica
7c19a706b0 Audio Processing Module: add play-out audio device runtime information
Add a runtime setting that notifies play-out audio device changes.
The payload is a pair indicating a device id and its maximum play-out
volume.

kPlayoutVolumeChange is now forwarded not only to capture, but also
render (required by render_pre_processor).

Bug: webrtc:10608
Change-Id: I8997c207422c1dcd1d53775397d6290939ef3db8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159002
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29725}
2019-11-07 13:33:09 +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
Alessio Bazzica
b81ab995a2 RNN VAD: Optimize GRU (recurrent) weights optimized layout
This CL adds the GRU weights memory layout optimization with which it
will be easier to add SSE2 code in a follow up CL. The new memory
layout also improves the performance of the unoptimized code.

This CL also includes a bug fix in the GRU layer input validation.
It was a silent bug since the GRU layer of the RNN VAD has the same
input and output size. This was caught by changing memory layout of
the recurrent weights. The unit test has been adapted by removing the
unused recurrent weights (the expected result does not change).

Bug: webrtc:10480
Change-Id: Ia1551abde4cb24aa7e109c4447e0fffe7c839077
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/142177
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29717}
2019-11-06 21:51:07 +00:00
Alessio Bazzica
d58fdbedcf RNN VAD: FC layer with SSE2 impl
This CL adds the SSE2 optimized implementation for fully connected
(FC) layers. The change includes a weights re-alignment op done once
at construction time. It is required in order to optimize the load op
to fill 128 bit registers.

This CL also includes unit test adaptations and a benchmark test
(disabled by default).

Bug: webrtc:10480
Change-Id: I5ed87f0a629faaaf4c8bffbce1cea5557518f8c8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/141862
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29712}
2019-11-06 17:47:09 +00:00
Alessio Bazzica
43afc09fc5 Reland "RNN VAD: prepare for SIMD optimization"
This reverts commit 5ab21f8853.

Reason for revert: downstream fixed

Original change's description:
> Revert "RNN VAD: prepare for SIMD optimization"
> 
> This reverts commit 7350a90237.
> 
> Reason for revert: possibly breaking downstream projects
> 
> Original change's description:
> > RNN VAD: prepare for SIMD optimization
> > 
> > This CL adds the boilerplate for SIMD optimization of FC and GRU layers
> > in rnn.cc. The same scheme of AEC3 has been used. Unit tests for the
> > optimized architectures have been added (the same unoptimized
> > implementation will run).
> > 
> > Minor changes:
> > - unnecessary const removed in rnn.h
> > - FC and GRU test data in the anon namespace as constexpr
> > 
> > Bug: webrtc:10480
> > Change-Id: Ifae4e970326e7e7c603d49aeaf61194b5efdabd3
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/141419
> > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> > Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#29696}
> 
> TBR=gustaf@webrtc.org,alessiob@webrtc.org,fhernqvist@webrtc.org
> 
> Change-Id: I9ae82f4bd2d30797646fabfb5ad16bea378208b8
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10480
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158893
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29699}

TBR=gustaf@webrtc.org,alessiob@webrtc.org,fhernqvist@webrtc.org

Change-Id: I33edd144f7ac795bf472aae9fa5a79c326000443
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10480
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159001
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29708}
2019-11-06 14:42:46 +00:00
Alessio Bazzica
5ab21f8853 Revert "RNN VAD: prepare for SIMD optimization"
This reverts commit 7350a90237.

Reason for revert: possibly breaking downstream projects

Original change's description:
> RNN VAD: prepare for SIMD optimization
> 
> This CL adds the boilerplate for SIMD optimization of FC and GRU layers
> in rnn.cc. The same scheme of AEC3 has been used. Unit tests for the
> optimized architectures have been added (the same unoptimized
> implementation will run).
> 
> Minor changes:
> - unnecessary const removed in rnn.h
> - FC and GRU test data in the anon namespace as constexpr
> 
> Bug: webrtc:10480
> Change-Id: Ifae4e970326e7e7c603d49aeaf61194b5efdabd3
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/141419
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29696}

TBR=gustaf@webrtc.org,alessiob@webrtc.org,fhernqvist@webrtc.org

Change-Id: I9ae82f4bd2d30797646fabfb5ad16bea378208b8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10480
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158893
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29699}
2019-11-05 21:46:16 +00:00
Alessio Bazzica
7350a90237 RNN VAD: prepare for SIMD optimization
This CL adds the boilerplate for SIMD optimization of FC and GRU layers
in rnn.cc. The same scheme of AEC3 has been used. Unit tests for the
optimized architectures have been added (the same unoptimized
implementation will run).

Minor changes:
- unnecessary const removed in rnn.h
- FC and GRU test data in the anon namespace as constexpr

Bug: webrtc:10480
Change-Id: Ifae4e970326e7e7c603d49aeaf61194b5efdabd3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/141419
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29696}
2019-11-05 18:34:15 +00:00
Gustaf Ullberg
5ea5749a86 AEC3: Multichannel suppressor
This change adds multichannel support to the AEC3 suppressor.
Processing of mono capture is bit-exact to the previous code.

Bug: webrtc:10913
Change-Id: I89affe3e066021bc34e4b525edf44dd3bea68365
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158882
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29692}
2019-11-05 15:51:39 +00:00
Per Åhgren
4e5c709ed4 Reland "Correct AEC3 multichannel functionality activation"
This is a reland of 9dda1b3a48

Original change's description:
> Correct AEC3 multichannel functionality activation
> 
> This CL corrects the AEC3 multichannel activation
> to also work for the case when a factory is used
> for the activation.
> 
> Bug: webrtc:10913
> Change-Id: Ic2807d8bcef759261fde14447cff30633ba248dc
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158794
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29676}

Bug: webrtc:10913
Change-Id: I1cb3d0de61ea0b299158ca85433f2442c65c196f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158886
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29690}
2019-11-05 14:38:49 +00:00
Per Åhgren
1983458981 Revert "Reland "Correct AEC3 multichannel functionality activation""
This reverts commit d5a7838926.

Reason for revert: Causing errors in downstream tests.

Original change's description:
> Reland "Correct AEC3 multichannel functionality activation"
> 
> This is a reland of 9dda1b3a48
> 
> Original change's description:
> > Correct AEC3 multichannel functionality activation
> > 
> > This CL corrects the AEC3 multichannel activation
> > to also work for the case when a factory is used
> > for the activation.
> > 
> > Bug: webrtc:10913
> > Change-Id: Ic2807d8bcef759261fde14447cff30633ba248dc
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158794
> > Commit-Queue: Per Åhgren <peah@webrtc.org>
> > Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#29676}
> 
> Bug: webrtc:10913
> Change-Id: Ibfe4e8a51183390a4054514bb294c89c2ea201e9
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158880
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29685}

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

Change-Id: I6e27bc7fd1c9d4d5550fdc6ae14c39ca84fb03f8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10913
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158883
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29687}
2019-11-05 09:54:06 +00:00
Per Åhgren
d5a7838926 Reland "Correct AEC3 multichannel functionality activation"
This is a reland of 9dda1b3a48

Original change's description:
> Correct AEC3 multichannel functionality activation
> 
> This CL corrects the AEC3 multichannel activation
> to also work for the case when a factory is used
> for the activation.
> 
> Bug: webrtc:10913
> Change-Id: Ic2807d8bcef759261fde14447cff30633ba248dc
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158794
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29676}

Bug: webrtc:10913
Change-Id: Ibfe4e8a51183390a4054514bb294c89c2ea201e9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158880
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29685}
2019-11-05 09:11:23 +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
cc9bf6398c Revert "Correct AEC3 multichannel functionality activation"
This reverts commit 9dda1b3a48.

Reason for revert: The CL is causing downstream issues

Original change's description:
> Correct AEC3 multichannel functionality activation
> 
> This CL corrects the AEC3 multichannel activation
> to also work for the case when a factory is used
> for the activation.
> 
> Bug: webrtc:10913
> Change-Id: Ic2807d8bcef759261fde14447cff30633ba248dc
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158794
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29676}

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

Change-Id: Ic487f77f5c11485a0f25a2a1d3797d0ec956f913
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10913
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158797
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29678}
2019-11-04 08:49:30 +00:00
Per Åhgren
9dda1b3a48 Correct AEC3 multichannel functionality activation
This CL corrects the AEC3 multichannel activation
to also work for the case when a factory is used
for the activation.

Bug: webrtc:10913
Change-Id: Ic2807d8bcef759261fde14447cff30633ba248dc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158794
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29676}
2019-11-04 08:23:27 +00:00
Alessio Bazzica
8846c8af85 RNN VAD: cast and scale quantized weights at init
This CL has two goals: (i) avoid casting and scaling of the NN weights
for every processed feature vector and (ii) prepare for SIMD
optimizations.

Bug: webrtc:10480
Change-Id: Ice7bac5657123354714cc7c63b00abbb8a76c7d7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/141413
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Fredrik Hernqvist <fhernqvist@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29675}
2019-11-01 16:44:59 +00:00
Gustaf Ullberg
caaa9e73d7 AEC3: Handle multichannel audio in single CNG instance
Instead of having a comfort noise generator (CNG) instance per capture
channel, one instance handles CNG for all capture channels.

Bug: webrtc:10913
Change-Id: I897471be6d203ad750c517c5076d421f2ae3879b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158780
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29668}
2019-10-31 14:51:35 +00:00
Per Åhgren
0cbb58e046 Reland "Refactoring of the noise suppressor and adding true multichannel support"
This is a reland of 87a7b82520

Original change's description:
> Refactoring of the noise suppressor and adding true multichannel support
> 
> This CL adds proper multichannel support to the noise suppressor.
> To accomplish that in a safe way, a full refactoring of the noise
> suppressor code has been done.
> 
> Due to floating point precision, the changes made are not entirely
> bitexact. They are, however, very close to being bitexact.
> 
> As a safety measure, the former noise suppressor code is preserved
> and a kill-switch is added to allow revering to the legacy noise
> suppressor in case issues arise.
> 
> Bug: webrtc:10895, b/143344262
> Change-Id: I0b071011b23265ac12e6d4b3956499d122286657
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158407
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29646}

Bug: webrtc:10895, b/143344262
Change-Id: I236f1e67bb0baa4e30908a4cf7a8a7bb55fbced3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158747
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29663}
2019-10-31 11:56:01 +00:00
Artem Titov
4778f6ce7a Revert "Refactoring of the noise suppressor and adding true multichannel support"
This reverts commit 87a7b82520.

Reason for revert: Speculative revert. Breaks downstream projects.

Original change's description:
> Refactoring of the noise suppressor and adding true multichannel support
> 
> This CL adds proper multichannel support to the noise suppressor.
> To accomplish that in a safe way, a full refactoring of the noise
> suppressor code has been done.
> 
> Due to floating point precision, the changes made are not entirely
> bitexact. They are, however, very close to being bitexact.
> 
> As a safety measure, the former noise suppressor code is preserved
> and a kill-switch is added to allow revering to the legacy noise
> suppressor in case issues arise.
> 
> Bug: webrtc:10895, b/143344262
> Change-Id: I0b071011b23265ac12e6d4b3956499d122286657
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158407
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29646}

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

Change-Id: I4d4025bda01f484979961fe57380a705e4d78397
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10895, b/143344262
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158701
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29651}
2019-10-30 09:49:31 +00:00
Per Åhgren
ae40e19805 AEC3: Adding a configurable render signal gain
Bug: webrtc:8671
Change-Id: I405d669517382ce195065caa3147eabace5ec18a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158669
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29647}
2019-10-29 23:26:38 +00:00
Per Åhgren
87a7b82520 Refactoring of the noise suppressor and adding true multichannel support
This CL adds proper multichannel support to the noise suppressor.
To accomplish that in a safe way, a full refactoring of the noise
suppressor code has been done.

Due to floating point precision, the changes made are not entirely
bitexact. They are, however, very close to being bitexact.

As a safety measure, the former noise suppressor code is preserved
and a kill-switch is added to allow revering to the legacy noise
suppressor in case issues arise.

Bug: webrtc:10895, b/143344262
Change-Id: I0b071011b23265ac12e6d4b3956499d122286657
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158407
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29646}
2019-10-29 23:23:38 +00:00
Gustaf Ullberg
cb30726646 Remove deprecated Audio Processing APIs
This change removes the deprecated ChannelLayout versions of ProcessStream
and AnalyzeReverseStream.

Bug: webrtc:5298
Change-Id: I8a7e33e89cffac5eceecd00dfd3c96000643f51b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158529
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29641}
2019-10-29 10:07:08 +00:00
Sam Zackrisson
70770accb3 Make AudioFrame member instead of raw pointer in APM test fixture
Bug: webrtc:11045
Change-Id: I35adbb675185629088ee8fd65ef4be74276c9db3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158085
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29632}
2019-10-28 15:34:29 +00:00
Sam Zackrisson
e277bde7e4 Add APM test of pre-amplifier gain
This tests that both the ApplyConfig() and SetRuntimeSetting() route of
APM configuration correctly induce the pre-amplifier gain effect in APM.

Bug: webrtc:11045
Change-Id: Iddaa1c19487c6f68ed6eb1be6913ec2dfd284b04
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158083
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29607}
2019-10-25 08:50:54 +00:00
Gustaf Ullberg
3cb6104864 AEC3: Support negative delay with external delay estimator
Bug: b/130016532
Change-Id: If41121e9ad95f235200c4b6b146ba8a8749daac4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158220
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29602}
2019-10-24 14:33:21 +00:00
Sam Zackrisson
21bfa401dd Update APM config on RuntimeSetting pre amplifier gain change
Bug: webrtc:11045
Change-Id: I78c777632a46e1f8ebf96f4a64c4e1738184d350
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158081
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29586}
2019-10-23 12:34:35 +00:00
Gustaf Ullberg
8c51f2e9cd AnalyzeReverseStream with StreamConfig
Adding a version of AnalyzeReverseStream with audio parameters
described by StreamConfig. This is part of preparations for
multichannel APM in Chromium.

Bug: webrtc:10913
Change-Id: I7c4650eab8bd7fcdec970a7e4a8fa203f09bed9e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157897
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29573}
2019-10-22 14:27:14 +00:00
Sam Zackrisson
72cc71cd70 Harmonize APM config logging, update config ToString
It is unclear what configuration the APM is running with.
This CL helps some of that. Note that the webrtc::Config
is still not reported.

Bug: webrtc:5298
Change-Id: Icc2cf0b20634c04d567c0951a57ba6fe7aa5c5b4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157423
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29555}
2019-10-21 11:35:40 +00:00
Mirko Bonadei
3663ed3ad6 Move rtc_base/ignore_wundef.h to its own target.
Since rtc_base/ignore_wundef.h doesn't have any dependency, it is easy to
move it to its own target and allow its dependant to avoid to take a
dependency rtc_base:on rtc_base_approved.

Bug: webrtc:9419
Change-Id: I17f205b0cb2b21cad388b04e60082df9398dffdf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157428
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29548}
2019-10-19 10:50:36 +00:00
Sam Zackrisson
6e5433c4d4 AEC3: Multi channel ERL estimator
The estimator will simply compute the worst value of all combinations
of render and capture signal.

This has the drawback that low-volume or silent render channels may
severely misestimate the ERL.

The changes have been shown to be bitexact over a large dataset.

Bug: webrtc:10913
Change-Id: Id53c3ab81646ac0fab303edafc5e38892d285d8e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157308
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29542}
2019-10-18 16:03:46 +00:00
saza
1d60052967 Delete ApmPublicSubmodules, fix ApmPrivateSubmodules, ApmSubmoduleStates
All submodule pointers are now private.

The unique_ptr to a ApmPrivateSubmodules is replaced by a direct member
object.

The main outcome of this CL is that the code is nicer.

Bug: webrtc:5298
Change-Id: Ib8ef70a35a64b875752d2a318c572d152d51487a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157440
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29539}
2019-10-18 14:23:50 +00:00
Per Åhgren
119e2197b7 AEC3: General cleanup after multichannel changes
This CL contains various cleanups/corrections to the multichannel AEC
code.

The changes have been shown to be bitexact over a large dataset.

Bug: webrtc:10913
Change-Id: Idd3e410b04527666e052f57ad81d0ac9eef3179b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157173
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29530}
2019-10-18 07:43:49 +00:00
Sam Zackrisson
98872dc556 AEC3: Update SpectrumBuffer API
- RenderBuffer::Spectrum() loses its channel argument, allowing for
  greater flexibility in passing the multi-channel spectrum data into
  functions.
- The FFT spectra lengths are made compile-time constant, rendering
  some DCHECKs obsolete.

Bug: webrtc:10913
Change-Id: Ied0c50cf72d974cfef7279fd2b9c572d049b8b16
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157104
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29528}
2019-10-18 07:01:42 +00:00
Mirko Bonadei
86d053c2db Use source_sets in component builds and static_library in release builds.
Static libraries don't guarantee that an exported symbol gets linked
into a shared library (and in order to support Chromium's component
build mode, WebRTC needs to be linked as a shared library).

Source sets always pass all the object files to the linker.

On the flip side, source_sets link more object files in release builds
and to avoid this, this CL introduces a the GN template "rtc_library" that
expands to static_library during release builds and to source_set during
component builds.

See: https://gn.googlesource.com/gn/+/master/docs/reference.md#func_source_set

Bug: webrtc:9419
Change-Id: I4667e820c2b3fcec417becbd2034acc13e4f04fe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157168
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#29525}
2019-10-17 21:17:18 +00:00
Per Åhgren
88d662ac69 AEC3: Removed some usages of DirectPathFilterDelays
Bug: webrtc:10913
Change-Id: Idb2428fcbebde0b4a705ef86185a87605f8ee757
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157165
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29523}
2019-10-17 19:13:04 +00:00
Per Åhgren
785d4c40ca AEC3: Add multichannel support in the ERLE estimation
Bug: webrtc:10913
Change-Id: I1667146d38dc99d099b140f47cd774a7f203b4f0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157047
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29521}
2019-10-17 17:34:18 +00:00
Henrik Lundin
4970670c78 Avoid reading outside of memory in WebRtcVad_FindMinimum
Also, change test target from rtc_static_library to rtc_source_set so that it is actually linked and run.

Bug: webrtc:11010, webrtc:11037
Change-Id: I05173718ee7de8a9fad73b62c0efd0da4d4f1a7e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157166
Commit-Queue: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29509}
2019-10-17 10:59:49 +00:00
saza
0bad15f2ed Remove the noise_suppression() pointer to submodule interface
Bug: webrtc:9878
Change-Id: I356afddb56cc1957e9d0415e2723f66e0e4ac522
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/137517
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29499}
2019-10-16 11:55:15 +00:00
Sam Zackrisson
ffc8452730 AEC3: Add support for logging warnings on delay buffer changes
This reintroduces the WARNING log level of a previous CL [1],
via a default-off config flag.

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

Bug: None
Change-Id: Ica8583cbb24a1611cfc684ae02d5a0f582004024
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156566
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29489}
2019-10-15 12:16:51 +00:00
Per Åhgren
8718afb283 AEC3: Made EchoAudibility multichannel
This CL corrects the EchoAudibility and StationarityEstimator
code to work properly with multiple channels.

It also changes the naming of the FilterDelayBlocks() method
to better reflect what it does.

The changes have been verified to be bitexact over a large number
of recordings.

Bug: webrtc:10913
Change-Id: I070b531efcdff4c33f70fd5b37fbb556dcebe5b4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156565
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29482}
2019-10-15 09:25:46 +00:00
Sam Zackrisson
41478c7c1b Remove AudioProcessing::gain_control() getter
This change also resolves a bug in audioproc_f:
The implicit ApplyConfig calls to enable gain control settings in
aec_dump_simulator.cc:377-406 [1] are overwritten by the ApplyConfig
call on line 500 using a config from line 292.

Compared to a ToT build including a fix for that bug, these changes
are bitexact on a large number of aecdumps.

[1] https://cs.chromium.org/chromium/src/third_party/webrtc/modules/audio_processing/test/aec_dump_based_simulator.cc?l=377&rcl=8bbf9e2c6e40feb8efcbf276b43945a14d651e9b

Bug: webrtc:9878
Change-Id: Id427d34e838c999d996d58193977ac2a9198edd6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156463
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29481}
2019-10-15 09:23:16 +00:00
Mirko Bonadei
35214fcfe2 Add missing RTC_EXPORT for the component build.
Bug: webrtc:9419
Change-Id: I3225259fb4cc55e9820f590928795f4587f1e3cb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153884
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29479}
2019-10-15 09:07:44 +00:00
Per Åhgren
8be669fd96 AEC3: Add support for multiple channels to the reverb modelling
This CL adds support for multiple channels in the reverb
modelling. As a side effect, it also partly adds multi-channel
supports for the sections of the code.

Beyond adding the multi-channel support, a bug is fixed as part of
this CL. Since the bug fix affects the bitexactness, as a safety
precaution the CL includes the ability to override the bugfix.

Apart from the contributions from the bugfix, the changes have
been verified to be bitexact for a large set of mono recordings.

Bug: webrtc:10913
Change-Id: I1f307b532be85ef4182f8db41384f44d40a25219
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156382
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29456}
2019-10-11 21:49:58 +00:00
saza
6787f232ae Remove AudioProcessing::level_estimator() getter
The new configuration path is via AudioProcessing::ApplyConfig and
AudioProcessing::GetStatistics.

Bug: webrtc:9878
Change-Id: Ic912d67455fcef4895566edb8fef62baf62d7cfe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156440
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29454}
2019-10-11 18:08:17 +00:00
Gustaf Ullberg
3c918b1af8 Fix bypass of unnecessary resampling
This change fixes an issue with bypass of unnecessary resampling
when using ProcessStream(AudioFrame*).

Bug: b/130016532
Change-Id: I887f05d55aaa47f21164ba237cf83d0be33a1fd5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156540
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29446}
2019-10-11 11:57:36 +00:00
Gustaf Ullberg
8675eeec26 Bypass unnecessary resampling.
This change keeps the original 48 kHz signal and uses it for the
fullband processing given that the following requirements are
fulfilled:
- Input signal is 48 kHz
- Output signal is 48 kHz
- Multiband processing is performed at 32 kHz
- The multiband processing does not modify the original signal
This avoids unnecessary, lossy resampling and band merging.

Bug: b/130016532
Change-Id: I690c26faba07eab0cbff6c0a95a81d89255dd1a1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155966
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29425}
2019-10-10 08:38:41 +00:00
Per Åhgren
f9807259a6 AEC3: Send the spectral power estimates for all channels to AecState
This CL passes the spectral power estimates for all channels into
the AecState.

Bug: webrtc:10913
Change-Id: Ie3b5c443be0c63f205e23ed2bfea06d9c447eb39
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156165
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29417}
2019-10-09 12:51:21 +00:00
Gustaf Ullberg
422b9e0982 Run fullband processing at output rate on ARM
The audio processing in the band-split domain on ARM platforms
operate at a sampling frequency of 32 kHz. This CL upsamples
the signal to fullband before the "fullband processing"
if an output rate of 48 kHz is chosen.

Change-Id: I268acd33aff1fcfa4f75ba8c0fb3e16abb9f74e8
Bug: b/130016532
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155640
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29415}
2019-10-09 12:09:06 +00:00
Per Åhgren
1d3008bfc6 AEC3: Remove redundant class
This CL removes the redundant class in preparation
for adding multichannel functionality to the
reverb computation.

The changes are bitexact.

Bug: webrtc:10913
Change-Id: I284665f7143cb5e1c79bfa573638fdff5f2411c9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155960
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29414}
2019-10-09 10:57:17 +00:00
Sam Zackrisson
0169a3e5cc Delete AecState::EchoPathGain()
Follow-up CL to https://webrtc-review.googlesource.com/c/src/+/155363
The value is computed, and only used, within AecState::Update().

Bug: webrtc:10913
Change-Id: I4e4248452a463f654c0310657b49c74ffa4c55b6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156161
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29412}
2019-10-09 07:45:45 +00:00
Sam Zackrisson
46b0140172 Update filter analyzer for multi channel
Multi-channel behaviors introduced in this CL:

- All filters are analyzed independently. The filtering is considered
consistent if any filter is consistent.

- The filter echo path gain used to detect saturation is maxed across
capture channels.

- The filter delay is taken to be the minimum of all filters:
Any module that looks in the render data starting from the filter
delay will iterate over all render audio present in any channel.

- The FilterAnalyzer will consider a render block to be active if any
render channel has activity.

The changes in the CL has been shown to be bitexact on a
large set of mono recordings.

Bug: webrtc:10913
Change-Id: I1e360cd7136ee82d1f6e0f8a1459806e83f4426d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155363
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29408}
2019-10-08 15:44:43 +00:00
Per Åhgren
b4161d3c0d AEC3: Add multichannel support to the residual echo estimator
This CL adds support for multichannel in the residual echo
estimator code. It also adds placeholder functionality in
the surrounding code to ensure that the residual echo
estimator receives the require inputs.

The changes in the CL has been shown to be bitexact on a
large set of mono recordings.

Bug: webrtc:10913
Change-Id: I726128ca928648b1dcf36c5f479eb243f3ff3f96
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155361
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29400}
2019-10-08 11:18:35 +00:00
Sam Zackrisson
0824c6f61a Delete voice_detection() pointer to submodule
The new configuration path is via AudioProcessing::ApplyConfig and
AudioProcessing::GetStatistics.

ApmTest.Process passes with unchanged reference files if
audio_processing_impl would initialize the VAD with
VoiceDetection::kLowLikelihood instead of kVeryLowLikelihood.
This was verified by testing this CL with that modification.

Bug: webrtc:9878
Change-Id: I4d08df37a07e5c72feeec02a07d6b9435f917d72
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155445
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29395}
2019-10-07 13:06:05 +00:00
Per Åhgren
b441acf656 AEC3: Add support in the echo subtractor for handling multiple channels
This CL adds support in the echo subtractor for handling multiple
capture and render channels.

The changes have passed bitexactness tests for substantial set
of mono recordings.

Bug: webrtc:10913
Change-Id: Ib448c9edf172ebc31e8c28db7b2f2a389a53adb9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155168
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29389}
2019-10-05 07:45:47 +00:00
Sam Zackrisson
8f736c0aeb AEC3: Analyze multi-channel SubtractorOutput in AecState
Updates SubtractorOutputAnalyzer and AecState::SaturationDetector
to multi-channel.

Bug: webrtc:10913
Change-Id: I39edafdc5d5a4db5cc853cf116d60af0f506b3bf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/154342
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29355}
2019-10-01 11:36:58 +00:00
Sam Zackrisson
32eae4c231 AEC3: use different seed for different channels in CNG
Bug: webrtc:10913
Change-Id: Idca6be02b54b67753cfaf6ff588f5271e0cce892
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155160
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29344}
2019-09-30 13:04:00 +00:00
Per Åhgren
7bdf073c1c First step of adding multi-channel support to the echo subtractor
This CL contains the first step of adding multi-channel support to the
echo subtractor.

The CL is bitexact for the mono case.

Bug: webrtc:10913
Change-Id: I10647b45c692bc001407afc6ff00e26a3e2cffaa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/154356
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29303}
2019-09-25 13:27:56 +00:00
Per Åhgren
0e3b1ff8c4 Moving e to comply to the rest of the stack/heap storage scheme
Bug: webrtc:10913
Change-Id: I7dada71fb86e1c7eea27d0aec01b870fd0a6a15e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/154347
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29300}
2019-09-25 11:09:22 +00:00
Gustaf Ullberg
7911d3705c AEC3: Simplify use of SignalTransition
Simplifying the use of signal transition and removing unused code.

Bug: webrtc:8671
Change-Id: I0b845405727936b2fa7df7c92ad2e83bea3bc823
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/154348
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29298}
2019-09-25 09:00:24 +00:00
Gustaf Ullberg
af3fdc069d AEC3: Suppression filter handles multiple channels
Suppression filter is extended to support the synthesis
of multiple channels. This CL is also a major clean-up of ApplyGain.

The CL has been tested for bit-exactness for single channel output.

Bug: webrtc:10913
Change-Id: I1319f127981552e17dec66701a248d34dcf0e563
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/154341
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29284}
2019-09-24 13:50:04 +00:00
Gustaf Ullberg
a99b89b41c AEC3: Echo remover handles multiple capture signals.
Echo remover processes all microphone signals. Suppression gains are
computed separately for each capture signal. The minimum gains determine
the final suppression gains applied.

Only the first channel is synthesized. A follow-up CL will add the
synthesis of the remaining channels.

Bug: webrtc:10913
Change-Id: Ife7e74c9a9c6c208fca3992e3cfa840b6b7afcfa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153526
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29269}
2019-09-23 14:43:50 +00:00
Sam Zackrisson
feee1e4c36 Add flag to APM to force multichannel even with AEC3
Currently, APM fakes multichannel in two ways:
 - With injected AECs, capture processing is only performed on the left
channel. The result is copied into the other channels.
 - With multichannel render audio, all channels are mixed into one
before analysing.

This CL adds a flag to disable these behaviors, ensuring proper
multichannel processing happens throughout the APM pipeline.

Adds killswitches to separately disable render / capture multichannel.

Additionally - AEC3 currently crashes when running with multichannel.
This CL adds the missing pieces to at least have it run without
triggering any DCHECKS, including making the high pass filter properly
handle multichannel.

Bug: webrtc:10913, webrtc:10907
Change-Id: I38795bf8f312b959fcc816a056fba2c68d4e424d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/152483
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29248}
2019-09-20 06:36:12 +00:00
Mirko Bonadei
317a1f09ed Use std::make_unique instead of absl::make_unique.
WebRTC is now using C++14 so there is no need to use the Abseil version
of std::make_unique.

This CL has been created with the following steps:

git grep -l absl::make_unique | sort | uniq > /tmp/make_unique.txt
git grep -l absl::WrapUnique | sort | uniq > /tmp/wrap_unique.txt
git grep -l "#include <memory>" | sort | uniq > /tmp/memory.txt

diff --new-line-format="" --unchanged-line-format="" \
  /tmp/make_unique.txt /tmp/wrap_unique.txt | sort | \
  uniq > /tmp/only_make_unique.txt
diff --new-line-format="" --unchanged-line-format="" \
  /tmp/only_make_unique.txt /tmp/memory.txt | \
  xargs grep -l "absl/memory" > /tmp/add-memory.txt

git grep -l "\babsl::make_unique\b" | \
  xargs sed -i "s/\babsl::make_unique\b/std::make_unique/g"

git checkout PRESUBMIT.py abseil-in-webrtc.md

cat /tmp/add-memory.txt | \
  xargs sed -i \
  's/#include "absl\/memory\/memory.h"/#include <memory>/g'
git cl format
# Manual fix order of the new inserted #include <memory>

cat /tmp/only_make_unique | xargs grep -l "#include <memory>" | \
  xargs sed -i '/#include "absl\/memory\/memory.h"/d'

git ls-files | grep BUILD.gn | \
  xargs sed -i '/\/\/third_party\/abseil-cpp\/absl\/memory/d'

python tools_webrtc/gn_check_autofix.py \
  -m tryserver.webrtc -b linux_rel

# Repead the gn_check_autofix step for other platforms

git ls-files | grep BUILD.gn | \
  xargs sed -i 's/absl\/memory:memory/absl\/memory/g'
git cl format

Bug: webrtc:10945
Change-Id: I3fe28ea80f4dd3ba3cf28effd151d5e1f19aff89
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153221
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29209}
2019-09-17 15:47:29 +00:00
Per Åhgren
fcbe4071ce Adding more refined control over choice of band-splitting
This CL allows the user to have more refined control over what band
splitting-scheme is used inside the audio processing module.


Bug: webrtc:6181
Change-Id: I236c3b1f96ab80cc4ffb8c39c045c034764567a1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/152480
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29189}
2019-09-14 23:14:17 +00:00
Sam Zackrisson
3f17221d98 AEC3: Make RenderSignalAnalyzer multi-channel
In this CL:
 - Render signal analyzer considers a frequency bin a narrow band
(peak) if any channel exhibits narrowband (-peak) behavior.
 - The unit tests have to fill frames with noise because small
inaccuracies in the FFT spectrum lead to consistent "narrow bands"
despite spectrum being essentially flat.

Bug: webrtc:10913
Change-Id: I8fa181412c0ee1beeacfda37ffef18251d5f0cd7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151912
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29176}
2019-09-13 06:07:09 +00:00
Per Åhgren
f6aa572e36 First step for introducing multichannel support for the AEC3 capture
This CL introduces the handling of multiple microphone channels in
the EchoRemover layer.
The implementation is done such as to support an arbitrary number of
channels in a way that balances stack and heap-space usage.

Bug: webrtc:10913
Change-Id: I475369de6c463b8fe2d7e53799d7322eefb6938f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151647
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29140}
2019-09-10 16:44:18 +00:00
Gustaf Ullberg
ee84d39fce AEC3: Downmix multichannel signals before delay estimation
Multichannel signals are downmixed to mono before decimation and
delay estimation. This is useful when not all channels play
audio content. The feature can be toggled in the AEC3 configuration.

Bug: webrtc:10913
Change-Id: I7d40edf7732bb51fec69e7f3ca063d821c5069c4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151762
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29126}
2019-09-10 08:16:07 +00:00
Sam Zackrisson
e611f19c32 Remove completed TODOs
Bug: webrtc:10913
Change-Id: I0a47b50ad04a1b4e5ba3416c6e74efe79ee73935
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151904
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29100}
2019-09-06 14:53:11 +00:00
Per Åhgren
d4e6904d40 AEC3: Reducing the complexity and heap usage of the adaptive filter
This CL reduces the complexity and heap usage of the adaptive filter
in AEC3 by avoiding to compute these for the shadow
filter. In particular it
-Moves to compute the ERL, frequency response and impulse response
 on an on-demand basis.
-Stores the ERL, frequency response and impulse response outside
 of the adaptive filter.

All the changes have been tested for bitexactness on a sizeable
amount of recordings.

Bug: webrtc:10913
Change-Id: If83c236a6e3f2e489be129b9ebf6143a72f521d1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151138
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29081}
2019-09-05 14:30:49 +00:00
Sam Zackrisson
cfb9497299 Add multi-channel to FftBuffer
All channels are populated by RenderDelayBuffer. but all other
dependent modules are hardcoded to do their regular mono processing
on the first channel.

Bug: webrtc:10913
Tested: Bitexactness on a large set of aecdumps
Change-Id: I11d11aa0ad3da0f244c0ec020d2c9f0f4a735834
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151640
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29079}
2019-09-05 14:10:04 +00:00
Sam Zackrisson
f3f6159114 Rename VectorBuffer->SpectrumBuffer, MatrixBuffer->BlockBuffer, BlockBuffer->Aec2BlockBuffer
The VectorBuffer and MatrixBuffer names are too generic for their use case.

Bug: webrtc:10913
Change-Id: Ideecd0d27e07487a85a61dc6474e69733d07dcd6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151602
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29076}
2019-09-05 10:53:24 +00:00
Sam Zackrisson
a81c09d5b6 Make VectorBuffer in AEC3 multi-channel
All dependent modules are hardcoded to do their regular mono processing on the first channel.

This _almost_ makes RenderBuffer multi-channel: FftData is still only mono.

Bug: webrtc:10913
Change-Id: Id5cc34dbabfe59e1cc72a9675dc7979794e870ed
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151139
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29074}
2019-09-05 09:03:47 +00:00
Per Åhgren
a33dc0144a AEC3: Propagate the number of channels to the adaptive filters
This CL propagates the number of render and capture channels into
the echo subtractor and the adaptive filters.

Bug: webrtc:10913
Change-Id: I5ffff24ff64b7cc0f262bf008b34b6dfca1e78f9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151300
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29059}
2019-09-04 09:32:14 +00:00
Per Åhgren
ce202a0f98 Reland "Reland "Add core multi-channel pipeline in AEC3 This CL adds basic the basic pipeline to support multi-channel processing in AEC3.""
This is a reland of a66395e72f

Original change's description:
> Reland "Add core multi-channel pipeline in AEC3 This CL adds basic the basic pipeline to support multi-channel processing in AEC3."
> 
> This is a reland of f3a197e553
> 
> Original change's description:
> > Add core multi-channel pipeline in AEC3
> > This CL adds basic the basic pipeline to support multi-channel
> > processing in AEC3.
> > 
> > Apart from that, it removes the 8 kHz processing support in several
> > places of the AEC3 code.
> > 
> > Bug: webrtc:10913
> > Change-Id: If5b75fa325ed0071deea94a7546cb4a7adf22137
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150332
> > Commit-Queue: Per Åhgren <peah@webrtc.org>
> > Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#29017}
> 
> Bug: webrtc:10913
> Change-Id: Ifc4b13bd994cfd22dca8f8755fa5700617cc379d
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151124
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29034}

Bug: webrtc:10913
Change-Id: Id8da5666df8c86f290c73ad5dc9958199f1a7ebe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151127
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29042}
2019-09-03 06:12:32 +00:00
Per Åhgren
d112c75801 Revert "Reland "Add core multi-channel pipeline in AEC3 This CL adds basic the basic pipeline to support multi-channel processing in AEC3.""
This reverts commit a66395e72f.

Reason for revert: Breaking downstream tests

Original change's description:
> Reland "Add core multi-channel pipeline in AEC3 This CL adds basic the basic pipeline to support multi-channel processing in AEC3."
> 
> This is a reland of f3a197e553
> 
> Original change's description:
> > Add core multi-channel pipeline in AEC3
> > This CL adds basic the basic pipeline to support multi-channel
> > processing in AEC3.
> > 
> > Apart from that, it removes the 8 kHz processing support in several
> > places of the AEC3 code.
> > 
> > Bug: webrtc:10913
> > Change-Id: If5b75fa325ed0071deea94a7546cb4a7adf22137
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150332
> > Commit-Queue: Per Åhgren <peah@webrtc.org>
> > Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#29017}
> 
> Bug: webrtc:10913
> Change-Id: Ifc4b13bd994cfd22dca8f8755fa5700617cc379d
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151124
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29034}

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

Change-Id: I0e9fd154da5910d73b7a4c82e4e588f3220fd39d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10913
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151126
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29038}
2019-09-02 13:57:07 +00:00
Per Åhgren
a66395e72f Reland "Add core multi-channel pipeline in AEC3 This CL adds basic the basic pipeline to support multi-channel processing in AEC3."
This is a reland of f3a197e553

Original change's description:
> Add core multi-channel pipeline in AEC3
> This CL adds basic the basic pipeline to support multi-channel
> processing in AEC3.
> 
> Apart from that, it removes the 8 kHz processing support in several
> places of the AEC3 code.
> 
> Bug: webrtc:10913
> Change-Id: If5b75fa325ed0071deea94a7546cb4a7adf22137
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150332
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29017}

Bug: webrtc:10913
Change-Id: Ifc4b13bd994cfd22dca8f8755fa5700617cc379d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151124
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29034}
2019-09-02 12:08:27 +00:00
Ilya Nikolaevskiy
e3e30ae5c5 Revert "Add core multi-channel pipeline in AEC3"
This reverts commit f3a197e553.

Reason for revert: Speculative revert, as this may'be broken some build bots

Original change's description:
> Add core multi-channel pipeline in AEC3
> This CL adds basic the basic pipeline to support multi-channel
> processing in AEC3.
> 
> Apart from that, it removes the 8 kHz processing support in several
> places of the AEC3 code.
> 
> Bug: webrtc:10913
> Change-Id: If5b75fa325ed0071deea94a7546cb4a7adf22137
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150332
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29017}

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

Change-Id: I877d2993b9ccf024bd1d57bca1513c3e24d0bed3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10913
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150940
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29022}
2019-08-30 10:19:29 +00:00
Per Åhgren
f3a197e553 Add core multi-channel pipeline in AEC3
This CL adds basic the basic pipeline to support multi-channel
processing in AEC3.

Apart from that, it removes the 8 kHz processing support in several
places of the AEC3 code.

Bug: webrtc:10913
Change-Id: If5b75fa325ed0071deea94a7546cb4a7adf22137
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150332
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29017}
2019-08-30 08:07:27 +00:00
Per Åhgren
3e8bf282c4 Increase the maximum supported sample rate to 384000 Hz and add tests
This CL increases the maximum supported sample rate so that all rates
up to 384000 Hz are handled.

The CL also adds tests that verifies that APM works as intended for
different combinations of number of channels and sample rates.

Bug: webrtc:10882
Change-Id: I98738e33ac21413ae00fec10bb43b8796ae2078c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150532
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29014}
2019-08-29 22:14:25 +00:00
Oleksandr Iakovenko
d191533717 Fix wrong-import-order pylint errors in quality_assessment.signal_processing module.
Bug: webrtc:10924
Change-Id: I9aeb062f1e4b4e061192b42b9a1f8b061fbbb8c2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150646
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28989}
2019-08-28 14:48:28 +00:00
Sam Zackrisson
6558fa5d64 Reintroduce command line controlled reference data updating for ApmTest.Process
Replaces a hardcoded bool in a test with command line flag.

The current hardcoding of the bool is a little bit hacky. And the
tests will pass automatically, so it is possible to accidentally
commit the flipped bool in a CL, like here:
https://webrtc-review.googlesource.com/c/src/+/150221

I am fairly sure this resolves the vague issue referred to in the attached bug.
The bug is introduced with a TODO here:
https://webrtc-codereview.appspot.com/1728005/diff/4001/webrtc/modules/audio_processing/test/unit_test.cc
Another TODO was added later that refers to the first TODO:
https://webrtc-codereview.appspot.com/6879004/diff/150001/webrtc/modules/audio_processing/test/audio_processing_unittest.cc

Bug: webrtc:1981
Change-Id: I066f41add602c791a5f2ba18829c4306da7dac15
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150334
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28955}
2019-08-26 11:12:55 +00:00
Per Åhgren
2ca0b3689f Correct the handling of sample rates that don't scale well into even 10 ms chunks
This CL corrects the way the audio processing module handles sample rates that
don't allow partitioning the data into evenly sized 10 ms chunks, examples
being 22050 Hz and 11025 Hz.

Bug: webrtc:10882
Change-Id: I35d738f8a0e1debc443fe5d473c0d666a7ba8d98
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150526
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28953}
2019-08-26 09:54:48 +00:00
Per Åhgren
0aefbf0ec4 Use the AEC3 high-pass filter for the whole APM
This CL removes and replaces the legacy fixed-point high-pass filter in
APM with the floating point high-pass filter in AEC3.

Bug: webrtc:10907
Change-Id: I88cf8f622ab139e4ffa97f89a72425aa3becfc58
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150103
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28950}
2019-08-23 20:04:10 +00:00
Per Åhgren
c8626b6072 Reland "Reland Process 8 kHz audio as 16 kHz internally of the audio processing module"
This is a reland of b7b8e30cb4

Original change's description:
> Reland Process 8 kHz audio as 16 kHz internally of the audio processing module
> 
> This CL relands the code from the CL "Process 8 kHz audio as 16 kHz internally
> of the audio processing module" which by mistake was reverted via a rebase in
> another CL.
> 
> The CL changes the behavior of APM for 8 kHz so that it is internally
> processed as 16 kHz.
> 
> Bug: webrtc:10863
> Change-Id: I32a57b2d279c2134125667c19b09cfda381a33c3
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150221
> Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28944}

Bug: webrtc:10863
Change-Id: Ic626b99b099248f0d8a677dc4cfe1505e14ae7cd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150330
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28949}
2019-08-23 14:24:48 +00:00
Artem Titarenko
7c4b0c56bf Revert "Reland Process 8 kHz audio as 16 kHz internally of the audio processing module"
This reverts commit b7b8e30cb4.

Reason for revert: Broke ApmTest.Process test in internal iOS waterfall

Original change's description:
> Reland Process 8 kHz audio as 16 kHz internally of the audio processing module
> 
> This CL relands the code from the CL "Process 8 kHz audio as 16 kHz internally
> of the audio processing module" which by mistake was reverted via a rebase in
> another CL.
> 
> The CL changes the behavior of APM for 8 kHz so that it is internally
> processed as 16 kHz.
> 
> Bug: webrtc:10863
> Change-Id: I32a57b2d279c2134125667c19b09cfda381a33c3
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150221
> Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28944}

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

Change-Id: Ia49e07b0c25c49da646917516e317f1d57cc4e84
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10863
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150326
Reviewed-by: Artem Titarenko <artit@webrtc.org>
Commit-Queue: Artem Titarenko <artit@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28948}
2019-08-23 13:11:13 +00:00
Per Åhgren
b7b8e30cb4 Reland Process 8 kHz audio as 16 kHz internally of the audio processing module
This CL relands the code from the CL "Process 8 kHz audio as 16 kHz internally
of the audio processing module" which by mistake was reverted via a rebase in
another CL.

The CL changes the behavior of APM for 8 kHz so that it is internally
processed as 16 kHz.

Bug: webrtc:10863
Change-Id: I32a57b2d279c2134125667c19b09cfda381a33c3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150221
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28944}
2019-08-23 09:19:28 +00:00
Per Åhgren
d47941e018 Reland "Simplification and refactoring of the AudioBuffer code"
This is a reland of 81c0cf287c

Original change's description:
> Simplification and refactoring of the AudioBuffer code
> 
> This CL performs a major refactoring and simplification
> of the AudioBuffer code that.
> -Removes 7 of the 9 internal buffers of the AudioBuffer.
> -Avoids the implicit copying required to keep the
>  internal buffers in sync.
> -Removes all code relating to handling of fixed-point
>  sample data in the AudioBuffer.
> -Changes the naming of the class methods to reflect
>  that only floating point is handled.
> -Corrects some bugs in the code.
> -Extends the handling of internal downmixing to be
>  more generic.
> 
> Bug: webrtc:10882
> Change-Id: I12c8af156fbe366b154744a0a1b3d926bf7be572
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/149828
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28928}

Bug: webrtc:10882
Change-Id: I2ddf327e80a03468c41662ae63c619ff34f2363a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150101
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28938}
2019-08-22 10:34:05 +00:00
Steve Anton
f254e9e9e5 Revert "Simplification and refactoring of the AudioBuffer code"
This reverts commit 81c0cf287c.

Reason for revert: internal test failures

Original change's description:
> Simplification and refactoring of the AudioBuffer code
> 
> This CL performs a major refactoring and simplification
> of the AudioBuffer code that.
> -Removes 7 of the 9 internal buffers of the AudioBuffer.
> -Avoids the implicit copying required to keep the
>  internal buffers in sync.
> -Removes all code relating to handling of fixed-point
>  sample data in the AudioBuffer.
> -Changes the naming of the class methods to reflect
>  that only floating point is handled.
> -Corrects some bugs in the code.
> -Extends the handling of internal downmixing to be
>  more generic.
> 
> Bug: webrtc:10882
> Change-Id: I12c8af156fbe366b154744a0a1b3d926bf7be572
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/149828
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28928}

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

Change-Id: I2729e3ad24b3a9b40b368b84cb565c859e79b51e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10882
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150084
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28931}
2019-08-21 18:00:59 +00:00
Per Åhgren
1c602e39ce Process 8 kHz audio as 16 kHz internally of the audio processing module
This CL changes the behavior of APM for 8 kHz so that it is internally
processed as 16 kHz.


Bug: webrtc:10863
Change-Id: Ie17de6551c6e984b60534820374a49ca298f06ce
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/148800
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28929}
2019-08-21 14:21:53 +00:00
Per Åhgren
81c0cf287c Simplification and refactoring of the AudioBuffer code
This CL performs a major refactoring and simplification
of the AudioBuffer code that.
-Removes 7 of the 9 internal buffers of the AudioBuffer.
-Avoids the implicit copying required to keep the
 internal buffers in sync.
-Removes all code relating to handling of fixed-point
 sample data in the AudioBuffer.
-Changes the naming of the class methods to reflect
 that only floating point is handled.
-Corrects some bugs in the code.
-Extends the handling of internal downmixing to be
 more generic.

Bug: webrtc:10882
Change-Id: I12c8af156fbe366b154744a0a1b3d926bf7be572
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/149828
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28928}
2019-08-21 13:40:59 +00:00
Mirko Bonadei
2dac4e4e35 Remove rtc_use_lto GN arg.
This CL is a no-op since rtc_use_lto is always false and in general
such change should probably be implemented in
//build/config/compiler/BUILD.gn.

Bug: chromium:408997
Change-Id: Id37d3181e66e699f8cd535aee1af7609352a7259
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/149833
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28919}
2019-08-20 14:00:49 +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
Per Åhgren
62c174c5a1 Reland of Correct conversion between float and fixed formats
This CL changes the way that values are converted
between fixed and floating point to
-Avoid the former asymmetric conversion causing
nonlinear distortions.
-Reduce the complexity.

In contrast to the initial CL, the DCHECKS on the incoming sample
range was changed to limiting.

Bug: webrtc:6594
Change-Id: I8218dfd5c45388ad5aac61be453d2f28725a2475
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/132783
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Original-Commit-Position: refs/heads/master@{#28867}
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/149169
Cr-Commit-Position: refs/heads/master@{#28897}
2019-08-19 12:15:07 +00:00
Gustaf Ullberg
cd277b84da AEC3: Fix computation of audio buffer delay
This change fixes a bug where the initial delay could be set incorrectly.

Bug: webrtc:10896
Change-Id: I66b2234b69c46639488f4561e973384001230861
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/149820
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28894}
2019-08-19 11:05:21 +00:00
Henrik Andreassson
533c225c93 Revert "Correct conversion between float and fixed formats"
This reverts commit 67e43c8b95.

Reason for revert: speculative revert since we see failing bots on Android after this change

https://ci.chromium.org/p/chromium/builders/webrtc.fyi/WebRTC%20Chromium%20FYI%20Android%20Tests%20%28dbg%29%20%28K%20Nexus5%29/4124

Original change's description:
> Correct conversion between float and fixed formats
> 
> This CL changes the way that values are converted
> between fixed and floating point to
> -Avoid the former asymmetric conversion causing
> nonlinear distortions.
> -Reduce the complexity.
> 
> Bug: webrtc:6594
> Change-Id: I64d0cc31c5d16f397686a59a062cfbc4b336d94d
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/132783
> Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
> Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28867}

TBR=henrik.lundin@webrtc.org,gustaf@webrtc.org,peah@webrtc.org

Change-Id: Id828a09de7075e48556fe2d0beba7a0c6ec227f6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:6594
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/149165
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28872}
2019-08-16 10:40:11 +00:00
Per Åhgren
67e43c8b95 Correct conversion between float and fixed formats
This CL changes the way that values are converted
between fixed and floating point to
-Avoid the former asymmetric conversion causing
nonlinear distortions.
-Reduce the complexity.

Bug: webrtc:6594
Change-Id: I64d0cc31c5d16f397686a59a062cfbc4b336d94d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/132783
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28867}
2019-08-15 13:51:39 +00:00
Per Åhgren
a1351271e6 Remove all AudioBuffer code that is not related to storing audio data
This CL moves/removes all code from the AudioBuffer that:
-Is not directly handling audio data (e.g., keytaps, VAD descisions).
-Is caching aggregated versions of the rest of the audio data.
-Is not used (or only used in testing)

Bug: webrtc:10882
Change-Id: I737deb3f692748eff30f46ad806b2c6f6292802c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/149072
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28866}
2019-08-15 13:49:29 +00:00
Sonia-Florina Horchidan
b75d14c802 audioproc_f: input AEC dump as string, output audio to vector
This CL adds the following options:

pass an input AEC dump as a string (currently, the tool can only accept a path to an AEC dump file)
write the processed capture samples to a given vector

Bug: webrtc:10808
Change-Id: I02863c97ec3cd8c03ade2ea8521836f2e7417050
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145208
Commit-Queue: Sonia-Florina Horchidan <soniahorchidan@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28826}
2019-08-12 09:17:36 +00:00
Gustaf Ullberg
940c2b5005 AEC3: Reduce level of log messages
This change reduces the level of several non-critical log messages in
order to reduce log spamming.

Bug: webrtc:8671
Change-Id: I6faae7a2ae4eeafd18c2770208485a75ad946e20
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/148528
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28809}
2019-08-08 14:08:05 +00:00
Per Åhgren
eac47f7fae Removing unused fallback variant for the reverb computation
This CL removes a long unused fallback behavior for the reverb
computation.

Bug: webrtc:8671
Change-Id: I4b57795a9bb33769237858f40392881ee235653e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/148520
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28802}
2019-08-08 08:00:38 +00:00
Per Åhgren
45231be79c AEC3: Removing unused code in the echo subtractor
Bug: webrtc:8671
Change-Id: I77e9c55fe2e1030e5b74c02d4bc9222de422f6f4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/137045
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28760}
2019-08-05 14:53:59 +00:00
Per Åhgren
cdbaeeb737 Aec3:Remove unused legacy code
Bug: webrtc:8671
Change-Id: I54f14cc304dbe1639fbb356dbdf9beeb1781ede4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/137801
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28759}
2019-08-05 14:13:54 +00:00
Artem Titov
59bbd65561 Add ToString method for AudioProcessing::Config
Bug: webrtc:10138
Change-Id: Icc0b40596867fd6fb8c1de5ca209dbafb504e50d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/147726
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28745}
2019-08-02 10:01:56 +00:00
Niels Möller
74cebb3c6d Mark the audio_generator_factory target as testonly
Bug: None
Change-Id: Iad9b740835e373b254c9702f8178b4bb41eb36c4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/147266
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28706}
2019-07-30 13:50:54 +00:00
Mirko Bonadei
2ab97f6f8e Migrate WebRTC test infra to ABSL_FLAG.
This is the last CL required to migrate WebRTC to ABSL_FLAG, rtc::Flag
will be removed soon after this one lands.

Bug: webrtc:10616
Change-Id: I2807cec39e28a2737d2c49e2dc23f2a6f98d08f0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145727
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28606}
2019-07-19 06:54:04 +00:00
Jonas Olsson
a4d873786f Format almost everything.
This CL was generated by running

git ls-files | grep -P "(\.h|\.cc)$" | grep -v 'sdk/' | grep -v 'rtc_base/ssl_' | \
grep -v 'fake_rtc_certificate_generator.h' | grep -v 'modules/audio_device/win/' | \
grep -v 'system_wrappers/source/clock.cc' | grep -v 'rtc_base/trace_event.h' | \
grep -v 'modules/audio_coding/codecs/ilbc/' | grep -v 'screen_capturer_mac.h' | \
grep -v 'spl_inl_mips.h' | grep -v 'data_size_unittest.cc' | grep -v 'timestamp_unittest.cc' \
| xargs clang-format -i ; git cl format

Most of these changes are clang-format grouping and reordering includes
differently.

Bug: webrtc:9340
Change-Id: Ic83ddbc169bfacd21883e381b5181c3dd4fe8a63
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144051
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28505}
2019-07-08 13:45:15 +00:00