blob: 81df70cd66321d1a4dcaca8ec544906fb14a8e93 [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
9import("//build/config/arm.gni")
10import("../build/webrtc.gni")
11
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000012config("common_audio_config") {
13 include_dirs = [
14 "resampler/include",
15 "signal_processing/include",
16 "vad/include",
17 ]
18}
19
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000020source_set("common_audio") {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000021 sources = [
andrew@webrtc.org041035b2015-01-26 21:23:53 +000022 "../modules/audio_processing/channel_buffer.cc",
23 "../modules/audio_processing/channel_buffer.h",
andrew@webrtc.orgaada86b2014-10-27 18:18:17 +000024 "audio_converter.cc",
25 "audio_converter.h",
andrew@webrtc.org041035b2015-01-26 21:23:53 +000026 "audio_ring_buffer.cc",
27 "audio_ring_buffer.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000028 "audio_util.cc",
andrew@webrtc.org325cff02014-10-01 17:42:18 +000029 "blocker.cc",
30 "blocker.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000031 "fir_filter.cc",
32 "fir_filter.h",
33 "fir_filter_neon.h",
34 "fir_filter_sse.h",
35 "include/audio_util.h",
36 "resampler/include/push_resampler.h",
37 "resampler/include/resampler.h",
38 "resampler/push_resampler.cc",
39 "resampler/push_sinc_resampler.cc",
40 "resampler/push_sinc_resampler.h",
41 "resampler/resampler.cc",
42 "resampler/sinc_resampler.cc",
43 "resampler/sinc_resampler.h",
andrew@webrtc.org6b630152015-01-15 00:09:53 +000044 "ring_buffer.c",
45 "ring_buffer.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000046 "signal_processing/include/real_fft.h",
47 "signal_processing/include/signal_processing_library.h",
48 "signal_processing/include/spl_inl.h",
49 "signal_processing/auto_corr_to_refl_coef.c",
50 "signal_processing/auto_correlation.c",
51 "signal_processing/complex_fft_tables.h",
52 "signal_processing/copy_set_operations.c",
53 "signal_processing/cross_correlation.c",
54 "signal_processing/division_operations.c",
55 "signal_processing/dot_product_with_scale.c",
56 "signal_processing/downsample_fast.c",
57 "signal_processing/energy.c",
58 "signal_processing/filter_ar.c",
59 "signal_processing/filter_ma_fast_q12.c",
60 "signal_processing/get_hanning_window.c",
61 "signal_processing/get_scaling_square.c",
62 "signal_processing/ilbc_specific_functions.c",
63 "signal_processing/levinson_durbin.c",
64 "signal_processing/lpc_to_refl_coef.c",
65 "signal_processing/min_max_operations.c",
66 "signal_processing/randomization_functions.c",
67 "signal_processing/refl_coef_to_lpc.c",
68 "signal_processing/real_fft.c",
69 "signal_processing/resample.c",
70 "signal_processing/resample_48khz.c",
71 "signal_processing/resample_by_2.c",
72 "signal_processing/resample_by_2_internal.c",
73 "signal_processing/resample_by_2_internal.h",
74 "signal_processing/resample_fractional.c",
75 "signal_processing/spl_init.c",
76 "signal_processing/spl_sqrt.c",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000077 "signal_processing/splitting_filter.c",
78 "signal_processing/sqrt_of_one_minus_x_squared.c",
79 "signal_processing/vector_scaling_operations.c",
henrik.lundin@webrtc.org8aa4d2d2014-10-30 13:23:25 +000080 "vad/include/vad.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000081 "vad/include/webrtc_vad.h",
henrik.lundin@webrtc.org8aa4d2d2014-10-30 13:23:25 +000082 "vad/vad.cc",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000083 "vad/webrtc_vad.c",
84 "vad/vad_core.c",
85 "vad/vad_core.h",
86 "vad/vad_filterbank.c",
87 "vad/vad_filterbank.h",
88 "vad/vad_gmm.c",
89 "vad/vad_gmm.h",
90 "vad/vad_sp.c",
91 "vad/vad_sp.h",
92 "wav_header.cc",
93 "wav_header.h",
andrew@webrtc.orga3ed7132014-10-31 21:51:03 +000094 "wav_file.cc",
95 "wav_file.h",
andrew@webrtc.org325cff02014-10-01 17:42:18 +000096 "window_generator.cc",
97 "window_generator.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000098 ]
99
100 deps = [ "../system_wrappers" ]
101
andrew@webrtc.org4165f7a2014-10-08 18:01:27 +0000102 if (rtc_use_openmax_dl) {
103 sources += [
104 "lapped_transform.cc",
105 "lapped_transform.h",
106 "real_fourier.cc",
107 "real_fourier.h",
108 ]
109
110 deps += [ "//third_party/openmax_dl/dl" ]
111 }
andrew@webrtc.org325cff02014-10-01 17:42:18 +0000112
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000113 if (cpu_arch == "arm") {
114 sources += [
115 "signal_processing/complex_bit_reverse_arm.S",
116 "signal_processing/spl_sqrt_floor_arm.S",
117 ]
118
andrew@webrtc.org1090a6e2014-12-18 21:36:18 +0000119 if (arm_version >= 7) {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000120 deps += [ ":common_audio_neon" ]
121 sources += [ "signal_processing/filter_ar_fast_q12_armv7.S" ]
122 } else {
123 sources += [ "signal_processing/filter_ar_fast_q12.c" ]
124 }
125 }
126
127 if (cpu_arch == "mipsel") {
128 sources += [
129 "signal_processing/include/spl_inl_mips.h",
130 "signal_processing/complex_bit_reverse_mips.c",
131 "signal_processing/complex_fft_mips.c",
132 "signal_processing/cross_correlation_mips.c",
133 "signal_processing/downsample_fast_mips.c",
134 "signal_processing/filter_ar_fast_q12_mips.c",
135 "signal_processing/min_max_operations_mips.c",
136 "signal_processing/resample_by_2_mips.c",
137 "signal_processing/spl_sqrt_floor_mips.c",
138 ]
139 if (mips_dsp_rev > 0) {
140 sources += [ "signal_processing/vector_scaling_operations_mips.c" ]
141 }
142 } else {
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000143 sources += [ "signal_processing/complex_fft.c" ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000144 }
145
146 if (cpu_arch != "arm" && cpu_arch != "mipsel") {
147 sources += [
148 "signal_processing/complex_bit_reverse.c",
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000149 "signal_processing/filter_ar_fast_q12.c",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000150 "signal_processing/spl_sqrt_floor.c",
151 ]
152 }
153
154 if (is_win) {
pbos@webrtc.orga6cefca2014-09-16 17:57:02 +0000155 cflags = [
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000156 "/wd4334", # Ignore warning on shift operator promotion.
157 ]
158 }
159
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000160 configs += [ "..:common_config" ]
161
162 public_configs = [
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000163 "..:common_inherited_config",
164 ":common_audio_config",
165 ]
166
167 if (is_clang) {
168 # Suppress warnings from Chrome's Clang plugins.
169 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
170 configs -= [ "//build/config/clang:find_bad_constructs" ]
171 }
172
173 if (cpu_arch == "x86" || cpu_arch == "x64") {
174 deps += [ ":common_audio_sse2" ]
175 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000176}
177
178if (cpu_arch == "x86" || cpu_arch == "x64") {
179 source_set("common_audio_sse2") {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000180 sources = [
181 "fir_filter_sse.cc",
182 "resampler/sinc_resampler_sse.cc",
183 ]
184
185 cflags = [ "-msse2" ]
186
187 configs += [ "..:common_inherited_config" ]
188
189 if (is_clang) {
190 # Suppress warnings from Chrome's Clang plugins.
191 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
192 configs -= [ "//build/config/clang:find_bad_constructs" ]
193 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000194 }
195}
196
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000197if (rtc_build_armv7_neon) {
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000198 source_set("common_audio_neon") {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000199 sources = [
200 "fir_filter_neon.cc",
201 "resampler/sinc_resampler_neon.cc",
202 "signal_processing/cross_correlation_neon.S",
203 "signal_processing/downsample_fast_neon.S",
204 "signal_processing/min_max_operations_neon.S",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000205 ]
206
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000207 configs += [ "..:common_config" ]
208 public_configs = [ "..:common_inherited_config" ]
209
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000210
211 # Enable compilation for the ARM v7 Neon instruction set. This is needed
212 # since //build/config/arm.gni only enables Neon for iOS, not Android.
213 # This provides the same functionality as webrtc/build/arm_neon.gypi.
214 # TODO(kjellander): Investigate if this can be moved into webrtc.gni or
215 # //build/config/arm.gni instead, to reduce code duplication.
216 # Remove the -mfpu=vfpv3-d16 cflag.
217 configs -= [ "//build/config/compiler:compiler_arm_fpu" ]
218 cflags = [
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000219 "-mfpu=neon",
220 ]
221
222 # Disable LTO in audio_processing_neon target due to compiler bug.
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000223 if (rtc_use_lto) {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000224 cflags -= [
225 "-flto",
226 "-ffat-lto-objects",
227 ]
228 }
229
230 if (is_clang) {
231 # Suppress warnings from Chrome's Clang plugins.
232 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
233 configs -= [ "//build/config/clang:find_bad_constructs" ]
234 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000235 }
236}