kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 1 | # Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
| 2 | # |
| 3 | # Use of this source code is governed by a BSD-style license |
| 4 | # that can be found in the LICENSE file in the root of the source |
| 5 | # tree. An additional intellectual property rights grant can be found |
| 6 | # in the file PATENTS. All contributing project authors may |
| 7 | # be found in the AUTHORS file in the root of the source tree. |
| 8 | |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 9 | import("//build/config/arm.gni") |
| 10 | import("//third_party/protobuf/proto_library.gni") |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 11 | import("../../build/webrtc.gni") |
| 12 | |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 13 | declare_args() { |
| 14 | # Outputs some low-level debug files. |
| 15 | aec_debug_dump = false |
| 16 | |
| 17 | # Disables the usual mode where we trust the reported system delay |
| 18 | # values the AEC receives. The corresponding define is set appropriately |
| 19 | # in the code, but it can be force-enabled here for testing. |
| 20 | aec_untrusted_delay_for_testing = false |
| 21 | } |
| 22 | |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 23 | source_set("audio_processing") { |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 24 | sources = [ |
pbos@webrtc.org | 788acd1 | 2014-12-15 09:41:24 +0000 | [diff] [blame] | 25 | "aec/aec_core.c", |
| 26 | "aec/aec_core.h", |
| 27 | "aec/aec_core_internal.h", |
| 28 | "aec/aec_rdft.c", |
| 29 | "aec/aec_rdft.h", |
| 30 | "aec/aec_resampler.c", |
| 31 | "aec/aec_resampler.h", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 32 | "aec/echo_cancellation.c", |
| 33 | "aec/echo_cancellation_internal.h", |
pbos@webrtc.org | 788acd1 | 2014-12-15 09:41:24 +0000 | [diff] [blame] | 34 | "aec/include/echo_cancellation.h", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 35 | "aecm/aecm_core.c", |
| 36 | "aecm/aecm_core.h", |
pbos@webrtc.org | 788acd1 | 2014-12-15 09:41:24 +0000 | [diff] [blame] | 37 | "aecm/echo_control_mobile.c", |
| 38 | "aecm/include/echo_control_mobile.h", |
| 39 | "agc/agc.cc", |
| 40 | "agc/agc.h", |
| 41 | "agc/agc_audio_proc.cc", |
| 42 | "agc/agc_audio_proc.h", |
| 43 | "agc/agc_audio_proc_internal.h", |
| 44 | "agc/agc_manager_direct.cc", |
| 45 | "agc/agc_manager_direct.h", |
pbos@webrtc.org | 788acd1 | 2014-12-15 09:41:24 +0000 | [diff] [blame] | 46 | "agc/circular_buffer.cc", |
| 47 | "agc/circular_buffer.h", |
| 48 | "agc/common.h", |
pbos@webrtc.org | 788acd1 | 2014-12-15 09:41:24 +0000 | [diff] [blame] | 49 | "agc/gain_map_internal.h", |
| 50 | "agc/gmm.cc", |
| 51 | "agc/gmm.h", |
| 52 | "agc/histogram.cc", |
| 53 | "agc/histogram.h", |
bjornv@webrtc.org | b395a5e | 2014-12-16 10:38:10 +0000 | [diff] [blame] | 54 | "agc/legacy/analog_agc.c", |
| 55 | "agc/legacy/analog_agc.h", |
| 56 | "agc/legacy/digital_agc.c", |
| 57 | "agc/legacy/digital_agc.h", |
| 58 | "agc/legacy/gain_control.h", |
pbos@webrtc.org | 788acd1 | 2014-12-15 09:41:24 +0000 | [diff] [blame] | 59 | "agc/noise_gmm_tables.h", |
| 60 | "agc/pitch_based_vad.cc", |
| 61 | "agc/pitch_based_vad.h", |
| 62 | "agc/pitch_internal.cc", |
| 63 | "agc/pitch_internal.h", |
| 64 | "agc/pole_zero_filter.cc", |
| 65 | "agc/pole_zero_filter.h", |
| 66 | "agc/standalone_vad.cc", |
| 67 | "agc/standalone_vad.h", |
| 68 | "agc/utility.cc", |
| 69 | "agc/utility.h", |
| 70 | "agc/voice_gmm_tables.h", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 71 | "audio_buffer.cc", |
| 72 | "audio_buffer.h", |
| 73 | "audio_processing_impl.cc", |
| 74 | "audio_processing_impl.h", |
aluebs@webrtc.org | 0c39e91 | 2014-12-18 22:22:04 +0000 | [diff] [blame] | 75 | "beamformer/complex_matrix.h", |
| 76 | "beamformer/covariance_matrix_generator.cc", |
| 77 | "beamformer/covariance_matrix_generator.h", |
| 78 | "beamformer/matrix.h", |
aluebs@webrtc.org | 79b9eba | 2014-11-26 20:21:38 +0000 | [diff] [blame] | 79 | "channel_buffer.cc", |
| 80 | "channel_buffer.h", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 81 | "common.h", |
| 82 | "echo_cancellation_impl.cc", |
| 83 | "echo_cancellation_impl.h", |
| 84 | "echo_control_mobile_impl.cc", |
| 85 | "echo_control_mobile_impl.h", |
| 86 | "gain_control_impl.cc", |
| 87 | "gain_control_impl.h", |
| 88 | "high_pass_filter_impl.cc", |
| 89 | "high_pass_filter_impl.h", |
| 90 | "include/audio_processing.h", |
| 91 | "level_estimator_impl.cc", |
| 92 | "level_estimator_impl.h", |
| 93 | "noise_suppression_impl.cc", |
| 94 | "noise_suppression_impl.h", |
| 95 | "processing_component.cc", |
| 96 | "processing_component.h", |
| 97 | "rms_level.cc", |
| 98 | "rms_level.h", |
aluebs@webrtc.org | be05c74 | 2014-11-14 22:18:10 +0000 | [diff] [blame] | 99 | "splitting_filter.cc", |
| 100 | "splitting_filter.h", |
pbos@webrtc.org | 788acd1 | 2014-12-15 09:41:24 +0000 | [diff] [blame] | 101 | "transient/common.h", |
| 102 | "transient/daubechies_8_wavelet_coeffs.h", |
| 103 | "transient/dyadic_decimator.h", |
| 104 | "transient/moving_moments.cc", |
| 105 | "transient/moving_moments.h", |
| 106 | "transient/transient_detector.cc", |
| 107 | "transient/transient_detector.h", |
| 108 | "transient/transient_suppressor.cc", |
| 109 | "transient/transient_suppressor.h", |
| 110 | "transient/wpd_node.cc", |
| 111 | "transient/wpd_node.h", |
| 112 | "transient/wpd_tree.cc", |
| 113 | "transient/wpd_tree.h", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 114 | "typing_detection.cc", |
| 115 | "typing_detection.h", |
| 116 | "utility/delay_estimator.c", |
| 117 | "utility/delay_estimator.h", |
| 118 | "utility/delay_estimator_internal.h", |
| 119 | "utility/delay_estimator_wrapper.c", |
| 120 | "utility/delay_estimator_wrapper.h", |
| 121 | "utility/fft4g.c", |
| 122 | "utility/fft4g.h", |
| 123 | "utility/ring_buffer.c", |
| 124 | "utility/ring_buffer.h", |
| 125 | "voice_detection_impl.cc", |
| 126 | "voice_detection_impl.h", |
| 127 | ] |
| 128 | |
brettw@chromium.org | 87ff9c8 | 2014-09-09 23:34:56 +0000 | [diff] [blame] | 129 | configs += [ "../..:common_config" ] |
kjellander@webrtc.org | f21ea91 | 2014-09-28 17:37:22 +0000 | [diff] [blame] | 130 | public_configs = [ "../..:common_inherited_config" ] |
brettw@chromium.org | 87ff9c8 | 2014-09-09 23:34:56 +0000 | [diff] [blame] | 131 | |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 132 | defines = [] |
| 133 | deps = [] |
| 134 | |
| 135 | if (aec_debug_dump) { |
| 136 | defines += [ "WEBRTC_AEC_DEBUG_DUMP" ] |
| 137 | } |
| 138 | |
| 139 | if (aec_untrusted_delay_for_testing) { |
| 140 | defines += [ "WEBRTC_UNTRUSTED_DELAY" ] |
| 141 | } |
| 142 | |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 143 | if (rtc_enable_protobuf) { |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 144 | defines += [ "WEBRTC_AUDIOPROC_DEBUG_DUMP" ] |
| 145 | deps += [ ":audioproc_debug_proto" ] |
| 146 | } |
| 147 | |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 148 | if (rtc_prefer_fixed_point) { |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 149 | defines += [ "WEBRTC_NS_FIXED" ] |
| 150 | sources += [ |
| 151 | "ns/include/noise_suppression_x.h", |
| 152 | "ns/noise_suppression_x.c", |
| 153 | "ns/nsx_core.c", |
| 154 | "ns/nsx_core.h", |
| 155 | "ns/nsx_defines.h", |
| 156 | ] |
| 157 | if (cpu_arch == "mipsel") { |
| 158 | sources += [ "ns/nsx_core_mips.c" ] |
| 159 | } else { |
| 160 | sources += [ "ns/nsx_core_c.c" ] |
| 161 | } |
| 162 | } else { |
| 163 | defines += [ "WEBRTC_NS_FLOAT" ] |
| 164 | sources += [ |
| 165 | "ns/defines.h", |
| 166 | "ns/include/noise_suppression.h", |
| 167 | "ns/noise_suppression.c", |
| 168 | "ns/ns_core.c", |
| 169 | "ns/ns_core.h", |
| 170 | "ns/windows_private.h", |
| 171 | ] |
| 172 | } |
| 173 | |
aluebs@webrtc.org | 0c39e91 | 2014-12-18 22:22:04 +0000 | [diff] [blame] | 174 | if (rtc_use_openmax_dl) { |
| 175 | sources += [ |
| 176 | "beamformer/beamformer.cc", |
| 177 | "beamformer/beamformer.h", |
| 178 | ] |
| 179 | } |
| 180 | |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 181 | if (cpu_arch == "x86" || cpu_arch == "x64") { |
| 182 | deps += [ ":audio_processing_sse2" ] |
| 183 | } |
| 184 | |
andrew@webrtc.org | a56a2c5 | 2014-11-26 17:01:40 +0000 | [diff] [blame] | 185 | if (rtc_build_armv7_neon || cpu_arch == "arm64") { |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 186 | deps += [ ":audio_processing_neon" ] |
| 187 | } |
| 188 | |
| 189 | if (cpu_arch == "mipsel") { |
| 190 | sources += [ "aecm/aecm_core_mips.c" ] |
| 191 | if (mips_fpu) { |
| 192 | sources += [ |
| 193 | "aec/aec_core_mips.c", |
| 194 | "aec/aec_rdft_mips.c", |
| 195 | ] |
| 196 | } |
| 197 | } else { |
| 198 | sources += [ "aecm/aecm_core_c.c" ] |
| 199 | } |
| 200 | |
| 201 | if (is_win) { |
| 202 | cflags = [ |
| 203 | # TODO(jschuh): Bug 1348: fix this warning. |
| 204 | "/wd4267", # size_t to int truncations |
| 205 | ] |
| 206 | } |
| 207 | |
| 208 | if (is_clang) { |
| 209 | # Suppress warnings from Chrome's Clang plugins. |
| 210 | # See http://code.google.com/p/webrtc/issues/detail?id=163 for details. |
| 211 | configs -= [ "//build/config/clang:find_bad_constructs" ] |
| 212 | } |
| 213 | |
| 214 | deps += [ |
xians@webrtc.org | e46bc77 | 2014-10-10 08:36:56 +0000 | [diff] [blame] | 215 | "../../base:rtc_base_approved", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 216 | "../../common_audio", |
| 217 | "../../system_wrappers", |
| 218 | ] |
| 219 | } |
| 220 | |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 221 | if (rtc_enable_protobuf) { |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 222 | proto_library("audioproc_debug_proto") { |
| 223 | sources = [ "debug.proto" ] |
| 224 | |
| 225 | proto_out_dir = "webrtc/audio_processing" |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | if (cpu_arch == "x86" || cpu_arch == "x64") { |
| 230 | source_set("audio_processing_sse2") { |
| 231 | sources = [ |
| 232 | "aec/aec_core_sse2.c", |
| 233 | "aec/aec_rdft_sse2.c", |
| 234 | ] |
| 235 | |
| 236 | cflags = [ "-msse2" ] |
| 237 | |
kjellander@webrtc.org | f21ea91 | 2014-09-28 17:37:22 +0000 | [diff] [blame] | 238 | configs += [ "../..:common_config" ] |
| 239 | public_configs = [ "../..:common_inherited_config" ] |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 240 | } |
| 241 | } |
| 242 | |
andrew@webrtc.org | a56a2c5 | 2014-11-26 17:01:40 +0000 | [diff] [blame] | 243 | if (rtc_build_armv7_neon || cpu_arch == "arm64") { |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 244 | source_set("audio_processing_neon") { |
| 245 | sources = [ |
| 246 | "aec/aec_core_neon.c", |
| 247 | "aec/aec_rdft_neon.c", |
andrew@webrtc.org | a56a2c5 | 2014-11-26 17:01:40 +0000 | [diff] [blame] | 248 | "aecm/aecm_core_neon.c", |
| 249 | "ns/nsx_core_neon.c", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 250 | ] |
| 251 | |
kjellander@webrtc.org | f21ea91 | 2014-09-28 17:37:22 +0000 | [diff] [blame] | 252 | configs += [ "../..:common_config" ] |
| 253 | public_configs = [ "../..:common_inherited_config" ] |
| 254 | |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 255 | deps = [ "../../common_audio" ] |
| 256 | |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 257 | # Enable compilation for the ARM v7 Neon instruction set. This is needed |
| 258 | # since //build/config/arm.gni only enables Neon for iOS, not Android. |
| 259 | # This provides the same functionality as webrtc/build/arm_neon.gypi. |
| 260 | # TODO(kjellander): Investigate if this can be moved into webrtc.gni or |
| 261 | # //build/config/arm.gni instead, to reduce code duplication. |
| 262 | # Remove the -mfpu=vfpv3-d16 cflag. |
| 263 | configs -= [ "//build/config/compiler:compiler_arm_fpu" ] |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 264 | |
andrew@webrtc.org | a56a2c5 | 2014-11-26 17:01:40 +0000 | [diff] [blame] | 265 | # "-mfpu=neon" is not requried for arm64 in GCC. |
| 266 | if (cpu_arch != "arm64") { |
andrew@webrtc.org | 1751ee7 | 2014-12-02 19:36:14 +0000 | [diff] [blame] | 267 | cflags = [ "-mfpu=neon" ] |
andrew@webrtc.org | a56a2c5 | 2014-11-26 17:01:40 +0000 | [diff] [blame] | 268 | } |
| 269 | |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 270 | # Disable LTO in audio_processing_neon target due to compiler bug. |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 271 | if (rtc_use_lto) { |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 272 | cflags -= [ |
| 273 | "-flto", |
| 274 | "-ffat-lto-objects", |
| 275 | ] |
| 276 | } |
| 277 | } |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 278 | } |