OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("//build/config/arm.gni") | 5 import("//build/config/arm.gni") |
6 | 6 |
7 # If fixed point implementation shall be used (otherwise float). | 7 # If fixed point implementation shall be used (otherwise float). |
8 use_opus_fixed_point = ((is_android || is_chromeos || | 8 use_opus_fixed_point = (cpu_arch == "arm" || cpu_arch == "arm64") |
9 (is_ios && arm_version == 7)) && cpu_arch == "arm") | |
10 | 9 |
11 # If ARM optimizations shall be used to accelerate performance. | 10 # If ARM optimizations shall be used to accelerate performance. |
12 use_opus_arm_optimization = use_opus_fixed_point | 11 use_opus_arm_optimization = (cpu_arch == "arm") |
13 | 12 |
14 # If OPUS Run Time CPU Detections (RTCD) shall be used. | 13 # If OPUS Run Time CPU Detections (RTCD) shall be used. |
15 use_opus_rtcd = ((is_android || is_chromeos) && cpu_arch == "arm") | 14 # Based on the conditions in celt/arm/armcpu.c: |
| 15 # defined(_MSC_VER) || defined(__linux__). |
| 16 use_opus_rtcd = (cpu_arch == "arm" && (is_win || is_android || is_linux)) |
16 | 17 |
17 config("opus_config") { | 18 config("opus_config") { |
18 include_dirs = [ | 19 include_dirs = [ |
19 "src/include", | 20 "src/include", |
20 ] | 21 ] |
21 } | 22 } |
22 | 23 |
23 if (use_opus_rtcd) { | 24 if (use_opus_rtcd) { |
24 action("convert_rtcd_assembler") { | 25 action("convert_rtcd_assembler") { |
25 script = "convert_rtcd_assembler.py" | 26 script = "convert_rtcd_assembler.py" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 } | 77 } |
77 | 78 |
78 if (is_posix && !is_android) { | 79 if (is_posix && !is_android) { |
79 # Suppress a warning given by opus_decoder.c that tells us | 80 # Suppress a warning given by opus_decoder.c that tells us |
80 # optimizations are turned off. | 81 # optimizations are turned off. |
81 cflags = [ | 82 cflags = [ |
82 "-Wno-#pragma-messages", | 83 "-Wno-#pragma-messages", |
83 ] | 84 ] |
84 } | 85 } |
85 | 86 |
| 87 if (!is_debug && is_posix && (cpu_arch == "arm" || cpu_arch == "arm64")) { |
| 88 configs -= [ "//build/config/compiler:optimize" ] |
| 89 configs += [ "//build/config/compiler:optimize_max" ] |
| 90 } |
| 91 |
86 if (use_opus_fixed_point) { | 92 if (use_opus_fixed_point) { |
87 sources += gypi_values.opus_fixed_sources | 93 sources += gypi_values.opus_fixed_sources |
88 | 94 |
89 defines += [ "FIXED_POINT" ] | 95 defines += [ "FIXED_POINT" ] |
90 | 96 |
91 include_dirs += [ | 97 include_dirs += [ |
92 "src/silk/fixed", | 98 "src/silk/fixed", |
93 ] | 99 ] |
94 } else { | 100 } else { |
95 sources += gypi_values.opus_float_sources | 101 sources += gypi_values.opus_float_sources |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 } | 162 } |
157 if (is_android) { | 163 if (is_android) { |
158 libs = [ "log" ] | 164 libs = [ "log" ] |
159 } | 165 } |
160 if (is_clang) { | 166 if (is_clang) { |
161 cflags = [ "-Wno-absolute-value" ] | 167 cflags = [ "-Wno-absolute-value" ] |
162 } | 168 } |
163 | 169 |
164 deps = [ ":opus" ] | 170 deps = [ ":opus" ] |
165 } | 171 } |
OLD | NEW |