• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1cc_library_static {
2    name: "libavcdec",
3    vendor_available: true,
4    host_supported: true,
5    shared_libs: [
6        "liblog",
7        "libcutils",
8    ],
9
10    cflags: [
11        "-fPIC",
12        "-O3",
13        "-Wall",
14        "-Werror",
15        "-Wno-unused-variable",
16        "-Wno-null-pointer-arithmetic",
17    ],
18
19    export_include_dirs: [
20        "decoder",
21        "common",
22    ],
23
24    srcs: [
25        "common/ih264_buf_mgr.c",
26        "common/ih264_disp_mgr.c",
27        "common/ih264_inter_pred_filters.c",
28        "common/ih264_luma_intra_pred_filters.c",
29        "common/ih264_chroma_intra_pred_filters.c",
30        "common/ih264_padding.c",
31        "common/ih264_mem_fns.c",
32        "common/ih264_deblk_edge_filters.c",
33        "common/ih264_iquant_itrans_recon.c",
34        "common/ih264_ihadamard_scaling.c",
35        "common/ih264_weighted_pred.c",
36        "common/ithread.c",
37        "decoder/ih264d_cabac.c",
38        "decoder/ih264d_parse_mb_header.c",
39        "decoder/ih264d_parse_cabac.c",
40        "decoder/ih264d_process_intra_mb.c",
41        "decoder/ih264d_inter_pred.c",
42        "decoder/ih264d_parse_bslice.c",
43        "decoder/ih264d_parse_pslice.c",
44        "decoder/ih264d_parse_islice.c",
45        "decoder/ih264d_cabac_init_tables.c",
46        "decoder/ih264d_bitstrm.c",
47        "decoder/ih264d_compute_bs.c",
48        "decoder/ih264d_deblocking.c",
49        "decoder/ih264d_parse_headers.c",
50        "decoder/ih264d_mb_utils.c",
51        "decoder/ih264d_mvpred.c",
52        "decoder/ih264d_utils.c",
53        "decoder/ih264d_process_bslice.c",
54        "decoder/ih264d_process_pslice.c",
55        "decoder/ih264d_parse_slice.c",
56        "decoder/ih264d_quant_scaling.c",
57        "decoder/ih264d_parse_cavlc.c",
58        "decoder/ih264d_dpb_mgr.c",
59        "decoder/ih264d_nal.c",
60        "decoder/ih264d_sei.c",
61        "decoder/ih264d_tables.c",
62        "decoder/ih264d_vui.c",
63        "decoder/ih264d_format_conv.c",
64        "decoder/ih264d_thread_parse_decode.c",
65        "decoder/ih264d_api.c",
66        "decoder/ih264d_thread_compute_bs.c",
67        "decoder/ih264d_function_selector_generic.c",
68    ],
69
70    arch: {
71        arm: {
72            local_include_dirs: [
73                "decoder/arm",
74                "common/arm",
75            ],
76
77            srcs: [
78                "decoder/arm/ih264d_function_selector.c",
79                "common/arm/ih264_arm_memory_barrier.s",
80            ],
81
82            cflags: [
83                "-DARM",
84
85                // These will be overriden by armv7_a_neon
86                "-DDISABLE_NEON",
87                "-DDEFAULT_ARCH=D_ARCH_ARM_NONEON",
88            ],
89
90            neon: {
91                srcs: [
92                    "decoder/arm/ih264d_function_selector_a9q.c",
93                    "common/arm/ih264_intra_pred_chroma_a9q.s",
94                    "common/arm/ih264_intra_pred_luma_16x16_a9q.s",
95                    "common/arm/ih264_intra_pred_luma_4x4_a9q.s",
96                    "common/arm/ih264_intra_pred_luma_8x8_a9q.s",
97                    "common/arm/ih264_inter_pred_chroma_a9q.s",
98                    "common/arm/ih264_inter_pred_filters_luma_horz_a9q.s",
99                    "common/arm/ih264_inter_pred_filters_luma_vert_a9q.s",
100                    "common/arm/ih264_inter_pred_luma_copy_a9q.s",
101                    "common/arm/ih264_inter_pred_luma_horz_qpel_a9q.s",
102                    "common/arm/ih264_inter_pred_luma_vert_qpel_a9q.s",
103                    "common/arm/ih264_inter_pred_luma_horz_hpel_vert_hpel_a9q.s",
104                    "common/arm/ih264_inter_pred_luma_horz_qpel_vert_qpel_a9q.s",
105                    "common/arm/ih264_inter_pred_luma_horz_qpel_vert_hpel_a9q.s",
106                    "common/arm/ih264_inter_pred_luma_horz_hpel_vert_qpel_a9q.s",
107                    "common/arm/ih264_default_weighted_pred_a9q.s",
108                    "common/arm/ih264_weighted_pred_a9q.s",
109                    "common/arm/ih264_weighted_bi_pred_a9q.s",
110                    "common/arm/ih264_deblk_chroma_a9.s",
111                    "common/arm/ih264_deblk_luma_a9.s",
112                    "common/arm/ih264_padding_neon.s",
113                    "common/arm/ih264_iquant_itrans_recon_a9.s",
114                    "common/arm/ih264_iquant_itrans_recon_dc_a9.s",
115                    "common/arm/ih264_ihadamard_scaling_a9.s",
116                ],
117                cflags: [
118                    "-UDISABLE_NEON",
119                    "-UDEFAULT_ARCH",
120                    "-DDEFAULT_ARCH=D_ARCH_ARM_A9Q",
121                ],
122            },
123        },
124
125        arm64: {
126            cflags: [
127                "-DARMV8",
128                "-DARM",
129                "-DDEFAULT_ARCH=D_ARCH_ARMV8_GENERIC",
130            ],
131            local_include_dirs: [
132                "decoder/arm",
133                "common/armv8",
134            ],
135
136            srcs: [
137                "decoder/arm/ih264d_function_selector.c",
138                "decoder/arm/ih264d_function_selector_av8.c",
139                "common/armv8/ih264_intra_pred_chroma_av8.s",
140                "common/armv8/ih264_intra_pred_luma_16x16_av8.s",
141                "common/armv8/ih264_intra_pred_luma_4x4_av8.s",
142                "common/armv8/ih264_inter_pred_chroma_av8.s",
143                "common/armv8/ih264_inter_pred_filters_luma_horz_av8.s",
144                "common/armv8/ih264_inter_pred_filters_luma_vert_av8.s",
145                "common/armv8/ih264_inter_pred_luma_copy_av8.s",
146                "common/armv8/ih264_inter_pred_luma_horz_qpel_av8.s",
147                "common/armv8/ih264_inter_pred_luma_vert_qpel_av8.s",
148                "common/armv8/ih264_inter_pred_luma_horz_hpel_vert_hpel_av8.s",
149                "common/armv8/ih264_inter_pred_luma_horz_qpel_vert_qpel_av8.s",
150                "common/armv8/ih264_inter_pred_luma_horz_qpel_vert_hpel_av8.s",
151                "common/armv8/ih264_inter_pred_luma_horz_hpel_vert_qpel_av8.s",
152                "common/armv8/ih264_default_weighted_pred_av8.s",
153                "common/armv8/ih264_weighted_pred_av8.s",
154                "common/armv8/ih264_weighted_bi_pred_av8.s",
155                "common/armv8/ih264_deblk_chroma_av8.s",
156                "common/armv8/ih264_deblk_luma_av8.s",
157                "common/armv8/ih264_padding_neon_av8.s",
158                "common/armv8/ih264_iquant_itrans_recon_av8.s",
159                "common/armv8/ih264_iquant_itrans_recon_dc_av8.s",
160                "common/armv8/ih264_ihadamard_scaling_av8.s",
161                "common/armv8/ih264_intra_pred_luma_8x8_av8.s",
162            ],
163        },
164
165        mips: {
166            local_include_dirs: ["common/mips"],
167
168            srcs: ["decoder/mips/ih264d_function_selector.c"],
169        },
170
171        mips64: {
172            local_include_dirs: ["common/mips"],
173
174            srcs: ["decoder/mips/ih264d_function_selector.c"],
175        },
176
177        x86: {
178            cflags: [
179                "-DX86",
180                "-msse4.2",
181                "-DDEFAULT_ARCH=D_ARCH_X86_SSE42",
182            ],
183
184            local_include_dirs: [
185                "decoder/x86",
186                "common/x86",
187            ],
188
189            srcs: [
190                "decoder/x86/ih264d_function_selector.c",
191                "decoder/x86/ih264d_function_selector_sse42.c",
192                "decoder/x86/ih264d_function_selector_ssse3.c",
193                "common/x86/ih264_inter_pred_filters_ssse3.c",
194                "common/x86/ih264_deblk_luma_ssse3.c",
195                "common/x86/ih264_deblk_chroma_ssse3.c",
196                "common/x86/ih264_padding_ssse3.c",
197                "common/x86/ih264_mem_fns_ssse3.c",
198                "common/x86/ih264_iquant_itrans_recon_dc_ssse3.c",
199                "common/x86/ih264_iquant_itrans_recon_ssse3.c",
200                "common/x86/ih264_luma_intra_pred_filters_ssse3.c",
201                "common/x86/ih264_chroma_intra_pred_filters_ssse3.c",
202                "common/x86/ih264_iquant_itrans_recon_sse42.c",
203                "common/x86/ih264_weighted_pred_sse42.c",
204                "common/x86/ih264_ihadamard_scaling_sse42.c",
205            ],
206        },
207
208        x86_64: {
209            cflags: [
210                "-DX86",
211                "-msse4.2",
212                "-DDEFAULT_ARCH=D_ARCH_X86_SSE42",
213            ],
214
215            local_include_dirs: [
216                "decoder/x86",
217                "common/x86",
218            ],
219
220            srcs: [
221                "decoder/x86/ih264d_function_selector.c",
222                "decoder/x86/ih264d_function_selector_sse42.c",
223                "decoder/x86/ih264d_function_selector_ssse3.c",
224                "common/x86/ih264_inter_pred_filters_ssse3.c",
225                "common/x86/ih264_deblk_luma_ssse3.c",
226                "common/x86/ih264_deblk_chroma_ssse3.c",
227                "common/x86/ih264_padding_ssse3.c",
228                "common/x86/ih264_mem_fns_ssse3.c",
229                "common/x86/ih264_iquant_itrans_recon_dc_ssse3.c",
230                "common/x86/ih264_iquant_itrans_recon_ssse3.c",
231                "common/x86/ih264_luma_intra_pred_filters_ssse3.c",
232                "common/x86/ih264_chroma_intra_pred_filters_ssse3.c",
233                "common/x86/ih264_iquant_itrans_recon_sse42.c",
234                "common/x86/ih264_weighted_pred_sse42.c",
235                "common/x86/ih264_ihadamard_scaling_sse42.c",
236            ],
237        },
238    },
239
240    sanitize: {
241        integer_overflow: true,
242        misc_undefined: ["bounds"],
243        // Enable CFI if this becomes a shared library.
244        // cfi: true,
245        blacklist: "libavc_blacklist.txt",
246    },
247    apex_available: [
248        "//apex_available:platform", // used by libstagefright_soft_avcdec
249        "com.android.media.swcodec",
250    ],
251    min_sdk_version: "29",
252}
253
254cc_library_static {
255    name: "libavcenc",
256    vendor_available: true,
257    host_supported: true,
258    shared_libs: [
259        "liblog",
260        "libcutils",
261    ],
262
263    cflags: [
264        "-DNDEBUG",
265        "-UHP_PL",
266        "-DN_MB_ENABLE",
267        "-fPIC",
268
269        "-O3",
270        "-Wall",
271        "-Werror",
272        "-Wno-error=constant-conversion",
273    ],
274
275    export_include_dirs: [
276        "encoder",
277        "common",
278    ],
279
280    srcs: [ //Rate Control
281        "common/ih264_resi_trans_quant.c",
282        "common/ih264_iquant_itrans_recon.c",
283        "common/ih264_ihadamard_scaling.c",
284        "common/ih264_inter_pred_filters.c",
285        "common/ih264_luma_intra_pred_filters.c",
286        "common/ih264_chroma_intra_pred_filters.c",
287        "common/ih264_padding.c",
288        "common/ih264_mem_fns.c",
289        "common/ih264_deblk_edge_filters.c",
290        "common/ih264_deblk_tables.c",
291        "common/ih264_cavlc_tables.c",
292        "common/ih264_cabac_tables.c",
293        "common/ih264_common_tables.c",
294        "common/ih264_trans_data.c",
295        "common/ih264_buf_mgr.c",
296        "common/ih264_dpb_mgr.c",
297        "common/ih264_list.c",
298        "common/ithread.c",
299        "encoder/ih264e_globals.c",
300        "encoder/ih264e_intra_modes_eval.c",
301        "encoder/ih264e_half_pel.c",
302        "encoder/ih264e_mc.c",
303        "encoder/ih264e_me.c",
304        "encoder/ih264e_rc_mem_interface.c",
305        "encoder/ih264e_time_stamp.c",
306        "encoder/ih264e_modify_frm_rate.c",
307        "encoder/ih264e_rate_control.c",
308        "encoder/ih264e_core_coding.c",
309        "encoder/ih264e_deblk.c",
310        "encoder/ih264e_api.c",
311        "encoder/ih264e_process.c",
312        "encoder/ih264e_encode.c",
313        "encoder/ih264e_utils.c",
314        "encoder/ih264e_version.c",
315        "encoder/ih264e_bitstream.c",
316        "encoder/ih264e_cavlc.c",
317        "encoder/ih264e_cabac_init.c",
318        "encoder/ih264e_cabac.c",
319        "encoder/ih264e_cabac_encode.c",
320        "encoder/ih264e_encode_header.c",
321        "encoder/ih264e_function_selector_generic.c",
322        "encoder/ih264e_fmt_conv.c",
323        "encoder/irc_rate_control_api.c",
324        "encoder/irc_bit_allocation.c",
325        "encoder/irc_cbr_buffer_control.c",
326        "encoder/irc_est_sad.c",
327        "encoder/irc_fixed_point_error_bits.c",
328        "encoder/irc_frame_info_collector.c",
329        "encoder/irc_mb_model_based.c",
330        "encoder/irc_picture_type.c",
331        "encoder/irc_rd_model.c",
332        "encoder/irc_vbr_storage_vbv.c",
333        "encoder/irc_vbr_str_prms.c",
334        "encoder/ime.c",
335        "encoder/ime_distortion_metrics.c",
336        "encoder/ih264e_sei.c",
337    ],
338
339    arch: {
340        arm: {
341            local_include_dirs: [
342                "encoder/arm",
343                "common/arm",
344            ],
345
346            srcs: [
347                "encoder/arm/ih264e_function_selector.c",
348                "common/arm/ih264_arm_memory_barrier.s",
349            ],
350
351            cflags: [
352                "-DARM",
353
354                // This will be overriden by armv7_a_neon
355                "-DDISABLE_NEON",
356            ],
357
358            neon: {
359                srcs: [
360                    "encoder/arm/ih264e_function_selector_a9q.c",
361                    "common/arm/ih264_resi_trans_quant_a9.s",
362                    "common/arm/ih264_iquant_itrans_recon_a9.s",
363                    "common/arm/ih264_iquant_itrans_recon_dc_a9.s",
364                    "common/arm/ih264_ihadamard_scaling_a9.s",
365                    "common/arm/ih264_deblk_chroma_a9.s",
366                    "common/arm/ih264_deblk_luma_a9.s",
367                    "common/arm/ih264_intra_pred_chroma_a9q.s",
368                    "common/arm/ih264_intra_pred_luma_16x16_a9q.s",
369                    "common/arm/ih264_intra_pred_luma_4x4_a9q.s",
370                    "common/arm/ih264_intra_pred_luma_8x8_a9q.s",
371                    "common/arm/ih264_inter_pred_chroma_a9q.s",
372                    "common/arm/ih264_inter_pred_filters_luma_horz_a9q.s",
373                    "common/arm/ih264_inter_pred_filters_luma_vert_a9q.s",
374                    "common/arm/ih264_inter_pred_luma_bilinear_a9q.s",
375                    "common/arm/ih264_inter_pred_luma_copy_a9q.s",
376                    "common/arm/ih264_padding_neon.s",
377                    "common/arm/ih264_mem_fns_neon.s",
378                    "encoder/arm/ih264e_evaluate_intra16x16_modes_a9q.s",
379                    "encoder/arm/ih264e_evaluate_intra4x4_modes_a9q.s",
380                    "encoder/arm/ih264e_evaluate_intra_chroma_modes_a9q.s",
381                    "encoder/arm/ih264e_half_pel.s",
382                    "encoder/arm/ih264e_fmt_conv.s",
383                    "encoder/arm/ime_distortion_metrics_a9q.s",
384                ],
385
386                cflags: [
387                    "-UDISABLE_NEON",
388                ],
389            },
390        },
391
392        arm64: {
393            cflags: [
394                "-DARMV8",
395                "-DARM",
396            ],
397
398            local_include_dirs: [
399                "encoder/arm",
400                "encoder/armv8",
401                "common/armv8",
402            ],
403
404            srcs: [
405                "encoder/arm/ih264e_function_selector.c",
406                "encoder/arm/ih264e_function_selector_av8.c",
407                "common/armv8/ih264_resi_trans_quant_av8.s",
408                "common/armv8/ih264_iquant_itrans_recon_av8.s",
409                "common/armv8/ih264_iquant_itrans_recon_dc_av8.s",
410                "common/armv8/ih264_ihadamard_scaling_av8.s",
411                "common/armv8/ih264_intra_pred_chroma_av8.s",
412                "common/armv8/ih264_intra_pred_luma_16x16_av8.s",
413                "common/armv8/ih264_intra_pred_luma_4x4_av8.s",
414                "common/armv8/ih264_intra_pred_luma_8x8_av8.s",
415                "common/armv8/ih264_inter_pred_luma_copy_av8.s",
416                "common/armv8/ih264_inter_pred_chroma_av8.s",
417                "common/armv8/ih264_inter_pred_filters_luma_horz_av8.s",
418                "common/armv8/ih264_inter_pred_filters_luma_vert_av8.s",
419                "common/armv8/ih264_padding_neon_av8.s",
420                "common/armv8/ih264_mem_fns_neon_av8.s",
421                "common/armv8/ih264_deblk_luma_av8.s",
422                "common/armv8/ih264_deblk_chroma_av8.s",
423                "encoder/armv8/ih264e_evaluate_intra16x16_modes_av8.s",
424                "encoder/armv8/ih264e_evaluate_intra_chroma_modes_av8.s",
425                "encoder/armv8/ih264e_half_pel_av8.s",
426                "encoder/armv8/ime_distortion_metrics_av8.s",
427            ],
428        },
429
430        mips: {
431            local_include_dirs: [
432                "common/mips",
433                "encoder/mips",
434            ],
435
436            srcs: ["encoder/mips/ih264e_function_selector.c"],
437        },
438
439        mips64: {
440            local_include_dirs: [
441                "common/mips",
442                "encoder/mips",
443            ],
444
445            srcs: ["encoder/mips/ih264e_function_selector.c"],
446        },
447
448        x86: {
449            cflags: [
450                "-DX86",
451                "-msse4.2",
452            ],
453
454            local_include_dirs: [
455                "encoder/x86",
456                "common/x86",
457            ],
458
459            srcs: [
460                "encoder/x86/ih264e_function_selector.c",
461                "encoder/x86/ih264e_function_selector_sse42.c",
462                "encoder/x86/ih264e_function_selector_ssse3.c",
463                "common/x86/ih264_iquant_itrans_recon_ssse3.c",
464                "common/x86/ih264_iquant_itrans_recon_dc_ssse3.c",
465                "common/x86/ih264_ihadamard_scaling_ssse3.c",
466                "common/x86/ih264_inter_pred_filters_ssse3.c",
467                "common/x86/ih264_mem_fns_ssse3.c",
468                "common/x86/ih264_padding_ssse3.c",
469                "common/x86/ih264_luma_intra_pred_filters_ssse3.c",
470                "common/x86/ih264_chroma_intra_pred_filters_ssse3.c",
471                "common/x86/ih264_deblk_chroma_ssse3.c",
472                "common/x86/ih264_deblk_luma_ssse3.c",
473                "common/x86/ih264_iquant_itrans_recon_sse42.c",
474                "common/x86/ih264_ihadamard_scaling_sse42.c",
475                "common/x86/ih264_resi_trans_quant_sse42.c",
476                "common/x86/ih264_weighted_pred_sse42.c",
477                "encoder/x86/ih264e_half_pel_ssse3.c",
478                "encoder/x86/ih264e_intra_modes_eval_ssse3.c",
479                "encoder/x86/ime_distortion_metrics_sse42.c",
480            ],
481        },
482
483        x86_64: {
484            cflags: [
485                "-DX86",
486                "-msse4.2",
487            ],
488
489            local_include_dirs: [
490                "encoder/x86",
491                "common/x86",
492            ],
493
494            srcs: [
495                "encoder/x86/ih264e_function_selector.c",
496                "encoder/x86/ih264e_function_selector_sse42.c",
497                "encoder/x86/ih264e_function_selector_ssse3.c",
498                "common/x86/ih264_iquant_itrans_recon_ssse3.c",
499                "common/x86/ih264_iquant_itrans_recon_dc_ssse3.c",
500                "common/x86/ih264_ihadamard_scaling_ssse3.c",
501                "common/x86/ih264_inter_pred_filters_ssse3.c",
502                "common/x86/ih264_mem_fns_ssse3.c",
503                "common/x86/ih264_padding_ssse3.c",
504                "common/x86/ih264_luma_intra_pred_filters_ssse3.c",
505                "common/x86/ih264_chroma_intra_pred_filters_ssse3.c",
506                "common/x86/ih264_deblk_chroma_ssse3.c",
507                "common/x86/ih264_deblk_luma_ssse3.c",
508                "common/x86/ih264_iquant_itrans_recon_sse42.c",
509                "common/x86/ih264_ihadamard_scaling_sse42.c",
510                "common/x86/ih264_resi_trans_quant_sse42.c",
511                "common/x86/ih264_weighted_pred_sse42.c",
512                "encoder/x86/ih264e_half_pel_ssse3.c",
513                "encoder/x86/ih264e_intra_modes_eval_ssse3.c",
514                "encoder/x86/ime_distortion_metrics_sse42.c",
515            ],
516        },
517    },
518
519    sanitize: {
520        integer_overflow: true,
521        misc_undefined: ["bounds"],
522        // Enable CFI if this becomes a shared library.
523        // cfi: true,
524        blacklist: "libavc_blacklist.txt",
525    },
526    apex_available: [
527        "//apex_available:platform", //due to libstagefright_soft_avcenc
528        "com.android.media.swcodec",
529    ],
530    min_sdk_version: "29",
531}
532
533subdirs = ["test"]
534