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
23extern prototype_sad(vp8_sad4x4_mmx);
24extern prototype_sad(vp8_sad8x8_mmx);
25extern prototype_sad(vp8_sad8x16_mmx);
26extern prototype_sad(vp8_sad16x8_mmx);
27extern prototype_sad(vp8_sad16x16_mmx);
28extern prototype_variance(vp8_variance4x4_mmx);
29extern prototype_variance(vp8_variance8x8_mmx);
30extern prototype_variance(vp8_variance8x16_mmx);
31extern prototype_variance(vp8_variance16x8_mmx);
32extern prototype_variance(vp8_variance16x16_mmx);
33extern prototype_subpixvariance(vp8_sub_pixel_variance4x4_mmx);
34extern prototype_subpixvariance(vp8_sub_pixel_variance8x8_mmx);
35extern prototype_subpixvariance(vp8_sub_pixel_variance8x16_mmx);
36extern prototype_subpixvariance(vp8_sub_pixel_variance16x8_mmx);
37extern prototype_subpixvariance(vp8_sub_pixel_variance16x16_mmx);
38extern prototype_variance(vp8_variance_halfpixvar16x16_h_mmx);
39extern prototype_variance(vp8_variance_halfpixvar16x16_v_mmx);
40extern prototype_variance(vp8_variance_halfpixvar16x16_hv_mmx);
41extern prototype_subpixvariance(vp8_sub_pixel_mse16x16_mmx);
42extern prototype_getmbss(vp8_get_mb_ss_mmx);
43extern prototype_variance(vp8_mse16x16_mmx);
44extern prototype_sad(vp8_get16x16pred_error_mmx);
45extern prototype_variance2(vp8_get8x8var_mmx);
46extern prototype_variance2(vp8_get16x16var_mmx);
47extern 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
130extern prototype_sad(vp8_sad4x4_wmt);
131extern prototype_sad(vp8_sad8x8_wmt);
132extern prototype_sad(vp8_sad8x16_wmt);
133extern prototype_sad(vp8_sad16x8_wmt);
134extern prototype_sad(vp8_sad16x16_wmt);
135extern prototype_variance(vp8_variance4x4_wmt);
136extern prototype_variance(vp8_variance8x8_wmt);
137extern prototype_variance(vp8_variance8x16_wmt);
138extern prototype_variance(vp8_variance16x8_wmt);
139extern prototype_variance(vp8_variance16x16_wmt);
140extern prototype_subpixvariance(vp8_sub_pixel_variance4x4_wmt);
141extern prototype_subpixvariance(vp8_sub_pixel_variance8x8_wmt);
142extern prototype_subpixvariance(vp8_sub_pixel_variance8x16_wmt);
143extern prototype_subpixvariance(vp8_sub_pixel_variance16x8_wmt);
144extern prototype_subpixvariance(vp8_sub_pixel_variance16x16_wmt);
145extern prototype_variance(vp8_variance_halfpixvar16x16_h_wmt);
146extern prototype_variance(vp8_variance_halfpixvar16x16_v_wmt);
147extern prototype_variance(vp8_variance_halfpixvar16x16_hv_wmt);
148extern prototype_subpixvariance(vp8_sub_pixel_mse16x16_wmt);
149extern prototype_getmbss(vp8_get_mb_ss_sse2);
150extern prototype_variance(vp8_mse16x16_wmt);
151extern prototype_sad(vp8_get16x16pred_error_sse2);
152extern prototype_variance2(vp8_get8x8var_sse2);
153extern 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
233extern prototype_sad(vp8_sad16x16_sse3);
234extern prototype_sad(vp8_sad16x8_sse3);
235extern prototype_sad_multi_same_address(vp8_sad16x16x3_sse3);
236extern prototype_sad_multi_same_address(vp8_sad16x8x3_sse3);
237extern prototype_sad_multi_same_address(vp8_sad8x16x3_sse3);
238extern prototype_sad_multi_same_address(vp8_sad8x8x3_sse3);
239extern prototype_sad_multi_same_address(vp8_sad4x4x3_sse3);
240
241extern prototype_sad_multi_dif_address(vp8_sad16x16x4d_sse3);
242extern prototype_sad_multi_dif_address(vp8_sad16x8x4d_sse3);
243extern prototype_sad_multi_dif_address(vp8_sad8x16x4d_sse3);
244extern prototype_sad_multi_dif_address(vp8_sad8x8x4d_sse3);
245extern 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
287extern prototype_sad_multi_same_address(vp8_sad16x16x3_ssse3);
288extern prototype_sad_multi_same_address(vp8_sad16x8x3_ssse3);
289extern prototype_subpixvariance(vp8_sub_pixel_variance16x8_ssse3);
290extern 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
310extern prototype_sad_multi_same_address_1(vp8_sad16x16x8_sse4);
311extern prototype_sad_multi_same_address_1(vp8_sad16x8x8_sse4);
312extern prototype_sad_multi_same_address_1(vp8_sad8x16x8_sse4);
313extern prototype_sad_multi_same_address_1(vp8_sad8x8x8_sse4);
314extern 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