Index: webrtc/common_audio/BUILD.gn |
diff --git a/webrtc/common_audio/BUILD.gn b/webrtc/common_audio/BUILD.gn |
index a26d74b0ec4624a1c78e1b6fa3eb47ac86fe971d..39975e60ed93e40a872e8b5a769d2616a41554a7 100644 |
--- a/webrtc/common_audio/BUILD.gn |
+++ b/webrtc/common_audio/BUILD.gn |
@@ -28,8 +28,6 @@ rtc_static_library("common_audio") { |
"blocker.h", |
"channel_buffer.cc", |
"channel_buffer.h", |
- "fft4g.c", |
- "fft4g.h", |
"fir_filter.cc", |
"fir_filter.h", |
"fir_filter_neon.h", |
@@ -49,6 +47,65 @@ rtc_static_library("common_audio") { |
"resampler/resampler.cc", |
"resampler/sinc_resampler.cc", |
"resampler/sinc_resampler.h", |
+ "smoothing_filter.cc", |
+ "smoothing_filter.h", |
+ "sparse_fir_filter.cc", |
+ "sparse_fir_filter.h", |
+ "vad/include/vad.h", |
+ "vad/vad.cc", |
+ "wav_file.cc", |
+ "wav_file.h", |
+ "wav_header.cc", |
+ "wav_header.h", |
+ "window_generator.cc", |
+ "window_generator.h", |
+ ] |
+ |
+ deps = [ |
+ "../base:rtc_analytics", |
+ "../system_wrappers", |
+ ] |
+ public_deps = [ |
+ ":common_audio_c", |
+ ] |
+ |
+ defines = [] |
+ if (rtc_use_openmax_dl) { |
+ sources += [ |
+ "real_fourier_openmax.cc", |
+ "real_fourier_openmax.h", |
+ ] |
+ defines += [ "RTC_USE_OPENMAX_DL" ] |
+ if (rtc_build_openmax_dl) { |
+ deps += [ "//third_party/openmax_dl/dl" ] |
+ } |
+ } |
+ |
+ if (rtc_build_with_neon) { |
+ deps += [ ":common_audio_neon" ] |
+ } |
+ |
+ if (is_win) { |
+ cflags = [ "/wd4334" ] # Ignore warning on shift operator promotion. |
+ } |
+ |
+ public_configs = [ ":common_audio_config" ] |
+ |
+ if (!build_with_chromium && is_clang) { |
+ # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
+ suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
+ } |
+ |
+ if (current_cpu == "x86" || current_cpu == "x64") { |
+ deps += [ ":common_audio_sse2" ] |
+ } |
+} |
+ |
+rtc_source_set("common_audio_c") { |
+ visibility = [ ":*" ] # Only targets in this file can depend on this. |
+ sources = [ |
+ "fft4g.c", |
+ "fft4g.h", |
"ring_buffer.c", |
"ring_buffer.h", |
"signal_processing/auto_corr_to_refl_coef.c", |
@@ -86,13 +143,7 @@ rtc_static_library("common_audio") { |
"signal_processing/splitting_filter.c", |
"signal_processing/sqrt_of_one_minus_x_squared.c", |
"signal_processing/vector_scaling_operations.c", |
- "smoothing_filter.cc", |
- "smoothing_filter.h", |
- "sparse_fir_filter.cc", |
- "sparse_fir_filter.h", |
- "vad/include/vad.h", |
"vad/include/webrtc_vad.h", |
- "vad/vad.cc", |
"vad/vad_core.c", |
"vad/vad_core.h", |
"vad/vad_filterbank.c", |
@@ -102,31 +153,8 @@ rtc_static_library("common_audio") { |
"vad/vad_sp.c", |
"vad/vad_sp.h", |
"vad/webrtc_vad.c", |
- "wav_file.cc", |
- "wav_file.h", |
- "wav_header.cc", |
- "wav_header.h", |
- "window_generator.cc", |
- "window_generator.h", |
- ] |
- |
- deps = [ |
- "../base:rtc_analytics", |
- "../system_wrappers", |
] |
- defines = [] |
- if (rtc_use_openmax_dl) { |
- sources += [ |
- "real_fourier_openmax.cc", |
- "real_fourier_openmax.h", |
- ] |
- defines += [ "RTC_USE_OPENMAX_DL" ] |
- if (rtc_build_openmax_dl) { |
- deps += [ "//third_party/openmax_dl/dl" ] |
- } |
- } |
- |
if (current_cpu == "arm") { |
sources += [ |
"signal_processing/complex_bit_reverse_arm.S", |
@@ -140,10 +168,6 @@ rtc_static_library("common_audio") { |
} |
} |
- if (rtc_build_with_neon) { |
- deps += [ ":common_audio_neon" ] |
- } |
- |
if (current_cpu == "mipsel") { |
sources += [ |
"signal_processing/complex_bit_reverse_mips.c", |
@@ -176,15 +200,6 @@ rtc_static_library("common_audio") { |
} |
public_configs = [ ":common_audio_config" ] |
- |
- if (!build_with_chromium && is_clang) { |
- # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
- suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
- } |
- |
- if (current_cpu == "x86" || current_cpu == "x64") { |
- deps += [ ":common_audio_sse2" ] |
- } |
} |
if (current_cpu == "x86" || current_cpu == "x64") { |
@@ -210,6 +225,38 @@ if (rtc_build_with_neon) { |
sources = [ |
"fir_filter_neon.cc", |
"resampler/sinc_resampler_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 (!build_with_chromium && is_clang) { |
+ # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
+ suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
+ } |
+ |
+ public_deps = [ |
+ ":common_audio_neon_c", |
+ ] |
+ } |
+ |
+ rtc_source_set("common_audio_neon_c") { |
+ visibility = [ ":*" ] # Only targets in this file can depend on this. |
+ sources = [ |
"signal_processing/cross_correlation_neon.c", |
"signal_processing/downsample_fast_neon.c", |
"signal_processing/min_max_operations_neon.c", |