blob: 4be7d8f8fd8b4ab59e283536abbd40bc93341d19 [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
mbonadei9aa3f0a2017-01-24 06:58:22 -08009import("../../webrtc.gni")
Dan Minor9c686132018-01-15 10:20:00 -050010if (!build_with_mozilla) {
11 import("//third_party/protobuf/proto_library.gni")
12}
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000013
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000014declare_args() {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000015 # Disables the usual mode where we trust the reported system delay
16 # values the AEC receives. The corresponding define is set appropriately
17 # in the code, but it can be force-enabled here for testing.
18 aec_untrusted_delay_for_testing = false
19}
20
Patrik Höglundd75c8dc2017-12-19 09:45:24 +010021config("apm_debug_dump") {
22 if (apm_debug_dump) {
23 defines = [ "WEBRTC_APM_DEBUG_DUMP=1" ]
24 } else {
25 defines = [ "WEBRTC_APM_DEBUG_DUMP=0" ]
26 }
27}
28
kjellanderb62dbbe2016-09-23 00:38:52 -070029rtc_static_library("audio_processing") {
Per Kjellandera7f2d842018-01-10 15:54:53 +000030 visibility = [ "*" ]
Patrik Höglundd75c8dc2017-12-19 09:45:24 +010031 configs += [ ":apm_debug_dump" ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000032 sources = [
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000033 "audio_buffer.cc",
34 "audio_buffer.h",
35 "audio_processing_impl.cc",
36 "audio_processing_impl.h",
37 "common.h",
38 "echo_cancellation_impl.cc",
39 "echo_cancellation_impl.h",
40 "echo_control_mobile_impl.cc",
41 "echo_control_mobile_impl.h",
ivocaf27ed02016-10-28 07:04:03 -070042 "echo_detector/circular_buffer.cc",
43 "echo_detector/circular_buffer.h",
44 "echo_detector/mean_variance_estimator.cc",
45 "echo_detector/mean_variance_estimator.h",
ivoc4e477a12017-01-15 08:29:46 -080046 "echo_detector/moving_max.cc",
47 "echo_detector/moving_max.h",
ivocaf27ed02016-10-28 07:04:03 -070048 "echo_detector/normalized_covariance_estimator.cc",
49 "echo_detector/normalized_covariance_estimator.h",
peahbe615622016-02-13 16:40:47 -080050 "gain_control_for_experimental_agc.cc",
51 "gain_control_for_experimental_agc.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000052 "gain_control_impl.cc",
53 "gain_control_impl.h",
Alex Loikoe36e8bb2018-02-16 11:54:07 +010054 "gain_controller2.cc",
55 "gain_controller2.h",
Alex Loiko1aec5942018-05-15 13:13:22 +020056 "include/aec_dump.cc",
57 "include/aec_dump.h",
peahc19f3122016-10-07 14:54:10 -070058 "include/audio_processing.cc",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000059 "include/audio_processing.h",
solenberg88499ec2016-09-07 07:34:41 -070060 "include/config.cc",
61 "include/config.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000062 "level_estimator_impl.cc",
63 "level_estimator_impl.h",
peah8271d042016-11-22 07:24:52 -080064 "low_cut_filter.cc",
65 "low_cut_filter.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000066 "noise_suppression_impl.cc",
67 "noise_suppression_impl.h",
peah737f4b82016-03-10 23:05:28 -080068 "render_queue_item_verifier.h",
ivoc9f4a4a02016-10-28 05:39:16 -070069 "residual_echo_detector.cc",
70 "residual_echo_detector.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000071 "rms_level.cc",
72 "rms_level.h",
aluebs@webrtc.orgbe05c742014-11-14 22:18:10 +000073 "splitting_filter.cc",
74 "splitting_filter.h",
Alejandro Luebs5a92aa82015-04-27 11:34:45 -070075 "three_band_filter_bank.cc",
76 "three_band_filter_bank.h",
pbos@webrtc.org788acd12014-12-15 09:41:24 +000077 "transient/common.h",
78 "transient/daubechies_8_wavelet_coeffs.h",
79 "transient/dyadic_decimator.h",
80 "transient/moving_moments.cc",
81 "transient/moving_moments.h",
82 "transient/transient_detector.cc",
83 "transient/transient_detector.h",
84 "transient/transient_suppressor.cc",
85 "transient/transient_suppressor.h",
86 "transient/wpd_node.cc",
87 "transient/wpd_node.h",
88 "transient/wpd_tree.cc",
89 "transient/wpd_tree.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000090 "typing_detection.cc",
91 "typing_detection.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000092 "voice_detection_impl.cc",
93 "voice_detection_impl.h",
94 ]
95
96 defines = []
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020097 deps = [
Patrik Höglunde6ffc422017-12-11 10:28:16 +010098 ":apm_logging",
Alex Loikoe36e8bb2018-02-16 11:54:07 +010099 ":audio_frame_view",
Sam Zackrisson4d364492018-03-02 16:03:21 +0100100 ":audio_generator_interface",
Mirko Bonadei10679932017-12-05 15:07:16 +0100101 ":audio_processing_c",
Ivo Creusen56d46092017-11-24 17:29:59 +0100102 ":audio_processing_statistics",
Alex Loikoed8ff642018-07-06 14:54:30 +0200103 ":gain_control_interface",
Gustaf Ullbergf35c6662018-02-23 13:18:29 +0100104 "../..:typedefs",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200105 "../..:webrtc_common",
kwiberg529662a2017-09-04 05:43:17 -0700106 "../../api:array_view",
Gustaf Ullberg2ae140a2018-02-16 13:43:49 +0100107 "../../api/audio:aec3_config",
Fredrik Solenbergbbf21a32018-04-12 22:44:09 +0200108 "../../api/audio:audio_frame_api",
Gustaf Ullberg2ae140a2018-02-16 13:43:49 +0100109 "../../api/audio:echo_control",
aleloi6321b492016-12-05 01:46:09 -0800110 "../../audio/utility:audio_frame_operations",
Mirko Bonadeidbbb33c2018-02-05 15:50:41 +0100111 "../../common_audio:common_audio_c",
Artem Titovdf3bcdb2018-06-26 14:12:18 +0200112 "../../common_audio:fft4g",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100113 "../../rtc_base:checks",
Patrik Höglund3e113432017-12-15 14:40:10 +0100114 "../../rtc_base:deprecation",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700115 "../../rtc_base:gtest_prod",
Karl Wiberg12edf4c2018-03-07 14:18:56 +0100116 "../../rtc_base:safe_minmax",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100117 "../../rtc_base:sanitizer",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100118 "../../system_wrappers:cpu_features_api",
Per Åhgren11556462017-12-22 16:13:57 +0100119 "../../system_wrappers:field_trial_api",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100120 "../../system_wrappers:metrics_api",
Sam Zackrisson7219d052018-07-09 14:28:15 +0200121 "aec:aec",
122 "aec:aec_core",
123 "aecm:aecm_core",
Alex Loikoed8ff642018-07-06 14:54:30 +0200124 "agc",
125 "agc:agc_legacy_c",
Alex Loiko2bac8962018-03-27 13:38:36 +0200126 "agc2:adaptive_digital",
127 "agc2:fixed_digital",
Alex Loikob5c9a792018-04-16 16:31:22 +0200128 "agc2:gain_applier",
Alex Loiko0488fcf2018-02-05 11:15:23 +0100129 "vad",
Danil Chapovalovdb9f7ab2018-06-19 10:50:11 +0200130 "//third_party/abseil-cpp/absl/types:optional",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200131 ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000132
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000133 if (aec_untrusted_delay_for_testing) {
134 defines += [ "WEBRTC_UNTRUSTED_DELAY" ]
135 }
136
peah1bcfce52016-08-26 07:16:04 -0700137 if (rtc_enable_intelligibility_enhancer) {
138 defines += [ "WEBRTC_INTELLIGIBILITY_ENHANCER=1" ]
139 sources += [
140 "intelligibility/intelligibility_enhancer.cc",
141 "intelligibility/intelligibility_enhancer.h",
142 "intelligibility/intelligibility_utils.cc",
143 "intelligibility/intelligibility_utils.h",
144 ]
145 } else {
146 defines += [ "WEBRTC_INTELLIGIBILITY_ENHANCER=0" ]
147 }
148
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000149 if (rtc_prefer_fixed_point) {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000150 defines += [ "WEBRTC_NS_FIXED" ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000151 } else {
152 defines += [ "WEBRTC_NS_FLOAT" ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000153 }
154
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000155 deps += [
156 "../../common_audio",
Patrik Höglundf715c532017-11-17 11:04:15 +0100157 "../../common_audio:fir_filter",
158 "../../common_audio:fir_filter_factory",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700159 "../../rtc_base:rtc_base_approved",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000160 "../../system_wrappers",
161 ]
162}
163
Alex Loikoed8ff642018-07-06 14:54:30 +0200164rtc_source_set("gain_control_interface") {
165 sources = [
166 "include/gain_control.h",
167 ]
168}
169
Ivo Creusen56d46092017-11-24 17:29:59 +0100170rtc_source_set("audio_processing_statistics") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000171 visibility = [ "*" ]
Ivo Creusen56d46092017-11-24 17:29:59 +0100172 sources = [
173 "include/audio_processing_statistics.cc",
174 "include/audio_processing_statistics.h",
175 ]
176 deps = [
Danil Chapovalovdb9f7ab2018-06-19 10:50:11 +0200177 "//third_party/abseil-cpp/absl/types:optional",
Ivo Creusen56d46092017-11-24 17:29:59 +0100178 ]
179}
180
Alex Loikoe36e8bb2018-02-16 11:54:07 +0100181rtc_source_set("audio_frame_view") {
182 sources = [
183 "include/audio_frame_view.h",
184 ]
185 deps = [
186 "../../api:array_view",
187 ]
188}
189
Sam Zackrisson4d364492018-03-02 16:03:21 +0100190rtc_source_set("audio_generator_interface") {
191 visibility = [ "*" ]
192 sources = [
193 "include/audio_generator.h",
194 ]
195 deps = [
196 ":audio_frame_view",
197 "../../rtc_base:rtc_base_approved",
198 "../../system_wrappers:system_wrappers",
199 ]
200}
201
202rtc_source_set("audio_generator_factory") {
203 visibility = [ "*" ]
204 sources = [
205 "include/audio_generator_factory.cc",
206 "include/audio_generator_factory.h",
207 ]
208 deps = [
209 ":audio_generator_interface",
210 ":file_audio_generator",
211 "../../common_audio:common_audio",
212 "../../rtc_base:rtc_base_approved",
213 "../../system_wrappers:system_wrappers",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200214 "//third_party/abseil-cpp/absl/memory",
Sam Zackrisson4d364492018-03-02 16:03:21 +0100215 ]
216}
217
218rtc_source_set("file_audio_generator") {
219 sources = [
220 "audio_generator/file_audio_generator.cc",
221 "audio_generator/file_audio_generator.h",
222 ]
223 deps = [
224 ":audio_generator_interface",
225 "../../common_audio:common_audio",
226 "../../rtc_base:rtc_base_approved",
227 "../../system_wrappers:system_wrappers",
228 ]
229}
230
kjellander7439f972016-12-05 22:47:46 -0800231rtc_source_set("audio_processing_c") {
232 visibility = [ ":*" ] # Only targets in this file can depend on this.
Alex Loikoed8ff642018-07-06 14:54:30 +0200233 sources = []
kjellander7439f972016-12-05 22:47:46 -0800234
235 if (rtc_prefer_fixed_point) {
236 sources += [
237 "ns/noise_suppression_x.c",
238 "ns/noise_suppression_x.h",
239 "ns/nsx_core.c",
240 "ns/nsx_core.h",
241 "ns/nsx_defines.h",
242 ]
243 if (current_cpu == "mipsel") {
244 sources += [ "ns/nsx_core_mips.c" ]
245 } else {
246 sources += [ "ns/nsx_core_c.c" ]
247 }
248 } else {
249 sources += [
250 "ns/defines.h",
251 "ns/noise_suppression.c",
252 "ns/noise_suppression.h",
253 "ns/ns_core.c",
254 "ns/ns_core.h",
255 "ns/windows_private.h",
256 ]
257 }
258
259 deps = [
Gustaf Ullbergf35c6662018-02-23 13:18:29 +0100260 "../..:typedefs",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800261 "../..:webrtc_common",
kjellander7439f972016-12-05 22:47:46 -0800262 "../../common_audio",
Mirko Bonadeidbbb33c2018-02-05 15:50:41 +0100263 "../../common_audio:common_audio_c",
Artem Titovdf3bcdb2018-06-26 14:12:18 +0200264 "../../common_audio:fft4g",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100265 "../../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700266 "../../rtc_base:rtc_base_approved",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100267 "../../system_wrappers:cpu_features_api",
Alex Loikoed8ff642018-07-06 14:54:30 +0200268 "agc:agc_legacy_c",
kjellander7439f972016-12-05 22:47:46 -0800269 ]
mbonadeie5dc3ce2017-01-25 05:34:46 -0800270
271 if (rtc_build_with_neon) {
Patrik Höglund67c20ae2017-12-18 11:21:14 +0100272 sources += [ "ns/nsx_core_neon.c" ]
273
274 if (current_cpu != "arm64") {
275 # Enable compilation for the NEON instruction set. This is needed
276 # since //build/config/arm.gni only enables NEON for iOS, not Android.
277 # This provides the same functionality as webrtc/build/arm_neon.gypi.
278 suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
279 cflags = [ "-mfpu=neon" ]
280 }
281
282 # Disable LTO on NEON targets due to compiler bug.
283 # TODO(fdegans): Enable this. See crbug.com/408997.
284 if (rtc_use_lto) {
285 cflags -= [
286 "-flto",
287 "-ffat-lto-objects",
288 ]
289 }
mbonadeie5dc3ce2017-01-25 05:34:46 -0800290 }
kjellander7439f972016-12-05 22:47:46 -0800291}
292
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000293if (rtc_enable_protobuf) {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000294 proto_library("audioproc_debug_proto") {
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200295 sources = [
296 "debug.proto",
297 ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000298
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200299 proto_out_dir = "modules/audio_processing"
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000300 }
301}
302
Patrik Höglunde6ffc422017-12-11 10:28:16 +0100303rtc_source_set("apm_logging") {
Patrik Höglundd75c8dc2017-12-19 09:45:24 +0100304 configs += [ ":apm_debug_dump" ]
Patrik Höglunde6ffc422017-12-11 10:28:16 +0100305 sources = [
306 "logging/apm_data_dumper.cc",
307 "logging/apm_data_dumper.h",
308 ]
309 deps = [
310 "../../api:array_view",
311 "../../common_audio:common_audio",
312 "../../rtc_base:rtc_base_approved",
Patrik Höglund3e113432017-12-15 14:40:10 +0100313 "../../rtc_base:stringutils",
Patrik Höglunde6ffc422017-12-11 10:28:16 +0100314 ]
315 defines = []
Patrik Höglunde6ffc422017-12-11 10:28:16 +0100316}
Patrik Höglunda36d0e22017-12-04 10:11:11 +0000317
kjellanderfb114242016-06-13 00:19:48 -0700318if (rtc_include_tests) {
Patrik Höglund62139292017-12-19 16:44:45 +0100319 rtc_source_set("mocks") {
320 testonly = true
321 sources = [
322 "include/mock_audio_processing.h",
323 ]
324 deps = [
Patrik Höglund62139292017-12-19 16:44:45 +0100325 ":audio_processing",
326 ":audio_processing_statistics",
327 "../../test:test_support",
328 ]
329 }
330
kjellander6ceab082016-10-28 05:44:03 -0700331 group("audio_processing_tests") {
332 testonly = true
Mirko Bonadei10679932017-12-05 15:07:16 +0100333 deps = [
kjellander6ceab082016-10-28 05:44:03 -0700334 ":audioproc_test_utils",
335 ":click_annotate",
kjellander6ceab082016-10-28 05:44:03 -0700336 ":transient_suppression_test",
kjellander6ceab082016-10-28 05:44:03 -0700337 ]
338
339 if (rtc_enable_intelligibility_enhancer) {
Mirko Bonadei10679932017-12-05 15:07:16 +0100340 deps += [ ":intelligibility_proc" ]
kjellander6ceab082016-10-28 05:44:03 -0700341 }
342
343 if (rtc_enable_protobuf) {
Mirko Bonadei10679932017-12-05 15:07:16 +0100344 deps += [
ehmaldonado1fd08c12017-01-17 02:37:34 -0800345 ":audioproc_f",
346 ":audioproc_unittest_proto",
Alessio Bazzicaca90a552017-09-27 11:51:10 +0200347 "aec_dump:aec_dump_unittests",
alessiob5f32aca2017-03-18 02:29:13 -0700348 "test/conversational_speech",
alessiob306d1bf2017-02-24 05:32:21 -0800349 "test/py_quality_assessment",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800350 ]
kjellander6ceab082016-10-28 05:44:03 -0700351 }
352 }
353
ehmaldonado36268652017-01-19 08:27:11 -0800354 rtc_source_set("audio_processing_unittests") {
355 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700356
Patrik Höglundd75c8dc2017-12-19 09:45:24 +0100357 configs += [ ":apm_debug_dump" ]
ehmaldonado36268652017-01-19 08:27:11 -0800358 sources = [
ehmaldonado36268652017-01-19 08:27:11 -0800359 "audio_buffer_unittest.cc",
Alex Loiko153f11e2018-02-16 12:39:00 +0100360 "audio_frame_view_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800361 "config_unittest.cc",
362 "echo_cancellation_impl_unittest.cc",
Alex Loiko153f11e2018-02-16 12:39:00 +0100363 "gain_controller2_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800364 "splitting_filter_unittest.cc",
Alessio Bazzicaca90a552017-09-27 11:51:10 +0200365 "test/fake_recording_device_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800366 "transient/dyadic_decimator_unittest.cc",
367 "transient/file_utils.cc",
368 "transient/file_utils.h",
369 "transient/file_utils_unittest.cc",
370 "transient/moving_moments_unittest.cc",
371 "transient/transient_detector_unittest.cc",
372 "transient/transient_suppressor_unittest.cc",
373 "transient/wpd_node_unittest.cc",
374 "transient/wpd_tree_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800375 ]
376
377 deps = [
Alessio Bazzicaca90a552017-09-27 11:51:10 +0200378 ":analog_mic_simulation",
Patrik Höglunde6ffc422017-12-11 10:28:16 +0100379 ":apm_logging",
Alex Loiko153f11e2018-02-16 12:39:00 +0100380 ":audio_frame_view",
ehmaldonado36268652017-01-19 08:27:11 -0800381 ":audio_processing",
ehmaldonado36268652017-01-19 08:27:11 -0800382 ":audioproc_test_utils",
Sam Zackrisson4d364492018-03-02 16:03:21 +0100383 ":file_audio_generator_unittests",
Patrik Höglund62139292017-12-19 16:44:45 +0100384 ":mocks",
Gustaf Ullbergf35c6662018-02-23 13:18:29 +0100385 "../..:typedefs",
ehmaldonado36268652017-01-19 08:27:11 -0800386 "../..:webrtc_common",
kwiberg529662a2017-09-04 05:43:17 -0700387 "../../api:array_view",
Gustaf Ullberg2ae140a2018-02-16 13:43:49 +0100388 "../../api/audio:aec3_config",
Gustaf Ullberg0efa9412018-02-27 13:58:45 +0100389 "../../api/audio:aec3_factory",
ehmaldonado36268652017-01-19 08:27:11 -0800390 "../../common_audio:common_audio",
Mirko Bonadeidbbb33c2018-02-05 15:50:41 +0100391 "../../common_audio:common_audio_c",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100392 "../../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700393 "../../rtc_base:gtest_prod",
394 "../../rtc_base:protobuf_utils",
395 "../../rtc_base:rtc_base",
396 "../../rtc_base:rtc_base_approved",
Karl Wiberg12edf4c2018-03-07 14:18:56 +0100397 "../../rtc_base:safe_minmax",
Karl Wiberg6a4d4112018-03-23 10:39:34 +0100398 "../../rtc_base/system:file_wrapper",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100399 "../../system_wrappers",
400 "../../system_wrappers:cpu_features_api",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100401 "../../test:fileutils",
ehmaldonado36268652017-01-19 08:27:11 -0800402 "../../test:test_support",
Ivo Creusen385b10b2017-10-13 12:37:27 +0200403 "../audio_coding:neteq_input_audio_tools",
Sam Zackrisson7219d052018-07-09 14:28:15 +0200404 "aec:aec_core",
405 "aec:aec_unittests",
aleloi20e4a732017-06-08 08:12:46 -0700406 "aec_dump:mock_aec_dump_unittests",
Alex Loikoed8ff642018-07-06 14:54:30 +0200407 "agc:agc_unittests",
Alex Loiko1e48e802018-03-28 09:45:29 +0200408 "agc2:adaptive_digital_unittests",
Alessio Bazzicad8d02142018-05-07 13:26:47 +0200409 "agc2:biquad_filter_unittests",
Alex Loikoe36e8bb2018-02-16 11:54:07 +0100410 "agc2:fixed_digital_unittests",
Alex Loiko4ed47d02018-04-04 15:05:57 +0200411 "agc2:noise_estimator_unittests",
Alessio Bazzica4736d4e2018-04-17 16:46:45 +0200412 "agc2/rnn_vad:unittests",
alessiob4b6463c2017-03-23 05:17:06 -0700413 "test/conversational_speech:unittest",
Sam Zackrissonb2e17652018-07-05 16:41:55 +0200414 "utility:block_mean_calculator_unittest",
415 "utility:legacy_delay_estimator_unittest",
Alex Loiko0488fcf2018-02-05 11:15:23 +0100416 "vad:vad_unittests",
ehmaldonado36268652017-01-19 08:27:11 -0800417 "//testing/gtest",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200418 "//third_party/abseil-cpp/absl/memory",
Danil Chapovalovdb9f7ab2018-06-19 10:50:11 +0200419 "//third_party/abseil-cpp/absl/types:optional",
ehmaldonado36268652017-01-19 08:27:11 -0800420 ]
421
422 defines = []
423
ehmaldonado36268652017-01-19 08:27:11 -0800424 if (rtc_enable_intelligibility_enhancer) {
425 defines += [ "WEBRTC_INTELLIGIBILITY_ENHANCER=1" ]
426 sources += [
427 "intelligibility/intelligibility_enhancer_unittest.cc",
428 "intelligibility/intelligibility_utils_unittest.cc",
429 ]
430 } else {
431 defines += [ "WEBRTC_INTELLIGIBILITY_ENHANCER=0" ]
432 }
433
434 if (rtc_prefer_fixed_point) {
435 defines += [ "WEBRTC_AUDIOPROC_FIXED_PROFILE" ]
436 } else {
437 defines += [ "WEBRTC_AUDIOPROC_FLOAT_PROFILE" ]
438 }
439
440 if (rtc_enable_protobuf) {
441 defines += [ "WEBRTC_AUDIOPROC_DEBUG_DUMP" ]
442 deps += [
ehmaldonadof49ff262017-01-23 04:26:02 -0800443 ":audioproc_debug_proto",
ehmaldonado36268652017-01-19 08:27:11 -0800444 ":audioproc_protobuf_utils",
Sam Zackrissond57f9dd2017-09-13 11:00:04 +0200445 ":audioproc_test_utils",
ehmaldonado36268652017-01-19 08:27:11 -0800446 ":audioproc_unittest_proto",
Fredrik Solenbergbbf21a32018-04-12 22:44:09 +0200447 "../../api/audio:audio_frame_api",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700448 "../../rtc_base:rtc_task_queue",
aleloif4dd1912017-06-15 01:55:38 -0700449 "aec_dump",
450 "aec_dump:aec_dump_unittests",
ehmaldonado36268652017-01-19 08:27:11 -0800451 ]
452 sources += [
ehmaldonado36268652017-01-19 08:27:11 -0800453 "audio_processing_impl_locking_unittest.cc",
454 "audio_processing_impl_unittest.cc",
455 "audio_processing_unittest.cc",
456 "echo_cancellation_bit_exact_unittest.cc",
457 "echo_control_mobile_unittest.cc",
458 "echo_detector/circular_buffer_unittest.cc",
459 "echo_detector/mean_variance_estimator_unittest.cc",
460 "echo_detector/moving_max_unittest.cc",
461 "echo_detector/normalized_covariance_estimator_unittest.cc",
462 "gain_control_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800463 "level_estimator_unittest.cc",
464 "low_cut_filter_unittest.cc",
465 "noise_suppression_unittest.cc",
466 "residual_echo_detector_unittest.cc",
467 "rms_level_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800468 "test/debug_dump_replayer.cc",
469 "test/debug_dump_replayer.h",
470 "test/debug_dump_test.cc",
peah69221db2017-01-27 03:28:19 -0800471 "test/echo_canceller_test_tools.cc",
472 "test/echo_canceller_test_tools.h",
473 "test/echo_canceller_test_tools_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800474 "test/test_utils.h",
475 "voice_detection_unittest.cc",
476 ]
477 }
478
479 if ((!build_with_chromium || is_win) && is_clang) {
480 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
481 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
482 }
483 }
484
ehmaldonado021eef32017-01-05 07:09:50 -0800485 rtc_source_set("audio_processing_perf_tests") {
ehmaldonado021eef32017-01-05 07:09:50 -0800486 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700487
ehmaldonado021eef32017-01-05 07:09:50 -0800488 sources = [
489 "audio_processing_performance_unittest.cc",
ehmaldonado021eef32017-01-05 07:09:50 -0800490 ]
491 deps = [
492 ":audio_processing",
493 ":audioproc_test_utils",
Ivo Creusen69d276d2017-11-24 15:35:57 +0100494 "../../api:array_view",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700495 "../../rtc_base:protobuf_utils",
Ivo Creusen69d276d2017-11-24 15:35:57 +0100496 "../../rtc_base:rtc_base_approved",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100497 "../../system_wrappers",
Edward Lemure66572b2018-01-05 15:34:09 +0100498 "../../test:perf_test",
Ivo Creusen69d276d2017-11-24 15:35:57 +0100499 "../../test:test_support",
ehmaldonado021eef32017-01-05 07:09:50 -0800500 ]
mbonadei7c2c8432017-04-07 00:59:12 -0700501
ehmaldonado021eef32017-01-05 07:09:50 -0800502 if (rtc_enable_intelligibility_enhancer) {
503 defines = [ "WEBRTC_INTELLIGIBILITY_ENHANCER=1" ]
504 } else {
505 defines = [ "WEBRTC_INTELLIGIBILITY_ENHANCER=0" ]
506 }
507 }
508
Sam Zackrisson4d364492018-03-02 16:03:21 +0100509 rtc_source_set("file_audio_generator_unittests") {
510 testonly = true
511
512 sources = [
513 "audio_generator/file_audio_generator_unittest.cc",
514 ]
515
516 deps = [
517 ":audio_generator_factory",
518 ":audio_processing",
519 ":file_audio_generator",
520 "../../rtc_base:rtc_base_approved",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100521 "../../test:fileutils",
Sam Zackrisson4d364492018-03-02 16:03:21 +0100522 "../../test:test_support",
523 ]
524 }
525
Alessio Bazzicaca90a552017-09-27 11:51:10 +0200526 rtc_source_set("analog_mic_simulation") {
527 sources = [
528 "test/fake_recording_device.cc",
529 "test/fake_recording_device.h",
530 ]
531 deps = [
532 "../../api:array_view",
Fredrik Solenbergbbf21a32018-04-12 22:44:09 +0200533 "../../api/audio:audio_frame_api",
Alessio Bazzicaca90a552017-09-27 11:51:10 +0200534 "../../common_audio:common_audio",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100535 "../../rtc_base:checks",
Alessio Bazzicaca90a552017-09-27 11:51:10 +0200536 "../../rtc_base:rtc_base_approved",
Alex Loiko5c71e742018-07-02 11:37:47 +0200537 "../../rtc_base:safe_minmax",
Alex Loikoed8ff642018-07-06 14:54:30 +0200538 "agc:gain_map",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200539 "//third_party/abseil-cpp/absl/memory",
Danil Chapovalovdb9f7ab2018-06-19 10:50:11 +0200540 "//third_party/abseil-cpp/absl/types:optional",
Alessio Bazzicaca90a552017-09-27 11:51:10 +0200541 ]
542 }
543
ehmaldonado1fd08c12017-01-17 02:37:34 -0800544 if (rtc_enable_protobuf) {
Ivo Creusen8c812f32018-03-09 17:33:04 +0100545 rtc_source_set("audioproc_f_impl") {
ehmaldonado1fd08c12017-01-17 02:37:34 -0800546 testonly = true
547 sources = [
548 "test/aec_dump_based_simulator.cc",
549 "test/aec_dump_based_simulator.h",
550 "test/audio_processing_simulator.cc",
551 "test/audio_processing_simulator.h",
Ivo Creusen2cb41052018-03-15 12:22:52 +0100552 "test/audioproc_float_impl.cc",
553 "test/audioproc_float_impl.h",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800554 "test/wav_based_simulator.cc",
555 "test/wav_based_simulator.h",
556 ]
peahc3ec1fd2016-08-07 23:19:30 -0700557
ehmaldonado1fd08c12017-01-17 02:37:34 -0800558 deps = [
Alessio Bazzicaca90a552017-09-27 11:51:10 +0200559 ":analog_mic_simulation",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800560 ":audio_processing",
561 ":audioproc_debug_proto",
562 ":audioproc_protobuf_utils",
563 ":audioproc_test_utils",
Gustaf Ullberg0efa9412018-02-27 13:58:45 +0100564 "../../api/audio:aec3_factory",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800565 "../../common_audio:common_audio",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100566 "../../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700567 "../../rtc_base:protobuf_utils",
568 "../../rtc_base:rtc_base_approved",
Per Åhgrenad09d742018-03-08 07:47:14 +0100569 "../../rtc_base:rtc_json",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700570 "../../rtc_base:rtc_task_queue",
Patrik Höglund3e113432017-12-15 14:40:10 +0100571 "../../rtc_base:stringutils",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800572 "../../system_wrappers",
573 "../../system_wrappers:system_wrappers_default",
574 "../../test:test_support",
aleloif4dd1912017-06-15 01:55:38 -0700575 "aec_dump",
576 "aec_dump:aec_dump_impl",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800577 "//testing/gtest",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200578 "//third_party/abseil-cpp/absl/memory",
Danil Chapovalovdb9f7ab2018-06-19 10:50:11 +0200579 "//third_party/abseil-cpp/absl/types:optional",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800580 ]
Ivo Creusen8c812f32018-03-09 17:33:04 +0100581 } # audioproc_f_impl
582 rtc_executable("audioproc_f") {
583 testonly = true
584 sources = [
585 "test/audioproc_float_main.cc",
586 ]
587 deps = [
588 ":audio_processing",
Ivo Creusen2cb41052018-03-15 12:22:52 +0100589 "../../api:audioproc_f_api",
Ivo Creusen8c812f32018-03-09 17:33:04 +0100590 "../../rtc_base:rtc_base_approved",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200591 "//third_party/abseil-cpp/absl/memory",
Ivo Creusen8c812f32018-03-09 17:33:04 +0100592 ]
ehmaldonado1fd08c12017-01-17 02:37:34 -0800593 } # audioproc_f
594 }
peahc3ec1fd2016-08-07 23:19:30 -0700595
ehmaldonado38a21322016-09-02 04:10:34 -0700596 rtc_source_set("audioproc_test_utils") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000597 visibility = [ "*" ]
kjellanderfb114242016-06-13 00:19:48 -0700598 testonly = true
599 sources = [
ehmaldonado529f83c2016-07-27 08:14:32 -0700600 "test/audio_buffer_tools.cc",
601 "test/audio_buffer_tools.h",
Sam Zackrissond57f9dd2017-09-13 11:00:04 +0200602 "test/bitexactness_tools.cc",
603 "test/bitexactness_tools.h",
ivoc3cfb3ef2016-11-24 04:17:28 -0800604 "test/performance_timer.cc",
605 "test/performance_timer.h",
606 "test/simulator_buffers.cc",
607 "test/simulator_buffers.h",
kjellanderfb114242016-06-13 00:19:48 -0700608 "test/test_utils.cc",
609 "test/test_utils.h",
610 ]
611
kjellanderfb114242016-06-13 00:19:48 -0700612 deps = [
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800613 ":audio_processing",
kwiberg529662a2017-09-04 05:43:17 -0700614 "../../api:array_view",
Fredrik Solenbergbbf21a32018-04-12 22:44:09 +0200615 "../../api/audio:audio_frame_api",
kjellanderfb114242016-06-13 00:19:48 -0700616 "../../common_audio",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100617 "../../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700618 "../../rtc_base:rtc_base_approved",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100619 "../../system_wrappers",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100620 "../../test:fileutils",
Sam Zackrissond57f9dd2017-09-13 11:00:04 +0200621 "../../test:test_support",
Ivo Creusen385b10b2017-10-13 12:37:27 +0200622 "../audio_coding:neteq_input_audio_tools",
Sam Zackrissond57f9dd2017-09-13 11:00:04 +0200623 "//testing/gtest",
Danil Chapovalovdb9f7ab2018-06-19 10:50:11 +0200624 "//third_party/abseil-cpp/absl/types:optional",
kjellanderfb114242016-06-13 00:19:48 -0700625 ]
626 }
627
ehmaldonado38a21322016-09-02 04:10:34 -0700628 rtc_executable("transient_suppression_test") {
kwiberg7a770e02016-08-25 02:32:43 -0700629 testonly = true
630 sources = [
631 "transient/file_utils.cc",
632 "transient/file_utils.h",
633 "transient/transient_suppression_test.cc",
634 ]
635 deps = [
636 ":audio_processing",
Gustaf Ullbergf35c6662018-02-23 13:18:29 +0100637 "../..:typedefs",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800638 "../..:webrtc_common",
639 "../../common_audio:common_audio",
oprypin6e09d872017-08-31 03:21:39 -0700640 "../../rtc_base:rtc_base_approved",
Karl Wiberg6a4d4112018-03-23 10:39:34 +0100641 "../../rtc_base/system:file_wrapper",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100642 "../../system_wrappers",
Patrik Höglunde6ffc422017-12-11 10:28:16 +0100643 "../../system_wrappers:metrics_default",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100644 "../../test:fileutils",
kwiberg7a770e02016-08-25 02:32:43 -0700645 "../../test:test_support",
Alex Loikoed8ff642018-07-06 14:54:30 +0200646 "agc:level_estimation",
kwiberg7a770e02016-08-25 02:32:43 -0700647 "//testing/gtest",
kwiberg7a770e02016-08-25 02:32:43 -0700648 ]
kwiberg7a770e02016-08-25 02:32:43 -0700649 }
650
ehmaldonado38a21322016-09-02 04:10:34 -0700651 rtc_executable("click_annotate") {
kwiberg7a770e02016-08-25 02:32:43 -0700652 testonly = true
653 sources = [
654 "transient/click_annotate.cc",
655 "transient/file_utils.cc",
656 "transient/file_utils.h",
657 ]
658 deps = [
659 ":audio_processing",
Gustaf Ullbergf35c6662018-02-23 13:18:29 +0100660 "../..:typedefs",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800661 "../..:webrtc_common",
Karl Wiberg6a4d4112018-03-23 10:39:34 +0100662 "../../rtc_base/system:file_wrapper",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100663 "../../system_wrappers",
kwiberg7a770e02016-08-25 02:32:43 -0700664 "../../system_wrappers:metrics_default",
665 ]
666 }
667
peah1bcfce52016-08-26 07:16:04 -0700668 if (rtc_enable_intelligibility_enhancer) {
ehmaldonado38a21322016-09-02 04:10:34 -0700669 rtc_executable("intelligibility_proc") {
peah1bcfce52016-08-26 07:16:04 -0700670 testonly = true
671 sources = [
672 "intelligibility/test/intelligibility_proc.cc",
673 ]
674 deps = [
675 ":audio_processing",
676 ":audioproc_test_utils",
Alex Loiko0488fcf2018-02-05 11:15:23 +0100677 "../../common_audio",
oprypin6e09d872017-08-31 03:21:39 -0700678 "../../rtc_base:rtc_base_approved",
peah1bcfce52016-08-26 07:16:04 -0700679 "../../system_wrappers:metrics_default",
680 "../../test:test_support",
681 "//testing/gtest",
peah1bcfce52016-08-26 07:16:04 -0700682 ]
kwiberg7a770e02016-08-25 02:32:43 -0700683 }
684 }
685
kjellanderfb114242016-06-13 00:19:48 -0700686 if (rtc_enable_protobuf) {
687 proto_library("audioproc_unittest_proto") {
688 sources = [
689 "test/unittest.proto",
690 ]
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200691 proto_out_dir = "modules/audio_processing/test"
kjellanderfb114242016-06-13 00:19:48 -0700692 }
693
kjellanderb62dbbe2016-09-23 00:38:52 -0700694 rtc_static_library("audioproc_protobuf_utils") {
kjellanderfb114242016-06-13 00:19:48 -0700695 sources = [
696 "test/protobuf_utils.cc",
697 "test/protobuf_utils.h",
698 ]
699
700 deps = [
ehmaldonadobcba64a2016-08-19 02:11:07 -0700701 ":audioproc_debug_proto",
Gustaf Ullbergf35c6662018-02-23 13:18:29 +0100702 "../..:typedefs",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800703 "../..:webrtc_common",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700704 "../../rtc_base:protobuf_utils",
705 "../../rtc_base:rtc_base_approved",
kjellanderfb114242016-06-13 00:19:48 -0700706 ]
707 }
708 }
709}