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.
15 #define prototype_sad(sym)\
18 const unsigned char *src_ptr, \
20 const unsigned char *ref_ptr, \
25 #define prototype_sad_multi_same_address(sym)\
28 const unsigned char *src_ptr, \
30 const unsigned char *ref_ptr, \
32 unsigned int *sad_array\
35 #define prototype_sad_multi_same_address_1(sym)\
38 const unsigned char *src_ptr, \
40 const unsigned char *ref_ptr, \
42 unsigned short *sad_array\
45 #define prototype_sad_multi_dif_address(sym)\
48 const unsigned char *src_ptr, \
50 unsigned char *ref_ptr[4], \
52 unsigned int *sad_array\
55 #define prototype_variance(sym) \
58 const unsigned char *src_ptr, \
60 const unsigned char *ref_ptr, \
65 #define prototype_variance2(sym) \
68 const unsigned char *src_ptr, \
70 const unsigned char *ref_ptr, \
76 #define prototype_subpixvariance(sym) \
79 const unsigned char *src_ptr, \
83 const unsigned char *ref_ptr, \
88 #define prototype_ssimpf(sym) \
95 unsigned long *sum_s, \
96 unsigned long *sum_r, \
97 unsigned long *sum_sq_s, \
98 unsigned long *sum_sq_r, \
99 unsigned long *sum_sxr \
102 #define prototype_getmbss(sym) unsigned int (sym)(const short *)
104 #if ARCH_X86 || ARCH_X86_64
105 #include "x86/variance_x86.h"
109 #include "arm/variance_arm.h"
112 #ifndef vp8_variance_sad4x4
113 #define vp8_variance_sad4x4 vp8_sad4x4_c
115 extern prototype_sad(vp8_variance_sad4x4
);
117 #ifndef vp8_variance_sad8x8
118 #define vp8_variance_sad8x8 vp8_sad8x8_c
120 extern prototype_sad(vp8_variance_sad8x8
);
122 #ifndef vp8_variance_sad8x16
123 #define vp8_variance_sad8x16 vp8_sad8x16_c
125 extern prototype_sad(vp8_variance_sad8x16
);
127 #ifndef vp8_variance_sad16x8
128 #define vp8_variance_sad16x8 vp8_sad16x8_c
130 extern prototype_sad(vp8_variance_sad16x8
);
132 #ifndef vp8_variance_sad16x16
133 #define vp8_variance_sad16x16 vp8_sad16x16_c
135 extern prototype_sad(vp8_variance_sad16x16
);
137 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
139 #ifndef vp8_variance_sad16x16x3
140 #define vp8_variance_sad16x16x3 vp8_sad16x16x3_c
142 extern prototype_sad_multi_same_address(vp8_variance_sad16x16x3
);
144 #ifndef vp8_variance_sad16x8x3
145 #define vp8_variance_sad16x8x3 vp8_sad16x8x3_c
147 extern prototype_sad_multi_same_address(vp8_variance_sad16x8x3
);
149 #ifndef vp8_variance_sad8x8x3
150 #define vp8_variance_sad8x8x3 vp8_sad8x8x3_c
152 extern prototype_sad_multi_same_address(vp8_variance_sad8x8x3
);
154 #ifndef vp8_variance_sad8x16x3
155 #define vp8_variance_sad8x16x3 vp8_sad8x16x3_c
157 extern prototype_sad_multi_same_address(vp8_variance_sad8x16x3
);
159 #ifndef vp8_variance_sad4x4x3
160 #define vp8_variance_sad4x4x3 vp8_sad4x4x3_c
162 extern prototype_sad_multi_same_address(vp8_variance_sad4x4x3
);
164 #ifndef vp8_variance_sad16x16x8
165 #define vp8_variance_sad16x16x8 vp8_sad16x16x8_c
167 extern prototype_sad_multi_same_address_1(vp8_variance_sad16x16x8
);
169 #ifndef vp8_variance_sad16x8x8
170 #define vp8_variance_sad16x8x8 vp8_sad16x8x8_c
172 extern prototype_sad_multi_same_address_1(vp8_variance_sad16x8x8
);
174 #ifndef vp8_variance_sad8x8x8
175 #define vp8_variance_sad8x8x8 vp8_sad8x8x8_c
177 extern prototype_sad_multi_same_address_1(vp8_variance_sad8x8x8
);
179 #ifndef vp8_variance_sad8x16x8
180 #define vp8_variance_sad8x16x8 vp8_sad8x16x8_c
182 extern prototype_sad_multi_same_address_1(vp8_variance_sad8x16x8
);
184 #ifndef vp8_variance_sad4x4x8
185 #define vp8_variance_sad4x4x8 vp8_sad4x4x8_c
187 extern prototype_sad_multi_same_address_1(vp8_variance_sad4x4x8
);
189 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
191 #ifndef vp8_variance_sad16x16x4d
192 #define vp8_variance_sad16x16x4d vp8_sad16x16x4d_c
194 extern prototype_sad_multi_dif_address(vp8_variance_sad16x16x4d
);
196 #ifndef vp8_variance_sad16x8x4d
197 #define vp8_variance_sad16x8x4d vp8_sad16x8x4d_c
199 extern prototype_sad_multi_dif_address(vp8_variance_sad16x8x4d
);
201 #ifndef vp8_variance_sad8x8x4d
202 #define vp8_variance_sad8x8x4d vp8_sad8x8x4d_c
204 extern prototype_sad_multi_dif_address(vp8_variance_sad8x8x4d
);
206 #ifndef vp8_variance_sad8x16x4d
207 #define vp8_variance_sad8x16x4d vp8_sad8x16x4d_c
209 extern prototype_sad_multi_dif_address(vp8_variance_sad8x16x4d
);
211 #ifndef vp8_variance_sad4x4x4d
212 #define vp8_variance_sad4x4x4d vp8_sad4x4x4d_c
214 extern prototype_sad_multi_dif_address(vp8_variance_sad4x4x4d
);
216 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
218 #ifndef vp8_variance_var4x4
219 #define vp8_variance_var4x4 vp8_variance4x4_c
221 extern prototype_variance(vp8_variance_var4x4
);
223 #ifndef vp8_variance_var8x8
224 #define vp8_variance_var8x8 vp8_variance8x8_c
226 extern prototype_variance(vp8_variance_var8x8
);
228 #ifndef vp8_variance_var8x16
229 #define vp8_variance_var8x16 vp8_variance8x16_c
231 extern prototype_variance(vp8_variance_var8x16
);
233 #ifndef vp8_variance_var16x8
234 #define vp8_variance_var16x8 vp8_variance16x8_c
236 extern prototype_variance(vp8_variance_var16x8
);
238 #ifndef vp8_variance_var16x16
239 #define vp8_variance_var16x16 vp8_variance16x16_c
241 extern prototype_variance(vp8_variance_var16x16
);
243 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
245 #ifndef vp8_variance_subpixvar4x4
246 #define vp8_variance_subpixvar4x4 vp8_sub_pixel_variance4x4_c
248 extern prototype_subpixvariance(vp8_variance_subpixvar4x4
);
250 #ifndef vp8_variance_subpixvar8x8
251 #define vp8_variance_subpixvar8x8 vp8_sub_pixel_variance8x8_c
253 extern prototype_subpixvariance(vp8_variance_subpixvar8x8
);
255 #ifndef vp8_variance_subpixvar8x16
256 #define vp8_variance_subpixvar8x16 vp8_sub_pixel_variance8x16_c
258 extern prototype_subpixvariance(vp8_variance_subpixvar8x16
);
260 #ifndef vp8_variance_subpixvar16x8
261 #define vp8_variance_subpixvar16x8 vp8_sub_pixel_variance16x8_c
263 extern prototype_subpixvariance(vp8_variance_subpixvar16x8
);
265 #ifndef vp8_variance_subpixvar16x16
266 #define vp8_variance_subpixvar16x16 vp8_sub_pixel_variance16x16_c
268 extern prototype_subpixvariance(vp8_variance_subpixvar16x16
);
270 #ifndef vp8_variance_halfpixvar16x16_h
271 #define vp8_variance_halfpixvar16x16_h vp8_variance_halfpixvar16x16_h_c
273 extern prototype_variance(vp8_variance_halfpixvar16x16_h
);
275 #ifndef vp8_variance_halfpixvar16x16_v
276 #define vp8_variance_halfpixvar16x16_v vp8_variance_halfpixvar16x16_v_c
278 extern prototype_variance(vp8_variance_halfpixvar16x16_v
);
280 #ifndef vp8_variance_halfpixvar16x16_hv
281 #define vp8_variance_halfpixvar16x16_hv vp8_variance_halfpixvar16x16_hv_c
283 extern prototype_variance(vp8_variance_halfpixvar16x16_hv
);
285 #ifndef vp8_variance_subpixmse16x16
286 #define vp8_variance_subpixmse16x16 vp8_sub_pixel_mse16x16_c
288 extern prototype_subpixvariance(vp8_variance_subpixmse16x16
);
290 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
292 #ifndef vp8_variance_getmbss
293 #define vp8_variance_getmbss vp8_get_mb_ss_c
295 extern prototype_getmbss(vp8_variance_getmbss
);
297 #ifndef vp8_variance_mse16x16
298 #define vp8_variance_mse16x16 vp8_mse16x16_c
300 extern prototype_variance(vp8_variance_mse16x16
);
302 #ifndef vp8_variance_get16x16prederror
303 #define vp8_variance_get16x16prederror vp8_get16x16pred_error_c
305 extern prototype_sad(vp8_variance_get16x16prederror
);
307 #ifndef vp8_variance_get8x8var
308 #define vp8_variance_get8x8var vp8_get8x8var_c
310 extern prototype_variance2(vp8_variance_get8x8var
);
312 #ifndef vp8_variance_get16x16var
313 #define vp8_variance_get16x16var vp8_get16x16var_c
315 extern prototype_variance2(vp8_variance_get16x16var
);
317 #ifndef vp8_variance_get4x4sse_cs
318 #define vp8_variance_get4x4sse_cs vp8_get4x4sse_cs_c
320 extern prototype_sad(vp8_variance_get4x4sse_cs
);
323 #define vp8_ssimpf ssim_parms_c
325 extern prototype_ssimpf(vp8_ssimpf
)
327 #ifndef vp8_ssimpf_8x8
328 #define vp8_ssimpf_8x8 ssim_parms_8x8_c
330 extern prototype_ssimpf(vp8_ssimpf_8x8
)
332 typedef prototype_sad(*vp8_sad_fn_t
);
333 typedef prototype_sad_multi_same_address(*vp8_sad_multi_fn_t
);
334 typedef prototype_sad_multi_same_address_1(*vp8_sad_multi1_fn_t
);
335 typedef prototype_sad_multi_dif_address(*vp8_sad_multi_d_fn_t
);
336 typedef prototype_variance(*vp8_variance_fn_t
);
337 typedef prototype_variance2(*vp8_variance2_fn_t
);
338 typedef prototype_subpixvariance(*vp8_subpixvariance_fn_t
);
339 typedef prototype_getmbss(*vp8_getmbss_fn_t
);
341 typedef prototype_ssimpf(*vp8_ssimpf_fn_t
)
348 vp8_sad_fn_t sad8x16
;
349 vp8_sad_fn_t sad16x8
;
350 vp8_sad_fn_t sad16x16
;
352 vp8_variance_fn_t var4x4
;
353 vp8_variance_fn_t var8x8
;
354 vp8_variance_fn_t var8x16
;
355 vp8_variance_fn_t var16x8
;
356 vp8_variance_fn_t var16x16
;
358 vp8_subpixvariance_fn_t subpixvar4x4
;
359 vp8_subpixvariance_fn_t subpixvar8x8
;
360 vp8_subpixvariance_fn_t subpixvar8x16
;
361 vp8_subpixvariance_fn_t subpixvar16x8
;
362 vp8_subpixvariance_fn_t subpixvar16x16
;
363 vp8_variance_fn_t halfpixvar16x16_h
;
364 vp8_variance_fn_t halfpixvar16x16_v
;
365 vp8_variance_fn_t halfpixvar16x16_hv
;
366 vp8_subpixvariance_fn_t subpixmse16x16
;
368 vp8_getmbss_fn_t getmbss
;
369 vp8_variance_fn_t mse16x16
;
371 vp8_sad_fn_t get16x16prederror
;
372 vp8_variance2_fn_t get8x8var
;
373 vp8_variance2_fn_t get16x16var
;
374 vp8_sad_fn_t get4x4sse_cs
;
376 vp8_sad_multi_fn_t sad16x16x3
;
377 vp8_sad_multi_fn_t sad16x8x3
;
378 vp8_sad_multi_fn_t sad8x16x3
;
379 vp8_sad_multi_fn_t sad8x8x3
;
380 vp8_sad_multi_fn_t sad4x4x3
;
382 vp8_sad_multi1_fn_t sad16x16x8
;
383 vp8_sad_multi1_fn_t sad16x8x8
;
384 vp8_sad_multi1_fn_t sad8x16x8
;
385 vp8_sad_multi1_fn_t sad8x8x8
;
386 vp8_sad_multi1_fn_t sad4x4x8
;
388 vp8_sad_multi_d_fn_t sad16x16x4d
;
389 vp8_sad_multi_d_fn_t sad16x8x4d
;
390 vp8_sad_multi_d_fn_t sad8x16x4d
;
391 vp8_sad_multi_d_fn_t sad8x8x4d
;
392 vp8_sad_multi_d_fn_t sad4x4x4d
;
395 vp8_ssimpf_fn_t ssimpf_8x8
;
396 vp8_ssimpf_fn_t ssimpf
;
399 } vp8_variance_rtcd_vtable_t
;
404 vp8_variance_fn_t vf
;
405 vp8_subpixvariance_fn_t svf
;
406 vp8_variance_fn_t svf_halfpix_h
;
407 vp8_variance_fn_t svf_halfpix_v
;
408 vp8_variance_fn_t svf_halfpix_hv
;
409 vp8_sad_multi_fn_t sdx3f
;
410 vp8_sad_multi1_fn_t sdx8f
;
411 vp8_sad_multi_d_fn_t sdx4df
;
413 } vp8_variance_fn_ptr_t
;
415 #if CONFIG_RUNTIME_CPU_DETECT
416 #define VARIANCE_INVOKE(ctx,fn) (ctx)->fn
418 #define VARIANCE_INVOKE(ctx,fn) vp8_variance_##fn