Reland "Refactoring of the noise suppressor and adding true multichannel support"
This is a reland of 87a7b82520b83a6cf42da27cdc46142c2eb6248c
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}
diff --git a/modules/audio_processing/BUILD.gn b/modules/audio_processing/BUILD.gn
index f270416..57b49b2 100644
--- a/modules/audio_processing/BUILD.gn
+++ b/modules/audio_processing/BUILD.gn
@@ -132,10 +132,10 @@
"gain_controller2.h",
"include/aec_dump.cc",
"include/aec_dump.h",
+ "legacy_noise_suppression.cc",
+ "legacy_noise_suppression.h",
"level_estimator.cc",
"level_estimator.h",
- "noise_suppression.cc",
- "noise_suppression.h",
"render_queue_item_verifier.h",
"residual_echo_detector.cc",
"residual_echo_detector.h",
@@ -199,6 +199,7 @@
"agc2:adaptive_digital",
"agc2:fixed_digital",
"agc2:gain_applier",
+ "ns",
"vad",
"//third_party/abseil-cpp/absl/types:optional",
]
@@ -287,29 +288,29 @@
rtc_source_set("audio_processing_c") {
visibility = [ ":*" ] # Only targets in this file can depend on this.
sources = [
- "ns/windows_private.h",
+ "legacy_ns/windows_private.h",
]
if (rtc_prefer_fixed_point) {
sources += [
- "ns/noise_suppression_x.c",
- "ns/noise_suppression_x.h",
- "ns/nsx_core.c",
- "ns/nsx_core.h",
- "ns/nsx_defines.h",
+ "legacy_ns/noise_suppression_x.c",
+ "legacy_ns/noise_suppression_x.h",
+ "legacy_ns/nsx_core.c",
+ "legacy_ns/nsx_core.h",
+ "legacy_ns/nsx_defines.h",
]
if (current_cpu == "mipsel") {
- sources += [ "ns/nsx_core_mips.c" ]
+ sources += [ "legacy_ns/nsx_core_mips.c" ]
} else {
- sources += [ "ns/nsx_core_c.c" ]
+ sources += [ "legacy_ns/nsx_core_c.c" ]
}
} else {
sources += [
- "ns/defines.h",
- "ns/noise_suppression.c",
- "ns/noise_suppression.h",
- "ns/ns_core.c",
- "ns/ns_core.h",
+ "legacy_ns/defines.h",
+ "legacy_ns/noise_suppression.c",
+ "legacy_ns/noise_suppression.h",
+ "legacy_ns/ns_core.c",
+ "legacy_ns/ns_core.h",
]
}
@@ -324,7 +325,7 @@
]
if (rtc_build_with_neon) {
- sources += [ "ns/nsx_core_neon.c" ]
+ sources += [ "legacy_ns/nsx_core_neon.c" ]
if (current_cpu != "arm64") {
# Enable compilation for the NEON instruction set.
@@ -507,8 +508,8 @@
"echo_detector/normalized_covariance_estimator_unittest.cc",
"gain_control_unittest.cc",
"high_pass_filter_unittest.cc",
+ "legacy_noise_suppression_unittest.cc",
"level_estimator_unittest.cc",
- "noise_suppression_unittest.cc",
"residual_echo_detector_unittest.cc",
"rms_level_unittest.cc",
"test/debug_dump_replayer.cc",