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