Commit graph

134 commits

Author SHA1 Message Date
Alessio Bazzica
533e461228 APM: make recommended_stream_analog_level() a trivial getter
The current design of the modified getter is error-prone since the
returned value changes meaning based on when (which point in the code)
the getter is called - namely, before `ProcessStream()` is called the
getter returns the stream analog level, after it returns the
recommended level.

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

Bug: webrtc:7494, b/241923537
Change-Id: I6714444df27bcc055ae693974ecd1f77f79e6ec0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271580
Reviewed-by: Hanna Silen <silen@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38055}
2022-09-10 08:54:36 +00:00
Alessio Bazzica
fcf1af3049 APM: add AudioProcessingImpl::capture_::applied_input_volume(_changed)
The `recommended_stream_analog_level()` getter is used to retrieve
both the applied and the recommended input volume. This behavior is
error-prone since the caller must know what is returned based on
the point in the code (namely, before/after the AGC has changed
the last applied input volume into a recommended level).

This CL is a first step to make clarity on which input volume is
handled in different parts of APM. Next in the pipeline: make
`recommended_stream_analog_level()` a trivial getter that always
returns the recommended level.

Main changes:
- When `recommended_stream_analog_level()` is called but
  `set_stream_analog_level()` is not called, APM logs an error
  and returns a fall-back volume (which should not be applied
  since, when `set_stream_analog_level()` is not called, no
  external input volume is expected to be present
- When APM is used without calling the `*_stream_analog_level()`
  methods (e.g., when the caller does not provide any input volume),
  the recorded AEC dumps won't store `Stream::applied_input_level`

Other changes:
- Removed `AudioProcessingImpl::capture_::prev_analog_mic_level`
- Removed redundant code in `GainController2` around detecting
  input volume changes (already done by APM)
- Adapted the `audioproc_f` and `unpack_aecdump` tools
- Data dumps clean-up: the applied and the recommended input
  volumes are now recorded in an AGC implementation agnostic way

Bug: webrtc:7494, b/241923537
Change-Id: I3cb4a731fd9f3dc19bf6ac679b7ed8c969ea283b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271544
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38054}
2022-09-09 17:36:05 +00:00
Alessio Bazzica
0c0c602653 APM: refactor emulated input volume for capture level adjustment
Switching to an AGC implementation agnostic solution for the input
volume emulation functionality offered by the
`capture_levels_adjuster` sub-module.

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

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

Bug: webrtc:7494, b/241923537
Change-Id: Ide3085f9a5dfd85888ad812ebd56faa175fb2ba7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/273902
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38053}
2022-09-09 16:38:26 +00:00
Ali Tofigh
980ad0cd64 Remove unnecessary overloads of AudioProcessing::CreateAndAttachAecDump()
Bug: webrtc:13579
Change-Id: I2e121b5fd30de4ac1813483f00a51184ff861760
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269623
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37723}
2022-08-09 13:32:59 +00:00
Ali Tofigh
1fa87c44cb Adopt absl::string_view in AudioProcessing's interface
This is the first step of migrating
AudioProcessing::CreateAndAttachAecDump() from using std::string to
absl::string_view.

Bug: webrtc:13579
Change-Id: I8fc373e7ac55fd8e96bb0b01d1a30e28883ac9a2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269400
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37631}
2022-07-27 19:24:39 +00:00
Niels Möller
7a66900683 Delete rtc_base/atomic_ops.h
Bug: webrtc:9305
Change-Id: I3e8b0db03b84b5361d63db31ee23e6db3deabfe4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266497
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37348}
2022-06-28 08:32:13 +00:00
Hanna Silen
0c1ad2992b AudioProcessingImpl: Add a VAD submodule
Add a VoiceActivityDetectorWrapper submodule in AudioProcessingImpl
and enable injecting speech probability into GainController2.

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

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

Bug: webrtc:13663
Change-Id: I21ed49f91875a4ee0f04db97ea87c0dbc3db7f8a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250962
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36485}
2022-04-07 16:27:32 +00:00
Alessio Bazzica
1db0a261ca Reland "Reland "Remove unused APM voice activity detection sub-module""
This reverts commit 09aaf6f7bc.

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

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

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

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

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

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

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

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

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

Reason for revert: dependency in a downstream project removed

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

# Not skipping CQ checks because this is a reland.

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

Reason for revert: breaking downstream projects

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

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

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

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

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

Bug: chromium:1271981, b/217349489
Change-Id: If115336c36d6d7b5845a903e421c18aebfe434ee
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251242
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35946}
2022-02-08 10:07:36 +00:00
Alessio Bazzica
bab128555a Improve code quality in modules/audio_processing/agc/
- Switch from ptr+size to rtc::ArrayView
- Remove `AgcManagerDirect::sample_rate_hz_` since it's always 16 kHz
- Stop passing nullptr in agc_manager_direct_unittest.cc when
  `AgcManagerDirect::Process()` is called
- Allow to correctly run the tests added in the child CL (see [1])

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

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

Bug: chromium:1271981, b/217349489
Change-Id: I7259a114a395f74f735a9c06510c0fc0f0f008e3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250221
Reviewed-by: Sam Zackrisson <saza@google.com>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Auto-Submit: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35908}
2022-02-04 14:27:51 +00:00
Sam Zackrisson
03cb7e5a61 APM: Make echo detector an optionally compilable and injectable component
Important: This change does not in any way affect echo cancellation or standardized stats. The user audio experience is unchanged. Only non-standard stats are affected. Echo return loss metrics are unchanged. Residual echo likelihood {recent max} will no longer be computed by default.

Important: The echo detector is no longer enabled by default.

API change, PSA: https://groups.google.com/g/discuss-webrtc/c/mJV5cDysBDI/m/7PTPBjVHCgAJ

This CL removes the default usage of the residual echo detector in APM.
It can now only be used via injection and the helper function webrtc::CreateEchoDetector. See how the function audio_processing_unittest.cc:CreateApm() changed, for an example.

The echo detector implementation is marked poisonous, to avoid accidental dependencies.

Some cleanup is done:
- EchoDetector::PackRenderAudioBuffer is declared in one target but is defined in another target. It is not necessary to keep in the API. It is made an implementation detail, and the echo detector input is documented in the API.
- The internal state of APM is large and difficult to track. Submodule pointers that are set permanently on construction are now appropriately marked const.

Tested:
- existing + new unit tests
- audioproc_f is bitexact on a large number of aecdumps

Bug: webrtc:11539
Change-Id: I00cc2ee112fedb06451a533409311605220064d0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/239652
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35550}
2021-12-16 17:39:11 +00:00
Hanna Silen
529131d3e4 Add AnalogGainStatsReporter to compute and report analog gain statistics
Implement AnalogGainStatsReporter and add it in AudioProcessingImpl.
This class computes statistics for analog gain updates and
periodically reports them into a histogram.

The added histograms for analog gain update statistics:

 - WebRTC.Audio.ApmAnalogGainDecreaseRate
 - WebRTC.Audio.ApmAnalogGainIncreaseRate
 - WebRTC.Audio.ApmAnalogGainUpdateRate
 - WebRTC.Audio.ApmAnalogGainDecreaseAverage
 - WebRTC.Audio.ApmAnalogGainIncreaseAverage
 - WebRTC.Audio.ApmAnalogGainUpdateAverage

The histograms are defined in
https://chromium-review.googlesource.com/c/chromium/src/+/3207987

Bug: webrtc:12774
Change-Id: I3c58d4bb3eb034a11c3f39ab8edb2bc67c5fd5e4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/234140
Commit-Queue: Hanna Silen <silen@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35301}
2021-11-03 06:32:33 +00:00
Alessio Bazzica
183c64ce19 APM: remove LevelEstimator
Only used in unit tests and a duplication of what `capture_output_rms_`
already does.

This CL also removes `AudioProcessingStats::output_rms_dbfs`, which is
now unused.

Bug: webrtc:5298
Fix: chromium:1261339
Change-Id: I6e583c11d4abb58444c440509a8495a7f5ebc589
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/235664
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35246}
2021-10-20 10:52:17 +00:00
Alessio Bazzica
bf2a70a14d APM: fix level estimator null pointer bug
When APM is used without calling `ApplyConfig()` and the level
estimator sub-module, which is disabled by default (see [1]), is used,
APM crashes because the enabled config flag is true, but the unique
pointer object is unset.

[1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_processing/include/audio_processing.h;l=391?q=include%2Faudio_processing.h

Bug: webrtc:7494
Change-Id: I482a9aa4f6a0a56793769674aba7b2661330bb14
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/235375
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35230}
2021-10-18 15:59:07 +00:00
Alessio Bazzica
389010438d AGC2: GainController::ApplyConfig removed
When `AudioProcessingImpl::ApplyConfig()` is called, AGC2 is initialized
and then the new config is applied. That is error prone and for example
breaks bit exactness in [1].

Changes:
- `GainController2` must be created by passing configuration,
  sample rate and number of channels
- `GainController2::ApplyConfig()` removed

Bit exactness verified with audioproc_f on a collection of AEC dumps
and Wav files (42 recordings in total).

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

Bug: webrtc:7494
Change-Id: I251e03603394a4fc8769b9b5c197a157893676a9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/235060
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35206}
2021-10-14 12:58:25 +00:00
Alessio Bazzica
20a9ac655c APM: add AudioProcessingBuilder::SetConfig()
Bug: webrtc:5298
Change-Id: If3468ebb841c49dcd410a8bea2f9f8111ee8bc06
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/234842
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35199}
2021-10-14 10:45:16 +00:00
Alessio Bazzica
be1b8989d1 ExperimentalNs removed + APM not depending anymore on webrtc::Config
Thanks to the elimination of `ExperimentalNs`, there is no need anymore
to pass `webrtc::Config` to build APM.
Hence, `AudioProcessingBuilder::Create(const webrtc::Config&)` is also
removed.

Bug: webrtc:5298
Change-Id: I0a3482376a7753434486fe564681f7b9f83939c5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232128
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35025}
2021-09-17 10:53:43 +00:00
Alessio Bazzica
0441bb625f APM: add HW-only denormal disabler
Denormal numbers (see [1]) may origin in APM when the input is zeroed
after a non-zero signal. In extreme cases, instructions involving
denormal operands may run as much as 100 times slower, which seems to
be the case (to some extent) of crbug.com/1227566.

This CL adds a class that disables denormals only via hardware on x86
and on ARM. The class is used in APM and it is an adaption of [2].

Tested: appr.tc call on Chromium (Win, Mac)

[1] https://en.wikipedia.org/wiki/Denormal_number
[2] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/audio/denormal_disabler.h

Fixed: chromium:1227566
Change-Id: I0ed2eab55dc597529f09f93c26c7a01de051fdbe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227768
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34701}
2021-08-10 15:48:22 +00:00
Artem Titov
0b489303d2 Use backticks not vertical bars to denote variables in comments for /modules/audio_processing
Bug: webrtc:12338
Change-Id: I85bff694dd2ead83c939c4d1945eff82e1296001
No-Presubmit: True
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227161
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34690}
2021-08-09 21:49:02 +00:00
Niels Möller
5b747233a3 Add method Mutex::AssertHeld
Acts as a compile time annotation, with corresponding run-time check
only when DCHECKs are enabled, and built using absl or pthreads mutexes.

Bug: None
Change-Id: Ie044c1ea1e576df71d634301f7df9d75cdf10b1b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226328
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34555}
2021-07-27 07:46:32 +00:00
Gustaf Ullberg
a399c823bb Field trial to disable the transient suppressor
This change adds the field trial "WebRTC-TransientSuppressorForcedOff"
that can be used to disable the transient suppressor (removal of
keyboard typing sounds). The field trial can be enabled by users via
command-line or via experimentation.

Bug: chromium:1186705
Change-Id: I7272df6a20fbbee24a7ba0904502c76bd775d275
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/219282
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34038}
2021-05-18 12:34:37 +00:00
Per Åhgren
19775cbd29 Reland "Reduce complexity in the APM pipeline when the output is not used"
This is a reland of aa6adffba3

What was changed in the reland is that the merging of the bands is
excluded from the code that is not run when the output is not used.
I.e., the merging is always done.

This is important to have since some clients may apply muting before APM,
and still flag to APM that the signal is muted. If the merging is not
always done, those clients will get nonzero output from APM during muting.


Original change's description:
> Reduce complexity in the APM pipeline when the output is not used
>
> This CL selectively turns off parts of the audio processing when
> the output of APM is not used. The parts turned off are such that
> don't need to continuously need to be trained, but rather can be
> temporarily deactivated.
>
> The purpose of this CL is to allow CPU to be reduced when the
> client is muted.
>
> The CL will be follow by additional CLs, adding similar functionality
> in the echo canceller and the noiser suppressor
>
> Bug: b/177830919
> Change-Id: I72d24505197a53872562c0955f3e7b670c43df6b
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/209703
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#33431}

Bug: b/177830919
Change-Id: Ib74dd1cefa173d45101e26c4f2b931860abc6d08
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/211760
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33478}
2021-03-16 09:33:02 +00:00
Per Åhgren
db5d728878 Add refined handling of the internal scaling of the audio in APM
This CL adds functionality that allows adjusting the audio levels
internally in APM. The main purpose of the functionality is to allow
APM to optionally be moved to an integration that does not provide an
analog gain to control, and the implementation of this has been
tailored specifically to meet the requirements for that.

More specifically, this CL does
-Add a new variant of the pre-amplifier gain that is intended to replace
 the pre-amplifier gain (but at the moment can coexist with that). The
 main differences with the pre-amplifier gain is that an attenuating
 gain is allowed, the gain is applied jointly with any emulated analog
 gain, and that its packaging fits better with the post gain.
-Add an emulation of an analog microphone gain. The emulation is
 designed to match the analog mic gain functionality in Chrome OS (which
 is digital) but should be usable also on other platforms.
-Add a post-gain which is applied after all processing has been applied.
 The purpose of this gain is for it to work well with the integration
 in ChromeOS, and be used to compensate for the offset that there is
 applied on some USB audio devices.


Bug: b/177830918
Change-Id: I0f312996e4088c9bd242a713a703eaaeb17f188a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/209707
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33466}
2021-03-15 19:12:02 +00:00
Per Åhgren
55bc077b45 Add one frame (10 ms) of silence in APM output after unmuting
This CL adds one frame (10 ms) of silence in APM output after unmuting to mask
audio resulting from the turning on the processing that was deactivated
during the muting.

Bug: b/177830919
Change-Id: If44cfb0ef270dde839dcd3f0b98d1c91e81668dd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/211343
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33454}
2021-03-13 01:05:45 +00:00
Ilya Nikolaevskiy
8097935df3 Revert "Reduce complexity in the APM pipeline when the output is not used"
This reverts commit aa6adffba3.

Reason for revert: breaks webrtc-importer

Original change's description:
> Reduce complexity in the APM pipeline when the output is not used
>
> This CL selectively turns off parts of the audio processing when
> the output of APM is not used. The parts turned off are such that
> don't need to continuously need to be trained, but rather can be
> temporarily deactivated.
>
> The purpose of this CL is to allow CPU to be reduced when the
> client is muted.
>
> The CL will be follow by additional CLs, adding similar functionality
> in the echo canceller and the noiser suppressor
>
> Bug: b/177830919
> Change-Id: I72d24505197a53872562c0955f3e7b670c43df6b
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/209703
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#33431}

Bug: b/177830919
Change-Id: I937cd61dedcd43150933eb1b9d65aebe68401e91
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/211348
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33433}
2021-03-11 11:41:20 +00:00
Per Åhgren
aa6adffba3 Reduce complexity in the APM pipeline when the output is not used
This CL selectively turns off parts of the audio processing when
the output of APM is not used. The parts turned off are such that
don't need to continuously need to be trained, but rather can be
temporarily deactivated.

The purpose of this CL is to allow CPU to be reduced when the
client is muted.

The CL will be follow by additional CLs, adding similar functionality
in the echo canceller and the noiser suppressor

Bug: b/177830919
Change-Id: I72d24505197a53872562c0955f3e7b670c43df6b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/209703
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33431}
2021-03-11 10:06:58 +00:00
Per Åhgren
652ada5029 Enabling a safe fall-back functionality for overruns in the runtime settings
Bug: b/177830919
Change-Id: I9369f6fc004ceb2b626d33b36262bc8aeabdb1a0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206988
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33371}
2021-03-03 12:06:54 +00:00
Per Åhgren
0a144a705a Adding initial support for lock-less informing of muting
This CL adds the initial support for letting APM know when its output
will be used or not.
It also adds a new method for passing RuntimeInformation to APM that
returns a bool indicating the success of the passing of information.

Bug: b/177830919
Change-Id: Ic2e1b92c37241d74ca6394b785b91736ca7532aa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206061
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33201}
2021-02-09 12:08:54 +00:00
Sam Zackrisson
53610223a8 Delete unused function webrtc::AudioProcessing::MutateConfig
Bug: None
Change-Id: Ibc70e5246a3f7b89775c65a19c808c1f030b8ac6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205522
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33147}
2021-02-03 12:55:23 +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
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
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
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
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
Mirko Bonadei
491ff3d54c Remove AudioProcessing::UpdateHistogramsOnCallEnd.
Bug: webrtc:10198
Change-Id: I3e7a98f9b94c171e7f105883fc755e44b2e991ae
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173464
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31070}
2020-04-14 18:08:52 +00:00
Per Åhgren
fea8b94591 Reland "APM: Remove the usage of AudioFrame in the AudioProcessing interface"
This is a reland of 12e2d4ddb2

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

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

Reason for revert: Speculative revert: breaks downstream project

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

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

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

Bug: webrtc:5298
Change-Id: Iab470b26b10e06dcf29c543851ae0085bc5b66f0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/172939
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31016}
2020-04-07 13:40:58 +00:00
Per Åhgren
dc5522b4bf APM: Removing the redundant VAD output from the integer API
This CL removes the redundant VAD output from the newly introduced
integer API in AudioProcessing.

Bug: webrtc:5298
Change-Id: Iad2b1b97ada7f4863139655526c110e326c6788a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170824
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30832}
2020-03-19 13:59:00 +00:00
Per Åhgren
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
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