| 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 config("libwebp_config") { | 7 config("libwebp_config") { |
| 8 include_dirs = [ "." ] | 8 include_dirs = [ "." ] |
| 9 } | 9 } |
| 10 | 10 |
| 11 use_dsp_neon = (cpu_arch == "arm64" || | 11 use_dsp_neon = cpu_arch == "arm64" || cpu_arch == "arm" && arm_version >= 7 && |
| 12 (cpu_arch == "arm" && arm_version >= 7 && | 12 (arm_use_neon || arm_optionally_use_neon) |
| 13 (arm_use_neon || arm_optionally_use_neon))) | |
| 14 | 13 |
| 15 source_set("libwebp_dec") { | 14 source_set("libwebp_dec") { |
| 16 sources = [ | 15 sources = [ |
| 17 "dec/alpha.c", | 16 "dec/alpha.c", |
| 18 "dec/buffer.c", | 17 "dec/buffer.c", |
| 19 "dec/frame.c", | 18 "dec/frame.c", |
| 20 "dec/idec.c", | 19 "dec/idec.c", |
| 21 "dec/io.c", | 20 "dec/io.c", |
| 22 "dec/quant.c", | 21 "dec/quant.c", |
| 23 "dec/tree.c", | 22 "dec/tree.c", |
| 24 "dec/vp8.c", | 23 "dec/vp8.c", |
| 25 "dec/vp8l.c", | 24 "dec/vp8l.c", |
| 26 "dec/webp.c", | 25 "dec/webp.c", |
| 27 ] | 26 ] |
| 28 | 27 |
| 29 configs -= [ "//build/config/compiler:chromium_code" ] | 28 configs -= [ "//build/config/compiler:chromium_code" ] |
| 30 configs += [ "//build/config/compiler:no_chromium_code" ] | 29 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 31 | 30 |
| 32 deps = [ | 31 deps = [ |
| 33 ":libwebp_dsp", | 32 ":libwebp_dsp", |
| 34 ":libwebp_utils", | 33 ":libwebp_utils", |
| 35 ] | 34 ] |
| 36 all_dependent_configs = [ | 35 all_dependent_configs = [ ":libwebp_config" ] |
| 37 ":libwebp_config" | |
| 38 ] | |
| 39 if (use_dsp_neon) { | 36 if (use_dsp_neon) { |
| 40 deps += [ ":libwebp_dsp_neon"] | 37 deps += [ ":libwebp_dsp_neon" ] |
| 41 } | 38 } |
| 42 } | 39 } |
| 43 | 40 |
| 44 source_set("libwebp_demux") { | 41 source_set("libwebp_demux") { |
| 45 sources = [ | 42 sources = [ |
| 46 "demux/demux.c", | 43 "demux/demux.c", |
| 47 ] | 44 ] |
| 48 all_dependent_configs = [ | 45 all_dependent_configs = [ ":libwebp_config" ] |
| 49 ":libwebp_config" | |
| 50 ] | |
| 51 configs -= [ "//build/config/compiler:chromium_code" ] | 46 configs -= [ "//build/config/compiler:chromium_code" ] |
| 52 configs += [ "//build/config/compiler:no_chromium_code" ] | 47 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 53 } | 48 } |
| 54 | 49 |
| 55 | |
| 56 source_set("libwebp_dsp") { | 50 source_set("libwebp_dsp") { |
| 57 sources = [ | 51 sources = [ |
| 58 "dsp/alpha_processing.c", | 52 "dsp/alpha_processing.c", |
| 59 "dsp/alpha_processing_sse2.c", | 53 "dsp/alpha_processing_sse2.c", |
| 60 "dsp/cpu.c", | 54 "dsp/cpu.c", |
| 61 "dsp/dec.c", | 55 "dsp/dec.c", |
| 62 "dsp/dec_clip_tables.c", | 56 "dsp/dec_clip_tables.c", |
| 63 "dsp/dec_mips32.c", | 57 "dsp/dec_mips32.c", |
| 64 "dsp/dec_sse2.c", | 58 "dsp/dec_sse2.c", |
| 65 "dsp/enc.c", | 59 "dsp/enc.c", |
| 66 "dsp/enc_avx2.c", | 60 "dsp/enc_avx2.c", |
| 67 "dsp/enc_mips32.c", | 61 "dsp/enc_mips32.c", |
| 68 "dsp/enc_sse2.c", | 62 "dsp/enc_sse2.c", |
| 69 "dsp/lossless.c", | 63 "dsp/lossless.c", |
| 70 "dsp/lossless_mips32.c", | 64 "dsp/lossless_mips32.c", |
| 71 "dsp/lossless_sse2.c", | 65 "dsp/lossless_sse2.c", |
| 72 "dsp/upsampling.c", | 66 "dsp/upsampling.c", |
| 73 "dsp/upsampling_sse2.c", | 67 "dsp/upsampling_sse2.c", |
| 74 "dsp/yuv.c", | 68 "dsp/yuv.c", |
| 75 "dsp/yuv_mips32.c", | 69 "dsp/yuv_mips32.c", |
| 76 "dsp/yuv_sse2.c", | 70 "dsp/yuv_sse2.c", |
| 77 ] | 71 ] |
| 78 configs -= [ "//build/config/compiler:chromium_code" ] | 72 configs -= [ "//build/config/compiler:chromium_code" ] |
| 79 configs += [ "//build/config/compiler:no_chromium_code" ] | 73 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 80 | 74 |
| 81 all_dependent_configs = [ | 75 all_dependent_configs = [ ":libwebp_config" ] |
| 82 ":libwebp_config" | |
| 83 ] | |
| 84 deps = [] | 76 deps = [] |
| 85 if (is_android) { | 77 if (is_android) { |
| 86 deps += [ "//third_party/android_tools:cpu_features" ] | 78 deps += [ "//third_party/android_tools:cpu_features" ] |
| 87 } | 79 } |
| 88 # TODO(GYP): | 80 |
| 89 # 'conditions': [ | 81 # TODO(GYP): |
| 90 # ['order_profiling != 0', { | 82 # 'conditions': [ |
| 91 # 'target_conditions' : [ | 83 # ['order_profiling != 0', { |
| 92 # ['_toolset=="target"', { | 84 # 'target_conditions' : [ |
| 93 # 'cflags!': [ '-finstrument-functions' ], | 85 # ['_toolset=="target"', { |
| 94 # }], | 86 # 'cflags!': [ '-finstrument-functions' ], |
| 95 # ], | 87 # }], |
| 96 # }], | 88 # ], |
| 97 # ], | 89 # }], |
| 90 # ], |
| 98 } | 91 } |
| 99 | 92 |
| 100 if (use_dsp_neon) { | 93 if (use_dsp_neon) { |
| 94 source_set("libwebp_dsp_neon") { |
| 95 sources = [ |
| 96 "dsp/dec_neon.c", |
| 97 "dsp/enc_neon.c", |
| 98 "dsp/lossless_neon.c", |
| 99 "dsp/upsampling_neon.c", |
| 100 ] |
| 101 | 101 |
| 102 source_set("libwebp_dsp_neon") { | 102 include_dirs = [ "." ] |
| 103 sources = [ | |
| 104 "dsp/dec_neon.c", | |
| 105 "dsp/enc_neon.c", | |
| 106 "dsp/lossless_neon.c", | |
| 107 "dsp/upsampling_neon.c", | |
| 108 ] | |
| 109 | 103 |
| 110 include_dirs = [ "." ] | 104 if (cpu_arch == "arm") { |
| 105 # behavior similar to *.c.neon in an Android.mk |
| 106 configs -= [ "//build/config/compiler:compiler_arm_fpu" ] |
| 107 cflags = [ "-mfpu=neon" ] |
| 108 } else if (cpu_arch == "arm64") { |
| 109 # avoid an ICE with gcc-4.9: b/15574841 |
| 110 cflags = [ "-frename-registers" ] |
| 111 } |
| 111 | 112 |
| 112 if (cpu_arch == "arm") { | 113 # TODO(GYP): |
| 113 # behavior similar to *.c.neon in an Android.mk | 114 # ['order_profiling != 0', { |
| 114 configs -= [ "//build/config/compiler:compiler_arm_fpu" ] | 115 # 'target_conditions' : [ |
| 115 cflags = [ "-mfpu=neon" ] | 116 # ['_toolset=="target"', { |
| 116 } else if (cpu_arch == "arm64") { | 117 # 'cflags!': [ '-finstrument-functions' ], |
| 117 # avoid an ICE with gcc-4.9: b/15574841 | 118 # }], |
| 118 cflags = [ "-frename-registers" ] | 119 # ], |
| 120 # }], |
| 121 # ], |
| 122 # } |
| 119 } | 123 } |
| 120 | |
| 121 # TODO(GYP): | |
| 122 # ['order_profiling != 0', { | |
| 123 # 'target_conditions' : [ | |
| 124 # ['_toolset=="target"', { | |
| 125 # 'cflags!': [ '-finstrument-functions' ], | |
| 126 # }], | |
| 127 # ], | |
| 128 # }], | |
| 129 # ], | |
| 130 # } | |
| 131 } | |
| 132 | |
| 133 } # use_dsp_neon | 124 } # use_dsp_neon |
| 134 | 125 |
| 135 source_set("libwebp_enc") { | 126 source_set("libwebp_enc") { |
| 136 sources = [ | 127 sources = [ |
| 137 "enc/alpha.c", | 128 "enc/alpha.c", |
| 138 "enc/analysis.c", | 129 "enc/analysis.c", |
| 139 "enc/backward_references.c", | 130 "enc/backward_references.c", |
| 140 "enc/config.c", | 131 "enc/config.c", |
| 141 "enc/cost.c", | 132 "enc/cost.c", |
| 142 "enc/filter.c", | 133 "enc/filter.c", |
| 143 "enc/frame.c", | 134 "enc/frame.c", |
| 144 "enc/histogram.c", | 135 "enc/histogram.c", |
| 145 "enc/iterator.c", | 136 "enc/iterator.c", |
| 146 "enc/picture.c", | 137 "enc/picture.c", |
| 147 "enc/picture_csp.c", | 138 "enc/picture_csp.c", |
| 148 "enc/picture_psnr.c", | 139 "enc/picture_psnr.c", |
| 149 "enc/picture_rescale.c", | 140 "enc/picture_rescale.c", |
| 150 "enc/picture_tools.c", | 141 "enc/picture_tools.c", |
| 151 "enc/quant.c", | 142 "enc/quant.c", |
| 152 "enc/syntax.c", | 143 "enc/syntax.c", |
| 153 "enc/token.c", | 144 "enc/token.c", |
| 154 "enc/tree.c", | 145 "enc/tree.c", |
| 155 "enc/vp8l.c", | 146 "enc/vp8l.c", |
| 156 "enc/webpenc.c", | 147 "enc/webpenc.c", |
| 157 ] | 148 ] |
| 158 configs -= [ "//build/config/compiler:chromium_code" ] | 149 configs -= [ "//build/config/compiler:chromium_code" ] |
| 159 configs += [ "//build/config/compiler:no_chromium_code" ] | 150 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 160 | 151 |
| 161 all_dependent_configs = [ | 152 all_dependent_configs = [ ":libwebp_config" ] |
| 162 ":libwebp_config" | |
| 163 ] | |
| 164 } | 153 } |
| 165 | 154 |
| 166 source_set("libwebp_utils") { | 155 source_set("libwebp_utils") { |
| 167 sources = [ | 156 sources = [ |
| 168 "utils/bit_reader.c", | 157 "utils/bit_reader.c", |
| 169 "utils/bit_writer.c", | 158 "utils/bit_writer.c", |
| 170 "utils/color_cache.c", | 159 "utils/color_cache.c", |
| 171 "utils/filters.c", | 160 "utils/filters.c", |
| 172 "utils/huffman.c", | 161 "utils/huffman.c", |
| 173 "utils/huffman_encode.c", | 162 "utils/huffman_encode.c", |
| 174 "utils/quant_levels.c", | 163 "utils/quant_levels.c", |
| 175 "utils/quant_levels_dec.c", | 164 "utils/quant_levels_dec.c", |
| 176 "utils/random.c", | 165 "utils/random.c", |
| 177 "utils/rescaler.c", | 166 "utils/rescaler.c", |
| 178 "utils/thread.c", | 167 "utils/thread.c", |
| 179 "utils/utils.c", | 168 "utils/utils.c", |
| 180 ] | 169 ] |
| 181 configs -= [ "//build/config/compiler:chromium_code" ] | 170 configs -= [ "//build/config/compiler:chromium_code" ] |
| 182 configs += [ "//build/config/compiler:no_chromium_code" ] | 171 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 183 | 172 |
| 184 all_dependent_configs = [ | 173 all_dependent_configs = [ ":libwebp_config" ] |
| 185 ":libwebp_config" | |
| 186 ] | |
| 187 } | 174 } |
| 188 | 175 |
| 189 group("libwebp") { | 176 group("libwebp") { |
| 190 deps = [ | 177 deps = [ |
| 191 ":libwebp_dec", | 178 ":libwebp_dec", |
| 192 ":libwebp_demux", | 179 ":libwebp_demux", |
| 193 ":libwebp_dsp", | 180 ":libwebp_dsp", |
| 194 ":libwebp_enc", | 181 ":libwebp_enc", |
| 195 ":libwebp_utils", | 182 ":libwebp_utils", |
| 196 ] | 183 ] |
| 197 public_configs = [ | 184 public_configs = [ ":libwebp_config" ] |
| 198 ":libwebp_config" | |
| 199 ] | |
| 200 if (use_dsp_neon) { | 185 if (use_dsp_neon) { |
| 201 deps += [ ":libwebp_dsp_neon" ] | 186 deps += [ ":libwebp_dsp_neon" ] |
| 202 } | 187 } |
| 203 } | 188 } |
| OLD | NEW |