blob: dafe5200480c8b41b59f099662947d4820e0ebbb [file] [log] [blame]
Colin Cross3f774362017-04-20 16:42:47 -07001cc_library_static {
2 name: "libhevcdec",
Jiyong Park0323e532017-08-07 13:15:09 +09003 vendor_available: true,
Mitch Phillips84e41b12019-06-17 14:49:49 -07004 host_supported: true,
Colin Cross3f774362017-04-20 16:42:47 -07005
6 cflags: [
7 "-D_LIB",
8 "-DMULTICORE",
9 "-fPIC",
10
11 "-O3",
12 "-DANDROID",
Chih-Hung Hsieh3dcae232017-09-28 14:24:46 -070013 "-Wall",
14 "-Werror",
15 // common/x86/ihevc_sao_ssse3_intr.c: implicit conversion from
16 // 'int' to 'char' changes value from 128 to -128
17 "-Wno-error=constant-conversion",
Colin Cross3f774362017-04-20 16:42:47 -070018 ],
19
20 export_include_dirs: [
21 "decoder",
22 "common",
23 ],
24
25 srcs: [
26 "common/ihevc_quant_tables.c",
27 "common/ihevc_inter_pred_filters.c",
28 "common/ihevc_weighted_pred.c",
29 "common/ihevc_padding.c",
30 "common/ihevc_deblk_edge_filter.c",
31 "common/ihevc_deblk_tables.c",
32 "common/ihevc_cabac_tables.c",
33 "common/ihevc_common_tables.c",
34 "common/ihevc_intra_pred_filters.c",
35 "common/ihevc_chroma_intra_pred_filters.c",
36 "common/ihevc_mem_fns.c",
37 "common/ihevc_sao.c",
38 "common/ihevc_trans_tables.c",
39 "common/ihevc_recon.c",
40 "common/ihevc_itrans.c",
41 "common/ihevc_itrans_recon.c",
42 "common/ihevc_iquant_recon.c",
43 "common/ihevc_iquant_itrans_recon.c",
44 "common/ihevc_itrans_recon_32x32.c",
45 "common/ihevc_itrans_recon_16x16.c",
46 "common/ihevc_itrans_recon_8x8.c",
47 "common/ihevc_chroma_itrans_recon.c",
48 "common/ihevc_chroma_iquant_recon.c",
49 "common/ihevc_chroma_iquant_itrans_recon.c",
50 "common/ihevc_chroma_recon.c",
51 "common/ihevc_chroma_itrans_recon_16x16.c",
52 "common/ihevc_chroma_itrans_recon_8x8.c",
53 "common/ihevc_buf_mgr.c",
54 "common/ihevc_disp_mgr.c",
55 "common/ihevc_dpb_mgr.c",
56 "common/ithread.c",
57 "decoder/ihevcd_version.c",
58 "decoder/ihevcd_api.c",
59 "decoder/ihevcd_decode.c",
60 "decoder/ihevcd_nal.c",
61 "decoder/ihevcd_bitstream.c",
62 "decoder/ihevcd_parse_headers.c",
63 "decoder/ihevcd_parse_slice_header.c",
64 "decoder/ihevcd_parse_slice.c",
65 "decoder/ihevcd_parse_residual.c",
66 "decoder/ihevcd_cabac.c",
67 "decoder/ihevcd_intra_pred_mode_prediction.c",
68 "decoder/ihevcd_process_slice.c",
69 "decoder/ihevcd_utils.c",
70 "decoder/ihevcd_job_queue.c",
71 "decoder/ihevcd_ref_list.c",
72 "decoder/ihevcd_get_mv.c",
73 "decoder/ihevcd_mv_pred.c",
74 "decoder/ihevcd_mv_merge.c",
75 "decoder/ihevcd_iquant_itrans_recon_ctb.c",
76 "decoder/ihevcd_itrans_recon_dc.c",
77 "decoder/ihevcd_common_tables.c",
78 "decoder/ihevcd_boundary_strength.c",
79 "decoder/ihevcd_deblk.c",
80 "decoder/ihevcd_inter_pred.c",
81 "decoder/ihevcd_sao.c",
82 "decoder/ihevcd_ilf_padding.c",
83 "decoder/ihevcd_fmt_conv.c",
84 ],
85
86 arch: {
87 arm64: {
88 cflags: [
89 "-DARMV8",
90 "-DDISABLE_NEONINTR",
91 "-DARM",
92 "-DARMGCC",
93
94 "-DDEFAULT_ARCH=D_ARCH_ARMV8_GENERIC",
95 ],
96 local_include_dirs: [
97 "decoder/arm",
98 "common/arm",
99 "decoder/arm64",
100 "common/arm64",
101 ],
102
103 srcs: [
104 "decoder/arm/ihevcd_function_selector.c",
105 "decoder/arm/ihevcd_function_selector_noneon.c",
106 "decoder/arm64/ihevcd_function_selector_av8.c",
107 "common/arm/ihevc_intra_pred_filters_neon_intr.c",
108 "common/arm/ihevc_weighted_pred_neon_intr.c",
109 "common/arm64/ihevc_mem_fns.s",
110 "common/arm64/ihevc_itrans_recon_32x32.s",
111 "common/arm64/ihevc_weighted_pred_bi_default.s",
112 "common/arm64/ihevc_weighted_pred_bi.s",
113 "common/arm64/ihevc_weighted_pred_uni.s",
114 "common/arm64/ihevc_deblk_luma_horz.s",
115 "common/arm64/ihevc_deblk_luma_vert.s",
116 "common/arm64/ihevc_deblk_chroma_vert.s",
117 "common/arm64/ihevc_deblk_chroma_horz.s",
118 "common/arm64/ihevc_sao_band_offset_luma.s",
119 "common/arm64/ihevc_sao_band_offset_chroma.s",
120 "common/arm64/ihevc_sao_edge_offset_class0.s",
121 "common/arm64/ihevc_sao_edge_offset_class0_chroma.s",
122 "common/arm64/ihevc_sao_edge_offset_class1.s",
123 "common/arm64/ihevc_sao_edge_offset_class1_chroma.s",
124 "common/arm64/ihevc_sao_edge_offset_class2.s",
125 "common/arm64/ihevc_sao_edge_offset_class2_chroma.s",
126 "common/arm64/ihevc_sao_edge_offset_class3.s",
127 "common/arm64/ihevc_sao_edge_offset_class3_chroma.s",
128 "common/arm64/ihevc_inter_pred_luma_horz_w16out.s",
129 "common/arm64/ihevc_inter_pred_filters_luma_horz.s",
130 "common/arm64/ihevc_inter_pred_filters_luma_vert.s",
131 "common/arm64/ihevc_inter_pred_chroma_horz.s",
132 "common/arm64/ihevc_inter_pred_chroma_horz_w16out.s",
133 "common/arm64/ihevc_inter_pred_chroma_vert.s",
134 "common/arm64/ihevc_inter_pred_chroma_vert_w16out.s",
135 "common/arm64/ihevc_inter_pred_chroma_vert_w16inp.s",
136 "common/arm64/ihevc_inter_pred_chroma_vert_w16inp_w16out.s",
137 "common/arm64/ihevc_inter_pred_filters_luma_vert_w16inp.s",
138 "common/arm64/ihevc_inter_pred_filters_luma_vert_w16out.s",
139 "common/arm64/ihevc_inter_pred_luma_vert_w16inp_w16out.s",
140 "common/arm64/ihevc_inter_pred_luma_copy_w16out.s",
141 "common/arm64/ihevc_inter_pred_luma_copy.s",
142 "common/arm64/ihevc_inter_pred_chroma_copy.s",
143 "common/arm64/ihevc_inter_pred_chroma_copy_w16out.s",
144 "common/arm64/ihevc_itrans_recon_4x4_ttype1.s",
145 "common/arm64/ihevc_itrans_recon_4x4.s",
146 "common/arm64/ihevc_itrans_recon_8x8.s",
147 "common/arm64/ihevc_itrans_recon_16x16.s",
148 "common/arm64/ihevc_intra_pred_chroma_planar.s",
149 "common/arm64/ihevc_intra_pred_chroma_dc.s",
150 "common/arm64/ihevc_intra_pred_chroma_horz.s",
151 "common/arm64/ihevc_intra_pred_chroma_ver.s",
152 "common/arm64/ihevc_intra_pred_chroma_mode2.s",
153 "common/arm64/ihevc_intra_pred_chroma_mode_18_34.s",
154 "common/arm64/ihevc_intra_pred_filters_chroma_mode_11_to_17.s",
155 "common/arm64/ihevc_intra_pred_filters_chroma_mode_19_to_25.s",
156 "common/arm64/ihevc_intra_pred_chroma_mode_3_to_9.s",
157 "common/arm64/ihevc_intra_pred_chroma_mode_27_to_33.s",
158 "common/arm64/ihevc_intra_pred_luma_planar.s",
159 "common/arm64/ihevc_intra_pred_luma_horz.s",
160 "common/arm64/ihevc_intra_pred_luma_mode2.s",
161 "common/arm64/ihevc_intra_pred_luma_mode_27_to_33.s",
162 "common/arm64/ihevc_intra_pred_luma_mode_18_34.s",
163 "common/arm64/ihevc_intra_pred_luma_vert.s",
164 "common/arm64/ihevc_intra_pred_luma_dc.s",
165 "common/arm64/ihevc_intra_pred_filters_luma_mode_11_to_17.s",
166 "common/arm64/ihevc_intra_pred_filters_luma_mode_19_to_25.s",
167 "common/arm64/ihevc_intra_pred_luma_mode_3_to_9.s",
168 "common/arm64/ihevc_padding.s",
169 "decoder/arm64/ihevcd_itrans_recon_dc_luma.s",
170 "decoder/arm64/ihevcd_itrans_recon_dc_chroma.s",
171 "decoder/arm64/ihevcd_fmt_conv_420sp_to_420p.s",
172 "decoder/arm64/ihevcd_fmt_conv_420sp_to_420sp.s",
173 "decoder/arm64/ihevcd_fmt_conv_420sp_to_rgba8888.s",
174 ],
175 },
176
177 arm: {
178 local_include_dirs: [
179 "decoder/arm",
180 "common/arm",
181 ],
182
183 srcs: [
184 "decoder/arm/ihevcd_function_selector.c",
185 "decoder/arm/ihevcd_function_selector_noneon.c",
186 ],
187
188 cflags: [
189 "-DDISABLE_NEONINTR",
190 "-DARM",
191 "-DARMGCC",
192 "-fno-tree-vectorize",
193
194 // These will be overriden by armv7_a_neon
195 "-DDISABLE_NEON",
196 "-DDEFAULT_ARCH=D_ARCH_ARM_NONEON",
197 ],
198
199 instruction_set: "arm",
200
Isaac Chen36ff7b62017-09-12 16:58:19 +0800201 neon: {
Colin Cross3f774362017-04-20 16:42:47 -0700202 srcs: [
203 "decoder/arm/ihevcd_function_selector_a9q.c",
204 "common/arm/ihevc_intra_ref_substitution_a9q.c",
205 "common/arm/ihevc_intra_pred_filters_neon_intr.c",
206 "common/arm/ihevc_weighted_pred_neon_intr.c",
207 "common/arm/ihevc_mem_fns.s",
208 "common/arm/ihevc_itrans_recon_32x32.s",
209 "common/arm/ihevc_weighted_pred_bi_default.s",
210 "common/arm/ihevc_weighted_pred_bi.s",
211 "common/arm/ihevc_weighted_pred_uni.s",
212 "common/arm/ihevc_deblk_luma_horz.s",
213 "common/arm/ihevc_deblk_luma_vert.s",
214 "common/arm/ihevc_deblk_chroma_vert.s",
215 "common/arm/ihevc_deblk_chroma_horz.s",
216 "common/arm/ihevc_sao_band_offset_luma.s",
217 "common/arm/ihevc_sao_band_offset_chroma.s",
218 "common/arm/ihevc_sao_edge_offset_class0.s",
219 "common/arm/ihevc_sao_edge_offset_class0_chroma.s",
220 "common/arm/ihevc_sao_edge_offset_class1.s",
221 "common/arm/ihevc_sao_edge_offset_class1_chroma.s",
222 "common/arm/ihevc_sao_edge_offset_class2.s",
223 "common/arm/ihevc_sao_edge_offset_class2_chroma.s",
224 "common/arm/ihevc_sao_edge_offset_class3.s",
225 "common/arm/ihevc_sao_edge_offset_class3_chroma.s",
226 "common/arm/ihevc_inter_pred_luma_horz_w16out.s",
227 "common/arm/ihevc_inter_pred_filters_luma_horz.s",
228 "common/arm/ihevc_inter_pred_filters_luma_vert.s",
229 "common/arm/ihevc_inter_pred_chroma_horz.s",
230 "common/arm/ihevc_inter_pred_chroma_horz_w16out.s",
231 "common/arm/ihevc_inter_pred_chroma_vert.s",
232 "common/arm/ihevc_inter_pred_chroma_vert_w16out.s",
233 "common/arm/ihevc_inter_pred_chroma_vert_w16inp.s",
234 "common/arm/ihevc_inter_pred_chroma_vert_w16inp_w16out.s",
235 "common/arm/ihevc_inter_pred_filters_luma_vert_w16inp.s",
236 "common/arm/ihevc_inter_pred_luma_vert_w16inp_w16out.s",
237 "common/arm/ihevc_inter_pred_luma_copy_w16out.s",
238 "common/arm/ihevc_inter_pred_luma_copy.s",
239 "common/arm/ihevc_inter_pred_chroma_copy.s",
240 "common/arm/ihevc_inter_pred_chroma_copy_w16out.s",
241 "common/arm/ihevc_itrans_recon_4x4_ttype1.s",
242 "common/arm/ihevc_itrans_recon_4x4.s",
243 "common/arm/ihevc_itrans_recon_8x8.s",
244 "common/arm/ihevc_itrans_recon_16x16.s",
245 "common/arm/ihevc_intra_pred_chroma_planar.s",
246 "common/arm/ihevc_intra_pred_chroma_dc.s",
247 "common/arm/ihevc_intra_pred_chroma_horz.s",
248 "common/arm/ihevc_intra_pred_chroma_ver.s",
249 "common/arm/ihevc_intra_pred_chroma_mode2.s",
250 "common/arm/ihevc_intra_pred_chroma_mode_18_34.s",
251 "common/arm/ihevc_intra_pred_filters_chroma_mode_11_to_17.s",
252 "common/arm/ihevc_intra_pred_filters_chroma_mode_19_to_25.s",
253 "common/arm/ihevc_intra_pred_chroma_mode_3_to_9.s",
254 "common/arm/ihevc_intra_pred_chroma_mode_27_to_33.s",
255 "common/arm/ihevc_intra_pred_luma_planar.s",
256 "common/arm/ihevc_intra_pred_luma_horz.s",
257 "common/arm/ihevc_intra_pred_luma_mode2.s",
258 "common/arm/ihevc_intra_pred_luma_mode_27_to_33.s",
259 "common/arm/ihevc_intra_pred_luma_mode_18_34.s",
260 "common/arm/ihevc_intra_pred_luma_vert.s",
261 "common/arm/ihevc_intra_pred_luma_dc.s",
262 "common/arm/ihevc_intra_pred_filters_luma_mode_11_to_17.s",
263 "common/arm/ihevc_intra_pred_filters_luma_mode_19_to_25.s",
264 "common/arm/ihevc_intra_pred_luma_mode_3_to_9.s",
265 "common/arm/ihevc_padding.s",
266 "decoder/arm/ihevcd_itrans_recon_dc_luma.s",
267 "decoder/arm/ihevcd_itrans_recon_dc_chroma.s",
268 "decoder/arm/ihevcd_fmt_conv_420sp_to_420p.s",
269 "decoder/arm/ihevcd_fmt_conv_420sp_to_420sp.s",
270 "decoder/arm/ihevcd_fmt_conv_420sp_to_rgba8888.s",
271 ],
272 cflags: [
273 "-UDISABLE_NEON",
274 "-UDEFAULT_ARCH",
275 "-DDEFAULT_ARCH=D_ARCH_ARM_A9Q",
276 ],
277 },
278 },
279
280 mips64: {
281 local_include_dirs: [
282 "decoder/mips",
283 "common/mips",
284 ],
285
286 srcs: [
287 "decoder/mips/ihevcd_function_selector.c",
288 "decoder/mips/ihevcd_function_selector_mips_generic.c",
289 ],
290 },
291
292 mips: {
293 local_include_dirs: [
294 "decoder/mips",
295 "common/mips",
296 ],
297
298 srcs: [
299 "decoder/mips/ihevcd_function_selector.c",
300 "decoder/mips/ihevcd_function_selector_mips_generic.c",
301 ],
302 },
303
304 x86_64: {
305 cflags: [
306 "-DX86",
307 "-DDISABLE_AVX2",
308 "-msse4.2",
309 "-mno-avx",
310 "-DDEFAULT_ARCH=D_ARCH_X86_SSE42",
311 ],
312
313 local_include_dirs: [
314 "decoder/x86",
315 "common/x86",
316 ],
317
318 srcs: [
319 "decoder/x86/ihevcd_function_selector.c",
320 "decoder/x86/ihevcd_function_selector_generic.c",
321 "decoder/x86/ihevcd_function_selector_ssse3.c",
322 "decoder/x86/ihevcd_function_selector_sse42.c",
323 "common/x86/ihevc_inter_pred_filters_ssse3_intr.c",
324 "common/x86/ihevc_weighted_pred_ssse3_intr.c",
325 "common/x86/ihevc_intra_pred_filters_ssse3_intr.c",
326 "common/x86/ihevc_chroma_intra_pred_filters_ssse3_intr.c",
327 "common/x86/ihevc_itrans_recon_ssse3_intr.c",
328 "common/x86/ihevc_itrans_recon_16x16_ssse3_intr.c",
329 "common/x86/ihevc_itrans_recon_32x32_ssse3_intr.c",
330 "common/x86/ihevc_sao_ssse3_intr.c",
331 "common/x86/ihevc_deblk_ssse3_intr.c",
332 "common/x86/ihevc_padding_ssse3_intr.c",
333 "common/x86/ihevc_mem_fns_ssse3_intr.c",
334 "decoder/x86/ihevcd_fmt_conv_ssse3_intr.c",
335 "decoder/x86/ihevcd_it_rec_dc_ssse3_intr.c",
336 "common/x86/ihevc_inter_pred_filters_sse42_intr.c",
337 "common/x86/ihevc_weighted_pred_sse42_intr.c",
338 "common/x86/ihevc_intra_pred_filters_sse42_intr.c",
339 "common/x86/ihevc_chroma_intra_pred_filters_sse42_intr.c",
340 "common/x86/ihevc_itrans_recon_sse42_intr.c",
341 "common/x86/ihevc_16x16_itrans_recon_sse42_intr.c",
342 "common/x86/ihevc_32x32_itrans_recon_sse42_intr.c",
343 "decoder/x86/ihevcd_it_rec_dc_sse42_intr.c",
344 "common/x86/ihevc_tables_x86_intr.c",
345 ],
346 },
347
348 x86: {
349 cflags: [
350 "-DX86",
351 "-DDISABLE_AVX2",
352 "-msse4.2",
353 "-mno-avx",
354 "-DDEFAULT_ARCH=D_ARCH_X86_SSE42",
355 ],
356
357 local_include_dirs: [
358 "decoder/x86",
359 "common/x86",
360 ],
361
362 srcs: [
363 "decoder/x86/ihevcd_function_selector.c",
364 "decoder/x86/ihevcd_function_selector_generic.c",
365 "decoder/x86/ihevcd_function_selector_ssse3.c",
366 "decoder/x86/ihevcd_function_selector_sse42.c",
367 "common/x86/ihevc_inter_pred_filters_ssse3_intr.c",
368 "common/x86/ihevc_weighted_pred_ssse3_intr.c",
369 "common/x86/ihevc_intra_pred_filters_ssse3_intr.c",
370 "common/x86/ihevc_chroma_intra_pred_filters_ssse3_intr.c",
371 "common/x86/ihevc_itrans_recon_ssse3_intr.c",
372 "common/x86/ihevc_itrans_recon_16x16_ssse3_intr.c",
373 "common/x86/ihevc_itrans_recon_32x32_ssse3_intr.c",
374 "common/x86/ihevc_sao_ssse3_intr.c",
375 "common/x86/ihevc_deblk_ssse3_intr.c",
376 "common/x86/ihevc_padding_ssse3_intr.c",
377 "common/x86/ihevc_mem_fns_ssse3_intr.c",
378 "decoder/x86/ihevcd_fmt_conv_ssse3_intr.c",
379 "decoder/x86/ihevcd_it_rec_dc_ssse3_intr.c",
380 "common/x86/ihevc_inter_pred_filters_sse42_intr.c",
381 "common/x86/ihevc_weighted_pred_sse42_intr.c",
382 "common/x86/ihevc_intra_pred_filters_sse42_intr.c",
383 "common/x86/ihevc_chroma_intra_pred_filters_sse42_intr.c",
384 "common/x86/ihevc_itrans_recon_sse42_intr.c",
385 "common/x86/ihevc_16x16_itrans_recon_sse42_intr.c",
386 "common/x86/ihevc_32x32_itrans_recon_sse42_intr.c",
387 "decoder/x86/ihevcd_it_rec_dc_sse42_intr.c",
388 "common/x86/ihevc_tables_x86_intr.c",
389 ],
390 },
391 },
bohu174b57b2018-03-20 12:19:22 -0700392
393 sanitize: {
394 cfi: true,
395 diag: {
396 cfi: true,
397 },
398 blacklist: "cfi_blacklist.txt",
399 },
Colin Cross3f774362017-04-20 16:42:47 -0700400}
Ivan Lozano662b2472018-07-16 12:39:37 -0700401
402cc_test {
403 name: "hevcdec",
404 cflags: [
405 "-DPROFILE_ENABLE",
406 "-DARM",
407 "-fPIC",
408 "-DMD5_DISABLE",
409 "-Wall",
410 "-Werror",
411 ],
412 srcs: ["test/decoder/main.c"],
413 static_libs: ["libhevcdec"],
414}