Split out some dependencies from the monolith audio processing target
This is a first step to make the transient suppressor and voice detection optional.
Bug: webrtc:11226, webrtc:11292
Change-Id: I203125e11694a957a32bc7f98f3bec3ec8867839
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166523
Reviewed-by: Per Ã…hgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30783}
diff --git a/modules/audio_processing/BUILD.gn b/modules/audio_processing/BUILD.gn
index 185e4f7..2519ba3 100644
--- a/modules/audio_processing/BUILD.gn
+++ b/modules/audio_processing/BUILD.gn
@@ -129,24 +129,8 @@
"residual_echo_detector.h",
"rms_level.cc",
"rms_level.h",
- "transient/common.h",
- "transient/daubechies_8_wavelet_coeffs.h",
- "transient/dyadic_decimator.h",
- "transient/moving_moments.cc",
- "transient/moving_moments.h",
- "transient/transient_detector.cc",
- "transient/transient_detector.h",
- "transient/transient_suppressor.cc",
- "transient/transient_suppressor.h",
- "transient/windows_private.h",
- "transient/wpd_node.cc",
- "transient/wpd_node.h",
- "transient/wpd_tree.cc",
- "transient/wpd_tree.h",
"typing_detection.cc",
"typing_detection.h",
- "voice_detection.cc",
- "voice_detection.h",
]
defines = []
@@ -159,6 +143,7 @@
":audio_processing_statistics",
":config",
":high_pass_filter",
+ ":voice_detection",
"../../api:array_view",
"../../api:function_view",
"../../api/audio:aec3_config",
@@ -186,6 +171,7 @@
"agc2:fixed_digital",
"agc2:gain_applier",
"ns",
+ "transient:transient_suppressor",
"vad",
"//third_party/abseil-cpp/absl/types:optional",
]
@@ -199,6 +185,20 @@
]
}
+rtc_library("voice_detection") {
+ sources = [
+ "voice_detection.cc",
+ "voice_detection.h",
+ ]
+ deps = [
+ ":api",
+ ":audio_buffer",
+ "../../api/audio:audio_frame_api",
+ "../../common_audio:common_audio_c",
+ "../../rtc_base:checks",
+ ]
+}
+
rtc_library("audio_processing_statistics") {
visibility = [ "*" ]
sources = [
@@ -295,8 +295,8 @@
testonly = true
deps = [
":audioproc_test_utils",
- ":click_annotate",
- ":transient_suppression_test",
+ "transient:click_annotate",
+ "transient:transient_suppression_test",
]
if (rtc_enable_protobuf) {
@@ -321,15 +321,6 @@
"gain_controller2_unittest.cc",
"splitting_filter_unittest.cc",
"test/fake_recording_device_unittest.cc",
- "transient/dyadic_decimator_unittest.cc",
- "transient/file_utils.cc",
- "transient/file_utils.h",
- "transient/file_utils_unittest.cc",
- "transient/moving_moments_unittest.cc",
- "transient/transient_detector_unittest.cc",
- "transient/transient_suppressor_unittest.cc",
- "transient/wpd_node_unittest.cc",
- "transient/wpd_tree_unittest.cc",
]
deps = [
@@ -344,6 +335,7 @@
":file_audio_generator_unittests",
":high_pass_filter",
":mocks",
+ ":voice_detection",
"../../api:array_view",
"../../api:scoped_refptr",
"../../api/audio:aec3_config",
@@ -377,6 +369,7 @@
"agc2:test_utils",
"agc2/rnn_vad:unittests",
"test/conversational_speech:unittest",
+ "transient:transient_suppression_unittests",
"utility:legacy_delay_estimator_unittest",
"utility:pffft_wrapper_unittest",
"vad:vad_unittests",
@@ -568,42 +561,6 @@
]
}
- rtc_executable("transient_suppression_test") {
- testonly = true
- sources = [
- "transient/file_utils.cc",
- "transient/file_utils.h",
- "transient/transient_suppression_test.cc",
- ]
- deps = [
- ":audio_processing",
- "../../common_audio",
- "../../rtc_base:rtc_base_approved",
- "../../rtc_base/system:file_wrapper",
- "../../system_wrappers",
- "../../test:fileutils",
- "../../test:test_support",
- "agc:level_estimation",
- "//testing/gtest",
- "//third_party/abseil-cpp/absl/flags:flag",
- "//third_party/abseil-cpp/absl/flags:parse",
- ]
- }
-
- rtc_executable("click_annotate") {
- testonly = true
- sources = [
- "transient/click_annotate.cc",
- "transient/file_utils.cc",
- "transient/file_utils.h",
- ]
- deps = [
- ":audio_processing",
- "../../rtc_base/system:file_wrapper",
- "../../system_wrappers",
- ]
- }
-
if (rtc_enable_protobuf) {
proto_library("audioproc_unittest_proto") {
sources = [ "test/unittest.proto" ]
@@ -635,7 +592,6 @@
deps = [
":api",
- ":audio_processing",
":audioproc_debug_proto",
":audioproc_protobuf_utils",
"../../rtc_base:checks",
diff --git a/modules/audio_processing/audio_processing_impl.cc b/modules/audio_processing/audio_processing_impl.cc
index 375e179..f4c242b 100644
--- a/modules/audio_processing/audio_processing_impl.cc
+++ b/modules/audio_processing/audio_processing_impl.cc
@@ -46,7 +46,6 @@
namespace webrtc {
-constexpr int AudioProcessing::kNativeSampleRatesHz[];
constexpr int kRuntimeSettingQueueSize = 100;
namespace {
diff --git a/modules/audio_processing/include/audio_processing.cc b/modules/audio_processing/include/audio_processing.cc
index 30d025d..8854415 100644
--- a/modules/audio_processing/include/audio_processing.cc
+++ b/modules/audio_processing/include/audio_processing.cc
@@ -62,6 +62,8 @@
} // namespace
+constexpr int AudioProcessing::kNativeSampleRatesHz[];
+
void CustomProcessing::SetRuntimeSetting(
AudioProcessing::RuntimeSetting setting) {}
diff --git a/modules/audio_processing/transient/BUILD.gn b/modules/audio_processing/transient/BUILD.gn
new file mode 100644
index 0000000..cc4d513
--- /dev/null
+++ b/modules/audio_processing/transient/BUILD.gn
@@ -0,0 +1,101 @@
+# Copyright (c) 2020 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("transient_suppressor") {
+ sources = [
+ "common.h",
+ "daubechies_8_wavelet_coeffs.h",
+ "dyadic_decimator.h",
+ "moving_moments.cc",
+ "moving_moments.h",
+ "transient_detector.cc",
+ "transient_detector.h",
+ "transient_suppressor.cc",
+ "transient_suppressor.h",
+ "windows_private.h",
+ "wpd_node.cc",
+ "wpd_node.h",
+ "wpd_tree.cc",
+ "wpd_tree.h",
+ ]
+ deps = [
+ "../../../common_audio:common_audio",
+ "../../../common_audio:common_audio_c",
+ "../../../common_audio:fir_filter",
+ "../../../common_audio:fir_filter_factory",
+ "../../../common_audio/third_party/fft4g",
+ "../../../rtc_base:checks",
+ "../../../rtc_base:gtest_prod",
+ "../../../rtc_base:logging",
+ ]
+}
+
+if (rtc_include_tests) {
+ rtc_executable("click_annotate") {
+ testonly = true
+ sources = [
+ "click_annotate.cc",
+ "file_utils.cc",
+ "file_utils.h",
+ ]
+ deps = [
+ ":transient_suppressor",
+ "..:audio_processing",
+ "../../../rtc_base/system:file_wrapper",
+ "../../../system_wrappers",
+ ]
+ }
+
+ rtc_executable("transient_suppression_test") {
+ testonly = true
+ sources = [
+ "file_utils.cc",
+ "file_utils.h",
+ "transient_suppression_test.cc",
+ ]
+ deps = [
+ ":transient_suppressor",
+ "..:audio_processing",
+ "../../../common_audio",
+ "../../../rtc_base:rtc_base_approved",
+ "../../../rtc_base/system:file_wrapper",
+ "../../../system_wrappers",
+ "../../../test:fileutils",
+ "../../../test:test_support",
+ "../agc:level_estimation",
+ "//testing/gtest",
+ "//third_party/abseil-cpp/absl/flags:flag",
+ "//third_party/abseil-cpp/absl/flags:parse",
+ ]
+ }
+
+ rtc_library("transient_suppression_unittests") {
+ testonly = true
+ sources = [
+ "dyadic_decimator_unittest.cc",
+ "file_utils.cc",
+ "file_utils.h",
+ "file_utils_unittest.cc",
+ "moving_moments_unittest.cc",
+ "transient_detector_unittest.cc",
+ "transient_suppressor_unittest.cc",
+ "wpd_node_unittest.cc",
+ "wpd_tree_unittest.cc",
+ ]
+ deps = [
+ ":transient_suppressor",
+ "../../../rtc_base:stringutils",
+ "../../../rtc_base/system:file_wrapper",
+ "../../../test:fileutils",
+ "../../../test:test_support",
+ "//testing/gtest",
+ ]
+ }
+}