Home | History | Annotate | Download | only in common
      1 ##
      2 ##  Copyright (c) 2017 The WebM project authors. All Rights Reserved.
      3 ##
      4 ##  Use of this source code is governed by a BSD-style license
      5 ##  that can be found in the LICENSE file in the root of the source
      6 ##  tree. An additional intellectual property rights grant can be found
      7 ##  in the file PATENTS.  All contributing project authors may
      8 ##  be found in the AUTHORS file in the root of the source tree.
      9 ##
     10 
     11 sub vp8_common_forward_decls() {
     12 print <<EOF
     13 /*
     14  * VP8
     15  */
     16 
     17 struct blockd;
     18 struct macroblockd;
     19 struct loop_filter_info;
     20 
     21 /* Encoder forward decls */
     22 struct block;
     23 struct macroblock;
     24 struct variance_vtable;
     25 union int_mv;
     26 struct yv12_buffer_config;
     27 EOF
     28 }
     29 forward_decls qw/vp8_common_forward_decls/;
     30 
     31 #
     32 # Dequant
     33 #
     34 add_proto qw/void vp8_dequantize_b/, "struct blockd*, short *dqc";
     35 specialize qw/vp8_dequantize_b mmx neon msa mmi/;
     36 
     37 add_proto qw/void vp8_dequant_idct_add/, "short *input, short *dq, unsigned char *output, int stride";
     38 specialize qw/vp8_dequant_idct_add mmx neon dspr2 msa mmi/;
     39 
     40 add_proto qw/void vp8_dequant_idct_add_y_block/, "short *q, short *dq, unsigned char *dst, int stride, char *eobs";
     41 specialize qw/vp8_dequant_idct_add_y_block sse2 neon dspr2 msa mmi/;
     42 
     43 add_proto qw/void vp8_dequant_idct_add_uv_block/, "short *q, short *dq, unsigned char *dst_u, unsigned char *dst_v, int stride, char *eobs";
     44 specialize qw/vp8_dequant_idct_add_uv_block sse2 neon dspr2 msa mmi/;
     45 
     46 #
     47 # Loopfilter
     48 #
     49 add_proto qw/void vp8_loop_filter_mbv/, "unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi";
     50 specialize qw/vp8_loop_filter_mbv sse2 neon dspr2 msa mmi/;
     51 
     52 add_proto qw/void vp8_loop_filter_bv/, "unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi";
     53 specialize qw/vp8_loop_filter_bv sse2 neon dspr2 msa mmi/;
     54 
     55 add_proto qw/void vp8_loop_filter_mbh/, "unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi";
     56 specialize qw/vp8_loop_filter_mbh sse2 neon dspr2 msa mmi/;
     57 
     58 add_proto qw/void vp8_loop_filter_bh/, "unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi";
     59 specialize qw/vp8_loop_filter_bh sse2 neon dspr2 msa mmi/;
     60 
     61 
     62 add_proto qw/void vp8_loop_filter_simple_mbv/, "unsigned char *y, int ystride, const unsigned char *blimit";
     63 specialize qw/vp8_loop_filter_simple_mbv sse2 neon msa mmi/;
     64 $vp8_loop_filter_simple_mbv_c=vp8_loop_filter_simple_vertical_edge_c;
     65 $vp8_loop_filter_simple_mbv_sse2=vp8_loop_filter_simple_vertical_edge_sse2;
     66 $vp8_loop_filter_simple_mbv_neon=vp8_loop_filter_mbvs_neon;
     67 $vp8_loop_filter_simple_mbv_msa=vp8_loop_filter_simple_vertical_edge_msa;
     68 $vp8_loop_filter_simple_mbv_mmi=vp8_loop_filter_simple_vertical_edge_mmi;
     69 
     70 add_proto qw/void vp8_loop_filter_simple_mbh/, "unsigned char *y, int ystride, const unsigned char *blimit";
     71 specialize qw/vp8_loop_filter_simple_mbh sse2 neon msa mmi/;
     72 $vp8_loop_filter_simple_mbh_c=vp8_loop_filter_simple_horizontal_edge_c;
     73 $vp8_loop_filter_simple_mbh_sse2=vp8_loop_filter_simple_horizontal_edge_sse2;
     74 $vp8_loop_filter_simple_mbh_neon=vp8_loop_filter_mbhs_neon;
     75 $vp8_loop_filter_simple_mbh_msa=vp8_loop_filter_simple_horizontal_edge_msa;
     76 $vp8_loop_filter_simple_mbh_mmi=vp8_loop_filter_simple_horizontal_edge_mmi;
     77 
     78 add_proto qw/void vp8_loop_filter_simple_bv/, "unsigned char *y, int ystride, const unsigned char *blimit";
     79 specialize qw/vp8_loop_filter_simple_bv sse2 neon msa mmi/;
     80 $vp8_loop_filter_simple_bv_c=vp8_loop_filter_bvs_c;
     81 $vp8_loop_filter_simple_bv_sse2=vp8_loop_filter_bvs_sse2;
     82 $vp8_loop_filter_simple_bv_neon=vp8_loop_filter_bvs_neon;
     83 $vp8_loop_filter_simple_bv_msa=vp8_loop_filter_bvs_msa;
     84 $vp8_loop_filter_simple_bv_mmi=vp8_loop_filter_bvs_mmi;
     85 
     86 add_proto qw/void vp8_loop_filter_simple_bh/, "unsigned char *y, int ystride, const unsigned char *blimit";
     87 specialize qw/vp8_loop_filter_simple_bh sse2 neon msa mmi/;
     88 $vp8_loop_filter_simple_bh_c=vp8_loop_filter_bhs_c;
     89 $vp8_loop_filter_simple_bh_sse2=vp8_loop_filter_bhs_sse2;
     90 $vp8_loop_filter_simple_bh_neon=vp8_loop_filter_bhs_neon;
     91 $vp8_loop_filter_simple_bh_msa=vp8_loop_filter_bhs_msa;
     92 $vp8_loop_filter_simple_bh_mmi=vp8_loop_filter_bhs_mmi;
     93 
     94 #
     95 # IDCT
     96 #
     97 #idct16
     98 add_proto qw/void vp8_short_idct4x4llm/, "short *input, unsigned char *pred, int pitch, unsigned char *dst, int dst_stride";
     99 specialize qw/vp8_short_idct4x4llm mmx neon dspr2 msa mmi/;
    100 
    101 #iwalsh1
    102 add_proto qw/void vp8_short_inv_walsh4x4_1/, "short *input, short *output";
    103 specialize qw/vp8_short_inv_walsh4x4_1 dspr2/;
    104 
    105 #iwalsh16
    106 add_proto qw/void vp8_short_inv_walsh4x4/, "short *input, short *output";
    107 specialize qw/vp8_short_inv_walsh4x4 sse2 neon dspr2 msa mmi/;
    108 
    109 #idct1_scalar_add
    110 add_proto qw/void vp8_dc_only_idct_add/, "short input, unsigned char *pred, int pred_stride, unsigned char *dst, int dst_stride";
    111 specialize qw/vp8_dc_only_idct_add mmx neon dspr2 msa mmi/;
    112 
    113 #
    114 # RECON
    115 #
    116 add_proto qw/void vp8_copy_mem16x16/, "unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch";
    117 specialize qw/vp8_copy_mem16x16 sse2 neon dspr2 msa mmi/;
    118 
    119 add_proto qw/void vp8_copy_mem8x8/, "unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch";
    120 specialize qw/vp8_copy_mem8x8 mmx neon dspr2 msa mmi/;
    121 
    122 add_proto qw/void vp8_copy_mem8x4/, "unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch";
    123 specialize qw/vp8_copy_mem8x4 mmx neon dspr2 msa mmi/;
    124 
    125 #
    126 # Postproc
    127 #
    128 if (vpx_config("CONFIG_POSTPROC") eq "yes") {
    129 
    130     add_proto qw/void vp8_blend_mb_inner/, "unsigned char *y, unsigned char *u, unsigned char *v, int y1, int u1, int v1, int alpha, int stride";
    131 
    132     add_proto qw/void vp8_blend_mb_outer/, "unsigned char *y, unsigned char *u, unsigned char *v, int y1, int u1, int v1, int alpha, int stride";
    133 
    134     add_proto qw/void vp8_blend_b/, "unsigned char *y, unsigned char *u, unsigned char *v, int y1, int u1, int v1, int alpha, int stride";
    135 
    136     add_proto qw/void vp8_filter_by_weight16x16/, "unsigned char *src, int src_stride, unsigned char *dst, int dst_stride, int src_weight";
    137     specialize qw/vp8_filter_by_weight16x16 sse2 msa/;
    138 
    139     add_proto qw/void vp8_filter_by_weight8x8/, "unsigned char *src, int src_stride, unsigned char *dst, int dst_stride, int src_weight";
    140     specialize qw/vp8_filter_by_weight8x8 sse2 msa/;
    141 
    142     add_proto qw/void vp8_filter_by_weight4x4/, "unsigned char *src, int src_stride, unsigned char *dst, int dst_stride, int src_weight";
    143 }
    144 
    145 #
    146 # Subpixel
    147 #
    148 add_proto qw/void vp8_sixtap_predict16x16/, "unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch";
    149 specialize qw/vp8_sixtap_predict16x16 sse2 ssse3 neon dspr2 msa mmi/;
    150 
    151 add_proto qw/void vp8_sixtap_predict8x8/, "unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch";
    152 specialize qw/vp8_sixtap_predict8x8 sse2 ssse3 neon dspr2 msa mmi/;
    153 
    154 add_proto qw/void vp8_sixtap_predict8x4/, "unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch";
    155 specialize qw/vp8_sixtap_predict8x4 sse2 ssse3 neon dspr2 msa mmi/;
    156 
    157 add_proto qw/void vp8_sixtap_predict4x4/, "unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch";
    158 specialize qw/vp8_sixtap_predict4x4 mmx ssse3 neon dspr2 msa mmi/;
    159 
    160 add_proto qw/void vp8_bilinear_predict16x16/, "unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch";
    161 specialize qw/vp8_bilinear_predict16x16 sse2 ssse3 neon msa/;
    162 
    163 add_proto qw/void vp8_bilinear_predict8x8/, "unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch";
    164 specialize qw/vp8_bilinear_predict8x8 sse2 ssse3 neon msa/;
    165 
    166 add_proto qw/void vp8_bilinear_predict8x4/, "unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch";
    167 specialize qw/vp8_bilinear_predict8x4 mmx neon msa/;
    168 
    169 add_proto qw/void vp8_bilinear_predict4x4/, "unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch";
    170 specialize qw/vp8_bilinear_predict4x4 mmx neon msa/;
    171 
    172 #
    173 # Encoder functions below this point.
    174 #
    175 if (vpx_config("CONFIG_VP8_ENCODER") eq "yes") {
    176 
    177 #
    178 # Block copy
    179 #
    180 if ($opts{arch} =~ /x86/) {
    181     add_proto qw/void vp8_copy32xn/, "const unsigned char *src_ptr, int source_stride, unsigned char *dst_ptr, int dst_stride, int n";
    182     specialize qw/vp8_copy32xn sse2 sse3/;
    183 }
    184 
    185 #
    186 # Forward DCT
    187 #
    188 add_proto qw/void vp8_short_fdct4x4/, "short *input, short *output, int pitch";
    189 specialize qw/vp8_short_fdct4x4 sse2 neon msa mmi/;
    190 
    191 add_proto qw/void vp8_short_fdct8x4/, "short *input, short *output, int pitch";
    192 specialize qw/vp8_short_fdct8x4 sse2 neon msa mmi/;
    193 
    194 add_proto qw/void vp8_short_walsh4x4/, "short *input, short *output, int pitch";
    195 specialize qw/vp8_short_walsh4x4 sse2 neon msa mmi/;
    196 
    197 #
    198 # Quantizer
    199 #
    200 add_proto qw/void vp8_regular_quantize_b/, "struct block *, struct blockd *";
    201 specialize qw/vp8_regular_quantize_b sse2 sse4_1 msa mmi/;
    202 
    203 add_proto qw/void vp8_fast_quantize_b/, "struct block *, struct blockd *";
    204 specialize qw/vp8_fast_quantize_b sse2 ssse3 neon msa mmi/;
    205 
    206 #
    207 # Block subtraction
    208 #
    209 add_proto qw/int vp8_block_error/, "short *coeff, short *dqcoeff";
    210 specialize qw/vp8_block_error sse2 msa/;
    211 
    212 add_proto qw/int vp8_mbblock_error/, "struct macroblock *mb, int dc";
    213 specialize qw/vp8_mbblock_error sse2 msa/;
    214 
    215 add_proto qw/int vp8_mbuverror/, "struct macroblock *mb";
    216 specialize qw/vp8_mbuverror sse2 msa/;
    217 
    218 #
    219 # Motion search
    220 #
    221 add_proto qw/int vp8_full_search_sad/, "struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, int sad_per_bit, int distance, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv";
    222 specialize qw/vp8_full_search_sad sse3 sse4_1/;
    223 $vp8_full_search_sad_sse3=vp8_full_search_sadx3;
    224 $vp8_full_search_sad_sse4_1=vp8_full_search_sadx8;
    225 
    226 add_proto qw/int vp8_refining_search_sad/, "struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, int sad_per_bit, int distance, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv";
    227 specialize qw/vp8_refining_search_sad sse2 msa/;
    228 $vp8_refining_search_sad_sse2=vp8_refining_search_sadx4;
    229 $vp8_refining_search_sad_msa=vp8_refining_search_sadx4;
    230 
    231 add_proto qw/int vp8_diamond_search_sad/, "struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, union int_mv *best_mv, int search_param, int sad_per_bit, int *num00, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv";
    232 specialize qw/vp8_diamond_search_sad sse2 msa/;
    233 $vp8_diamond_search_sad_sse2=vp8_diamond_search_sadx4;
    234 $vp8_diamond_search_sad_msa=vp8_diamond_search_sadx4;
    235 
    236 #
    237 # Alt-ref Noise Reduction (ARNR)
    238 #
    239 if (vpx_config("CONFIG_REALTIME_ONLY") ne "yes") {
    240     add_proto qw/void vp8_temporal_filter_apply/, "unsigned char *frame1, unsigned int stride, unsigned char *frame2, unsigned int block_size, int strength, int filter_weight, unsigned int *accumulator, unsigned short *count";
    241     specialize qw/vp8_temporal_filter_apply sse2 msa/;
    242 }
    243 
    244 #
    245 # Denoiser filter
    246 #
    247 if (vpx_config("CONFIG_TEMPORAL_DENOISING") eq "yes") {
    248     add_proto qw/int vp8_denoiser_filter/, "unsigned char *mc_running_avg_y, int mc_avg_y_stride, unsigned char *running_avg_y, int avg_y_stride, unsigned char *sig, int sig_stride, unsigned int motion_magnitude, int increase_denoising";
    249     specialize qw/vp8_denoiser_filter sse2 neon msa/;
    250     add_proto qw/int vp8_denoiser_filter_uv/, "unsigned char *mc_running_avg, int mc_avg_stride, unsigned char *running_avg, int avg_stride, unsigned char *sig, int sig_stride, unsigned int motion_magnitude, int increase_denoising";
    251     specialize qw/vp8_denoiser_filter_uv sse2 neon msa/;
    252 }
    253 
    254 # End of encoder only functions
    255 }
    256 1;
    257