Debian Codegraph @

Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/BUILD.gn

raw
1 # Copyright (c) 2018 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
9 import("../../../webrtc.gni")
10
11 rtc_library("aec3") {
12 visibility = [ "*" ]
13 configs += [ "..:apm_debug_dump" ]
14 sources = [
15 "adaptive_fir_filter.cc",
16 "adaptive_fir_filter_erl.cc",
17 "aec3_common.cc",
18 "aec3_fft.cc",
19 "aec_state.cc",
20 "aec_state.h",
21 "alignment_mixer.cc",
22 "alignment_mixer.h",
23 "api_call_jitter_metrics.cc",
24 "api_call_jitter_metrics.h",
25 "block_buffer.cc",
26 "block_delay_buffer.cc",
27 "block_delay_buffer.h",
28 "block_framer.cc",
29 "block_framer.h",
30 "block_processor.cc",
31 "block_processor.h",
32 "block_processor_metrics.cc",
33 "block_processor_metrics.h",
34 "clockdrift_detector.cc",
35 "clockdrift_detector.h",
36 "coarse_filter_update_gain.cc",
37 "coarse_filter_update_gain.h",
38 "comfort_noise_generator.cc",
39 "comfort_noise_generator.h",
40 "decimator.cc",
41 "decimator.h",
42 "delay_estimate.h",
43 "dominant_nearend_detector.cc",
44 "dominant_nearend_detector.h",
45 "downsampled_render_buffer.cc",
46 "downsampled_render_buffer.h",
47 "echo_audibility.cc",
48 "echo_audibility.h",
49 "echo_canceller3.cc",
50 "echo_canceller3.h",
51 "echo_path_delay_estimator.cc",
52 "echo_path_delay_estimator.h",
53 "echo_path_variability.cc",
54 "echo_path_variability.h",
55 "echo_remover.cc",
56 "echo_remover.h",
57 "echo_remover_metrics.cc",
58 "echo_remover_metrics.h",
59 "erl_estimator.cc",
60 "erl_estimator.h",
61 "erle_estimator.cc",
62 "erle_estimator.h",
63 "fft_buffer.cc",
64 "filter_analyzer.cc",
65 "filter_analyzer.h",
66 "frame_blocker.cc",
67 "frame_blocker.h",
68 "fullband_erle_estimator.cc",
69 "fullband_erle_estimator.h",
70 "matched_filter.cc",
71 "matched_filter_lag_aggregator.cc",
72 "matched_filter_lag_aggregator.h",
73 "moving_average.cc",
74 "moving_average.h",
75 "nearend_detector.h",
76 "refined_filter_update_gain.cc",
77 "refined_filter_update_gain.h",
78 "render_buffer.cc",
79 "render_delay_buffer.cc",
80 "render_delay_buffer.h",
81 "render_delay_controller.cc",
82 "render_delay_controller.h",
83 "render_delay_controller_metrics.cc",
84 "render_delay_controller_metrics.h",
85 "render_signal_analyzer.cc",
86 "render_signal_analyzer.h",
87 "residual_echo_estimator.cc",
88 "residual_echo_estimator.h",
89 "reverb_decay_estimator.cc",
90 "reverb_decay_estimator.h",
91 "reverb_frequency_response.cc",
92 "reverb_frequency_response.h",
93 "reverb_model.cc",
94 "reverb_model.h",
95 "reverb_model_estimator.cc",
96 "reverb_model_estimator.h",
97 "signal_dependent_erle_estimator.cc",
98 "signal_dependent_erle_estimator.h",
99 "spectrum_buffer.cc",
100 "stationarity_estimator.cc",
101 "stationarity_estimator.h",
102 "subband_erle_estimator.cc",
103 "subband_erle_estimator.h",
104 "subband_nearend_detector.cc",
105 "subband_nearend_detector.h",
106 "subtractor.cc",
107 "subtractor.h",
108 "subtractor_output.cc",
109 "subtractor_output.h",
110 "subtractor_output_analyzer.cc",
111 "subtractor_output_analyzer.h",
112 "suppression_filter.cc",
113 "suppression_filter.h",
114 "suppression_gain.cc",
115 "suppression_gain.h",
116 "transparent_mode.cc",
117 "transparent_mode.h",
118 ]
119
120 defines = []
121 if (rtc_build_with_neon && current_cpu != "arm64") {
122 suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
123 cflags = [ "-mfpu=neon" ]
124 }
125
126 deps = [
127 ":adaptive_fir_filter",
128 ":adaptive_fir_filter_erl",
129 ":aec3_common",
130 ":aec3_fft",
131 ":fft_data",
132 ":matched_filter",
133 ":render_buffer",
134 ":vector_math",
135 "..:apm_logging",
136 "..:audio_buffer",
137 "..:high_pass_filter",
138 "../../../api:array_view",
139 "../../../api/audio:aec3_config",
140 "../../../api/audio:echo_control",
141 "../../../common_audio:common_audio_c",
142 "../../../rtc_base:checks",
143 "../../../rtc_base:rtc_base_approved",
144 "../../../rtc_base:safe_minmax",
145 "../../../rtc_base/experiments:field_trial_parser",
146 "../../../rtc_base/system:arch",
147 "../../../system_wrappers",
148 "../../../system_wrappers:field_trial",
149 "../../../system_wrappers:metrics",
150 "../utility:cascaded_biquad_filter",
151 ]
152 absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
153
154 if (current_cpu == "x86" || current_cpu == "x64") {
155 deps += [ ":aec3_avx2" ]
156 }
157 }
158
159 rtc_source_set("aec3_common") {
160 sources = [ "aec3_common.h" ]
161 }
162
163 rtc_source_set("aec3_fft") {
164 sources = [ "aec3_fft.h" ]
165 deps = [
166 ":aec3_common",
167 ":fft_data",
168 "../../../api:array_view",
169 "../../../common_audio/third_party/ooura:fft_size_128",
170 "../../../rtc_base:checks",
171 "../../../rtc_base:rtc_base_approved",
172 "../../../rtc_base/system:arch",
173 ]
174 }
175
176 rtc_source_set("render_buffer") {
177 sources = [
178 "block_buffer.h",
179 "fft_buffer.h",
180 "render_buffer.h",
181 "spectrum_buffer.h",
182 ]
183 deps = [
184 ":aec3_common",
185 ":fft_data",
186 "../../../api:array_view",
187 "../../../rtc_base:checks",
188 "../../../rtc_base:rtc_base_approved",
189 "../../../rtc_base/system:arch",
190 ]
191 }
192
193 rtc_source_set("adaptive_fir_filter") {
194 sources = [ "adaptive_fir_filter.h" ]
195 deps = [
196 ":aec3_common",
197 ":aec3_fft",
198 ":fft_data",
199 ":render_buffer",
200 "..:apm_logging",
201 "../../../api:array_view",
202 "../../../rtc_base/system:arch",
203 ]
204 }
205
206 rtc_source_set("adaptive_fir_filter_erl") {
207 sources = [ "adaptive_fir_filter_erl.h" ]
208 deps = [
209 ":aec3_common",
210 "../../../api:array_view",
211 "../../../rtc_base/system:arch",
212 ]
213 }
214
215 rtc_source_set("matched_filter") {
216 sources = [ "matched_filter.h" ]
217 deps = [
218 ":aec3_common",
219 "../../../api:array_view",
220 "../../../rtc_base:rtc_base_approved",
221 "../../../rtc_base/system:arch",
222 ]
223 }
224
225 rtc_source_set("vector_math") {
226 sources = [ "vector_math.h" ]
227 deps = [
228 ":aec3_common",
229 "../../../api:array_view",
230 "../../../rtc_base:checks",
231 "../../../rtc_base/system:arch",
232 ]
233 }
234
235 rtc_source_set("fft_data") {
236 sources = [ "fft_data.h" ]
237 deps = [
238 ":aec3_common",
239 "../../../api:array_view",
240 "../../../rtc_base/system:arch",
241 ]
242 }
243
244 if (current_cpu == "x86" || current_cpu == "x64") {
245 rtc_library("aec3_avx2") {
246 configs += [ "..:apm_debug_dump" ]
247 sources = [
248 "adaptive_fir_filter_avx2.cc",
249 "adaptive_fir_filter_erl_avx2.cc",
250 "fft_data_avx2.cc",
251 "matched_filter_avx2.cc",
252 "vector_math_avx2.cc",
253 ]
254
255 if (is_win) {
256 cflags = [ "/arch:AVX2" ]
257 } else {
258 cflags = [
259 "-mavx2",
260 "-mfma",
261 ]
262 }
263
264 deps = [
265 ":adaptive_fir_filter",
266 ":adaptive_fir_filter_erl",
267 ":fft_data",
268 ":matched_filter",
269 ":vector_math",
270 "../../../api:array_view",
271 "../../../rtc_base:checks",
272 ]
273 }
274 }
275
276 if (rtc_include_tests) {
277 rtc_library("aec3_unittests") {
278 testonly = true
279
280 configs += [ "..:apm_debug_dump" ]
281 sources = [
282 "mock/mock_block_processor.cc",
283 "mock/mock_block_processor.h",
284 "mock/mock_echo_remover.cc",
285 "mock/mock_echo_remover.h",
286 "mock/mock_render_delay_buffer.cc",
287 "mock/mock_render_delay_buffer.h",
288 "mock/mock_render_delay_controller.cc",
289 "mock/mock_render_delay_controller.h",
290 ]
291
292 deps = [
293 ":adaptive_fir_filter",
294 ":adaptive_fir_filter_erl",
295 ":aec3",
296 ":aec3_common",
297 ":aec3_fft",
298 ":fft_data",
299 ":matched_filter",
300 ":render_buffer",
301 ":vector_math",
302 "..:apm_logging",
303 "..:audio_buffer",
304 "..:audio_processing",
305 "..:high_pass_filter",
306 "../../../api:array_view",
307 "../../../api/audio:aec3_config",
308 "../../../rtc_base:checks",
309 "../../../rtc_base:rtc_base_approved",
310 "../../../rtc_base:safe_minmax",
311 "../../../rtc_base/system:arch",
312 "../../../system_wrappers",
313 "../../../test:field_trial",
314 "../../../test:test_support",
315 "../utility:cascaded_biquad_filter",
316 ]
317 absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
318
319 defines = []
320
321 if (rtc_enable_protobuf) {
322 sources += [
323 "adaptive_fir_filter_erl_unittest.cc",
324 "adaptive_fir_filter_unittest.cc",
325 "aec3_fft_unittest.cc",
326 "aec_state_unittest.cc",
327 "alignment_mixer_unittest.cc",
328 "api_call_jitter_metrics_unittest.cc",
329 "block_delay_buffer_unittest.cc",
330 "block_framer_unittest.cc",
331 "block_processor_metrics_unittest.cc",
332 "block_processor_unittest.cc",
333 "clockdrift_detector_unittest.cc",
334 "coarse_filter_update_gain_unittest.cc",
335 "comfort_noise_generator_unittest.cc",
336 "decimator_unittest.cc",
337 "echo_canceller3_unittest.cc",
338 "echo_path_delay_estimator_unittest.cc",
339 "echo_path_variability_unittest.cc",
340 "echo_remover_metrics_unittest.cc",
341 "echo_remover_unittest.cc",
342 "erl_estimator_unittest.cc",
343 "erle_estimator_unittest.cc",
344 "fft_data_unittest.cc",
345 "filter_analyzer_unittest.cc",
346 "frame_blocker_unittest.cc",
347 "matched_filter_lag_aggregator_unittest.cc",
348 "matched_filter_unittest.cc",
349 "moving_average_unittest.cc",
350 "refined_filter_update_gain_unittest.cc",
351 "render_buffer_unittest.cc",
352 "render_delay_buffer_unittest.cc",
353 "render_delay_controller_metrics_unittest.cc",
354 "render_delay_controller_unittest.cc",
355 "render_signal_analyzer_unittest.cc",
356 "residual_echo_estimator_unittest.cc",
357 "reverb_model_estimator_unittest.cc",
358 "signal_dependent_erle_estimator_unittest.cc",
359 "subtractor_unittest.cc",
360 "suppression_filter_unittest.cc",
361 "suppression_gain_unittest.cc",
362 "vector_math_unittest.cc",
363 ]
364 }
365
366 if (!build_with_chromium) {
367 deps += [ "..:audio_processing_unittests" ]
368 }
369 }
370 }