1package { 2 default_applicable_licenses: ["external_libvpx_license"], 3} 4 5// Added automatically by a large-scale-change that took the approach of 6// 'apply every license found to every target'. While this makes sure we respect 7// every license restriction, it may not be entirely correct. 8// 9// e.g. GPL in an MIT project might only apply to the contrib/ directory. 10// 11// Please consider splitting the single license below into multiple licenses, 12// taking care not to lose any license_kind information, and overriding the 13// default license using the 'licenses: [...]' property on targets as needed. 14// 15// For unused files, consider creating a 'fileGroup' with "//visibility:private" 16// to attach the license to, and including a comment whether the files may be 17// used in the current project. 18// See: http://go/android-license-faq 19license { 20 name: "external_libvpx_license", 21 visibility: [":__subpackages__"], 22 license_kinds: [ 23 "SPDX-license-identifier-BSD", 24 "SPDX-license-identifier-ISC", 25 "legacy_unencumbered", 26 ], 27 license_text: [ 28 "NOTICE", 29 ], 30} 31 32cc_defaults { 33 name: "libvpx_defaults", 34 35 cflags: [ 36 "-O3", 37 ], 38 39 min_sdk_version: "29", 40 apex_available: [ 41 "//apex_available:platform", 42 "com.android.media.swcodec", 43 ], 44 45 target: { 46 darwin: { 47 enabled: false, 48 }, 49 android: { 50 sanitize: { 51 cfi: true, 52 config: { 53 cfi_assembly_support: true, 54 }, 55 }, 56 }, 57 }, 58 59 arch: { 60 // configured to require the neon unit 61 arm: { 62 local_include_dirs: ["config/arm-neon"], 63 }, 64 65 arm64: { 66 local_include_dirs: ["config/arm64"], 67 }, 68 69 riscv64: { 70 local_include_dirs: ["config/generic"], 71 }, 72 73 x86: { 74 local_include_dirs: ["config/x86"], 75 }, 76 77 x86_64: { 78 local_include_dirs: ["config/x86_64"], 79 }, 80 }, 81} 82 83cc_library_static { 84 name: "libvpx_avx", 85 defaults: ["libvpx_defaults"], 86 host_supported: true, 87 vendor_available: true, 88 visibility: ["//visibility:private"], 89 90 cflags: [ 91 "-Xclang -target-feature", 92 // This comment prevents bpfmt from sorting the flags incorrectly. 93 "-Xclang +avx", 94 ], 95 96 arch: { 97 x86: { 98 srcs: libvpx_x86_avx_c_srcs, 99 }, 100 101 x86_64: { 102 srcs: libvpx_x86_64_avx_c_srcs, 103 }, 104 }, 105} 106 107cc_library_static { 108 name: "libvpx_avx2", 109 defaults: ["libvpx_defaults"], 110 host_supported: true, 111 vendor_available: true, 112 visibility: ["//visibility:private"], 113 114 cflags: [ 115 "-Xclang -target-feature", 116 // This comment prevents bpfmt from sorting the flags incorrectly. 117 "-Xclang +avx2", 118 ], 119 120 arch: { 121 x86: { 122 srcs: libvpx_x86_avx2_c_srcs, 123 }, 124 125 x86_64: { 126 srcs: libvpx_x86_64_avx2_c_srcs, 127 }, 128 }, 129} 130 131cc_library_static { 132 name: "libvpx_avx512", 133 defaults: ["libvpx_defaults"], 134 host_supported: true, 135 vendor_available: true, 136 visibility: ["//visibility:private"], 137 138 cflags: [ 139 "-Xclang -target-feature", 140 // This comment prevents bpfmt from sorting the flags incorrectly. 141 "-Xclang +avx512f", 142 // This comment prevents bpfmt from sorting the flags incorrectly. 143 "-Xclang -target-feature", 144 // This comment prevents bpfmt from sorting the flags incorrectly. 145 "-Xclang +avx512cd", 146 // This comment prevents bpfmt from sorting the flags incorrectly. 147 "-Xclang -target-feature", 148 // This comment prevents bpfmt from sorting the flags incorrectly. 149 "-Xclang +avx512bw", 150 // This comment prevents bpfmt from sorting the flags incorrectly. 151 "-Xclang -target-feature", 152 // This comment prevents bpfmt from sorting the flags incorrectly. 153 "-Xclang +avx512dq", 154 // This comment prevents bpfmt from sorting the flags incorrectly. 155 "-Xclang -target-feature", 156 // This comment prevents bpfmt from sorting the flags incorrectly. 157 "-Xclang +avx512vl", 158 ], 159 160 arch: { 161 x86: { 162 srcs: libvpx_x86_avx512_c_srcs, 163 }, 164 165 x86_64: { 166 srcs: libvpx_x86_64_avx512_c_srcs, 167 }, 168 }, 169} 170 171cc_library_static { 172 name: "libvpx_neon_dotprod", 173 defaults: ["libvpx_defaults"], 174 host_supported: true, 175 vendor_available: true, 176 visibility: ["//visibility:private"], 177 178 cflags: [ 179 "-Xclang -target-feature", 180 // This comment prevents bpfmt from sorting the flags incorrectly. 181 "-Xclang +dotprod", 182 ], 183 184 arch: { 185 arm64: { 186 srcs: libvpx_arm64_neon_dotprod_c_srcs, 187 }, 188 }, 189} 190 191cc_library_static { 192 name: "libvpx_neon_i8mm", 193 defaults: ["libvpx_defaults"], 194 host_supported: true, 195 vendor_available: true, 196 visibility: ["//visibility:private"], 197 198 cflags: [ 199 "-Xclang -target-feature", 200 // This comment prevents bpfmt from sorting the flags incorrectly. 201 "-Xclang +dotprod", 202 // This comment prevents bpfmt from sorting the flags incorrectly. 203 "-Xclang -target-feature", 204 // This comment prevents bpfmt from sorting the flags incorrectly. 205 "-Xclang +i8mm", 206 ], 207 208 arch: { 209 arm64: { 210 srcs: libvpx_arm64_neon_i8mm_c_srcs, 211 }, 212 }, 213} 214 215cc_library_static { 216 name: "libvpx_sse4", 217 defaults: ["libvpx_defaults"], 218 host_supported: true, 219 vendor_available: true, 220 visibility: ["//visibility:private"], 221 222 cflags: [ 223 "-Xclang -target-feature", 224 // This comment prevents bpfmt from sorting the flags incorrectly. 225 "-Xclang +sse4.1", 226 ], 227 228 arch: { 229 x86: { 230 srcs: libvpx_x86_sse4_c_srcs, 231 }, 232 233 x86_64: { 234 srcs: libvpx_x86_64_sse4_c_srcs, 235 }, 236 }, 237} 238 239cc_library_static { 240 name: "libvpx_sve", 241 defaults: ["libvpx_defaults"], 242 host_supported: true, 243 vendor_available: true, 244 visibility: ["//visibility:private"], 245 246 cflags: [ 247 "-Xclang -target-feature", 248 // This comment prevents bpfmt from sorting the flags incorrectly. 249 "-Xclang +dotprod", 250 // This comment prevents bpfmt from sorting the flags incorrectly. 251 "-Xclang -target-feature", 252 // This comment prevents bpfmt from sorting the flags incorrectly. 253 "-Xclang +i8mm", 254 // This comment prevents bpfmt from sorting the flags incorrectly. 255 "-Xclang -target-feature", 256 // This comment prevents bpfmt from sorting the flags incorrectly. 257 "-Xclang +sve", 258 ], 259 260 arch: { 261 arm64: { 262 srcs: libvpx_arm64_sve_c_srcs, 263 }, 264 }, 265} 266 267cc_library_static { 268 name: "libvpx_sve2", 269 defaults: ["libvpx_defaults"], 270 host_supported: true, 271 vendor_available: true, 272 visibility: ["//visibility:private"], 273 274 cflags: [ 275 "-Xclang -target-feature", 276 // This comment prevents bpfmt from sorting the flags incorrectly. 277 "-Xclang +dotprod", 278 // This comment prevents bpfmt from sorting the flags incorrectly. 279 "-Xclang -target-feature", 280 // This comment prevents bpfmt from sorting the flags incorrectly. 281 "-Xclang +i8mm", 282 // This comment prevents bpfmt from sorting the flags incorrectly. 283 "-Xclang -target-feature", 284 // This comment prevents bpfmt from sorting the flags incorrectly. 285 "-Xclang +sve", 286 // This comment prevents bpfmt from sorting the flags incorrectly. 287 "-Xclang -target-feature", 288 // This comment prevents bpfmt from sorting the flags incorrectly. 289 "-Xclang +sve2", 290 ], 291 292 arch: { 293 arm64: { 294 srcs: libvpx_arm64_sve2_c_srcs, 295 }, 296 }, 297} 298 299cc_library { 300 name: "libvpx", 301 defaults: [ "libvpx_defaults" ], 302 vendor_available: true, 303 host_supported: true, 304 version_script: "exports.lds", 305 306 arch: { 307 // configured to require the neon unit 308 arm: { 309 // Want arm, not thumb, optimized 310 instruction_set: "arm", 311 312 srcs: libvpx_arm_neon_c_srcs + libvpx_arm_neon_asm_srcs, 313 }, 314 315 arm64: { 316 srcs: libvpx_arm64_c_srcs, 317 whole_static_libs: [ 318 "libvpx_neon_dotprod", 319 "libvpx_neon_i8mm", 320 "libvpx_sve", 321 "libvpx_sve2", 322 ], 323 }, 324 325 riscv64: { 326 srcs: libvpx_generic_c_srcs, 327 }, 328 329 x86: { 330 srcs: libvpx_x86_c_srcs + libvpx_x86_asm_srcs, 331 cflags: [ 332 "-mssse3", 333 ], 334 whole_static_libs: [ 335 "libvpx_avx", 336 "libvpx_avx2", 337 "libvpx_avx512", 338 "libvpx_sse4", 339 ], 340 }, 341 342 x86_64: { 343 srcs: libvpx_x86_64_c_srcs + libvpx_x86_64_asm_srcs, 344 cflags: [ 345 "-mssse3", 346 ], 347 whole_static_libs: [ 348 "libvpx_avx", 349 "libvpx_avx2", 350 "libvpx_avx512", 351 "libvpx_sse4", 352 ], 353 }, 354 }, 355 356 cflags: [ 357 "-Wno-unused-parameter", 358 ], 359 360 export_include_dirs: ["."], 361 362 sanitize: { 363 integer_overflow: true, 364 misc_undefined: ["bounds"], 365 blocklist: "libvpx_blocklist.txt", 366 }, 367} 368 369cc_library { 370 name: "libvpxrc", 371 defaults: [ "libvpx_defaults" ], 372 vendor_available: true, 373 static_libs: [ "libvpx" ], 374 375 arch: { 376 x86_64: { 377 srcs: libvpxrc_x86_64_c_srcs + 378 libvpxrc_x86_64_cc_srcs + 379 libvpxrc_x86_64_asm_srcs, 380 cflags: [ 381 "-mssse3", 382 ], 383 }, 384 }, 385 386 export_include_dirs: ["."], 387} 388 389cc_library_headers { 390 name: "libvpx_headers", 391 vendor_available: true, 392 host_supported: true, 393 394 arch: { 395 arm: { 396 export_include_dirs: ["config/arm-neon"], 397 }, 398 399 arm64: { 400 export_include_dirs: ["config/arm64"], 401 }, 402 403 riscv64: { 404 export_include_dirs: ["config/generic"], 405 }, 406 407 x86: { 408 export_include_dirs: ["config/x86"], 409 }, 410 411 x86_64: { 412 export_include_dirs: ["config/x86_64"], 413 }, 414 }, 415 416 export_include_dirs: ["."], 417} 418 419cc_fuzz { 420 name: "vp9_dec_fuzzer", 421 defaults: [ "libvpx_defaults" ], 422 host_supported: true, 423 srcs: [ 424 "examples/vpx_dec_fuzzer.cc", 425 ], 426 427 cflags: ["-DDECODER=vp9"], 428 static_libs: [ 429 "libvpx", 430 ], 431} 432 433cc_fuzz { 434 name: "vp8_dec_fuzzer", 435 defaults: [ "libvpx_defaults" ], 436 host_supported: true, 437 srcs: [ 438 "examples/vpx_dec_fuzzer.cc", 439 ], 440 441 cflags: ["-DDECODER=vp8"], 442 static_libs: [ 443 "libvpx", 444 ], 445} 446