Merge "Skip computation of distortion in vp8_pick_inter_mode if active_map is used"
[libvpx.git] / vp8 / encoder / x86 / variance_x86.h
blob4b41b5436c102c0831b4e8d1398dc949dd167495
1 /*
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
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 */
12 #ifndef VARIANCE_X86_H
13 #define VARIANCE_X86_H
16 /* Note:
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
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_variance2(vp8_get8x8var_mmx);
45 extern prototype_get16x16prederror(vp8_get4x4sse_cs_mmx);
47 #if !CONFIG_RUNTIME_CPU_DETECT
48 #undef vp8_variance_sad4x4
49 #define vp8_variance_sad4x4 vp8_sad4x4_mmx
51 #undef vp8_variance_sad8x8
52 #define vp8_variance_sad8x8 vp8_sad8x8_mmx
54 #undef vp8_variance_sad8x16
55 #define vp8_variance_sad8x16 vp8_sad8x16_mmx
57 #undef vp8_variance_sad16x8
58 #define vp8_variance_sad16x8 vp8_sad16x8_mmx
60 #undef vp8_variance_sad16x16
61 #define vp8_variance_sad16x16 vp8_sad16x16_mmx
63 #undef vp8_variance_var4x4
64 #define vp8_variance_var4x4 vp8_variance4x4_mmx
66 #undef vp8_variance_var8x8
67 #define vp8_variance_var8x8 vp8_variance8x8_mmx
69 #undef vp8_variance_var8x16
70 #define vp8_variance_var8x16 vp8_variance8x16_mmx
72 #undef vp8_variance_var16x8
73 #define vp8_variance_var16x8 vp8_variance16x8_mmx
75 #undef vp8_variance_var16x16
76 #define vp8_variance_var16x16 vp8_variance16x16_mmx
78 #undef vp8_variance_subpixvar4x4
79 #define vp8_variance_subpixvar4x4 vp8_sub_pixel_variance4x4_mmx
81 #undef vp8_variance_subpixvar8x8
82 #define vp8_variance_subpixvar8x8 vp8_sub_pixel_variance8x8_mmx
84 #undef vp8_variance_subpixvar8x16
85 #define vp8_variance_subpixvar8x16 vp8_sub_pixel_variance8x16_mmx
87 #undef vp8_variance_subpixvar16x8
88 #define vp8_variance_subpixvar16x8 vp8_sub_pixel_variance16x8_mmx
90 #undef vp8_variance_subpixvar16x16
91 #define vp8_variance_subpixvar16x16 vp8_sub_pixel_variance16x16_mmx
93 #undef vp8_variance_halfpixvar16x16_h
94 #define vp8_variance_halfpixvar16x16_h vp8_variance_halfpixvar16x16_h_mmx
96 #undef vp8_variance_halfpixvar16x16_v
97 #define vp8_variance_halfpixvar16x16_v vp8_variance_halfpixvar16x16_v_mmx
99 #undef vp8_variance_halfpixvar16x16_hv
100 #define vp8_variance_halfpixvar16x16_hv vp8_variance_halfpixvar16x16_hv_mmx
102 #undef vp8_variance_subpixmse16x16
103 #define vp8_variance_subpixmse16x16 vp8_sub_pixel_mse16x16_mmx
105 #undef vp8_variance_getmbss
106 #define vp8_variance_getmbss vp8_get_mb_ss_mmx
108 #undef vp8_variance_mse16x16
109 #define vp8_variance_mse16x16 vp8_mse16x16_mmx
111 #undef vp8_variance_get4x4sse_cs
112 #define vp8_variance_get4x4sse_cs vp8_get4x4sse_cs_mmx
114 #endif
115 #endif
118 #if HAVE_SSE2
119 extern prototype_sad(vp8_sad4x4_wmt);
120 extern prototype_sad(vp8_sad8x8_wmt);
121 extern prototype_sad(vp8_sad8x16_wmt);
122 extern prototype_sad(vp8_sad16x8_wmt);
123 extern prototype_sad(vp8_sad16x16_wmt);
124 extern prototype_sad(vp8_copy32xn_sse2);
125 extern prototype_variance(vp8_variance4x4_wmt);
126 extern prototype_variance(vp8_variance8x8_wmt);
127 extern prototype_variance(vp8_variance8x16_wmt);
128 extern prototype_variance(vp8_variance16x8_wmt);
129 extern prototype_variance(vp8_variance16x16_wmt);
130 extern prototype_subpixvariance(vp8_sub_pixel_variance4x4_wmt);
131 extern prototype_subpixvariance(vp8_sub_pixel_variance8x8_wmt);
132 extern prototype_subpixvariance(vp8_sub_pixel_variance8x16_wmt);
133 extern prototype_subpixvariance(vp8_sub_pixel_variance16x8_wmt);
134 extern prototype_subpixvariance(vp8_sub_pixel_variance16x16_wmt);
135 extern prototype_variance(vp8_variance_halfpixvar16x16_h_wmt);
136 extern prototype_variance(vp8_variance_halfpixvar16x16_v_wmt);
137 extern prototype_variance(vp8_variance_halfpixvar16x16_hv_wmt);
138 extern prototype_subpixvariance(vp8_sub_pixel_mse16x16_wmt);
139 extern prototype_getmbss(vp8_get_mb_ss_sse2);
140 extern prototype_variance(vp8_mse16x16_wmt);
141 extern prototype_variance2(vp8_get8x8var_sse2);
142 extern prototype_variance2(vp8_get16x16var_sse2);
143 extern prototype_ssimpf(vp8_ssim_parms_8x8_sse2)
144 extern prototype_ssimpf(vp8_ssim_parms_16x16_sse2)
146 #if !CONFIG_RUNTIME_CPU_DETECT
147 #undef vp8_variance_sad4x4
148 #define vp8_variance_sad4x4 vp8_sad4x4_wmt
150 #undef vp8_variance_sad8x8
151 #define vp8_variance_sad8x8 vp8_sad8x8_wmt
153 #undef vp8_variance_sad8x16
154 #define vp8_variance_sad8x16 vp8_sad8x16_wmt
156 #undef vp8_variance_sad16x8
157 #define vp8_variance_sad16x8 vp8_sad16x8_wmt
159 #undef vp8_variance_sad16x16
160 #define vp8_variance_sad16x16 vp8_sad16x16_wmt
162 #undef vp8_variance_copy32xn
163 #define vp8_variance_copy32xn vp8_copy32xn_sse2
165 #undef vp8_variance_var4x4
166 #define vp8_variance_var4x4 vp8_variance4x4_wmt
168 #undef vp8_variance_var8x8
169 #define vp8_variance_var8x8 vp8_variance8x8_wmt
171 #undef vp8_variance_var8x16
172 #define vp8_variance_var8x16 vp8_variance8x16_wmt
174 #undef vp8_variance_var16x8
175 #define vp8_variance_var16x8 vp8_variance16x8_wmt
177 #undef vp8_variance_var16x16
178 #define vp8_variance_var16x16 vp8_variance16x16_wmt
180 #undef vp8_variance_subpixvar4x4
181 #define vp8_variance_subpixvar4x4 vp8_sub_pixel_variance4x4_wmt
183 #undef vp8_variance_subpixvar8x8
184 #define vp8_variance_subpixvar8x8 vp8_sub_pixel_variance8x8_wmt
186 #undef vp8_variance_subpixvar8x16
187 #define vp8_variance_subpixvar8x16 vp8_sub_pixel_variance8x16_wmt
189 #undef vp8_variance_subpixvar16x8
190 #define vp8_variance_subpixvar16x8 vp8_sub_pixel_variance16x8_wmt
192 #undef vp8_variance_subpixvar16x16
193 #define vp8_variance_subpixvar16x16 vp8_sub_pixel_variance16x16_wmt
195 #undef vp8_variance_halfpixvar16x16_h
196 #define vp8_variance_halfpixvar16x16_h vp8_variance_halfpixvar16x16_h_wmt
198 #undef vp8_variance_halfpixvar16x16_v
199 #define vp8_variance_halfpixvar16x16_v vp8_variance_halfpixvar16x16_v_wmt
201 #undef vp8_variance_halfpixvar16x16_hv
202 #define vp8_variance_halfpixvar16x16_hv vp8_variance_halfpixvar16x16_hv_wmt
204 #undef vp8_variance_subpixmse16x16
205 #define vp8_variance_subpixmse16x16 vp8_sub_pixel_mse16x16_wmt
207 #undef vp8_variance_getmbss
208 #define vp8_variance_getmbss vp8_get_mb_ss_sse2
210 #undef vp8_variance_mse16x16
211 #define vp8_variance_mse16x16 vp8_mse16x16_wmt
213 #if ARCH_X86_64
214 #undef vp8_ssimpf_8x8
215 #define vp8_ssimpf_8x8 vp8_ssim_parms_8x8_sse2
217 #undef vp8_ssimpf_16x16
218 #define vp8_ssimpf_16x16 vp8_ssim_parms_16x16_sse2
219 #endif
221 #endif
222 #endif
225 #if HAVE_SSE3
226 extern prototype_sad(vp8_sad16x16_sse3);
227 extern prototype_sad(vp8_sad16x8_sse3);
228 extern prototype_sad_multi_same_address(vp8_sad16x16x3_sse3);
229 extern prototype_sad_multi_same_address(vp8_sad16x8x3_sse3);
230 extern prototype_sad_multi_same_address(vp8_sad8x16x3_sse3);
231 extern prototype_sad_multi_same_address(vp8_sad8x8x3_sse3);
232 extern prototype_sad_multi_same_address(vp8_sad4x4x3_sse3);
234 extern prototype_sad_multi_dif_address(vp8_sad16x16x4d_sse3);
235 extern prototype_sad_multi_dif_address(vp8_sad16x8x4d_sse3);
236 extern prototype_sad_multi_dif_address(vp8_sad8x16x4d_sse3);
237 extern prototype_sad_multi_dif_address(vp8_sad8x8x4d_sse3);
238 extern prototype_sad_multi_dif_address(vp8_sad4x4x4d_sse3);
239 extern prototype_sad(vp8_copy32xn_sse3);
241 #if !CONFIG_RUNTIME_CPU_DETECT
243 #undef vp8_variance_sad16x16
244 #define vp8_variance_sad16x16 vp8_sad16x16_sse3
246 #undef vp8_variance_sad16x16x3
247 #define vp8_variance_sad16x16x3 vp8_sad16x16x3_sse3
249 #undef vp8_variance_sad16x8x3
250 #define vp8_variance_sad16x8x3 vp8_sad16x8x3_sse3
252 #undef vp8_variance_sad8x16x3
253 #define vp8_variance_sad8x16x3 vp8_sad8x16x3_sse3
255 #undef vp8_variance_sad8x8x3
256 #define vp8_variance_sad8x8x3 vp8_sad8x8x3_sse3
258 #undef vp8_variance_sad4x4x3
259 #define vp8_variance_sad4x4x3 vp8_sad4x4x3_sse3
261 #undef vp8_variance_sad16x16x4d
262 #define vp8_variance_sad16x16x4d vp8_sad16x16x4d_sse3
264 #undef vp8_variance_sad16x8x4d
265 #define vp8_variance_sad16x8x4d vp8_sad16x8x4d_sse3
267 #undef vp8_variance_sad8x16x4d
268 #define vp8_variance_sad8x16x4d vp8_sad8x16x4d_sse3
270 #undef vp8_variance_sad8x8x4d
271 #define vp8_variance_sad8x8x4d vp8_sad8x8x4d_sse3
273 #undef vp8_variance_sad4x4x4d
274 #define vp8_variance_sad4x4x4d vp8_sad4x4x4d_sse3
276 #undef vp8_variance_copy32xn
277 #define vp8_variance_copy32xn vp8_copy32xn_sse3
279 #endif
280 #endif
283 #if HAVE_SSSE3
284 extern prototype_sad_multi_same_address(vp8_sad16x16x3_ssse3);
285 extern prototype_sad_multi_same_address(vp8_sad16x8x3_ssse3);
286 extern prototype_subpixvariance(vp8_sub_pixel_variance16x8_ssse3);
287 extern prototype_subpixvariance(vp8_sub_pixel_variance16x16_ssse3);
289 #if !CONFIG_RUNTIME_CPU_DETECT
290 #undef vp8_variance_sad16x16x3
291 #define vp8_variance_sad16x16x3 vp8_sad16x16x3_ssse3
293 #undef vp8_variance_sad16x8x3
294 #define vp8_variance_sad16x8x3 vp8_sad16x8x3_ssse3
296 #undef vp8_variance_subpixvar16x8
297 #define vp8_variance_subpixvar16x8 vp8_sub_pixel_variance16x8_ssse3
299 #undef vp8_variance_subpixvar16x16
300 #define vp8_variance_subpixvar16x16 vp8_sub_pixel_variance16x16_ssse3
302 #endif
303 #endif
306 #if HAVE_SSE4_1
307 extern prototype_sad_multi_same_address_1(vp8_sad16x16x8_sse4);
308 extern prototype_sad_multi_same_address_1(vp8_sad16x8x8_sse4);
309 extern prototype_sad_multi_same_address_1(vp8_sad8x16x8_sse4);
310 extern prototype_sad_multi_same_address_1(vp8_sad8x8x8_sse4);
311 extern prototype_sad_multi_same_address_1(vp8_sad4x4x8_sse4);
313 #if !CONFIG_RUNTIME_CPU_DETECT
314 #undef vp8_variance_sad16x16x8
315 #define vp8_variance_sad16x16x8 vp8_sad16x16x8_sse4
317 #undef vp8_variance_sad16x8x8
318 #define vp8_variance_sad16x8x8 vp8_sad16x8x8_sse4
320 #undef vp8_variance_sad8x16x8
321 #define vp8_variance_sad8x16x8 vp8_sad8x16x8_sse4
323 #undef vp8_variance_sad8x8x8
324 #define vp8_variance_sad8x8x8 vp8_sad8x8x8_sse4
326 #undef vp8_variance_sad4x4x8
327 #define vp8_variance_sad4x4x8 vp8_sad4x4x8_sse4
329 #endif
330 #endif
332 #endif