blob: f469cd4e191b4b4bbc8f22c813362bddd01a22f5 [file] [log] [blame]
Sam Zackrissonb2e17652018-07-05 16:41:55 +02001# 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
Sam Zackrissonb2e17652018-07-05 16:41:55 +02009import("../../../webrtc.gni")
10
11rtc_source_set("block_mean_calculator") {
12 sources = [
13 "block_mean_calculator.cc",
14 "block_mean_calculator.h",
15 ]
16 deps = [
17 "../../../rtc_base:checks",
18 "../../../rtc_base:rtc_base_approved",
19 ]
20}
21
22rtc_source_set("legacy_delay_estimator") {
23 sources = [
24 "delay_estimator.cc",
25 "delay_estimator.h",
26 "delay_estimator_internal.h",
27 "delay_estimator_wrapper.cc",
28 "delay_estimator_wrapper.h",
29 ]
30 deps = [
Sam Zackrissonb2e17652018-07-05 16:41:55 +020031 "../../../rtc_base:checks",
32 ]
33}
34
35rtc_source_set("ooura_fft") {
36 sources = [
37 "ooura_fft.cc",
38 "ooura_fft.h",
39 "ooura_fft_tables_common.h",
40 ]
41 deps = [
Niels Möllera12c42a2018-07-25 16:05:48 +020042 "../../../rtc_base/system:arch",
Sam Zackrissonb2e17652018-07-05 16:41:55 +020043 "../../../system_wrappers:cpu_features_api",
44 ]
45 cflags = []
46
47 if (current_cpu == "x86" || current_cpu == "x64") {
48 sources += [
49 "ooura_fft_sse2.cc",
50 "ooura_fft_tables_neon_sse2.h",
51 ]
52 if (is_posix || is_fuchsia) {
53 cflags += [ "-msse2" ]
54 }
55 }
56
57 if (rtc_build_with_neon) {
58 sources += [
59 "ooura_fft_neon.cc",
60 "ooura_fft_tables_neon_sse2.h",
61 ]
62
63 deps += [ "../../../common_audio" ]
64
65 if (current_cpu != "arm64") {
Oleh Prypind2f4e8b2018-08-01 12:18:05 +020066 # Enable compilation for the NEON instruction set.
Sam Zackrissonb2e17652018-07-05 16:41:55 +020067 suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
68 cflags += [ "-mfpu=neon" ]
69 }
70
71 # Disable LTO on NEON targets due to compiler bug.
72 # TODO(fdegans): Enable this. See crbug.com/408997.
73 if (rtc_use_lto) {
74 cflags -= [
75 "-flto",
76 "-ffat-lto-objects",
77 ]
78 }
79 }
80
81 if (current_cpu == "mipsel" && mips_float_abi == "hard") {
82 sources += [ "ooura_fft_mips.cc" ]
83 }
84}
85
Alessio Bazzicacaa499b2019-02-21 17:35:43 +010086rtc_source_set("pffft_wrapper") {
87 sources = [
88 "pffft_wrapper.cc",
89 "pffft_wrapper.h",
90 ]
91 deps = [
92 "../../../api:array_view",
93 "../../../rtc_base:checks",
94 "//third_party/pffft",
95 ]
96}
97
Sam Zackrissonb2e17652018-07-05 16:41:55 +020098if (rtc_include_tests) {
99 rtc_source_set("block_mean_calculator_unittest") {
100 testonly = true
101
102 sources = [
103 "block_mean_calculator_unittest.cc",
104 ]
105 deps = [
106 ":block_mean_calculator",
107 "../../../rtc_base:rtc_base_approved",
108 "../../../test:test_support",
109 "//testing/gtest",
110 ]
111 }
112
113 rtc_source_set("legacy_delay_estimator_unittest") {
114 testonly = true
115
116 sources = [
117 "delay_estimator_unittest.cc",
118 ]
119 deps = [
120 ":legacy_delay_estimator",
Sam Zackrissonb2e17652018-07-05 16:41:55 +0200121 "../../../rtc_base:rtc_base_approved",
122 "../../../test:test_support",
123 "//testing/gtest",
124 ]
125 }
Alessio Bazzicacaa499b2019-02-21 17:35:43 +0100126
127 rtc_source_set("pffft_wrapper_unittest") {
128 testonly = true
129 sources = [
130 "pffft_wrapper_unittest.cc",
131 ]
132 deps = [
133 ":pffft_wrapper",
134 "../../../test:test_support",
135 "//testing/gtest",
136 "//third_party/pffft",
137 ]
138 }
Sam Zackrissonb2e17652018-07-05 16:41:55 +0200139}