kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 1 | # 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 | |
| 9 | import("//build/config/arm.gni") |
| 10 | import("../build/webrtc.gni") |
| 11 | |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 12 | config("common_audio_config") { |
| 13 | include_dirs = [ |
| 14 | "resampler/include", |
| 15 | "signal_processing/include", |
| 16 | "vad/include", |
| 17 | ] |
| 18 | } |
| 19 | |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 20 | source_set("common_audio") { |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 21 | sources = [ |
andrew@webrtc.org | aada86b | 2014-10-27 18:18:17 +0000 | [diff] [blame] | 22 | "audio_converter.cc", |
| 23 | "audio_converter.h", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 24 | "audio_util.cc", |
andrew@webrtc.org | 325cff0 | 2014-10-01 17:42:18 +0000 | [diff] [blame] | 25 | "blocker.cc", |
| 26 | "blocker.h", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 27 | "fir_filter.cc", |
| 28 | "fir_filter.h", |
| 29 | "fir_filter_neon.h", |
| 30 | "fir_filter_sse.h", |
| 31 | "include/audio_util.h", |
| 32 | "resampler/include/push_resampler.h", |
| 33 | "resampler/include/resampler.h", |
| 34 | "resampler/push_resampler.cc", |
| 35 | "resampler/push_sinc_resampler.cc", |
| 36 | "resampler/push_sinc_resampler.h", |
| 37 | "resampler/resampler.cc", |
| 38 | "resampler/sinc_resampler.cc", |
| 39 | "resampler/sinc_resampler.h", |
| 40 | "signal_processing/include/real_fft.h", |
| 41 | "signal_processing/include/signal_processing_library.h", |
| 42 | "signal_processing/include/spl_inl.h", |
| 43 | "signal_processing/auto_corr_to_refl_coef.c", |
| 44 | "signal_processing/auto_correlation.c", |
| 45 | "signal_processing/complex_fft_tables.h", |
| 46 | "signal_processing/copy_set_operations.c", |
| 47 | "signal_processing/cross_correlation.c", |
| 48 | "signal_processing/division_operations.c", |
| 49 | "signal_processing/dot_product_with_scale.c", |
| 50 | "signal_processing/downsample_fast.c", |
| 51 | "signal_processing/energy.c", |
| 52 | "signal_processing/filter_ar.c", |
| 53 | "signal_processing/filter_ma_fast_q12.c", |
| 54 | "signal_processing/get_hanning_window.c", |
| 55 | "signal_processing/get_scaling_square.c", |
| 56 | "signal_processing/ilbc_specific_functions.c", |
| 57 | "signal_processing/levinson_durbin.c", |
| 58 | "signal_processing/lpc_to_refl_coef.c", |
| 59 | "signal_processing/min_max_operations.c", |
| 60 | "signal_processing/randomization_functions.c", |
| 61 | "signal_processing/refl_coef_to_lpc.c", |
| 62 | "signal_processing/real_fft.c", |
| 63 | "signal_processing/resample.c", |
| 64 | "signal_processing/resample_48khz.c", |
| 65 | "signal_processing/resample_by_2.c", |
| 66 | "signal_processing/resample_by_2_internal.c", |
| 67 | "signal_processing/resample_by_2_internal.h", |
| 68 | "signal_processing/resample_fractional.c", |
| 69 | "signal_processing/spl_init.c", |
| 70 | "signal_processing/spl_sqrt.c", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 71 | "signal_processing/splitting_filter.c", |
| 72 | "signal_processing/sqrt_of_one_minus_x_squared.c", |
| 73 | "signal_processing/vector_scaling_operations.c", |
henrik.lundin@webrtc.org | 8aa4d2d | 2014-10-30 13:23:25 +0000 | [diff] [blame] | 74 | "vad/include/vad.h", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 75 | "vad/include/webrtc_vad.h", |
henrik.lundin@webrtc.org | 8aa4d2d | 2014-10-30 13:23:25 +0000 | [diff] [blame] | 76 | "vad/vad.cc", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 77 | "vad/webrtc_vad.c", |
| 78 | "vad/vad_core.c", |
| 79 | "vad/vad_core.h", |
| 80 | "vad/vad_filterbank.c", |
| 81 | "vad/vad_filterbank.h", |
| 82 | "vad/vad_gmm.c", |
| 83 | "vad/vad_gmm.h", |
| 84 | "vad/vad_sp.c", |
| 85 | "vad/vad_sp.h", |
| 86 | "wav_header.cc", |
| 87 | "wav_header.h", |
andrew@webrtc.org | a3ed713 | 2014-10-31 21:51:03 +0000 | [diff] [blame] | 88 | "wav_file.cc", |
| 89 | "wav_file.h", |
andrew@webrtc.org | 325cff0 | 2014-10-01 17:42:18 +0000 | [diff] [blame] | 90 | "window_generator.cc", |
| 91 | "window_generator.h", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 92 | ] |
| 93 | |
| 94 | deps = [ "../system_wrappers" ] |
| 95 | |
andrew@webrtc.org | 4165f7a | 2014-10-08 18:01:27 +0000 | [diff] [blame] | 96 | if (rtc_use_openmax_dl) { |
| 97 | sources += [ |
| 98 | "lapped_transform.cc", |
| 99 | "lapped_transform.h", |
| 100 | "real_fourier.cc", |
| 101 | "real_fourier.h", |
| 102 | ] |
| 103 | |
| 104 | deps += [ "//third_party/openmax_dl/dl" ] |
| 105 | } |
andrew@webrtc.org | 325cff0 | 2014-10-01 17:42:18 +0000 | [diff] [blame] | 106 | |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 107 | if (cpu_arch == "arm") { |
| 108 | sources += [ |
| 109 | "signal_processing/complex_bit_reverse_arm.S", |
| 110 | "signal_processing/spl_sqrt_floor_arm.S", |
| 111 | ] |
| 112 | |
| 113 | if (arm_version == 7) { |
| 114 | deps += [ ":common_audio_neon" ] |
| 115 | sources += [ "signal_processing/filter_ar_fast_q12_armv7.S" ] |
| 116 | } else { |
| 117 | sources += [ "signal_processing/filter_ar_fast_q12.c" ] |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | if (cpu_arch == "mipsel") { |
| 122 | sources += [ |
| 123 | "signal_processing/include/spl_inl_mips.h", |
| 124 | "signal_processing/complex_bit_reverse_mips.c", |
| 125 | "signal_processing/complex_fft_mips.c", |
| 126 | "signal_processing/cross_correlation_mips.c", |
| 127 | "signal_processing/downsample_fast_mips.c", |
| 128 | "signal_processing/filter_ar_fast_q12_mips.c", |
| 129 | "signal_processing/min_max_operations_mips.c", |
| 130 | "signal_processing/resample_by_2_mips.c", |
| 131 | "signal_processing/spl_sqrt_floor_mips.c", |
| 132 | ] |
| 133 | if (mips_dsp_rev > 0) { |
| 134 | sources += [ "signal_processing/vector_scaling_operations_mips.c" ] |
| 135 | } |
| 136 | } else { |
kjellander@webrtc.org | b8caf6a | 2014-09-30 18:05:02 +0000 | [diff] [blame] | 137 | sources += [ "signal_processing/complex_fft.c" ] |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 138 | } |
| 139 | |
| 140 | if (cpu_arch != "arm" && cpu_arch != "mipsel") { |
| 141 | sources += [ |
| 142 | "signal_processing/complex_bit_reverse.c", |
kjellander@webrtc.org | b8caf6a | 2014-09-30 18:05:02 +0000 | [diff] [blame] | 143 | "signal_processing/filter_ar_fast_q12.c", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 144 | "signal_processing/spl_sqrt_floor.c", |
| 145 | ] |
| 146 | } |
| 147 | |
| 148 | if (is_win) { |
pbos@webrtc.org | a6cefca | 2014-09-16 17:57:02 +0000 | [diff] [blame] | 149 | cflags = [ |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 150 | "/wd4334", # Ignore warning on shift operator promotion. |
| 151 | ] |
| 152 | } |
| 153 | |
kjellander@webrtc.org | f21ea91 | 2014-09-28 17:37:22 +0000 | [diff] [blame] | 154 | configs += [ "..:common_config" ] |
| 155 | |
| 156 | public_configs = [ |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 157 | "..:common_inherited_config", |
| 158 | ":common_audio_config", |
| 159 | ] |
| 160 | |
| 161 | if (is_clang) { |
| 162 | # Suppress warnings from Chrome's Clang plugins. |
| 163 | # See http://code.google.com/p/webrtc/issues/detail?id=163 for details. |
| 164 | configs -= [ "//build/config/clang:find_bad_constructs" ] |
| 165 | } |
| 166 | |
| 167 | if (cpu_arch == "x86" || cpu_arch == "x64") { |
| 168 | deps += [ ":common_audio_sse2" ] |
| 169 | } |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 170 | } |
| 171 | |
| 172 | if (cpu_arch == "x86" || cpu_arch == "x64") { |
| 173 | source_set("common_audio_sse2") { |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 174 | sources = [ |
| 175 | "fir_filter_sse.cc", |
| 176 | "resampler/sinc_resampler_sse.cc", |
| 177 | ] |
| 178 | |
| 179 | cflags = [ "-msse2" ] |
| 180 | |
| 181 | configs += [ "..:common_inherited_config" ] |
| 182 | |
| 183 | if (is_clang) { |
| 184 | # Suppress warnings from Chrome's Clang plugins. |
| 185 | # See http://code.google.com/p/webrtc/issues/detail?id=163 for details. |
| 186 | configs -= [ "//build/config/clang:find_bad_constructs" ] |
| 187 | } |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 188 | } |
| 189 | } |
| 190 | |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 191 | if (rtc_build_armv7_neon) { |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 192 | source_set("common_audio_neon") { |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 193 | sources = [ |
| 194 | "fir_filter_neon.cc", |
| 195 | "resampler/sinc_resampler_neon.cc", |
| 196 | "signal_processing/cross_correlation_neon.S", |
| 197 | "signal_processing/downsample_fast_neon.S", |
| 198 | "signal_processing/min_max_operations_neon.S", |
| 199 | "signal_processing/vector_scaling_operations_neon.S", |
| 200 | ] |
| 201 | |
kjellander@webrtc.org | f21ea91 | 2014-09-28 17:37:22 +0000 | [diff] [blame] | 202 | configs += [ "..:common_config" ] |
| 203 | public_configs = [ "..:common_inherited_config" ] |
| 204 | |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 205 | |
| 206 | # Enable compilation for the ARM v7 Neon instruction set. This is needed |
| 207 | # since //build/config/arm.gni only enables Neon for iOS, not Android. |
| 208 | # This provides the same functionality as webrtc/build/arm_neon.gypi. |
| 209 | # TODO(kjellander): Investigate if this can be moved into webrtc.gni or |
| 210 | # //build/config/arm.gni instead, to reduce code duplication. |
| 211 | # Remove the -mfpu=vfpv3-d16 cflag. |
| 212 | configs -= [ "//build/config/compiler:compiler_arm_fpu" ] |
| 213 | cflags = [ |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 214 | "-mfpu=neon", |
| 215 | ] |
| 216 | |
| 217 | # Disable LTO in audio_processing_neon target due to compiler bug. |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 218 | if (rtc_use_lto) { |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 219 | cflags -= [ |
| 220 | "-flto", |
| 221 | "-ffat-lto-objects", |
| 222 | ] |
| 223 | } |
| 224 | |
| 225 | if (is_clang) { |
| 226 | # Suppress warnings from Chrome's Clang plugins. |
| 227 | # See http://code.google.com/p/webrtc/issues/detail?id=163 for details. |
| 228 | configs -= [ "//build/config/clang:find_bad_constructs" ] |
| 229 | } |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 230 | } |
| 231 | } |