This requires marking a bunch of compile-time constants "constexpr"
instead of just "const".
Review-Url: https://codereview.webrtc.org/2335483003
Cr-Commit-Position: refs/heads/master@{#14199}
behavior of the audio processing module is quite complex and hard to
implement in a threadsafe and efficient manner. Therefore a new
scheme for setting the parameters in the audio processing module is
introduced in this CL.
The idea is to roll this scheme out gradually and as a first functionality
in the audio processing module where this is applied the level controller
was chosen. This CL includes the replacement of the Config-based
level controller scheme with the new scheme.
TBR=henrik.lundin@webrtc.org, solenberg@webrtc.org,
BUG=webrtc:5298
Review-Url: https://codereview.webrtc.org/2338493002
Cr-Commit-Position: refs/heads/master@{#14190}
The former buffering scheme was overly complicated and
complex as.
-It buffered twice as many data points as needed.
-It used the ring_buffer C functionality directly inside the
delay adjustment functionality which makes that
functionality very hard to read.
In order to overcome these problems this CL does
-Change the buffering to buffer only the amount of samples
needed.
-Wrap the ring_buffer C functionality in a wrapper class
with methods that are more descriptive in what they do
to affect the AEC delay.
Additional notes:
-Some minor other name changes/code changes were also
introduced.
-The ringbuffer C functionality should be removed, but now
is not the time to do it as the rest of the code is very
adapted to the wrapping behavior of the ringbuffer. It is
better to simplify the surrounding code before doing that.
The changes have been tested to be bitexact.
This CL is chained to the CL https://codereview.webrtc.org/2321483002/
and will be followed by another CL.
BUG=webrtc:5298, webrtc:6018
Review-Url: https://codereview.webrtc.org/2319693003
Cr-Commit-Position: refs/heads/master@{#14188}
internal block size of the AEC differ from the frame
size in the AEC output.
Before this CL, this buffering was done using ringbuffers
as well as secondary internal AEC buffers that were stored
on the state. The internal buffers were redundant, and the
ringbuffers were so short that the benefit of using
ringbuffers were lost.
This CL addresses the above issues by replacing the
ringbuffers by linear buffers. This has the main advantage
of cleaner code but it should significantly less
computational complex.
Furthermore, as the complexity of the function where the
conversion to external and internal AEC frame sizes is done
increased significantly with the changes in this CL, the
CL also include refactoring the near-end buffer handling
to increase readability and reduce code repetition.
After the changes in this CL it is very clear that the
former buffering of the output was incorrectly done for
the first frames. This CL corrects that but in doing that
it breaks the bitexactness with the former code.
The bitexactness is, however, only broken for the first
1000 samples and it has been verified that for a test suite
the CL maintains bitexactness in the AEC output
after the first 1000 samples.
This CL is chained to the CL https://codereview.webrtc.org/2311833002/ and will be
followed by more CLs that refactor the other buffers
inside the AEC.
BUG=webrtc:5298, webrtc:6018
Review-Url: https://codereview.webrtc.org/2321483002
Cr-Commit-Position: refs/heads/master@{#14184}
Reason for revert:
Interface change in the mock breaks downstream code.
Original issue's description:
> The current scheme for setting parameters and specifying the behavior
> of the audio processing module is quite complex and hard to implement
> in a threadsafe and efficient manner. Therefore a new scheme for setting
> the parameters in the audio processing module is introduced in this CL.
>
> The idea is to roll this scheme out gradually and as a first functionality
> in the audio processing module where this is applied the level controller
> was chosen. This CL includes the replacement of the Config-based
> level controller scheme with the new scheme.
>
> BUG=webrtc:5298
>
> Committed: https://crrev.com/c8bbe3fe9aad9e9a1189a42dcaa8f5d6c261ecc8
> Cr-Commit-Position: refs/heads/master@{#14171}
TBR=solenberg@webrtc.org,henrik.lundin@webrtc.org,peah@webrtc.org
BUG=webrtc:5298
NOTRY=True
Review-Url: https://codereview.webrtc.org/2334583002
Cr-Commit-Position: refs/heads/master@{#14177}
functionalities doing sample-rate conversions:
-The implicit resampling done in the AudioBuffer CopyTo,
CopyFrom, InterleaveTo and DeinterleaveFrom methods.
-The multi-band splitting scheme.
The selection of rates in these have been difficult and
complicated, partly due to that the APM API which allows
for activating the APM submodules without notifying
the APM.
This CL adds functionality that for each capture frame
polls all submodules for whether they are active or not
and compares this against a cached result.
Furthermore, new functionality is added that based on the
results of the comparison do a reinitialization of the APM.
This has several advantages
-The code deciding on whether to analysis and synthesis is
needed for the bandsplitting can be much simplified and
centralized.
-The selection of the processing rate can be done such as
to avoid the implicit resampling that was in some cases
unnecessarily done.
-The optimization for whether an output copy is needed
that was done to improve performance due to the implicit
resampling is no longer needed, which simplifies the
code and makes it less error-prone in the sense that
is no longer neccessary to keep track of whether any
module has changed the signal.
Finally, it should be noted that the polling of the state
for all the submodules was done previously as well, but in
a less obvious and distributed manner.
BUG=webrtc:6181, webrtc:6220, webrtc:5298, webrtc:6296, webrtc:6298, webrtc:6297
Review-Url: https://codereview.webrtc.org/2304123002
Cr-Commit-Position: refs/heads/master@{#14175}
of the audio processing module is quite complex and hard to implement
in a threadsafe and efficient manner. Therefore a new scheme for setting
the parameters in the audio processing module is introduced in this CL.
The idea is to roll this scheme out gradually and as a first functionality
in the audio processing module where this is applied the level controller
was chosen. This CL includes the replacement of the Config-based
level controller scheme with the new scheme.
BUG=webrtc:5298
Review-Url: https://codereview.webrtc.org/2292863002
Cr-Commit-Position: refs/heads/master@{#14171}
the AEC. This solves the following issues:
-Even though the buffering was previously done using ringbuffers, those
were inefficiently used which caused a lot of hidden memcopys.
-The ringbuffers wasted a lot of space in the AEC state as they were too
long.
-The lowest and two upper bands were decoupled in the buffering, which
required extra code to handle.
-On top of the ringbuffers there was a second linear buffer that was
stored in the state which caused even more data to be stored on the
state.
-The incoming nearend frames were passed to the functions in the form
of buffers on the state, which made the code harder to read as it was
not immediately clear where the nearend signal was used, and when it
was modified.
The CL addresses this by replacing all the buffers by two linear buffers:
-One buffer before the AEC processing for producing nearend
blocks of size 64 that can be processed by the AEC.
-One inside the AEC processing that buffers the current
nearend block until the next block is processed.
The changes have been tested to be bitexact.
This CL will be followed by several other CLs, that refactor the other
buffers in the AEC.
BUG=webrtc:5298, webrtc:6018
Review-Url: https://codereview.webrtc.org/2311833002
Cr-Commit-Position: refs/heads/master@{#14141}
This file defines webrtc::Config which was mostly used by modules/audio_processing. The files webrtc/common.h, webrtc/common.cc and webrtc/test/common_unittests.cc are moved to modules/audio_processing and the few remaining uses of webrtc::Config are replaced with simpler code.
- For NetEq and pacing configuration, a VoEBase::ChannelConfig is passed to VoEBase::CreateChannel().
- Removes the need for VoiceEngine::Create(const Config& config). No need to store the webrtc::Config in VoE shared state.
BUG=webrtc:5879
Review-Url: https://codereview.webrtc.org/2307533004
Cr-Commit-Position: refs/heads/master@{#14109}
Remove common_inherited_config from the targets and add it to the
template instead.
BUG=webrtc:6187
NOTRY=True
Review-Url: https://codereview.webrtc.org/2311843002
Cr-Commit-Position: refs/heads/master@{#14069}
Remove common_config from the targets' config and add
it to the template instead.
BUG=webrtc:6187
NOTRY=True
Review-Url: https://codereview.webrtc.org/2300413002
Cr-Commit-Position: refs/heads/master@{#14063}
Remove //build/config/sanitizers:deps as a dependency for
all rtc_executable targets and add it to the template instead.
BUG=webrtc:6187
NOTRY=True
Review-Url: https://codereview.webrtc.org/2308553002
Cr-Commit-Position: refs/heads/master@{#14048}
Defines the rtc_executable, rtc_source_set, rtc_test and
rtc_static_library templates.
These templates provide no functionality yet, but will enable common
configuration to be introduced, avoiding repetition in every target
Changes summary:
- Prepend rtc_ to test, source_set, executable and static_library targets
- Change "configs -= [" to "suppressed_configs += ["
- Include webrtc/build/webrtc.gni where it wasn't included yet
- Delete import("//testing/test.gni"), since rtc_test makes it unnecessary.
BUG=webrtc:6187
TBR=henrik.lundin@webrtc.org,tommi@webrtc.org
NOTRY=True
Review-Url: https://codereview.webrtc.org/2301053002
Cr-Commit-Position: refs/heads/master@{#14043}
- Remove webrtc/tools/agc/test_utils.cc/.h - only used from the above test.
- Remove webrtc/tools/agc/agc_harness.cc - not used anymore.
BUG=webrtc:4690
Review-Url: https://codereview.webrtc.org/2299023004
Cr-Commit-Position: refs/heads/master@{#14039}
Currently, the aec_debug_dump buildflag can and is used to store data in the whole of
the audio processing module. Therefore a more appropriate name is apm_debug_dump which
also matches the names of the data dumping functionality. This CL makes that name change.
The CL also changes the WEBRTC_AEC_DEBUG_DUMP define to
WEBRTC_APM_DEBUG_DUMP == 1
Furthermore, this CL moves the buildflag to a more appropriate place.
BUG=webrtc:5298
Review-Url: https://codereview.webrtc.org/2300813004
Cr-Commit-Position: refs/heads/master@{#14026}
when building the code for ARM.
The intention is to follow up this CL with other CLs that
further addresses the internal resampling in APM
BUG=webrtc:6181
Review-Url: https://codereview.webrtc.org/2265473003
Cr-Commit-Position: refs/heads/master@{#13974}
Reason for revert:
This caused build breakage due to upstream dependencies.
These dependencies need to be resolved before landing the CL.
Original issue's description:
> This CL adds functionality in the level controller to
> receive a signal level to use initially, instead of the
> default initial signal level.
>
> BUG=
>
> Committed: https://crrev.com/57fec1d828113241186e78710ec5e851cc1a0e81
> Cr-Commit-Position: refs/heads/master@{#13931}
TBR=henrik.lundin@webrtc.org,aleloi@webrtc.org,solenberg@webrtc.org,henrika@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=
Review-Url: https://codereview.webrtc.org/2283793002
Cr-Commit-Position: refs/heads/master@{#13936}
receive a signal level to use initially, instead of the
default initial signal level.
BUG=
Review-Url: https://codereview.webrtc.org/2254973003
Cr-Commit-Position: refs/heads/master@{#13931}
We have RTC_CHECK and RTC_DCHECK for C now, so we should use it. It's
one fewer difference between our C and C++ code.
NOPRESUBMIT=true
Review-Url: https://codereview.webrtc.org/2274083002
Cr-Commit-Position: refs/heads/master@{#13930}
I saw this when browsing the code, I think the intended behavior is accumulating to a float.
BUG=none
Review-Url: https://codereview.webrtc.org/2268163004
Cr-Commit-Position: refs/heads/master@{#13918}
Reason for revert:
Breaks most of chromium.webrtc.fyi bots.
Original issue's description:
> GN build rules for four audio processing test executables
>
> click_annotate, intelligibility_proc, nonlinear_beamformer_test, and
> transient_suppression_test.
>
> BUG=webrtc:5949
>
> Committed: https://crrev.com/538b5606a3fb6310aab7a7e747aee16eac885f02
> Cr-Commit-Position: refs/heads/master@{#13890}
TBR=kjellander@webrtc.org,kwiberg@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:5949
Review-Url: https://codereview.webrtc.org/2274813004
Cr-Commit-Position: refs/heads/master@{#13891}
When the sanitizer bots are switched to GN, this needs to be included as a dependency so that the executables can be compiled.
BUG=webrtc:6215
NOTRY=True
Review-Url: https://codereview.webrtc.org/2250893003
Cr-Commit-Position: refs/heads/master@{#13829}
bitexactness test. The activation of the test will
be done in another CL.
BUG=
Review-Url: https://codereview.webrtc.org/2257733002
Cr-Commit-Position: refs/heads/master@{#13822}
Updated the sources in audio_processing:audioproc_test_utils to match the configuration on
"webrtc/modules/audio_processing/audio_processing_tests.gypi"
Removed audio_buffer_tools from modules_unittests to match the gyp file.
BUG=webrtc:6041
Review-Url: https://codereview.webrtc.org/2178963002
Cr-Commit-Position: refs/heads/master@{#13541}
Before this change the ChannelBuffer had a fixed number of channels. This meant for example that when the Beamformer would reduce the number of channels to one, the merging filter bank was still merging all the channels, which was unnecessary since they were not processed and just discarded later. This change doesn't change the signal at all. It just reflects the number of channels in the ChannelBuffer, reducing the complexity.
R=henrik.lundin@webrtc.org, peah@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/2053773002 .
Cr-Commit-Position: refs/heads/master@{#13352}
It does:
-Handle saturations in a better manner by adding different gain change
step sizes for upwards and downwards changes, as well as when there
is saturation.
-Handle conditions with initial noise-only regions in a better way by
setting a high initial peak level estimate which is gradually reduced until
certainty about the peak level is achieved.
-Limit the maximum gain to limit noise amplification, and to reflect that it
initially is intended to be used in cascade with the fixed digital AGC mode.
-Lower the maximum allowed stationary noise floor to reduce the risk of
excessive noise amplification.
-Lower the target gain to reduce the risk of causing the AEC on the other
end to fail due to high playout levels triggering nonlinearities.
This also reduces the risk for saturation.
-Handle the noise-only regions in a better manner.
NOTRY=true
TBR=aleloi
BUG=webrtc:5920
Review-Url: https://codereview.webrtc.org/2111553002
Cr-Commit-Position: refs/heads/master@{#13350}