Split aec and aecm into separate build targets
This clarifies dependencies and makes it easier to customize builds for different binaries. Also adds BUILD files in aec/ and aecm/. Moves unit tests to their own target, which subjects them to Chromium Clang style checks. The CL contains a fix for a thusly induced warning. Bug: webrtc:9488 Change-Id: I77b680b42a4dccc5f025005e0890f60b4eaf2961 Reviewed-on: https://webrtc-review.googlesource.com/87304 Commit-Queue: Sam Zackrisson <saza@webrtc.org> Reviewed-by: Alex Loiko <aleloi@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23887}
This commit is contained in:

committed by
Commit Bot

parent
4524c74171
commit
7219d053d5
@ -30,10 +30,6 @@ rtc_static_library("audio_processing") {
|
|||||||
visibility = [ "*" ]
|
visibility = [ "*" ]
|
||||||
configs += [ ":apm_debug_dump" ]
|
configs += [ ":apm_debug_dump" ]
|
||||||
sources = [
|
sources = [
|
||||||
"aec/aec_resampler.cc",
|
|
||||||
"aec/aec_resampler.h",
|
|
||||||
"aec/echo_cancellation.cc",
|
|
||||||
"aec/echo_cancellation.h",
|
|
||||||
"audio_buffer.cc",
|
"audio_buffer.cc",
|
||||||
"audio_buffer.h",
|
"audio_buffer.h",
|
||||||
"audio_processing_impl.cc",
|
"audio_processing_impl.cc",
|
||||||
@ -99,7 +95,6 @@ rtc_static_library("audio_processing") {
|
|||||||
|
|
||||||
defines = []
|
defines = []
|
||||||
deps = [
|
deps = [
|
||||||
":aec_core",
|
|
||||||
":apm_logging",
|
":apm_logging",
|
||||||
":audio_frame_view",
|
":audio_frame_view",
|
||||||
":audio_generator_interface",
|
":audio_generator_interface",
|
||||||
@ -123,6 +118,9 @@ rtc_static_library("audio_processing") {
|
|||||||
"../../system_wrappers:cpu_features_api",
|
"../../system_wrappers:cpu_features_api",
|
||||||
"../../system_wrappers:field_trial_api",
|
"../../system_wrappers:field_trial_api",
|
||||||
"../../system_wrappers:metrics_api",
|
"../../system_wrappers:metrics_api",
|
||||||
|
"aec:aec",
|
||||||
|
"aec:aec_core",
|
||||||
|
"aecm:aecm_core",
|
||||||
"agc",
|
"agc",
|
||||||
"agc:agc_legacy_c",
|
"agc:agc_legacy_c",
|
||||||
"agc2:adaptive_digital",
|
"agc2:adaptive_digital",
|
||||||
@ -317,81 +315,6 @@ rtc_source_set("apm_logging") {
|
|||||||
defines = []
|
defines = []
|
||||||
}
|
}
|
||||||
|
|
||||||
rtc_source_set("aec_core") {
|
|
||||||
configs += [ ":apm_debug_dump" ]
|
|
||||||
sources = [
|
|
||||||
"aec/aec_common.h",
|
|
||||||
"aec/aec_core.cc",
|
|
||||||
"aec/aec_core.h",
|
|
||||||
"aec/aec_core_optimized_methods.h",
|
|
||||||
"aecm/aecm_core.cc",
|
|
||||||
"aecm/aecm_core.h",
|
|
||||||
"aecm/aecm_defines.h",
|
|
||||||
"aecm/echo_control_mobile.cc",
|
|
||||||
"aecm/echo_control_mobile.h",
|
|
||||||
]
|
|
||||||
deps = [
|
|
||||||
":apm_logging",
|
|
||||||
":audio_processing_statistics",
|
|
||||||
"../..:typedefs",
|
|
||||||
"../..:webrtc_common",
|
|
||||||
"../../common_audio:common_audio",
|
|
||||||
"../../common_audio:common_audio_c",
|
|
||||||
"../../rtc_base:checks",
|
|
||||||
"../../rtc_base:rtc_base_approved",
|
|
||||||
"../../rtc_base:sanitizer",
|
|
||||||
"../../system_wrappers:cpu_features_api",
|
|
||||||
"../../system_wrappers:metrics_api",
|
|
||||||
"utility:block_mean_calculator",
|
|
||||||
"utility:legacy_delay_estimator",
|
|
||||||
"utility:ooura_fft",
|
|
||||||
]
|
|
||||||
cflags = []
|
|
||||||
defines = []
|
|
||||||
|
|
||||||
if (current_cpu == "x86" || current_cpu == "x64") {
|
|
||||||
sources += [ "aec/aec_core_sse2.cc" ]
|
|
||||||
if (is_posix || is_fuchsia) {
|
|
||||||
cflags += [ "-msse2" ]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rtc_build_with_neon) {
|
|
||||||
sources += [
|
|
||||||
"aec/aec_core_neon.cc",
|
|
||||||
"aecm/aecm_core_neon.cc",
|
|
||||||
]
|
|
||||||
|
|
||||||
if (current_cpu != "arm64") {
|
|
||||||
# Enable compilation for the NEON instruction set. This is needed
|
|
||||||
# since //build/config/arm.gni only enables NEON for iOS, not Android.
|
|
||||||
# This provides the same functionality as webrtc/build/arm_neon.gypi.
|
|
||||||
suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
|
|
||||||
cflags += [ "-mfpu=neon" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
# Disable LTO on NEON targets due to compiler bug.
|
|
||||||
# TODO(fdegans): Enable this. See crbug.com/408997.
|
|
||||||
if (rtc_use_lto) {
|
|
||||||
cflags -= [
|
|
||||||
"-flto",
|
|
||||||
"-ffat-lto-objects",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
deps += [ "../../common_audio" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
if (current_cpu == "mipsel") {
|
|
||||||
sources += [ "aecm/aecm_core_mips.cc" ]
|
|
||||||
if (mips_float_abi == "hard") {
|
|
||||||
sources += [ "aec/aec_core_mips.cc" ]
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
sources += [ "aecm/aecm_core_c.cc" ]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rtc_include_tests) {
|
if (rtc_include_tests) {
|
||||||
rtc_source_set("mocks") {
|
rtc_source_set("mocks") {
|
||||||
testonly = true
|
testonly = true
|
||||||
@ -433,8 +356,6 @@ if (rtc_include_tests) {
|
|||||||
|
|
||||||
configs += [ ":apm_debug_dump" ]
|
configs += [ ":apm_debug_dump" ]
|
||||||
sources = [
|
sources = [
|
||||||
"aec/echo_cancellation_unittest.cc",
|
|
||||||
"aec/system_delay_unittest.cc",
|
|
||||||
"audio_buffer_unittest.cc",
|
"audio_buffer_unittest.cc",
|
||||||
"audio_frame_view_unittest.cc",
|
"audio_frame_view_unittest.cc",
|
||||||
"config_unittest.cc",
|
"config_unittest.cc",
|
||||||
@ -454,7 +375,6 @@ if (rtc_include_tests) {
|
|||||||
]
|
]
|
||||||
|
|
||||||
deps = [
|
deps = [
|
||||||
":aec_core",
|
|
||||||
":analog_mic_simulation",
|
":analog_mic_simulation",
|
||||||
":apm_logging",
|
":apm_logging",
|
||||||
":audio_frame_view",
|
":audio_frame_view",
|
||||||
@ -481,6 +401,8 @@ if (rtc_include_tests) {
|
|||||||
"../../test:fileutils",
|
"../../test:fileutils",
|
||||||
"../../test:test_support",
|
"../../test:test_support",
|
||||||
"../audio_coding:neteq_input_audio_tools",
|
"../audio_coding:neteq_input_audio_tools",
|
||||||
|
"aec:aec_core",
|
||||||
|
"aec:aec_unittests",
|
||||||
"aec_dump:mock_aec_dump_unittests",
|
"aec_dump:mock_aec_dump_unittests",
|
||||||
"agc:agc_unittests",
|
"agc:agc_unittests",
|
||||||
"agc2:adaptive_digital_unittests",
|
"agc2:adaptive_digital_unittests",
|
||||||
|
104
modules/audio_processing/aec/BUILD.gn
Normal file
104
modules/audio_processing/aec/BUILD.gn
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
# Copyright (c) 2018 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_source_set("aec") {
|
||||||
|
configs += [ "..:apm_debug_dump" ]
|
||||||
|
sources = [
|
||||||
|
"aec_resampler.cc",
|
||||||
|
"aec_resampler.h",
|
||||||
|
"echo_cancellation.cc",
|
||||||
|
"echo_cancellation.h",
|
||||||
|
]
|
||||||
|
deps = [
|
||||||
|
":aec_core",
|
||||||
|
"..:apm_logging",
|
||||||
|
"../../..:typedefs",
|
||||||
|
"../../../common_audio:common_audio_c",
|
||||||
|
"../../../rtc_base:checks",
|
||||||
|
"../../../rtc_base:rtc_base_approved",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
rtc_source_set("aec_core") {
|
||||||
|
configs += [ "..:apm_debug_dump" ]
|
||||||
|
sources = [
|
||||||
|
"aec_common.h",
|
||||||
|
"aec_core.cc",
|
||||||
|
"aec_core.h",
|
||||||
|
"aec_core_optimized_methods.h",
|
||||||
|
]
|
||||||
|
deps = [
|
||||||
|
"..:apm_logging",
|
||||||
|
"../../..:typedefs",
|
||||||
|
"../../../common_audio:common_audio_c",
|
||||||
|
"../../../rtc_base:checks",
|
||||||
|
"../../../rtc_base:rtc_base_approved",
|
||||||
|
"../../../system_wrappers:cpu_features_api",
|
||||||
|
"../../../system_wrappers:metrics_api",
|
||||||
|
"../utility:block_mean_calculator",
|
||||||
|
"../utility:legacy_delay_estimator",
|
||||||
|
"../utility:ooura_fft",
|
||||||
|
]
|
||||||
|
cflags = []
|
||||||
|
|
||||||
|
if (current_cpu == "x86" || current_cpu == "x64") {
|
||||||
|
sources += [ "aec_core_sse2.cc" ]
|
||||||
|
if (is_posix || is_fuchsia) {
|
||||||
|
cflags += [ "-msse2" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rtc_build_with_neon) {
|
||||||
|
sources += [ "aec_core_neon.cc" ]
|
||||||
|
|
||||||
|
if (current_cpu != "arm64") {
|
||||||
|
# Enable compilation for the NEON instruction set. This is needed
|
||||||
|
# since //build/config/arm.gni only enables NEON for iOS, not Android.
|
||||||
|
# This provides the same functionality as webrtc/build/arm_neon.gypi.
|
||||||
|
suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
|
||||||
|
cflags += [ "-mfpu=neon" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
# Disable LTO on NEON targets due to compiler bug.
|
||||||
|
# TODO(fdegans): Enable this. See crbug.com/408997.
|
||||||
|
if (rtc_use_lto) {
|
||||||
|
cflags -= [
|
||||||
|
"-flto",
|
||||||
|
"-ffat-lto-objects",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
deps += [ "../../../common_audio" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
if (current_cpu == "mipsel" && mips_float_abi == "hard") {
|
||||||
|
sources += [ "aec_core_mips.cc" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rtc_include_tests) {
|
||||||
|
rtc_source_set("aec_unittests") {
|
||||||
|
testonly = true
|
||||||
|
|
||||||
|
sources = [
|
||||||
|
"echo_cancellation_unittest.cc",
|
||||||
|
"system_delay_unittest.cc",
|
||||||
|
]
|
||||||
|
deps = [
|
||||||
|
":aec",
|
||||||
|
":aec_core",
|
||||||
|
"../../..:typedefs",
|
||||||
|
"../../../rtc_base:checks",
|
||||||
|
"../../../rtc_base:rtc_base_approved",
|
||||||
|
"../../../test:test_support",
|
||||||
|
"//testing/gtest",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
@ -19,8 +19,8 @@ namespace {
|
|||||||
class SystemDelayTest : public ::testing::Test {
|
class SystemDelayTest : public ::testing::Test {
|
||||||
protected:
|
protected:
|
||||||
SystemDelayTest();
|
SystemDelayTest();
|
||||||
virtual void SetUp();
|
void SetUp() override;
|
||||||
virtual void TearDown();
|
void TearDown() override;
|
||||||
|
|
||||||
// Initialization of AEC handle with respect to |sample_rate_hz|. Since the
|
// Initialization of AEC handle with respect to |sample_rate_hz|. Since the
|
||||||
// device sample rate is unimportant we set that value to 48000 Hz.
|
// device sample rate is unimportant we set that value to 48000 Hz.
|
||||||
|
56
modules/audio_processing/aecm/BUILD.gn
Normal file
56
modules/audio_processing/aecm/BUILD.gn
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
# Copyright (c) 2018 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_source_set("aecm_core") {
|
||||||
|
sources = [
|
||||||
|
"aecm_core.cc",
|
||||||
|
"aecm_core.h",
|
||||||
|
"aecm_defines.h",
|
||||||
|
"echo_control_mobile.cc",
|
||||||
|
"echo_control_mobile.h",
|
||||||
|
]
|
||||||
|
deps = [
|
||||||
|
"../../..:typedefs",
|
||||||
|
"../../../common_audio:common_audio_c",
|
||||||
|
"../../../rtc_base:checks",
|
||||||
|
"../../../rtc_base:rtc_base_approved",
|
||||||
|
"../../../rtc_base:sanitizer",
|
||||||
|
"../../../system_wrappers:cpu_features_api",
|
||||||
|
"../utility:legacy_delay_estimator",
|
||||||
|
]
|
||||||
|
cflags = []
|
||||||
|
|
||||||
|
if (rtc_build_with_neon) {
|
||||||
|
sources += [ "aecm_core_neon.cc" ]
|
||||||
|
|
||||||
|
if (current_cpu != "arm64") {
|
||||||
|
# Enable compilation for the NEON instruction set. This is needed
|
||||||
|
# since //build/config/arm.gni only enables NEON for iOS, not Android.
|
||||||
|
# This provides the same functionality as webrtc/build/arm_neon.gypi.
|
||||||
|
suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
|
||||||
|
cflags += [ "-mfpu=neon" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
# Disable LTO on NEON targets due to compiler bug.
|
||||||
|
# TODO(fdegans): Enable this. See crbug.com/408997.
|
||||||
|
if (rtc_use_lto) {
|
||||||
|
cflags -= [
|
||||||
|
"-flto",
|
||||||
|
"-ffat-lto-objects",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (current_cpu == "mipsel") {
|
||||||
|
sources += [ "aecm_core_mips.cc" ]
|
||||||
|
} else {
|
||||||
|
sources += [ "aecm_core_c.cc" ]
|
||||||
|
}
|
||||||
|
}
|
@ -27,7 +27,6 @@ rtc_source_set("level_estimation_agc") {
|
|||||||
":gain_applier",
|
":gain_applier",
|
||||||
":noise_level_estimator",
|
":noise_level_estimator",
|
||||||
":rnn_vad_with_level",
|
":rnn_vad_with_level",
|
||||||
"..:aec_core",
|
|
||||||
"..:apm_logging",
|
"..:apm_logging",
|
||||||
"..:audio_frame_view",
|
"..:audio_frame_view",
|
||||||
"../../..:typedefs",
|
"../../..:typedefs",
|
||||||
|
Reference in New Issue
Block a user