blob: b24d0e965f0ee872e6da95f415d2301ee99d2435 [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") {
Alessio Bazzicac8ba8b22019-03-27 09:30:14 +010087 visibility = [ "../*" ]
Alessio Bazzicacaa499b2019-02-21 17:35:43 +010088 sources = [
89 "pffft_wrapper.cc",
90 "pffft_wrapper.h",
91 ]
92 deps = [
93 "../../../api:array_view",
94 "../../../rtc_base:checks",
95 "//third_party/pffft",
96 ]
97}
98
Sam Zackrissonb2e17652018-07-05 16:41:55 +020099if (rtc_include_tests) {
100 rtc_source_set("block_mean_calculator_unittest") {
101 testonly = true
102
103 sources = [
104 "block_mean_calculator_unittest.cc",
105 ]
106 deps = [
107 ":block_mean_calculator",
108 "../../../rtc_base:rtc_base_approved",
109 "../../../test:test_support",
110 "//testing/gtest",
111 ]
112 }
113
114 rtc_source_set("legacy_delay_estimator_unittest") {
115 testonly = true
116
117 sources = [
118 "delay_estimator_unittest.cc",
119 ]
120 deps = [
121 ":legacy_delay_estimator",
Sam Zackrissonb2e17652018-07-05 16:41:55 +0200122 "../../../rtc_base:rtc_base_approved",
123 "../../../test:test_support",
124 "//testing/gtest",
125 ]
126 }
Alessio Bazzicacaa499b2019-02-21 17:35:43 +0100127
128 rtc_source_set("pffft_wrapper_unittest") {
129 testonly = true
130 sources = [
131 "pffft_wrapper_unittest.cc",
132 ]
133 deps = [
134 ":pffft_wrapper",
135 "../../../test:test_support",
136 "//testing/gtest",
137 "//third_party/pffft",
138 ]
139 }
Sam Zackrissonb2e17652018-07-05 16:41:55 +0200140}