blob: 87501f4cdbdaaa780ecac2439be74095eaf99c5c [file] [log] [blame]
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +00001# 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.org524b8f72014-08-31 20:32:53 +00009import("//build/config/arm.gni")
10import("//third_party/protobuf/proto_library.gni")
mbonadei9aa3f0a2017-01-24 06:58:22 -080011import("../../webrtc.gni")
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000012
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000013declare_args() {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000014 # Disables the usual mode where we trust the reported system delay
15 # values the AEC receives. The corresponding define is set appropriately
16 # in the code, but it can be force-enabled here for testing.
17 aec_untrusted_delay_for_testing = false
18}
19
kjellanderb62dbbe2016-09-23 00:38:52 -070020rtc_static_library("audio_processing") {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000021 sources = [
peah8df5d4f2016-02-23 14:34:59 -080022 "aec/aec_core.cc",
pbos@webrtc.org788acd12014-12-15 09:41:24 +000023 "aec/aec_core.h",
peahe687f782016-05-09 03:57:33 -070024 "aec/aec_core_optimized_methods.h",
peah88950cf2016-03-04 00:12:40 -080025 "aec/aec_resampler.cc",
pbos@webrtc.org788acd12014-12-15 09:41:24 +000026 "aec/aec_resampler.h",
peah8df5d4f2016-02-23 14:34:59 -080027 "aec/echo_cancellation.cc",
Henrik Kjellander9b72af92015-11-11 20:16:11 +010028 "aec/echo_cancellation.h",
peahd0263542017-01-03 04:20:34 -080029 "aec3/aec3_constants.h",
30 "aec3/block_framer.cc",
31 "aec3/block_framer.h",
32 "aec3/block_processor.cc",
33 "aec3/block_processor.h",
34 "aec3/cascaded_biquad_filter.cc",
35 "aec3/cascaded_biquad_filter.h",
peahe0eae3c2016-12-14 01:16:23 -080036 "aec3/echo_canceller3.cc",
37 "aec3/echo_canceller3.h",
peahd0263542017-01-03 04:20:34 -080038 "aec3/frame_blocker.cc",
39 "aec3/frame_blocker.h",
peah27045122016-04-10 22:38:14 -070040 "aecm/aecm_core.cc",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000041 "aecm/aecm_core.h",
peah27045122016-04-10 22:38:14 -070042 "aecm/echo_control_mobile.cc",
Henrik Kjellander9b72af92015-11-11 20:16:11 +010043 "aecm/echo_control_mobile.h",
pbos@webrtc.org788acd12014-12-15 09:41:24 +000044 "agc/agc.cc",
45 "agc/agc.h",
pbos@webrtc.org788acd12014-12-15 09:41:24 +000046 "agc/agc_manager_direct.cc",
47 "agc/agc_manager_direct.h",
pbos@webrtc.org788acd12014-12-15 09:41:24 +000048 "agc/gain_map_internal.h",
peahbbe42332016-06-08 06:42:02 -070049 "agc/loudness_histogram.cc",
50 "agc/loudness_histogram.h",
pbos@webrtc.org788acd12014-12-15 09:41:24 +000051 "agc/utility.cc",
52 "agc/utility.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000053 "audio_buffer.cc",
54 "audio_buffer.h",
55 "audio_processing_impl.cc",
56 "audio_processing_impl.h",
aluebs4a66e4a2015-10-19 18:02:39 -070057 "beamformer/array_util.cc",
58 "beamformer/array_util.h",
aluebs@webrtc.org0c39e912014-12-18 22:22:04 +000059 "beamformer/complex_matrix.h",
60 "beamformer/covariance_matrix_generator.cc",
61 "beamformer/covariance_matrix_generator.h",
62 "beamformer/matrix.h",
andrew@webrtc.orgbd8c8652015-03-20 00:28:22 +000063 "beamformer/nonlinear_beamformer.cc",
64 "beamformer/nonlinear_beamformer.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000065 "common.h",
66 "echo_cancellation_impl.cc",
67 "echo_cancellation_impl.h",
68 "echo_control_mobile_impl.cc",
69 "echo_control_mobile_impl.h",
ivocaf27ed02016-10-28 07:04:03 -070070 "echo_detector/circular_buffer.cc",
71 "echo_detector/circular_buffer.h",
72 "echo_detector/mean_variance_estimator.cc",
73 "echo_detector/mean_variance_estimator.h",
ivoc4e477a12017-01-15 08:29:46 -080074 "echo_detector/moving_max.cc",
75 "echo_detector/moving_max.h",
ivocaf27ed02016-10-28 07:04:03 -070076 "echo_detector/normalized_covariance_estimator.cc",
77 "echo_detector/normalized_covariance_estimator.h",
peahbe615622016-02-13 16:40:47 -080078 "gain_control_for_experimental_agc.cc",
79 "gain_control_for_experimental_agc.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000080 "gain_control_impl.cc",
81 "gain_control_impl.h",
peahc19f3122016-10-07 14:54:10 -070082 "include/audio_processing.cc",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000083 "include/audio_processing.h",
solenberg88499ec2016-09-07 07:34:41 -070084 "include/config.cc",
85 "include/config.h",
peahca4cac72016-06-29 15:26:12 -070086 "level_controller/biquad_filter.cc",
87 "level_controller/biquad_filter.h",
88 "level_controller/down_sampler.cc",
89 "level_controller/down_sampler.h",
90 "level_controller/gain_applier.cc",
91 "level_controller/gain_applier.h",
92 "level_controller/gain_selector.cc",
93 "level_controller/gain_selector.h",
peahca4cac72016-06-29 15:26:12 -070094 "level_controller/level_controller.cc",
95 "level_controller/level_controller.h",
peahc19f3122016-10-07 14:54:10 -070096 "level_controller/level_controller_constants.h",
peahca4cac72016-06-29 15:26:12 -070097 "level_controller/noise_level_estimator.cc",
98 "level_controller/noise_level_estimator.h",
99 "level_controller/noise_spectrum_estimator.cc",
100 "level_controller/noise_spectrum_estimator.h",
101 "level_controller/peak_level_estimator.cc",
102 "level_controller/peak_level_estimator.h",
103 "level_controller/saturating_gain_estimator.cc",
104 "level_controller/saturating_gain_estimator.h",
105 "level_controller/signal_classifier.cc",
106 "level_controller/signal_classifier.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000107 "level_estimator_impl.cc",
108 "level_estimator_impl.h",
peahb46083e2016-05-03 07:01:18 -0700109 "logging/apm_data_dumper.cc",
110 "logging/apm_data_dumper.h",
peah8271d042016-11-22 07:24:52 -0800111 "low_cut_filter.cc",
112 "low_cut_filter.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000113 "noise_suppression_impl.cc",
114 "noise_suppression_impl.h",
peah737f4b82016-03-10 23:05:28 -0800115 "render_queue_item_verifier.h",
ivoc9f4a4a02016-10-28 05:39:16 -0700116 "residual_echo_detector.cc",
117 "residual_echo_detector.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000118 "rms_level.cc",
119 "rms_level.h",
aluebs@webrtc.orgbe05c742014-11-14 22:18:10 +0000120 "splitting_filter.cc",
121 "splitting_filter.h",
Alejandro Luebs5a92aa82015-04-27 11:34:45 -0700122 "three_band_filter_bank.cc",
123 "three_band_filter_bank.h",
pbos@webrtc.org788acd12014-12-15 09:41:24 +0000124 "transient/common.h",
125 "transient/daubechies_8_wavelet_coeffs.h",
126 "transient/dyadic_decimator.h",
127 "transient/moving_moments.cc",
128 "transient/moving_moments.h",
129 "transient/transient_detector.cc",
130 "transient/transient_detector.h",
131 "transient/transient_suppressor.cc",
132 "transient/transient_suppressor.h",
133 "transient/wpd_node.cc",
134 "transient/wpd_node.h",
135 "transient/wpd_tree.cc",
136 "transient/wpd_tree.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000137 "typing_detection.cc",
138 "typing_detection.h",
minyue84db6fa2016-03-24 14:36:25 -0700139 "utility/block_mean_calculator.cc",
140 "utility/block_mean_calculator.h",
peahbdb7af62016-04-12 14:47:40 -0700141 "utility/delay_estimator.cc",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000142 "utility/delay_estimator.h",
143 "utility/delay_estimator_internal.h",
peahbdb7af62016-04-12 14:47:40 -0700144 "utility/delay_estimator_wrapper.cc",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000145 "utility/delay_estimator_wrapper.h",
peah81b92912016-10-06 06:46:20 -0700146 "utility/ooura_fft.cc",
147 "utility/ooura_fft.h",
148 "utility/ooura_fft_tables_common.h",
aluebsecf6b812015-06-25 12:28:48 -0700149 "vad/common.h",
150 "vad/gmm.cc",
151 "vad/gmm.h",
152 "vad/noise_gmm_tables.h",
153 "vad/pitch_based_vad.cc",
154 "vad/pitch_based_vad.h",
155 "vad/pitch_internal.cc",
156 "vad/pitch_internal.h",
157 "vad/pole_zero_filter.cc",
158 "vad/pole_zero_filter.h",
159 "vad/standalone_vad.cc",
160 "vad/standalone_vad.h",
161 "vad/vad_audio_proc.cc",
162 "vad/vad_audio_proc.h",
163 "vad/vad_audio_proc_internal.h",
164 "vad/vad_circular_buffer.cc",
165 "vad/vad_circular_buffer.h",
166 "vad/voice_activity_detector.cc",
167 "vad/voice_activity_detector.h",
168 "vad/voice_gmm_tables.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000169 "voice_detection_impl.cc",
170 "voice_detection_impl.h",
171 ]
172
173 defines = []
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200174 deps = [
175 "../..:webrtc_common",
aleloi6321b492016-12-05 01:46:09 -0800176 "../../audio/utility:audio_frame_operations",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800177 "../../base:gtest_prod",
kwiberg98ab3a42015-09-30 21:54:21 -0700178 "../audio_coding:isac",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200179 ]
kjellander7439f972016-12-05 22:47:46 -0800180 public_deps = [
181 ":audio_processing_c",
182 ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000183
peahf28a3892016-09-01 08:58:21 -0700184 if (apm_debug_dump) {
185 defines += [ "WEBRTC_APM_DEBUG_DUMP=1" ]
peahb46083e2016-05-03 07:01:18 -0700186 } else {
peahf28a3892016-09-01 08:58:21 -0700187 defines += [ "WEBRTC_APM_DEBUG_DUMP=0" ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000188 }
189
190 if (aec_untrusted_delay_for_testing) {
191 defines += [ "WEBRTC_UNTRUSTED_DELAY" ]
192 }
193
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000194 if (rtc_enable_protobuf) {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000195 defines += [ "WEBRTC_AUDIOPROC_DEBUG_DUMP" ]
196 deps += [ ":audioproc_debug_proto" ]
197 }
198
peah1bcfce52016-08-26 07:16:04 -0700199 if (rtc_enable_intelligibility_enhancer) {
200 defines += [ "WEBRTC_INTELLIGIBILITY_ENHANCER=1" ]
201 sources += [
202 "intelligibility/intelligibility_enhancer.cc",
203 "intelligibility/intelligibility_enhancer.h",
204 "intelligibility/intelligibility_utils.cc",
205 "intelligibility/intelligibility_utils.h",
206 ]
207 } else {
208 defines += [ "WEBRTC_INTELLIGIBILITY_ENHANCER=0" ]
209 }
210
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000211 if (rtc_prefer_fixed_point) {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000212 defines += [ "WEBRTC_NS_FIXED" ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000213 } else {
214 defines += [ "WEBRTC_NS_FLOAT" ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000215 }
216
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000217 if (current_cpu == "x86" || current_cpu == "x64") {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000218 deps += [ ":audio_processing_sse2" ]
219 }
220
Andrew MacDonaldac4234c2015-06-24 18:25:54 -0700221 if (rtc_build_with_neon) {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000222 deps += [ ":audio_processing_neon" ]
223 }
224
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000225 if (current_cpu == "mipsel") {
peah27045122016-04-10 22:38:14 -0700226 sources += [ "aecm/aecm_core_mips.cc" ]
kjellander@webrtc.org6dab6d72015-03-04 09:50:31 +0000227 if (mips_float_abi == "hard") {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000228 sources += [
peah8df5d4f2016-02-23 14:34:59 -0800229 "aec/aec_core_mips.cc",
peah81b92912016-10-06 06:46:20 -0700230 "utility/ooura_fft_mips.cc",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000231 ]
232 }
233 } else {
peah27045122016-04-10 22:38:14 -0700234 sources += [ "aecm/aecm_core_c.cc" ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000235 }
236
kjellander8f4419b2016-06-02 02:09:52 -0700237 # TODO(jschuh): Bug 1348: fix this warning.
238 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000239
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000240 deps += [
xians@webrtc.orge46bc772014-10-10 08:36:56 +0000241 "../../base:rtc_base_approved",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000242 "../../common_audio",
243 "../../system_wrappers",
244 ]
245}
246
kjellander7439f972016-12-05 22:47:46 -0800247rtc_source_set("audio_processing_c") {
248 visibility = [ ":*" ] # Only targets in this file can depend on this.
249 sources = [
250 "agc/legacy/analog_agc.c",
251 "agc/legacy/analog_agc.h",
252 "agc/legacy/digital_agc.c",
253 "agc/legacy/digital_agc.h",
254 "agc/legacy/gain_control.h",
255 ]
256
257 if (rtc_prefer_fixed_point) {
258 sources += [
259 "ns/noise_suppression_x.c",
260 "ns/noise_suppression_x.h",
261 "ns/nsx_core.c",
262 "ns/nsx_core.h",
263 "ns/nsx_defines.h",
264 ]
265 if (current_cpu == "mipsel") {
266 sources += [ "ns/nsx_core_mips.c" ]
267 } else {
268 sources += [ "ns/nsx_core_c.c" ]
269 }
270 } else {
271 sources += [
272 "ns/defines.h",
273 "ns/noise_suppression.c",
274 "ns/noise_suppression.h",
275 "ns/ns_core.c",
276 "ns/ns_core.h",
277 "ns/windows_private.h",
278 ]
279 }
280
281 deps = [
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800282 "../..:webrtc_common",
kjellander7439f972016-12-05 22:47:46 -0800283 "../../base:rtc_base_approved",
284 "../../common_audio",
285 "../../system_wrappers",
286 ]
287}
288
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000289if (rtc_enable_protobuf) {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000290 proto_library("audioproc_debug_proto") {
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200291 sources = [
292 "debug.proto",
293 ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000294
kjellander78ddd732016-02-09 08:13:06 -0800295 proto_out_dir = "webrtc/modules/audio_processing"
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000296 }
297}
298
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000299if (current_cpu == "x86" || current_cpu == "x64") {
kjellanderb62dbbe2016-09-23 00:38:52 -0700300 rtc_static_library("audio_processing_sse2") {
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800301 # TODO(ehmaldonado): Remove (bugs.webrtc.org/6828)
302 # Errors on cyclic dependency with :audio_processing if enabled.
303 check_includes = false
304
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000305 sources = [
peah8df5d4f2016-02-23 14:34:59 -0800306 "aec/aec_core_sse2.cc",
peah81b92912016-10-06 06:46:20 -0700307 "utility/ooura_fft_sse2.cc",
308 "utility/ooura_fft_tables_neon_sse2.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000309 ]
310
Henrik Kjellanderf2497cf2015-04-16 08:57:16 +0200311 if (is_posix) {
312 cflags = [ "-msse2" ]
313 }
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000314
peahf28a3892016-09-01 08:58:21 -0700315 if (apm_debug_dump) {
316 defines = [ "WEBRTC_APM_DEBUG_DUMP=1" ]
peahb46083e2016-05-03 07:01:18 -0700317 } else {
peahf28a3892016-09-01 08:58:21 -0700318 defines = [ "WEBRTC_APM_DEBUG_DUMP=0" ]
peahb46083e2016-05-03 07:01:18 -0700319 }
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000320 }
321}
322
Andrew MacDonaldac4234c2015-06-24 18:25:54 -0700323if (rtc_build_with_neon) {
kjellanderb62dbbe2016-09-23 00:38:52 -0700324 rtc_static_library("audio_processing_neon") {
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800325 # TODO(ehmaldonado): Remove (bugs.webrtc.org/6828)
326 # Errors on cyclic dependency with :audio_processing if enabled.
327 check_includes = false
328
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000329 sources = [
peah8df5d4f2016-02-23 14:34:59 -0800330 "aec/aec_core_neon.cc",
peah27045122016-04-10 22:38:14 -0700331 "aecm/aecm_core_neon.cc",
peah81b92912016-10-06 06:46:20 -0700332 "utility/ooura_fft_neon.cc",
333 "utility/ooura_fft_tables_neon_sse2.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000334 ]
335
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000336 if (current_cpu != "arm64") {
Andrew MacDonaldac4234c2015-06-24 18:25:54 -0700337 # Enable compilation for the NEON instruction set. This is needed
338 # since //build/config/arm.gni only enables NEON for iOS, not Android.
339 # This provides the same functionality as webrtc/build/arm_neon.gypi.
ehmaldonado38a21322016-09-02 04:10:34 -0700340 suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200341 cflags = [ "-mfpu=neon" ]
andrew@webrtc.orga56a2c52014-11-26 17:01:40 +0000342 }
343
Andrew MacDonaldac4234c2015-06-24 18:25:54 -0700344 # Disable LTO on NEON targets due to compiler bug.
345 # TODO(fdegans): Enable this. See crbug.com/408997.
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000346 if (rtc_use_lto) {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000347 cflags -= [
348 "-flto",
349 "-ffat-lto-objects",
350 ]
351 }
Andrew MacDonaldac4234c2015-06-24 18:25:54 -0700352
Andrew MacDonaldac4234c2015-06-24 18:25:54 -0700353 deps = [
354 "../../common_audio",
355 ]
kjellander7439f972016-12-05 22:47:46 -0800356 public_deps = [
357 ":audio_processing_neon_c",
358 ]
peahb46083e2016-05-03 07:01:18 -0700359
peahf28a3892016-09-01 08:58:21 -0700360 if (apm_debug_dump) {
361 defines = [ "WEBRTC_APM_DEBUG_DUMP=1" ]
peahb46083e2016-05-03 07:01:18 -0700362 } else {
peahf28a3892016-09-01 08:58:21 -0700363 defines = [ "WEBRTC_APM_DEBUG_DUMP=0" ]
peahb46083e2016-05-03 07:01:18 -0700364 }
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000365 }
kjellander7439f972016-12-05 22:47:46 -0800366
367 rtc_static_library("audio_processing_neon_c") {
368 sources = [
369 "ns/nsx_core_neon.c",
370 ]
371
372 if (current_cpu != "arm64") {
373 # Enable compilation for the NEON instruction set. This is needed
374 # since //build/config/arm.gni only enables NEON for iOS, not Android.
375 # This provides the same functionality as webrtc/build/arm_neon.gypi.
376 suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
377 cflags = [ "-mfpu=neon" ]
378 }
379
380 # Disable LTO on NEON targets due to compiler bug.
381 # TODO(fdegans): Enable this. See crbug.com/408997.
382 if (rtc_use_lto) {
383 cflags -= [
384 "-flto",
385 "-ffat-lto-objects",
386 ]
387 }
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800388 deps = [
389 ":audio_processing_c",
390 "../../base:rtc_base_approved",
391 ]
kjellander7439f972016-12-05 22:47:46 -0800392 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000393}
kjellanderfb114242016-06-13 00:19:48 -0700394
395if (rtc_include_tests) {
kjellander6ceab082016-10-28 05:44:03 -0700396 group("audio_processing_tests") {
397 testonly = true
398 public_deps = [
kjellander6ceab082016-10-28 05:44:03 -0700399 ":audioproc_test_utils",
400 ":click_annotate",
401 ":nonlinear_beamformer_test",
402 ":transient_suppression_test",
kjellander6ceab082016-10-28 05:44:03 -0700403 ]
404
405 if (rtc_enable_intelligibility_enhancer) {
406 public_deps += [ ":intelligibility_proc" ]
407 }
408
409 if (rtc_enable_protobuf) {
ehmaldonado1fd08c12017-01-17 02:37:34 -0800410 public_deps += [
411 ":audioproc_f",
412 ":audioproc_unittest_proto",
413 ":unpack_aecdump",
414 ]
kjellander6ceab082016-10-28 05:44:03 -0700415 }
416 }
417
ehmaldonado36268652017-01-19 08:27:11 -0800418 rtc_source_set("audio_processing_unittests") {
419 testonly = true
420 sources = [
421 "aec/echo_cancellation_unittest.cc",
422 "aec/system_delay_unittest.cc",
423 "agc/agc_manager_direct_unittest.cc",
424 "agc/loudness_histogram_unittest.cc",
425 "agc/mock_agc.h",
426 "audio_buffer_unittest.cc",
427 "beamformer/array_util_unittest.cc",
428 "beamformer/complex_matrix_unittest.cc",
429 "beamformer/covariance_matrix_generator_unittest.cc",
430 "beamformer/matrix_unittest.cc",
431 "beamformer/mock_nonlinear_beamformer.h",
ehmaldonado36268652017-01-19 08:27:11 -0800432 "config_unittest.cc",
433 "echo_cancellation_impl_unittest.cc",
434 "splitting_filter_unittest.cc",
435 "transient/dyadic_decimator_unittest.cc",
436 "transient/file_utils.cc",
437 "transient/file_utils.h",
438 "transient/file_utils_unittest.cc",
439 "transient/moving_moments_unittest.cc",
440 "transient/transient_detector_unittest.cc",
441 "transient/transient_suppressor_unittest.cc",
442 "transient/wpd_node_unittest.cc",
443 "transient/wpd_tree_unittest.cc",
444 "utility/block_mean_calculator_unittest.cc",
445 "utility/delay_estimator_unittest.cc",
446 "vad/gmm_unittest.cc",
447 "vad/pitch_based_vad_unittest.cc",
448 "vad/pitch_internal_unittest.cc",
449 "vad/pole_zero_filter_unittest.cc",
450 "vad/standalone_vad_unittest.cc",
451 "vad/vad_audio_proc_unittest.cc",
452 "vad/vad_circular_buffer_unittest.cc",
453 "vad/voice_activity_detector_unittest.cc",
454 ]
455
456 deps = [
457 ":audio_processing",
ehmaldonado36268652017-01-19 08:27:11 -0800458 ":audioproc_test_utils",
459 "../..:webrtc_common",
460 "../../base:gtest_prod",
461 "../../base:rtc_base",
462 "../../base:rtc_base_approved",
463 "../../common_audio:common_audio",
464 "../../system_wrappers:system_wrappers",
465 "../../test:test_support",
466 "../audio_coding:neteq_unittest_tools",
467 "//testing/gmock",
468 "//testing/gtest",
469 ]
470
471 defines = []
472
473 if (apm_debug_dump) {
474 defines += [ "WEBRTC_APM_DEBUG_DUMP=1" ]
475 } else {
476 defines += [ "WEBRTC_APM_DEBUG_DUMP=0" ]
477 }
478
479 if (rtc_enable_intelligibility_enhancer) {
480 defines += [ "WEBRTC_INTELLIGIBILITY_ENHANCER=1" ]
481 sources += [
482 "intelligibility/intelligibility_enhancer_unittest.cc",
483 "intelligibility/intelligibility_utils_unittest.cc",
484 ]
485 } else {
486 defines += [ "WEBRTC_INTELLIGIBILITY_ENHANCER=0" ]
487 }
488
489 if (rtc_prefer_fixed_point) {
490 defines += [ "WEBRTC_AUDIOPROC_FIXED_PROFILE" ]
491 } else {
492 defines += [ "WEBRTC_AUDIOPROC_FLOAT_PROFILE" ]
493 }
494
495 if (rtc_enable_protobuf) {
496 defines += [ "WEBRTC_AUDIOPROC_DEBUG_DUMP" ]
497 deps += [
ehmaldonadof49ff262017-01-23 04:26:02 -0800498 ":audioproc_debug_proto",
ehmaldonado36268652017-01-19 08:27:11 -0800499 ":audioproc_protobuf_utils",
500 ":audioproc_unittest_proto",
501 ]
502 sources += [
503 "aec3/block_framer_unittest.cc",
504 "aec3/block_processor_unittest.cc",
505 "aec3/cascaded_biquad_filter_unittest.cc",
506 "aec3/echo_canceller3_unittest.cc",
507 "aec3/frame_blocker_unittest.cc",
508 "aec3/mock/mock_block_processor.h",
509 "audio_processing_impl_locking_unittest.cc",
510 "audio_processing_impl_unittest.cc",
511 "audio_processing_unittest.cc",
ehmaldonadof49ff262017-01-23 04:26:02 -0800512 "beamformer/nonlinear_beamformer_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800513 "echo_cancellation_bit_exact_unittest.cc",
514 "echo_control_mobile_unittest.cc",
515 "echo_detector/circular_buffer_unittest.cc",
516 "echo_detector/mean_variance_estimator_unittest.cc",
517 "echo_detector/moving_max_unittest.cc",
518 "echo_detector/normalized_covariance_estimator_unittest.cc",
519 "gain_control_unittest.cc",
520 "level_controller/level_controller_unittest.cc",
521 "level_estimator_unittest.cc",
522 "low_cut_filter_unittest.cc",
523 "noise_suppression_unittest.cc",
524 "residual_echo_detector_unittest.cc",
525 "rms_level_unittest.cc",
526 "test/bitexactness_tools.cc",
527 "test/bitexactness_tools.h",
528 "test/debug_dump_replayer.cc",
529 "test/debug_dump_replayer.h",
530 "test/debug_dump_test.cc",
531 "test/test_utils.h",
532 "voice_detection_unittest.cc",
533 ]
534 }
535
536 if ((!build_with_chromium || is_win) && is_clang) {
537 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
538 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
539 }
540 }
541
ehmaldonado021eef32017-01-05 07:09:50 -0800542 rtc_source_set("audio_processing_perf_tests") {
543 # Has problems with autogenerated targets on Android and iOS
544 # Dependency chain (there may also be others):
545 # //webrtc/modules/audio_processing:audio_processing_perf_tests -->
546 # //webrtc/modules:modules_unittests --[private]-->
547 # //webrtc/modules:modules_unittests_apk -->
548 # //webrtc/modules:modules_unittests_apk__create -->
549 # //webrtc/modules:modules_unittests_apk__create__finalize -->
550 # //webrtc/modules:modules_unittests_apk__create__package --[private]-->
551 # //webrtc/modules:_modules_unittests__library
552 check_includes = false
553 testonly = true
554 sources = [
555 "audio_processing_performance_unittest.cc",
556 "level_controller/level_controller_complexity_unittest.cc",
557 "residual_echo_detector_complexity_unittest.cc",
558 ]
559 deps = [
560 ":audio_processing",
561 ":audioproc_test_utils",
562 "//testing/gtest",
563 ]
564 if (rtc_enable_intelligibility_enhancer) {
565 defines = [ "WEBRTC_INTELLIGIBILITY_ENHANCER=1" ]
566 } else {
567 defines = [ "WEBRTC_INTELLIGIBILITY_ENHANCER=0" ]
568 }
569 }
570
ehmaldonado1fd08c12017-01-17 02:37:34 -0800571 if (rtc_enable_protobuf) {
572 rtc_executable("unpack_aecdump") {
573 testonly = true
574 sources = [
575 "test/unpack.cc",
576 ]
peahc3ec1fd2016-08-07 23:19:30 -0700577
ehmaldonado1fd08c12017-01-17 02:37:34 -0800578 deps = [
579 ":audio_processing",
580 ":audioproc_debug_proto",
581 ":audioproc_protobuf_utils",
582 ":audioproc_test_utils",
583 "../..:webrtc_common",
584 "../../base:rtc_base_approved",
585 "../../common_audio",
586 "../../system_wrappers:system_wrappers_default",
587 "//third_party/gflags:gflags",
588 ]
589 } # unpack_aecdump
peahc3ec1fd2016-08-07 23:19:30 -0700590
ehmaldonado1fd08c12017-01-17 02:37:34 -0800591 rtc_executable("audioproc_f") {
592 testonly = true
593 sources = [
594 "test/aec_dump_based_simulator.cc",
595 "test/aec_dump_based_simulator.h",
596 "test/audio_processing_simulator.cc",
597 "test/audio_processing_simulator.h",
598 "test/audioproc_float.cc",
599 "test/wav_based_simulator.cc",
600 "test/wav_based_simulator.h",
601 ]
peahc3ec1fd2016-08-07 23:19:30 -0700602
ehmaldonado1fd08c12017-01-17 02:37:34 -0800603 deps = [
604 ":audio_processing",
605 ":audioproc_debug_proto",
606 ":audioproc_protobuf_utils",
607 ":audioproc_test_utils",
608 "../../base:rtc_base_approved",
609 "../../common_audio:common_audio",
610 "../../system_wrappers",
611 "../../system_wrappers:system_wrappers_default",
612 "../../test:test_support",
613 "//testing/gtest",
614 "//third_party/gflags:gflags",
615 ]
616 } # audioproc_f
617 }
peahc3ec1fd2016-08-07 23:19:30 -0700618
ehmaldonado38a21322016-09-02 04:10:34 -0700619 rtc_source_set("audioproc_test_utils") {
kjellanderfb114242016-06-13 00:19:48 -0700620 testonly = true
621 sources = [
ehmaldonado529f83c2016-07-27 08:14:32 -0700622 "test/audio_buffer_tools.cc",
623 "test/audio_buffer_tools.h",
ivoc3cfb3ef2016-11-24 04:17:28 -0800624 "test/performance_timer.cc",
625 "test/performance_timer.h",
626 "test/simulator_buffers.cc",
627 "test/simulator_buffers.h",
kjellanderfb114242016-06-13 00:19:48 -0700628 "test/test_utils.cc",
629 "test/test_utils.h",
630 ]
631
kjellanderfb114242016-06-13 00:19:48 -0700632 deps = [
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800633 ":audio_processing",
kjellanderfb114242016-06-13 00:19:48 -0700634 "../../base:rtc_base_approved",
635 "../../common_audio",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800636 "../../system_wrappers:system_wrappers",
kjellanderfb114242016-06-13 00:19:48 -0700637 ]
638 }
639
ehmaldonado38a21322016-09-02 04:10:34 -0700640 rtc_executable("transient_suppression_test") {
kwiberg7a770e02016-08-25 02:32:43 -0700641 testonly = true
642 sources = [
643 "transient/file_utils.cc",
644 "transient/file_utils.h",
645 "transient/transient_suppression_test.cc",
646 ]
647 deps = [
648 ":audio_processing",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800649 "../..:webrtc_common",
650 "../../common_audio:common_audio",
kwiberg7a770e02016-08-25 02:32:43 -0700651 "../../system_wrappers:metrics_default",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800652 "../../system_wrappers:system_wrappers",
kwiberg7a770e02016-08-25 02:32:43 -0700653 "../../test:test_support",
654 "//testing/gtest",
655 "//third_party/gflags",
656 ]
kwiberg7a770e02016-08-25 02:32:43 -0700657 }
658
ehmaldonado38a21322016-09-02 04:10:34 -0700659 rtc_executable("click_annotate") {
kwiberg7a770e02016-08-25 02:32:43 -0700660 testonly = true
661 sources = [
662 "transient/click_annotate.cc",
663 "transient/file_utils.cc",
664 "transient/file_utils.h",
665 ]
666 deps = [
667 ":audio_processing",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800668 "../..:webrtc_common",
kwiberg7a770e02016-08-25 02:32:43 -0700669 "../../system_wrappers:metrics_default",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800670 "../../system_wrappers:system_wrappers",
kwiberg7a770e02016-08-25 02:32:43 -0700671 ]
672 }
673
ehmaldonado38a21322016-09-02 04:10:34 -0700674 rtc_executable("nonlinear_beamformer_test") {
kwiberg7a770e02016-08-25 02:32:43 -0700675 testonly = true
676 sources = [
677 "beamformer/nonlinear_beamformer_test.cc",
678 ]
679 deps = [
680 ":audio_processing",
681 ":audioproc_test_utils",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800682 "../../base:rtc_base_approved",
683 "../../common_audio:common_audio",
kwiberg7a770e02016-08-25 02:32:43 -0700684 "../../system_wrappers:metrics_default",
685 "//third_party/gflags",
686 ]
kwiberg7a770e02016-08-25 02:32:43 -0700687 }
688
peah1bcfce52016-08-26 07:16:04 -0700689 if (rtc_enable_intelligibility_enhancer) {
ehmaldonado38a21322016-09-02 04:10:34 -0700690 rtc_executable("intelligibility_proc") {
peah1bcfce52016-08-26 07:16:04 -0700691 testonly = true
692 sources = [
693 "intelligibility/test/intelligibility_proc.cc",
694 ]
695 deps = [
696 ":audio_processing",
697 ":audioproc_test_utils",
698 "../../system_wrappers:metrics_default",
699 "../../test:test_support",
700 "//testing/gtest",
701 "//third_party/gflags",
702 ]
kwiberg7a770e02016-08-25 02:32:43 -0700703 }
704 }
705
kjellanderfb114242016-06-13 00:19:48 -0700706 if (rtc_enable_protobuf) {
707 proto_library("audioproc_unittest_proto") {
708 sources = [
709 "test/unittest.proto",
710 ]
711 proto_out_dir = "webrtc/modules/audio_processing"
712 }
713
kjellanderb62dbbe2016-09-23 00:38:52 -0700714 rtc_static_library("audioproc_protobuf_utils") {
kjellanderfb114242016-06-13 00:19:48 -0700715 sources = [
716 "test/protobuf_utils.cc",
717 "test/protobuf_utils.h",
718 ]
719
720 deps = [
ehmaldonadobcba64a2016-08-19 02:11:07 -0700721 ":audioproc_debug_proto",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800722 "../..:webrtc_common",
723 "../../base:rtc_base_approved",
kjellanderfb114242016-06-13 00:19:48 -0700724 ]
725 }
726 }
727}