xref: /aosp_15_r20/external/libaom/Android.bp.in (revision 77c1e3ccc04c968bd2bc212e87364f250e820521)
1aom_av1_common_sources +=
2["common/av1_config.c"]
3
4package {
5    default_applicable_licenses: ["external_libaom_license"],
6}
7
8// Added automatically by a large-scale-change that took the approach of
9// 'apply every license found to every target'. While this makes sure we respect
10// every license restriction, it may not be entirely correct.
11//
12// e.g. GPL in an MIT project might only apply to the contrib/ directory.
13//
14// Please consider splitting the single license below into multiple licenses,
15// taking care not to lose any license_kind information, and overriding the
16// default license using the 'licenses: [...]' property on targets as needed.
17//
18// For unused files, consider creating a 'fileGroup' with "//visibility:private"
19// to attach the license to, and including a comment whether the files may be
20// used in the current project.
21// See: http://go/android-license-faq
22license {
23    name: "external_libaom_license",
24    visibility: [":__subpackages__"],
25    license_kinds: [
26        "SPDX-license-identifier-BSD",
27        "SPDX-license-identifier-ISC",
28        "SPDX-license-identifier-MIT",
29        "legacy_by_exception_only", // by exception only
30        "legacy_unencumbered",
31    ],
32    license_text: [
33        "LICENSE",
34        "PATENTS",
35    ],
36}
37
38cc_defaults {
39    name: "libaom_defaults",
40
41    cflags: [
42        "-O3",
43    ],
44
45    min_sdk_version: "29",
46    apex_available: [
47        "//apex_available:platform",
48        "com.android.media.swcodec",
49    ],
50
51    arch: {
52        arm64: {
53            local_include_dirs: [
54                "config/",
55                "config/arm64/",
56            ],
57        },
58
59        // configured to require the neon unit
60        arm: {
61            local_include_dirs: [
62                "config/",
63                "config/arm/",
64            ],
65        },
66
67        x86_64: {
68            local_include_dirs: [
69                "config/",
70                "config/x86_64/",
71            ],
72        },
73
74        x86: {
75            local_include_dirs: [
76                "config/",
77                "config/x86/",
78            ],
79        },
80
81        riscv64: {
82            local_include_dirs: [
83                "config/",
84                "config/riscv64/",
85            ],
86        },
87    },
88}
89
90cc_library_static {
91    name: "libaom_arm_crc32",
92    defaults: [ "libaom_defaults" ],
93    host_supported: true,
94    vendor_available: true,
95    visibility: ["//visibility:private"],
96
97    cflags: [
98        "-Xclang -target-feature",
99        // This comment prevents bpfmt from sorting the flags incorrectly.
100        "-Xclang +crc",
101    ],
102
103    arch: {
104        arm64: {
105            srcs: aom_av1_encoder_intrin_arm_crc32,
106        },
107    },
108}
109
110cc_library_static {
111    name: "libaom_neon_dotprod",
112    defaults: [ "libaom_defaults" ],
113    host_supported: true,
114    vendor_available: true,
115    visibility: ["//visibility:private"],
116
117    cflags: [
118        "-Xclang -target-feature",
119        // This comment prevents bpfmt from sorting the flags incorrectly.
120        "-Xclang +dotprod",
121    ],
122
123    arch: {
124        arm64: {
125            srcs: aom_av1_common_intrin_neon_dotprod +
126                aom_av1_encoder_intrin_neon_dotprod +
127                aom_dsp_common_intrin_neon_dotprod +
128                aom_dsp_encoder_intrin_neon_dotprod
129        },
130    },
131}
132
133cc_library_static {
134    name: "libaom_neon_i8mm",
135    defaults: [ "libaom_defaults" ],
136    host_supported: true,
137    vendor_available: true,
138    visibility: ["//visibility:private"],
139
140    cflags: [
141        "-Xclang -target-feature",
142        // This comment prevents bpfmt from sorting the flags incorrectly.
143        "-Xclang +dotprod",
144        // This comment prevents bpfmt from sorting the flags incorrectly.
145        "-Xclang -target-feature",
146        // This comment prevents bpfmt from sorting the flags incorrectly.
147        "-Xclang +i8mm",
148    ],
149
150    arch: {
151        arm64: {
152            srcs: aom_av1_common_intrin_neon_i8mm +
153                aom_dsp_common_intrin_neon_i8mm
154        },
155    },
156}
157
158cc_library_static {
159    name: "libaom_sve",
160    defaults: [ "libaom_defaults" ],
161    host_supported: true,
162    vendor_available: true,
163    visibility: ["//visibility:private"],
164
165    cflags: [
166        "-Xclang -target-feature",
167        // This comment prevents bpfmt from sorting the flags incorrectly.
168        "-Xclang +dotprod",
169        // This comment prevents bpfmt from sorting the flags incorrectly.
170        "-Xclang -target-feature",
171        // This comment prevents bpfmt from sorting the flags incorrectly.
172        "-Xclang +i8mm",
173        // This comment prevents bpfmt from sorting the flags incorrectly.
174        "-Xclang -target-feature",
175        // This comment prevents bpfmt from sorting the flags incorrectly.
176        "-Xclang +sve",
177    ],
178
179    arch: {
180        arm64: {
181            srcs: aom_av1_common_intrin_sve +
182                aom_av1_encoder_intrin_sve +
183                aom_dsp_common_intrin_sve +
184                aom_dsp_encoder_intrin_sve
185        },
186    },
187}
188
189cc_library_static {
190    name: "libaom_sve2",
191    defaults: [ "libaom_defaults" ],
192    host_supported: true,
193    vendor_available: true,
194    visibility: ["//visibility:private"],
195
196    cflags: [
197        "-Xclang -target-feature",
198        // This comment prevents bpfmt from sorting the flags incorrectly.
199        "-Xclang +dotprod",
200        // This comment prevents bpfmt from sorting the flags incorrectly.
201        "-Xclang -target-feature",
202        // This comment prevents bpfmt from sorting the flags incorrectly.
203        "-Xclang +i8mm",
204        // This comment prevents bpfmt from sorting the flags incorrectly.
205        "-Xclang -target-feature",
206        // This comment prevents bpfmt from sorting the flags incorrectly.
207        "-Xclang +sve",
208        // This comment prevents bpfmt from sorting the flags incorrectly.
209        "-Xclang -target-feature",
210        // This comment prevents bpfmt from sorting the flags incorrectly.
211        "-Xclang +sve2",
212    ],
213
214    arch: {
215        arm64: {
216            srcs: aom_av1_common_intrin_sve2
217        },
218    },
219}
220
221cc_library_static {
222    name: "libaom",
223    defaults: [ "libaom_defaults" ],
224    host_supported: true,
225    vendor_available: true,
226
227    export_include_dirs: [
228        ".",
229    ],
230
231    min_sdk_version: "29",
232    apex_available: [
233        "//apex_available:platform",
234        "com.android.media.swcodec",
235    ],
236
237    arch: {
238        arm64: {
239            srcs: aom_av1_common_sources +
240                aom_av1_decoder_sources +
241                aom_dsp_common_sources +
242                aom_dsp_decoder_sources +
243                aom_mem_sources +
244                ["aom_ports/aarch64_cpudetect.c"] +
245                aom_rtcd_sources +
246                aom_scale_sources +
247                aom_sources +
248                aom_util_sources +
249                aom_av1_common_intrin_neon +
250                aom_dsp_common_intrin_neon +
251                aom_av1_encoder_intrin_neon +
252                aom_av1_encoder_sources +
253                aom_dsp_encoder_intrin_neon +
254                aom_dsp_encoder_sources,
255            whole_static_libs: [
256                "libaom_arm_crc32",
257                "libaom_neon_dotprod",
258                "libaom_neon_i8mm",
259                "libaom_sve",
260                "libaom_sve2",
261            ],
262        },
263
264        // configured to require the neon unit
265        arm: {
266            srcs: aom_av1_common_sources +
267                aom_av1_decoder_sources +
268                aom_dsp_common_sources +
269                aom_dsp_decoder_sources +
270                aom_mem_sources +
271                aom_rtcd_sources +
272                ["aom_ports/aarch32_cpudetect.c"] +
273                aom_scale_sources +
274                aom_sources +
275                aom_util_sources +
276                aom_av1_common_intrin_neon +
277                aom_dsp_common_intrin_neon +
278                aom_av1_encoder_intrin_neon +
279                aom_av1_encoder_sources +
280                aom_dsp_encoder_intrin_neon +
281                aom_dsp_encoder_sources,
282        },
283
284        x86_64: {
285            cflags: [
286                "-mssse3",
287            ],
288            srcs: aom_av1_common_sources +
289                aom_av1_decoder_sources +
290                aom_dsp_common_sources +
291                aom_dsp_decoder_sources +
292                aom_mem_sources +
293                aom_rtcd_sources +
294                aom_scale_sources +
295                aom_sources +
296                aom_util_sources +
297                aom_dsp_common_asm_sse2 +
298                aom_dsp_common_asm_ssse3 +
299                aom_ports_asm_x86 +
300                aom_av1_common_intrin_sse2 +
301                aom_dsp_common_intrin_sse2 +
302                aom_av1_common_intrin_ssse3 +
303                aom_dsp_common_intrin_ssse3 +
304                aom_av1_encoder_asm_sse2 +
305                aom_av1_encoder_asm_ssse3_x86_64 +
306                aom_av1_encoder_intrin_sse2 +
307                aom_av1_encoder_intrin_sse3 +
308                aom_av1_encoder_sources +
309                aom_dsp_encoder_asm_sse2 +
310                aom_dsp_encoder_asm_sse2_x86_64 +
311                aom_dsp_encoder_asm_ssse3 +
312                aom_dsp_encoder_asm_ssse3_x86_64 +
313                aom_dsp_encoder_intrin_sse2 +
314                aom_dsp_encoder_intrin_ssse3 +
315                aom_dsp_encoder_sources,
316        },
317
318        x86: {
319            local_include_dirs: [
320                "config/",
321                "config/x86/",
322            ],
323            cflags: [
324                "-mssse3",
325            ],
326            srcs: aom_av1_common_sources +
327                aom_av1_decoder_sources +
328                aom_dsp_common_sources +
329                aom_dsp_decoder_sources +
330                aom_mem_sources +
331                aom_rtcd_sources +
332                aom_scale_sources +
333                aom_sources +
334                aom_util_sources +
335                aom_dsp_common_asm_sse2 +
336                aom_dsp_common_asm_ssse3 +
337                aom_ports_asm_x86 +
338                aom_av1_common_intrin_sse2 +
339                aom_dsp_common_intrin_sse2 +
340                aom_av1_common_intrin_ssse3 +
341                aom_dsp_common_intrin_ssse3 +
342                aom_av1_common_intrin_ssse3_x86 +
343                aom_av1_encoder_asm_sse2 +
344                aom_av1_encoder_intrin_sse2 +
345                aom_av1_encoder_intrin_sse3 +
346                aom_av1_encoder_sources +
347                aom_dsp_encoder_asm_sse2 +
348                aom_dsp_encoder_asm_ssse3 +
349                aom_dsp_encoder_intrin_sse2 +
350                aom_dsp_encoder_intrin_ssse3 +
351                aom_dsp_encoder_sources,
352        },
353
354        riscv64: {
355            local_include_dirs: [
356                "config/",
357                "config/riscv64/",
358            ],
359            cflags: [
360            ],
361            srcs: aom_av1_common_sources +
362                aom_av1_decoder_sources +
363                aom_dsp_common_sources +
364                aom_dsp_decoder_sources +
365                aom_mem_sources +
366                aom_rtcd_sources +
367                aom_scale_sources +
368                aom_sources +
369                aom_util_sources +
370                aom_av1_encoder_sources +
371                aom_dsp_encoder_sources,
372        },
373    },
374
375    sanitize: {
376        blocklist: "libaom_blocklist.txt",
377    },
378
379}
380
381cc_fuzz {
382    name: "av1_dec_fuzzer",
383    defaults: [ "libaom_defaults" ],
384    host_supported: true,
385    srcs: [
386        "examples/av1_dec_fuzzer.cc",
387    ],
388    static_libs: [
389        "libaom",
390    ],
391}
392