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}
This commit is contained in:
Per Åhgren
2019-12-13 15:05:48 +01:00
committed by Commit Bot
parent eae6896f76
commit 95059e0779
7 changed files with 117 additions and 1066 deletions

View File

@ -121,8 +121,6 @@ rtc_library("audio_processing") {
"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",
"render_queue_item_verifier.h",
@ -156,7 +154,6 @@ rtc_library("audio_processing") {
":audio_buffer",
":audio_frame_view",
":audio_generator_interface",
":audio_processing_c",
":audio_processing_statistics",
":config",
":high_pass_filter",
@ -186,17 +183,13 @@ rtc_library("audio_processing") {
"agc2:adaptive_digital",
"agc2:fixed_digital",
"agc2:gain_applier",
"legacy_ns:legacy_ns",
"legacy_ns:legacy_ns_c",
"ns",
"vad",
"//third_party/abseil-cpp/absl/types:optional",
]
if (rtc_prefer_fixed_point) {
defines += [ "WEBRTC_NS_FIXED" ]
} else {
defines += [ "WEBRTC_NS_FLOAT" ]
}
deps += [
"../../common_audio",
"../../common_audio:fir_filter",
@ -268,56 +261,6 @@ rtc_library("file_audio_generator") {
]
}
rtc_source_set("audio_processing_c") {
visibility = [ ":*" ] # Only targets in this file can depend on this.
sources = [
"legacy_ns/windows_private.h",
]
if (rtc_prefer_fixed_point) {
sources += [
"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 += [ "legacy_ns/nsx_core_mips.c" ]
} else {
sources += [ "legacy_ns/nsx_core_c.c" ]
}
} else {
sources += [
"legacy_ns/defines.h",
"legacy_ns/noise_suppression.c",
"legacy_ns/noise_suppression.h",
"legacy_ns/ns_core.c",
"legacy_ns/ns_core.h",
]
}
deps = [
"../../common_audio",
"../../common_audio:common_audio_c",
"../../common_audio/third_party/fft4g",
"../../rtc_base:checks",
"../../rtc_base:rtc_base_approved",
"../../system_wrappers:cpu_features_api",
"agc:agc_legacy_c",
]
if (rtc_build_with_neon) {
sources += [ "legacy_ns/nsx_core_neon.c" ]
if (current_cpu != "arm64") {
# Enable compilation for the NEON instruction set.
suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
cflags = [ "-mfpu=neon" ]
}
}
}
if (rtc_enable_protobuf) {
proto_library("audioproc_debug_proto") {
sources = [
@ -443,6 +386,7 @@ if (rtc_include_tests) {
"agc2:rnn_vad_with_level_unittests",
"agc2:test_utils",
"agc2/rnn_vad:unittests",
"legacy_ns:legacy_ns",
"test/conversational_speech:unittest",
"utility:legacy_delay_estimator_unittest",
"utility:pffft_wrapper_unittest",
@ -486,7 +430,6 @@ if (rtc_include_tests) {
"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",
"residual_echo_detector_unittest.cc",
"rms_level_unittest.cc",

View File

@ -27,7 +27,7 @@
#include "modules/audio_processing/include/aec_dump.h"
#include "modules/audio_processing/include/audio_processing.h"
#include "modules/audio_processing/include/audio_processing_statistics.h"
#include "modules/audio_processing/legacy_noise_suppression.h"
#include "modules/audio_processing/legacy_ns/legacy_noise_suppression.h"
#include "modules/audio_processing/level_estimator.h"
#include "modules/audio_processing/ns/noise_suppressor.h"
#include "modules/audio_processing/render_queue_item_verifier.h"

View File

@ -0,0 +1,109 @@
# Copyright (c) 2019 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
import("../../../webrtc.gni")
rtc_library("legacy_ns") {
visibility = [ "*" ] # Only targets in this file can depend on this.
sources = [
"legacy_noise_suppression.cc",
"legacy_noise_suppression.h",
]
if (rtc_prefer_fixed_point) {
defines = [ "WEBRTC_NS_FIXED" ]
} else {
defines = [ "WEBRTC_NS_FLOAT" ]
}
deps = [
":legacy_ns_c",
"..:audio_buffer",
"../../../common_audio",
"../../../common_audio:common_audio_c",
"../../../rtc_base:checks",
"../../../rtc_base:rtc_base_approved",
"../../../system_wrappers:cpu_features_api",
]
}
rtc_library("legacy_ns_c") {
visibility = [ "*" ] # Only targets in this file can depend on this.
sources = [
"windows_private.h",
]
if (rtc_prefer_fixed_point) {
sources += [
"noise_suppression_x.c",
"noise_suppression_x.h",
"nsx_core.c",
"nsx_core.h",
"nsx_core_c.c",
"nsx_defines.h",
]
} else {
sources += [
"defines.h",
"noise_suppression.c",
"noise_suppression.h",
"ns_core.c",
"ns_core.h",
]
}
if (rtc_prefer_fixed_point) {
defines = [ "WEBRTC_NS_FIXED" ]
} else {
defines = [ "WEBRTC_NS_FLOAT" ]
}
deps = [
"..:audio_buffer",
"../../../common_audio",
"../../../common_audio:common_audio_c",
"../../../common_audio/third_party/fft4g",
"../../../rtc_base:checks",
"../../../rtc_base:rtc_base_approved",
"../../../system_wrappers:cpu_features_api",
]
if (rtc_build_with_neon) {
sources += [ "nsx_core_neon.c" ]
if (current_cpu != "arm64") {
# Enable compilation for the NEON instruction set.
suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
cflags = [ "-mfpu=neon" ]
}
}
}
if (rtc_include_tests) {
rtc_source_set("legacy_ns_unittests") {
testonly = true
configs += []
sources = [
"legacy_noise_suppression_unittest.cc",
]
deps = [
"..:audio_buffer",
"..:audioproc_test_utils",
"../../../api:array_view",
"../../../test:test_support",
]
defines = []
if (rtc_enable_protobuf) {
sources += []
}
}
}

View File

@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "modules/audio_processing/legacy_noise_suppression.h"
#include "modules/audio_processing/legacy_ns/legacy_noise_suppression.h"
#include "modules/audio_processing/audio_buffer.h"
#include "rtc_base/checks.h"

View File

@ -8,8 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef MODULES_AUDIO_PROCESSING_LEGACY_NOISE_SUPPRESSION_H_
#define MODULES_AUDIO_PROCESSING_LEGACY_NOISE_SUPPRESSION_H_
#ifndef MODULES_AUDIO_PROCESSING_LEGACY_NS_LEGACY_NOISE_SUPPRESSION_H_
#define MODULES_AUDIO_PROCESSING_LEGACY_NS_LEGACY_NOISE_SUPPRESSION_H_
#include <memory>
#include <vector>
@ -54,4 +54,4 @@ class NoiseSuppression {
};
} // namespace webrtc
#endif // MODULES_AUDIO_PROCESSING_LEGACY_NOISE_SUPPRESSION_H_
#endif // MODULES_AUDIO_PROCESSING_LEGACY_NS_LEGACY_NOISE_SUPPRESSION_H_

File diff suppressed because it is too large Load Diff