Home | History | Annotate | Download | only in x86
      1 /*
      2  *  Copyright (c) 2010 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 
     12 #ifndef VARIANCE_X86_H
     13 #define VARIANCE_X86_H
     14 
     15 
     16 /* Note:
     17  *
     18  * This platform is commonly built for runtime CPU detection. If you modify
     19  * any of the function mappings present in this file, be sure to also update
     20  * them in the function pointer initialization code
     21  */
     22 #if HAVE_MMX
     23 extern prototype_sad(vp8_sad4x4_mmx);
     24 extern prototype_sad(vp8_sad8x8_mmx);
     25 extern prototype_sad(vp8_sad8x16_mmx);
     26 extern prototype_sad(vp8_sad16x8_mmx);
     27 extern prototype_sad(vp8_sad16x16_mmx);
     28 extern prototype_variance(vp8_variance4x4_mmx);
     29 extern prototype_variance(vp8_variance8x8_mmx);
     30 extern prototype_variance(vp8_variance8x16_mmx);
     31 extern prototype_variance(vp8_variance16x8_mmx);
     32 extern prototype_variance(vp8_variance16x16_mmx);
     33 extern prototype_subpixvariance(vp8_sub_pixel_variance4x4_mmx);
     34 extern prototype_subpixvariance(vp8_sub_pixel_variance8x8_mmx);
     35 extern prototype_subpixvariance(vp8_sub_pixel_variance8x16_mmx);
     36 extern prototype_subpixvariance(vp8_sub_pixel_variance16x8_mmx);
     37 extern prototype_subpixvariance(vp8_sub_pixel_variance16x16_mmx);
     38 extern prototype_variance(vp8_variance_halfpixvar16x16_h_mmx);
     39 extern prototype_variance(vp8_variance_halfpixvar16x16_v_mmx);
     40 extern prototype_variance(vp8_variance_halfpixvar16x16_hv_mmx);
     41 extern prototype_subpixvariance(vp8_sub_pixel_mse16x16_mmx);
     42 extern prototype_getmbss(vp8_get_mb_ss_mmx);
     43 extern prototype_variance(vp8_mse16x16_mmx);
     44 extern prototype_sad(vp8_get16x16pred_error_mmx);
     45 extern prototype_variance2(vp8_get8x8var_mmx);
     46 extern prototype_variance2(vp8_get16x16var_mmx);
     47 extern prototype_sad(vp8_get4x4sse_cs_mmx);
     48 
     49 #if !CONFIG_RUNTIME_CPU_DETECT
     50 #undef  vp8_variance_sad4x4
     51 #define vp8_variance_sad4x4 vp8_sad4x4_mmx
     52 
     53 #undef  vp8_variance_sad8x8
     54 #define vp8_variance_sad8x8 vp8_sad8x8_mmx
     55 
     56 #undef  vp8_variance_sad8x16
     57 #define vp8_variance_sad8x16 vp8_sad8x16_mmx
     58 
     59 #undef  vp8_variance_sad16x8
     60 #define vp8_variance_sad16x8 vp8_sad16x8_mmx
     61 
     62 #undef  vp8_variance_sad16x16
     63 #define vp8_variance_sad16x16 vp8_sad16x16_mmx
     64 
     65 #undef  vp8_variance_var4x4
     66 #define vp8_variance_var4x4 vp8_variance4x4_mmx
     67 
     68 #undef  vp8_variance_var8x8
     69 #define vp8_variance_var8x8 vp8_variance8x8_mmx
     70 
     71 #undef  vp8_variance_var8x16
     72 #define vp8_variance_var8x16 vp8_variance8x16_mmx
     73 
     74 #undef  vp8_variance_var16x8
     75 #define vp8_variance_var16x8 vp8_variance16x8_mmx
     76 
     77 #undef  vp8_variance_var16x16
     78 #define vp8_variance_var16x16 vp8_variance16x16_mmx
     79 
     80 #undef  vp8_variance_subpixvar4x4
     81 #define vp8_variance_subpixvar4x4 vp8_sub_pixel_variance4x4_mmx
     82 
     83 #undef  vp8_variance_subpixvar8x8
     84 #define vp8_variance_subpixvar8x8 vp8_sub_pixel_variance8x8_mmx
     85 
     86 #undef  vp8_variance_subpixvar8x16
     87 #define vp8_variance_subpixvar8x16 vp8_sub_pixel_variance8x16_mmx
     88 
     89 #undef  vp8_variance_subpixvar16x8
     90 #define vp8_variance_subpixvar16x8 vp8_sub_pixel_variance16x8_mmx
     91 
     92 #undef  vp8_variance_subpixvar16x16
     93 #define vp8_variance_subpixvar16x16 vp8_sub_pixel_variance16x16_mmx
     94 
     95 #undef  vp8_variance_halfpixvar16x16_h
     96 #define vp8_variance_halfpixvar16x16_h vp8_variance_halfpixvar16x16_h_mmx
     97 
     98 #undef  vp8_variance_halfpixvar16x16_v
     99 #define vp8_variance_halfpixvar16x16_v vp8_variance_halfpixvar16x16_v_mmx
    100 
    101 #undef  vp8_variance_halfpixvar16x16_hv
    102 #define vp8_variance_halfpixvar16x16_hv vp8_variance_halfpixvar16x16_hv_mmx
    103 
    104 #undef  vp8_variance_subpixmse16x16
    105 #define vp8_variance_subpixmse16x16 vp8_sub_pixel_mse16x16_mmx
    106 
    107 #undef  vp8_variance_getmbss
    108 #define vp8_variance_getmbss vp8_get_mb_ss_mmx
    109 
    110 #undef  vp8_variance_mse16x16
    111 #define vp8_variance_mse16x16 vp8_mse16x16_mmx
    112 
    113 #undef  vp8_variance_get16x16prederror
    114 #define vp8_variance_get16x16prederror vp8_get16x16pred_error_mmx
    115 
    116 #undef  vp8_variance_get8x8var
    117 #define vp8_variance_get8x8var vp8_get8x8var_mmx
    118 
    119 #undef  vp8_variance_get16x16var
    120 #define vp8_variance_get16x16var vp8_get16x16var_mmx
    121 
    122 #undef  vp8_variance_get4x4sse_cs
    123 #define vp8_variance_get4x4sse_cs vp8_get4x4sse_cs_mmx
    124 
    125 #endif
    126 #endif
    127 
    128 
    129 #if HAVE_SSE2
    130 extern prototype_sad(vp8_sad4x4_wmt);
    131 extern prototype_sad(vp8_sad8x8_wmt);
    132 extern prototype_sad(vp8_sad8x16_wmt);
    133 extern prototype_sad(vp8_sad16x8_wmt);
    134 extern prototype_sad(vp8_sad16x16_wmt);
    135 extern prototype_variance(vp8_variance4x4_wmt);
    136 extern prototype_variance(vp8_variance8x8_wmt);
    137 extern prototype_variance(vp8_variance8x16_wmt);
    138 extern prototype_variance(vp8_variance16x8_wmt);
    139 extern prototype_variance(vp8_variance16x16_wmt);
    140 extern prototype_subpixvariance(vp8_sub_pixel_variance4x4_wmt);
    141 extern prototype_subpixvariance(vp8_sub_pixel_variance8x8_wmt);
    142 extern prototype_subpixvariance(vp8_sub_pixel_variance8x16_wmt);
    143 extern prototype_subpixvariance(vp8_sub_pixel_variance16x8_wmt);
    144 extern prototype_subpixvariance(vp8_sub_pixel_variance16x16_wmt);
    145 extern prototype_variance(vp8_variance_halfpixvar16x16_h_wmt);
    146 extern prototype_variance(vp8_variance_halfpixvar16x16_v_wmt);
    147 extern prototype_variance(vp8_variance_halfpixvar16x16_hv_wmt);
    148 extern prototype_subpixvariance(vp8_sub_pixel_mse16x16_wmt);
    149 extern prototype_getmbss(vp8_get_mb_ss_sse2);
    150 extern prototype_variance(vp8_mse16x16_wmt);
    151 extern prototype_sad(vp8_get16x16pred_error_sse2);
    152 extern prototype_variance2(vp8_get8x8var_sse2);
    153 extern prototype_variance2(vp8_get16x16var_sse2);
    154 
    155 #if !CONFIG_RUNTIME_CPU_DETECT
    156 #undef  vp8_variance_sad4x4
    157 #define vp8_variance_sad4x4 vp8_sad4x4_wmt
    158 
    159 #undef  vp8_variance_sad8x8
    160 #define vp8_variance_sad8x8 vp8_sad8x8_wmt
    161 
    162 #undef  vp8_variance_sad8x16
    163 #define vp8_variance_sad8x16 vp8_sad8x16_wmt
    164 
    165 #undef  vp8_variance_sad16x8
    166 #define vp8_variance_sad16x8 vp8_sad16x8_wmt
    167 
    168 #undef  vp8_variance_sad16x16
    169 #define vp8_variance_sad16x16 vp8_sad16x16_wmt
    170 
    171 #undef  vp8_variance_var4x4
    172 #define vp8_variance_var4x4 vp8_variance4x4_wmt
    173 
    174 #undef  vp8_variance_var8x8
    175 #define vp8_variance_var8x8 vp8_variance8x8_wmt
    176 
    177 #undef  vp8_variance_var8x16
    178 #define vp8_variance_var8x16 vp8_variance8x16_wmt
    179 
    180 #undef  vp8_variance_var16x8
    181 #define vp8_variance_var16x8 vp8_variance16x8_wmt
    182 
    183 #undef  vp8_variance_var16x16
    184 #define vp8_variance_var16x16 vp8_variance16x16_wmt
    185 
    186 #undef  vp8_variance_subpixvar4x4
    187 #define vp8_variance_subpixvar4x4 vp8_sub_pixel_variance4x4_wmt
    188 
    189 #undef  vp8_variance_subpixvar8x8
    190 #define vp8_variance_subpixvar8x8 vp8_sub_pixel_variance8x8_wmt
    191 
    192 #undef  vp8_variance_subpixvar8x16
    193 #define vp8_variance_subpixvar8x16 vp8_sub_pixel_variance8x16_wmt
    194 
    195 #undef  vp8_variance_subpixvar16x8
    196 #define vp8_variance_subpixvar16x8 vp8_sub_pixel_variance16x8_wmt
    197 
    198 #undef  vp8_variance_subpixvar16x16
    199 #define vp8_variance_subpixvar16x16 vp8_sub_pixel_variance16x16_wmt
    200 
    201 #undef  vp8_variance_halfpixvar16x16_h
    202 #define vp8_variance_halfpixvar16x16_h vp8_variance_halfpixvar16x16_h_wmt
    203 
    204 #undef  vp8_variance_halfpixvar16x16_v
    205 #define vp8_variance_halfpixvar16x16_v vp8_variance_halfpixvar16x16_v_wmt
    206 
    207 #undef  vp8_variance_halfpixvar16x16_hv
    208 #define vp8_variance_halfpixvar16x16_hv vp8_variance_halfpixvar16x16_hv_wmt
    209 
    210 #undef  vp8_variance_subpixmse16x16
    211 #define vp8_variance_subpixmse16x16 vp8_sub_pixel_mse16x16_wmt
    212 
    213 #undef  vp8_variance_getmbss
    214 #define vp8_variance_getmbss vp8_get_mb_ss_sse2
    215 
    216 #undef  vp8_variance_mse16x16
    217 #define vp8_variance_mse16x16 vp8_mse16x16_wmt
    218 
    219 #undef  vp8_variance_get16x16prederror
    220 #define vp8_variance_get16x16prederror vp8_get16x16pred_error_sse2
    221 
    222 #undef  vp8_variance_get8x8var
    223 #define vp8_variance_get8x8var vp8_get8x8var_sse2
    224 
    225 #undef  vp8_variance_get16x16var
    226 #define vp8_variance_get16x16var vp8_get16x16var_sse2
    227 
    228 #endif
    229 #endif
    230 
    231 
    232 #if HAVE_SSE3
    233 extern prototype_sad(vp8_sad16x16_sse3);
    234 extern prototype_sad(vp8_sad16x8_sse3);
    235 extern prototype_sad_multi_same_address(vp8_sad16x16x3_sse3);
    236 extern prototype_sad_multi_same_address(vp8_sad16x8x3_sse3);
    237 extern prototype_sad_multi_same_address(vp8_sad8x16x3_sse3);
    238 extern prototype_sad_multi_same_address(vp8_sad8x8x3_sse3);
    239 extern prototype_sad_multi_same_address(vp8_sad4x4x3_sse3);
    240 
    241 extern prototype_sad_multi_dif_address(vp8_sad16x16x4d_sse3);
    242 extern prototype_sad_multi_dif_address(vp8_sad16x8x4d_sse3);
    243 extern prototype_sad_multi_dif_address(vp8_sad8x16x4d_sse3);
    244 extern prototype_sad_multi_dif_address(vp8_sad8x8x4d_sse3);
    245 extern prototype_sad_multi_dif_address(vp8_sad4x4x4d_sse3);
    246 
    247 #if !CONFIG_RUNTIME_CPU_DETECT
    248 
    249 #undef  vp8_variance_sad16x16
    250 #define vp8_variance_sad16x16 vp8_sad16x16_sse3
    251 
    252 #undef  vp8_variance_sad16x16x3
    253 #define vp8_variance_sad16x16x3 vp8_sad16x16x3_sse3
    254 
    255 #undef  vp8_variance_sad16x8x3
    256 #define vp8_variance_sad16x8x3 vp8_sad16x8x3_sse3
    257 
    258 #undef  vp8_variance_sad8x16x3
    259 #define vp8_variance_sad8x16x3 vp8_sad8x16x3_sse3
    260 
    261 #undef  vp8_variance_sad8x8x3
    262 #define vp8_variance_sad8x8x3 vp8_sad8x8x3_sse3
    263 
    264 #undef  vp8_variance_sad4x4x3
    265 #define vp8_variance_sad4x4x3 vp8_sad4x4x3_sse3
    266 
    267 #undef  vp8_variance_sad16x16x4d
    268 #define vp8_variance_sad16x16x4d vp8_sad16x16x4d_sse3
    269 
    270 #undef  vp8_variance_sad16x8x4d
    271 #define vp8_variance_sad16x8x4d vp8_sad16x8x4d_sse3
    272 
    273 #undef  vp8_variance_sad8x16x4d
    274 #define vp8_variance_sad8x16x4d vp8_sad8x16x4d_sse3
    275 
    276 #undef  vp8_variance_sad8x8x4d
    277 #define vp8_variance_sad8x8x4d vp8_sad8x8x4d_sse3
    278 
    279 #undef  vp8_variance_sad4x4x4d
    280 #define vp8_variance_sad4x4x4d vp8_sad4x4x4d_sse3
    281 
    282 #endif
    283 #endif
    284 
    285 
    286 #if HAVE_SSSE3
    287 extern prototype_sad_multi_same_address(vp8_sad16x16x3_ssse3);
    288 extern prototype_sad_multi_same_address(vp8_sad16x8x3_ssse3);
    289 extern prototype_subpixvariance(vp8_sub_pixel_variance16x8_ssse3);
    290 extern prototype_subpixvariance(vp8_sub_pixel_variance16x16_ssse3);
    291 
    292 #if !CONFIG_RUNTIME_CPU_DETECT
    293 #undef  vp8_variance_sad16x16x3
    294 #define vp8_variance_sad16x16x3 vp8_sad16x16x3_ssse3
    295 
    296 #undef  vp8_variance_sad16x8x3
    297 #define vp8_variance_sad16x8x3 vp8_sad16x8x3_ssse3
    298 
    299 #undef  vp8_variance_subpixvar16x8
    300 #define vp8_variance_subpixvar16x8 vp8_sub_pixel_variance16x8_ssse3
    301 
    302 #undef  vp8_variance_subpixvar16x16
    303 #define vp8_variance_subpixvar16x16 vp8_sub_pixel_variance16x16_ssse3
    304 
    305 #endif
    306 #endif
    307 
    308 
    309 #if HAVE_SSE4_1
    310 extern prototype_sad_multi_same_address_1(vp8_sad16x16x8_sse4);
    311 extern prototype_sad_multi_same_address_1(vp8_sad16x8x8_sse4);
    312 extern prototype_sad_multi_same_address_1(vp8_sad8x16x8_sse4);
    313 extern prototype_sad_multi_same_address_1(vp8_sad8x8x8_sse4);
    314 extern prototype_sad_multi_same_address_1(vp8_sad4x4x8_sse4);
    315 
    316 #if !CONFIG_RUNTIME_CPU_DETECT
    317 #undef  vp8_variance_sad16x16x8
    318 #define vp8_variance_sad16x16x8 vp8_sad16x16x8_sse4
    319 
    320 #undef  vp8_variance_sad16x8x8
    321 #define vp8_variance_sad16x8x8 vp8_sad16x8x8_sse4
    322 
    323 #undef  vp8_variance_sad8x16x8
    324 #define vp8_variance_sad8x16x8 vp8_sad8x16x8_sse4
    325 
    326 #undef  vp8_variance_sad8x8x8
    327 #define vp8_variance_sad8x8x8 vp8_sad8x8x8_sse4
    328 
    329 #undef  vp8_variance_sad4x4x8
    330 #define vp8_variance_sad4x4x8 vp8_sad4x4x8_sse4
    331 
    332 #endif
    333 #endif
    334 
    335 #endif
    336