Functions to estimate pitch period and gain.
Bug: webrtc:9076
Change-Id: Icfe9430dcae11bdb96165c5bfe6e2b1d3bf848ab
Reviewed-on: https://webrtc-review.googlesource.com/70382
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23066}
This CL removes the updating of the buffered data used to to pad the
64 sample blocks to 128 samples FFTs. As that padding was used
incorrectly in one place this resolves an important issue.
Bug: webrtc:9159,chromium:833801,webrtc:9206
Change-Id: Ie6830878ebec6130b61d4e7e3169357f2e253073
Reviewed-on: https://webrtc-review.googlesource.com/73240
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23059}
This CL changes the way the suppressor gain is computed in AEC3 in that
the FFTs used are padded with data and windowed with a Hanning-style
window.
This gives better FFT accuracy, an behavior matching the suppressor
gain application, and also results in one less FFT operation.
Bug: webrtc:9204,chromium:837563
Change-Id: I612676c389cb76a3130966a9b596ff3f44d21863
Reviewed-on: https://webrtc-review.googlesource.com/73141
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23057}
If the adaptive gain is too low, we raise it slowly and only during
speech.
The CL gives better behavior at the start of a call. If the gain is too
high, the fixed-digital limits it. The gain is also quickly reduced by
the AdaptiveGainApplier.
Bug: webrtc:7494
Change-Id: I683f1e3e463cddec2d91f6c7f15c73e744430034
Reviewed-on: https://webrtc-review.googlesource.com/71484
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23053}
This reverts commit b04e5cae08.
Reason for revert: The reason for the revert is that some scenarios were detected where this caused the delay estimation to occur too slowly.
Original change's description:
> Making the delay estimator more robust to noisy nearends and low echoes
>
> This CL reduces the delay estimator step size to make it react better in
> scenarios where the environment is noisy, or the echo level is fairly
> low.
>
> Bug: webrtc:9177,chromium:835281
> Change-Id: I482d898c91eddc497e1284ee500d26df21a0574a
> Reviewed-on: https://webrtc-review.googlesource.com/71486
> Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22990}
TBR=gustaf@webrtc.org,peah@webrtc.org
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: webrtc:9177, chromium:835281
Change-Id: I33e09ebfed8ad8330419e554f482c956608befce
Reviewed-on: https://webrtc-review.googlesource.com/72843
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23042}
This CL makes sure that the coherence-based gains are affected by the
upper gain limit during call start-up and after resets.
Bug: webrtc:9159,chromium:833801
Change-Id: I93fdd173b6e11ea861d0e01e12c048ec0a91db70
Reviewed-on: https://webrtc-review.googlesource.com/72841
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23039}
This CL is created from a work initiated at https://webrtc-review.googlesource.com/c/src/+/61160
The purpose of this work is to improve the performance of the echo canceler (AEC3) when the farend signal contains stationary noises:
- An stationarity estimator of the farend signal has been added for detecting the portions of the farend signal that are pure noise.
- When the echo canceler deals with a portion of the signal that contains basically noise, the echo suppressor is able to back-off and avoid the fading of the nearend speech.
Change-Id: Id4b87fc59f4765bf1fca36d1cab39a49aabe104a
Bug: webrtc:9193,chromium:836790
Reviewed-on: https://webrtc-review.googlesource.com/64141
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Jesus de Vicente Pena <devicentepena@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23024}
The code that attenuates narrow banded echo peaks in low frequencies
is removed as it affects transparency negatively.
Bug: webrtc:9192,chromium:836729
Change-Id: Ib90ce6a3db0a75e8d69bdca432e1f8f8bfbbd988
Reviewed-on: https://webrtc-review.googlesource.com/72380
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23022}
This CL overrides the power-based suppressor gain decision with
a coherence based descision for the cases when that indicates a
higher suppressor gain.
Bug: webrtc:9159,chromium:833801
Change-Id: I0e7d82ac1b8c70ffe9d45907559bb14b1b849d71
Reviewed-on: https://webrtc-review.googlesource.com/71660
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22997}
This CL reduces the delay estimator step size to make it react better in
scenarios where the environment is noisy, or the echo level is fairly
low.
Bug: webrtc:9177,chromium:835281
Change-Id: I482d898c91eddc497e1284ee500d26df21a0574a
Reviewed-on: https://webrtc-review.googlesource.com/71486
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22990}
Only specially taggged targets may transitively depend on poisonous
targets. We first apply it to audio codecs.
This makes it much clearer exactly what parts of the code still have
dependencies on the audio codecs (and we want to eventually get rid of
pretty much all of them).
Bug: webrtc:8396, webrtc:9121
Change-Id: Iba5c2e806c702b5cfe881022674705f647896d43
Reviewed-on: https://webrtc-review.googlesource.com/69520
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22979}
- No need to have a unique ptr for the swap queue
- Remove default case from the switch in
AudioProcessingImpl::HandleRuntimeSettings()
Bug: webrtc:9138
Change-Id: I346ba1db6510b5caa637510298b67ead07197b81
Reviewed-on: https://webrtc-review.googlesource.com/71164
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22958}
Functions to estimate the inverse filter via LPC and compute the LP
residual applying the inverse filter.
This CL also includes test utilities, in particular BinaryFileReader,
used to read chunks of data and optionally cast them on the fly, and
Create*Reader() functions to read resource files available at test
time.
Bug: webrtc:9076
Change-Id: Ia4793b8ad6a63cb3089ed11ddad89d1aa0b840f6
Reviewed-on: https://webrtc-review.googlesource.com/70244
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22946}
Adding a data structure to cache the results of pair-wise comparisons
between items stored in a ring buffer. This is used to avoid recomputing
the pair-wise comparison every time that a new item is added in a ring
buffer.
Bug: webrtc:9076
Change-Id: I88fb67a80bd3fd8497764dc7ae7e0a577c06b20f
Reviewed-on: https://webrtc-review.googlesource.com/70162
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22942}
Ring buffer template for a finite number of arrays of given type and size.
Bug: webrtc:9076
Change-Id: Ia6c2065b0013f4a00f693966641f9aebe09f6f5c
Reviewed-on: https://webrtc-review.googlesource.com/70161
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22939}
- protobuf library
- file_wrapper.h
These appear to have been left behind during the AecDump refactoring.
After this CL, APM no longer depends on zlib by default! :)
Bug: webrtc:9139
Change-Id: I12a8df2a17a575515b9c07165825f0879c4e15eb
Reviewed-on: https://webrtc-review.googlesource.com/70762
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22923}
The SequenceBuffer class template implements a linear buffer with a Push
operation that is used to add a fixed size chunk of new samples into the
buffer. Its properties are its size and the size of the chunks that are
pushed. It is used to implement the pitch buffer in the RNN VAD feature
extractor, for which a ring buffer would be a painful choice.
Bug: webrtc:9076
Change-Id: I4767bf06d5a414dbed724a96ea4186ef013a1e30
Reviewed-on: https://webrtc-review.googlesource.com/70204
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22919}
This CL adds support for using any externally reported audio buffer
delay to set the initial alignment in AEC3 which is used before the
AEC has been able to detect the delay.
Bug: chromium:834182,webrtc:9163
Change-Id: Ic71355f69b7c4d5815b78e49987043441e7908fb
Reviewed-on: https://webrtc-review.googlesource.com/70580
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22917}
This CL increases the transparency in AEC3 during regions of low level
echo. What is done is:
-Low-level echoes are smoothly weighted so as to be deemed less
disturbing.
-The time-domain masking effect of the nearend speech is increased for
all frequencies.
-A separate, even more increased, time-domain masking effect is
introduced for lower frequencies.
-The intra-band masking is reduced to reduce the risk of echo leakage.
-The limiting of maximum gain due to filter-bank dynamics is removed
as the usecase for it could no longer be identified.
Bug: webrtc:9159,cromium:833801
Change-Id: I289b92919763124d6c5e5ede19e9a5917877c654
Reviewed-on: https://webrtc-review.googlesource.com/70421
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22915}
This reverts commit 8628f5bb7c.
Reason for revert: iOS buildbot failing
Original change's description:
> AGC2 RNN VAD: initial build targets
>
> rnn_vad_tool is an executable that reads a wav file of any sample rate
> compatible with 10 ms frames that are resampled and, when the VAD is
> fully landed, will process the resampled frames to compute the VAD
> probability.
>
> To avoid mac, win and ios trybot failures, to_be_removed.h/.cc have
> been added and will be removed as soon as the :lib target includes
> code that leads to a non-empty static lib file on those platforms.
>
> Bug: webrtc:9076
> Change-Id: I810c08acfa1adf2029e3baac2adda3045ae5214a
> Reviewed-on: https://webrtc-review.googlesource.com/70202
> Reviewed-by: Alex Loiko <aleloi@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22898}
TBR=alessiob@webrtc.org,aleloi@webrtc.org
Change-Id: Ic6014dde78b0ef371804c52608145ba8acdd9c97
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9076
Reviewed-on: https://webrtc-review.googlesource.com/70144
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22899}
rnn_vad_tool is an executable that reads a wav file of any sample rate
compatible with 10 ms frames that are resampled and, when the VAD is
fully landed, will process the resampled frames to compute the VAD
probability.
To avoid mac, win and ios trybot failures, to_be_removed.h/.cc have
been added and will be removed as soon as the :lib target includes
code that leads to a non-empty static lib file on those platforms.
Bug: webrtc:9076
Change-Id: I810c08acfa1adf2029e3baac2adda3045ae5214a
Reviewed-on: https://webrtc-review.googlesource.com/70202
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22898}
Commit bbf21a3fd6 ("Remove dependencies on
modules:module_api from AudioProcessing") causes the build to fail with
libstdc++ due to several files using memcpy(3) or memset(3) while relying on
string.h being included implicitly by other headers.
Bug: webrtc:9139
Change-Id: Ib73284962f8694d8bed0551968265bfd13cab967
Reviewed-on: https://webrtc-review.googlesource.com/70180
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Raphael Kubo da Costa (rakuco) <raphael.kubo.da.costa@intel.com>
Cr-Commit-Position: refs/heads/master@{#22895}
Since we always pass in the first audio channel, we should always pass 1 as the number of channels in the initialization function.
Bug: webrtc:8732
Change-Id: I978edb125d7cc701a5e07193256327908be00560
Reviewed-on: https://webrtc-review.googlesource.com/69660
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22885}
It's a module for applying a gain to the capture signal.
The gain is the first processing step in APM.
After this CL, these two features work:
* The PreAmplifier can be activated with
AudioProcessing::Config::pre_amplifier
* The PreApmlifier can be controlled after APM creation by
AudioProcessing::SetRuntimeSetting.
What's left is a change to AecDumps and to AecDump-replay.
NOTRY=True # 1-line change, tests just passed.
Bug: webrtc:9138
Change-Id: I85b3af511695b0a9cec2eed6fee7f05080305e1d
Reviewed-on: https://webrtc-review.googlesource.com/69811
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22881}
Add configuration fields for the pre-amplifier in the Audio Processing
Module. Also add flags and settings for the pre-amplifier in
audioproc_f.
Also make the setting stored in Aec Dumps. And make the setting
applied when playing back Aec Dumps in audioproc_f.
Bug: webrtc:9138
Change-Id: I4e59df200e1ebc56f06fae74ebf17d85858958a3
Reviewed-on: https://webrtc-review.googlesource.com/69560
Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22876}
This CL includes the following changes:
- APM runtime setting (ID + float payload) and unit tests
- Swap queue of APM runtime settings used in AudioProcessingImpl
- runtime settings handler that forwards the settings to APM
sub-modules when a message is retrieved from the queue
- Unit test placeholder to check that the pre-gain update message
is correctly delivered
Bug: webrtc:9138
Change-Id: Id22704af15fde2b87a4431f5ce64ad1aeafc5280
Reviewed-on: https://webrtc-review.googlesource.com/69320
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22873}
Added a new sub-module 'GainApplier'. The build target is
'modules/audio_processing/agc2:gain_applier'. A small refactoring
makes the GainApplier used in adaptive-digital AGC2.
The AGC2 now multiplies samples with a gain in 3 places. It's the
GainApplier, the GainCurveApplier, and the FixedGainController. The
GainApplier is used in AdaptiveDigitalGainApplier and will be used as
a pre-amplifier.
Bug: webrtc:9138
Change-Id: Ibc4c0ea109c6757f159d4adb6e3d8614179c9bc6
Reviewed-on: https://webrtc-review.googlesource.com/69321
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22849}
- Directly include api/audio/audio_frame.h everywhere AudioFrame is used.
- This *will* remove transient dependencies on libjpeg and a bunch of other things from the e.g. APM.
- audio_frame.h still included from module_common_types.h for backwards compatibility with clients.
Bug: webrtc:9139, webrtc:7504
Change-Id: Id96f9268c01667fbcc29a01f5c1dd25a37836897
Reviewed-on: https://webrtc-review.googlesource.com/62464
Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22845}
This CL changes the handling of saturated microphone signals in AEC3.
Some of the changes included are
-Make the detection of saturated echoes depend on the echo path gain
estimate.
-Remove redundant code related to echo saturation.
-Correct the computation of residual echoes when the echo is saturated.
-Soften the echo removal during echo saturation.
Bug: webrtc:9119
Change-Id: I5cb11cd449de552ab670beeb24ed8112f8beb734
Reviewed-on: https://webrtc-review.googlesource.com/67220
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22809}
instead of relying on optional.h to included these 2 headers.
Bug: webrtc:9078
Change-Id: I7a4b3facd81690b8f107640487e129986c1f5ff6
Reviewed-on: https://webrtc-review.googlesource.com/68602
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22803}
|is_posix| will be switched to false for Fuchsia, this is a preliminary change.
Bug: chromium:812974
Change-Id: I3bfda3e056ad1e5229834286ce5d095d9204a428
Reviewed-on: https://webrtc-review.googlesource.com/65782
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Commit-Queue: Fabrice de Gans-Riberi <fdegans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#22753}
AGC2 component that computes and applies the digital gain.
The gain is computed from an estimated speech and noise level.
This component decides how fast the gain can change and what it
should be.
Bug: webrtc:7494
Change-Id: If55b6e5c765f958e433730cd9e3b2b93c14a7910
Reviewed-on: https://webrtc-review.googlesource.com/64985
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22741}
We put back the old noise estimator from LevelController. We add a few
new unit tests. We also re-arrange the code so that it fits with how
it is used in AGC2. The differences are:
1. The NoiseLevelEstimator is now fully self-contained.
2. The NoiseLevelEstimator is responsible for calling SignalClassifier
and computing the signal energy. Previously the signal type and
energy were used in several places. It made sense to compute the
values independently of the noise calculation.
3. Re-initialization doesn't have to be done by the caller.
4. The interface is AudioFrameView instead of AudioBuffer.
# Bots are green, nothing should break internal stuff
NOTRY=True
Bug: webrtc:7494
Change-Id: I442bdbbeb3796eb2518e96000aec9dc5a039ae6d
Reviewed-on: https://webrtc-review.googlesource.com/66380
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22738}
Another submodule of the Automatic Gain Controller 2. It refines the
biased estimate of the Adaptive Mode Level Estimator. It works by
generating a delayed stream of peak levels. The delayed peaks are
compared to the level estimate.
Bug: webrtc:7494
Change-Id: If4c2c19088d1ca73fb93511dad4e1c8ccabcaf03
Reviewed-on: https://webrtc-review.googlesource.com/65461
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22732}
We update the configuration settings for AGC2. We also update their
effects. Now, 'gain_controller2.enable=true' means 'first run Adaptive
AGC2; then run AGC2 limiter'.
Previously, only the AGC2 limiter was implemented. To run that, one
had to set both 'gain_controller2.enable=true' and
'gain_controller2.enable_limiter=true'.
This setting also enables adaptive AGC2 in the test tool 'audioproc_f'.
Bug: webrtc:7494
Change-Id: I0d5dfe443f2cdc0ecf3aa4054442dab6276d284d
Reviewed-on: https://webrtc-review.googlesource.com/64990
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22669}
This CL adds a timeout for the detection of the headset mode that
allows it to be entered also for the cases where a headset is
inserted during the call.
Bug: chromium:826720,webrtc:9083
Change-Id: Ic3cb4cc0258997a74eccd1bcdf65765e44016ad8
Reviewed-on: https://webrtc-review.googlesource.com/65240
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22658}
The level estimator (AdaptiveModeLevelEstimator) produces a biased
estimate of the speech level. In our model, we use another module
(the SaturationProtector) to compute the bias. This CL contains the
estimator and a stub of the saturation protector.
Bug: webrtc:7494
Change-Id: I0df736d0346063f544fa680b4cc84177ea548545
Reviewed-on: https://webrtc-review.googlesource.com/64820
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22641}
This CL defines the control flow of the adaptive AGC. It also defines
method and class stubs.
Contents:
1. Divide the 'agc2' build target into 'fixed_digital' and
'adaptive_digital'.
1. Update the dependencies of everything that depended on 'agc2'.
2. Define the sub-modules of the adaptive digital AGC 2. They are:
1. Level Estimator - it gets the energy and a speech probability
and updates a speech level estimate.
2. Noise Estimator - it gets an immutable view of the speech frame
and updates the noise level estimate
3. Gain applier - it gets the speech frame, the current speech and
noise estimates, and the speech probability. It finds a gain to
apply and applies it.
4. AdaptiveAgc - sets up and controls the sub-modules described
above.
Bug: webrtc:7494
Change-Id: Ib7ccd8924e94eead0bc5f935b5d8a12e06e24fd1
Reviewed-on: https://webrtc-review.googlesource.com/64440
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22628}
We had the following pattern:
if (case_A) metric = METRIC_A;
if (case_B) metric = METRIC_B;
RTC_HISTOGRAM_COUNTS_10000(metric, value);
That's wrong, because once the logging macro runs once, it will use
the same histogram no matter what the first argument is. The macro
expands into roughly
static Histogram* histogram_ptr = nullptr;
if (histogram_ptr == nullptr) {
// Look up the histogram and put in histogram_ptr
}
// Add data through the histogram pointer.
We change the logging to use macros with string literals. We add a
macro for every of the 4 possible invocations. The macros will expand
to one static pointer each.
Bug: webrtc:8925
Change-Id: Ic7e4a6299eff31dd5988047edfcedce7d369e5ce
Reviewed-on: https://webrtc-review.googlesource.com/64724
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22606}