diff --git a/modules/audio_processing/BUILD.gn b/modules/audio_processing/BUILD.gn index 1d4a9d429f..34cc7d392a 100644 --- a/modules/audio_processing/BUILD.gn +++ b/modules/audio_processing/BUILD.gn @@ -19,9 +19,6 @@ declare_args() { rtc_static_library("audio_processing") { sources = [ - "aec/aec_core.cc", - "aec/aec_core.h", - "aec/aec_core_optimized_methods.h", "aec/aec_resampler.cc", "aec/aec_resampler.h", "aec/echo_cancellation.cc", @@ -101,10 +98,6 @@ rtc_static_library("audio_processing") { "aec3/vector_buffer.cc", "aec3/vector_buffer.h", "aec3/vector_math.h", - "aecm/aecm_core.cc", - "aecm/aecm_core.h", - "aecm/echo_control_mobile.cc", - "aecm/echo_control_mobile.h", "agc/agc.cc", "agc/agc.h", "agc/agc_manager_direct.cc", @@ -172,8 +165,6 @@ rtc_static_library("audio_processing") { "level_controller/signal_classifier.h", "level_estimator_impl.cc", "level_estimator_impl.h", - "logging/apm_data_dumper.cc", - "logging/apm_data_dumper.h", "low_cut_filter.cc", "low_cut_filter.h", "noise_suppression_impl.cc", @@ -202,16 +193,6 @@ rtc_static_library("audio_processing") { "transient/wpd_tree.h", "typing_detection.cc", "typing_detection.h", - "utility/block_mean_calculator.cc", - "utility/block_mean_calculator.h", - "utility/delay_estimator.cc", - "utility/delay_estimator.h", - "utility/delay_estimator_internal.h", - "utility/delay_estimator_wrapper.cc", - "utility/delay_estimator_wrapper.h", - "utility/ooura_fft.cc", - "utility/ooura_fft.h", - "utility/ooura_fft_tables_common.h", "vad/common.h", "vad/gmm.cc", "vad/gmm.h", @@ -238,7 +219,9 @@ rtc_static_library("audio_processing") { defines = [] deps = [ + ":aec_core", ":aec_dump_interface", + ":apm_logging", ":audio_processing_c", ":audio_processing_statistics", "..:module_api", @@ -286,26 +269,6 @@ rtc_static_library("audio_processing") { defines += [ "WEBRTC_NS_FLOAT" ] } - if (current_cpu == "x86" || current_cpu == "x64") { - deps += [ ":audio_processing_sse2" ] - } - - if (rtc_build_with_neon) { - deps += [ ":audio_processing_neon" ] - } - - if (current_cpu == "mipsel") { - sources += [ "aecm/aecm_core_mips.cc" ] - if (mips_float_abi == "hard") { - sources += [ - "aec/aec_core_mips.cc", - "utility/ooura_fft_mips.cc", - ] - } - } else { - sources += [ "aecm/aecm_core_c.cc" ] - } - # TODO(jschuh): Bug 1348: fix this warning. configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] @@ -396,37 +359,69 @@ if (rtc_enable_protobuf) { } } -if (current_cpu == "x86" || current_cpu == "x64") { - rtc_static_library("audio_processing_sse2") { - # TODO(ehmaldonado): Remove (bugs.webrtc.org/6828) - # Errors on cyclic dependency with :audio_processing if enabled. - check_includes = false +rtc_source_set("apm_logging") { + sources = [ + "logging/apm_data_dumper.cc", + "logging/apm_data_dumper.h", + ] + deps = [ + "../../api:array_view", + "../../common_audio:common_audio", + "../../rtc_base:rtc_base_approved", + ] + defines = [] + if (apm_debug_dump) { + defines += [ "WEBRTC_APM_DEBUG_DUMP=1" ] + } else { + defines += [ "WEBRTC_APM_DEBUG_DUMP=0" ] + } +} - sources = [ +rtc_source_set("aec_core") { + sources = [ + "aec/aec_core.cc", + "aec/aec_core.h", + "aec/aec_core_optimized_methods.h", + "aecm/aecm_core.cc", + "aecm/aecm_core.h", + "aecm/echo_control_mobile.cc", + "aecm/echo_control_mobile.h", + "utility/block_mean_calculator.cc", + "utility/block_mean_calculator.h", + "utility/delay_estimator.cc", + "utility/delay_estimator.h", + "utility/delay_estimator_internal.h", + "utility/delay_estimator_wrapper.cc", + "utility/delay_estimator_wrapper.h", + "utility/ooura_fft.cc", + "utility/ooura_fft.h", + "utility/ooura_fft_tables_common.h", + ] + deps = [ + ":apm_logging", + ":audio_processing_statistics", + "../..:webrtc_common", + "../../common_audio:common_audio", + "../../rtc_base:rtc_base_approved", + "../../system_wrappers:cpu_features_api", + "../../system_wrappers:metrics_api", + ] + cflags = [] + defines = [] + + if (current_cpu == "x86" || current_cpu == "x64") { + sources += [ "aec/aec_core_sse2.cc", "utility/ooura_fft_sse2.cc", "utility/ooura_fft_tables_neon_sse2.h", ] - if (is_posix) { - cflags = [ "-msse2" ] - } - - if (apm_debug_dump) { - defines = [ "WEBRTC_APM_DEBUG_DUMP=1" ] - } else { - defines = [ "WEBRTC_APM_DEBUG_DUMP=0" ] + cflags += [ "-msse2" ] } } -} -if (rtc_build_with_neon) { - rtc_static_library("audio_processing_neon") { - # TODO(ehmaldonado): Remove (bugs.webrtc.org/6828) - # Errors on cyclic dependency with :audio_processing if enabled. - check_includes = false - - sources = [ + if (rtc_build_with_neon) { + sources += [ "aec/aec_core_neon.cc", "aecm/aecm_core_neon.cc", "utility/ooura_fft_neon.cc", @@ -438,7 +433,7 @@ if (rtc_build_with_neon) { # 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" ] + cflags += [ "-mfpu=neon" ] } # Disable LTO on NEON targets due to compiler bug. @@ -450,18 +445,31 @@ if (rtc_build_with_neon) { ] } - deps = [ + deps += [ ":audio_processing_neon_c", "../../common_audio", ] - - if (apm_debug_dump) { - defines = [ "WEBRTC_APM_DEBUG_DUMP=1" ] - } else { - defines = [ "WEBRTC_APM_DEBUG_DUMP=0" ] - } } + if (current_cpu == "mipsel") { + sources += [ "aecm/aecm_core_mips.cc" ] + if (mips_float_abi == "hard") { + sources += [ + "aec/aec_core_mips.cc", + "utility/ooura_fft_mips.cc", + ] + } + } else { + sources += [ "aecm/aecm_core_c.cc" ] + } + if (apm_debug_dump) { + defines += [ "WEBRTC_APM_DEBUG_DUMP=1" ] + } else { + defines += [ "WEBRTC_APM_DEBUG_DUMP=0" ] + } +} + +if (rtc_build_with_neon) { rtc_static_library("audio_processing_neon_c") { # TODO(mbonadei): Remove (bugs.webrtc.org/6828) # Errors on cyclic dependency with :audio_processing_c if enabled. @@ -560,7 +568,9 @@ if (rtc_include_tests) { ] deps = [ + ":aec_core", ":analog_mic_simulation", + ":apm_logging", ":audio_processing", ":audioproc_test_utils", "..:module_api", @@ -687,16 +697,6 @@ if (rtc_include_tests) { } rtc_source_set("audio_processing_perf_tests") { - # Has problems with autogenerated targets on Android and iOS - # Dependency chain (there may also be others): - # :audio_processing_perf_tests --> - # ..:modules_unittests --[private]--> - # ..:modules_unittests_apk --> - # ..:modules_unittests_apk__create --> - # ..:modules_unittests_apk__create__finalize --> - # ..:modules_unittests_apk__create__package --[private]--> - # ..:_modules_unittests__library - check_includes = false testonly = true sources = [ @@ -830,6 +830,7 @@ if (rtc_include_tests) { "../../common_audio:common_audio", "../../rtc_base:rtc_base_approved", "../../system_wrappers", + "../../system_wrappers:metrics_default", "../../test:test_support", "//testing/gtest", ] diff --git a/modules/audio_processing/test/py_quality_assessment/BUILD.gn b/modules/audio_processing/test/py_quality_assessment/BUILD.gn index 64e3a30bd3..19cfc03d65 100644 --- a/modules/audio_processing/test/py_quality_assessment/BUILD.gn +++ b/modules/audio_processing/test/py_quality_assessment/BUILD.gn @@ -141,6 +141,7 @@ rtc_executable("apm_vad") { "../../../..:webrtc_common", "../../../../common_audio", "../../../../rtc_base:rtc_base_approved", + "../../../../system_wrappers:metrics_default", ] }