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, \
89 #define prototype_getmbss(sym) unsigned int (sym)(const short *)
91 #if ARCH_X86 || ARCH_X86_64
92 #include "x86/variance_x86.h"
96 #include "arm/variance_arm.h"
99 #ifndef vp8_variance_sad4x4
100 #define vp8_variance_sad4x4 vp8_sad4x4_c
102 extern prototype_sad(vp8_variance_sad4x4
);
104 #ifndef vp8_variance_sad8x8
105 #define vp8_variance_sad8x8 vp8_sad8x8_c
107 extern prototype_sad(vp8_variance_sad8x8
);
109 #ifndef vp8_variance_sad8x16
110 #define vp8_variance_sad8x16 vp8_sad8x16_c
112 extern prototype_sad(vp8_variance_sad8x16
);
114 #ifndef vp8_variance_sad16x8
115 #define vp8_variance_sad16x8 vp8_sad16x8_c
117 extern prototype_sad(vp8_variance_sad16x8
);
119 #ifndef vp8_variance_sad16x16
120 #define vp8_variance_sad16x16 vp8_sad16x16_c
122 extern prototype_sad(vp8_variance_sad16x16
);
124 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
126 #ifndef vp8_variance_sad16x16x3
127 #define vp8_variance_sad16x16x3 vp8_sad16x16x3_c
129 extern prototype_sad_multi_same_address(vp8_variance_sad16x16x3
);
131 #ifndef vp8_variance_sad16x8x3
132 #define vp8_variance_sad16x8x3 vp8_sad16x8x3_c
134 extern prototype_sad_multi_same_address(vp8_variance_sad16x8x3
);
136 #ifndef vp8_variance_sad8x8x3
137 #define vp8_variance_sad8x8x3 vp8_sad8x8x3_c
139 extern prototype_sad_multi_same_address(vp8_variance_sad8x8x3
);
141 #ifndef vp8_variance_sad8x16x3
142 #define vp8_variance_sad8x16x3 vp8_sad8x16x3_c
144 extern prototype_sad_multi_same_address(vp8_variance_sad8x16x3
);
146 #ifndef vp8_variance_sad4x4x3
147 #define vp8_variance_sad4x4x3 vp8_sad4x4x3_c
149 extern prototype_sad_multi_same_address(vp8_variance_sad4x4x3
);
151 #ifndef vp8_variance_sad16x16x8
152 #define vp8_variance_sad16x16x8 vp8_sad16x16x8_c
154 extern prototype_sad_multi_same_address_1(vp8_variance_sad16x16x8
);
156 #ifndef vp8_variance_sad16x8x8
157 #define vp8_variance_sad16x8x8 vp8_sad16x8x8_c
159 extern prototype_sad_multi_same_address_1(vp8_variance_sad16x8x8
);
161 #ifndef vp8_variance_sad8x8x8
162 #define vp8_variance_sad8x8x8 vp8_sad8x8x8_c
164 extern prototype_sad_multi_same_address_1(vp8_variance_sad8x8x8
);
166 #ifndef vp8_variance_sad8x16x8
167 #define vp8_variance_sad8x16x8 vp8_sad8x16x8_c
169 extern prototype_sad_multi_same_address_1(vp8_variance_sad8x16x8
);
171 #ifndef vp8_variance_sad4x4x8
172 #define vp8_variance_sad4x4x8 vp8_sad4x4x8_c
174 extern prototype_sad_multi_same_address_1(vp8_variance_sad4x4x8
);
176 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
178 #ifndef vp8_variance_sad16x16x4d
179 #define vp8_variance_sad16x16x4d vp8_sad16x16x4d_c
181 extern prototype_sad_multi_dif_address(vp8_variance_sad16x16x4d
);
183 #ifndef vp8_variance_sad16x8x4d
184 #define vp8_variance_sad16x8x4d vp8_sad16x8x4d_c
186 extern prototype_sad_multi_dif_address(vp8_variance_sad16x8x4d
);
188 #ifndef vp8_variance_sad8x8x4d
189 #define vp8_variance_sad8x8x4d vp8_sad8x8x4d_c
191 extern prototype_sad_multi_dif_address(vp8_variance_sad8x8x4d
);
193 #ifndef vp8_variance_sad8x16x4d
194 #define vp8_variance_sad8x16x4d vp8_sad8x16x4d_c
196 extern prototype_sad_multi_dif_address(vp8_variance_sad8x16x4d
);
198 #ifndef vp8_variance_sad4x4x4d
199 #define vp8_variance_sad4x4x4d vp8_sad4x4x4d_c
201 extern prototype_sad_multi_dif_address(vp8_variance_sad4x4x4d
);
203 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
205 #ifndef vp8_variance_var4x4
206 #define vp8_variance_var4x4 vp8_variance4x4_c
208 extern prototype_variance(vp8_variance_var4x4
);
210 #ifndef vp8_variance_var8x8
211 #define vp8_variance_var8x8 vp8_variance8x8_c
213 extern prototype_variance(vp8_variance_var8x8
);
215 #ifndef vp8_variance_var8x16
216 #define vp8_variance_var8x16 vp8_variance8x16_c
218 extern prototype_variance(vp8_variance_var8x16
);
220 #ifndef vp8_variance_var16x8
221 #define vp8_variance_var16x8 vp8_variance16x8_c
223 extern prototype_variance(vp8_variance_var16x8
);
225 #ifndef vp8_variance_var16x16
226 #define vp8_variance_var16x16 vp8_variance16x16_c
228 extern prototype_variance(vp8_variance_var16x16
);
230 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
232 #ifndef vp8_variance_subpixvar4x4
233 #define vp8_variance_subpixvar4x4 vp8_sub_pixel_variance4x4_c
235 extern prototype_subpixvariance(vp8_variance_subpixvar4x4
);
237 #ifndef vp8_variance_subpixvar8x8
238 #define vp8_variance_subpixvar8x8 vp8_sub_pixel_variance8x8_c
240 extern prototype_subpixvariance(vp8_variance_subpixvar8x8
);
242 #ifndef vp8_variance_subpixvar8x16
243 #define vp8_variance_subpixvar8x16 vp8_sub_pixel_variance8x16_c
245 extern prototype_subpixvariance(vp8_variance_subpixvar8x16
);
247 #ifndef vp8_variance_subpixvar16x8
248 #define vp8_variance_subpixvar16x8 vp8_sub_pixel_variance16x8_c
250 extern prototype_subpixvariance(vp8_variance_subpixvar16x8
);
252 #ifndef vp8_variance_subpixvar16x16
253 #define vp8_variance_subpixvar16x16 vp8_sub_pixel_variance16x16_c
255 extern prototype_subpixvariance(vp8_variance_subpixvar16x16
);
257 #ifndef vp8_variance_halfpixvar16x16_h
258 #define vp8_variance_halfpixvar16x16_h vp8_variance_halfpixvar16x16_h_c
260 extern prototype_variance(vp8_variance_halfpixvar16x16_h
);
262 #ifndef vp8_variance_halfpixvar16x16_v
263 #define vp8_variance_halfpixvar16x16_v vp8_variance_halfpixvar16x16_v_c
265 extern prototype_variance(vp8_variance_halfpixvar16x16_v
);
267 #ifndef vp8_variance_halfpixvar16x16_hv
268 #define vp8_variance_halfpixvar16x16_hv vp8_variance_halfpixvar16x16_hv_c
270 extern prototype_variance(vp8_variance_halfpixvar16x16_hv
);
272 #ifndef vp8_variance_subpixmse16x16
273 #define vp8_variance_subpixmse16x16 vp8_sub_pixel_mse16x16_c
275 extern prototype_subpixvariance(vp8_variance_subpixmse16x16
);
277 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
279 #ifndef vp8_variance_getmbss
280 #define vp8_variance_getmbss vp8_get_mb_ss_c
282 extern prototype_getmbss(vp8_variance_getmbss
);
284 #ifndef vp8_variance_mse16x16
285 #define vp8_variance_mse16x16 vp8_mse16x16_c
287 extern prototype_variance(vp8_variance_mse16x16
);
289 #ifndef vp8_variance_get16x16prederror
290 #define vp8_variance_get16x16prederror vp8_get16x16pred_error_c
292 extern prototype_sad(vp8_variance_get16x16prederror
);
294 #ifndef vp8_variance_get8x8var
295 #define vp8_variance_get8x8var vp8_get8x8var_c
297 extern prototype_variance2(vp8_variance_get8x8var
);
299 #ifndef vp8_variance_get16x16var
300 #define vp8_variance_get16x16var vp8_get16x16var_c
302 extern prototype_variance2(vp8_variance_get16x16var
);
304 #ifndef vp8_variance_get4x4sse_cs
305 #define vp8_variance_get4x4sse_cs vp8_get4x4sse_cs_c
307 extern prototype_sad(vp8_variance_get4x4sse_cs
);
310 typedef prototype_sad(*vp8_sad_fn_t
);
311 typedef prototype_sad_multi_same_address(*vp8_sad_multi_fn_t
);
312 typedef prototype_sad_multi_same_address_1(*vp8_sad_multi1_fn_t
);
313 typedef prototype_sad_multi_dif_address(*vp8_sad_multi_d_fn_t
);
314 typedef prototype_variance(*vp8_variance_fn_t
);
315 typedef prototype_variance2(*vp8_variance2_fn_t
);
316 typedef prototype_subpixvariance(*vp8_subpixvariance_fn_t
);
317 typedef prototype_getmbss(*vp8_getmbss_fn_t
);
322 vp8_sad_fn_t sad8x16
;
323 vp8_sad_fn_t sad16x8
;
324 vp8_sad_fn_t sad16x16
;
326 vp8_variance_fn_t var4x4
;
327 vp8_variance_fn_t var8x8
;
328 vp8_variance_fn_t var8x16
;
329 vp8_variance_fn_t var16x8
;
330 vp8_variance_fn_t var16x16
;
332 vp8_subpixvariance_fn_t subpixvar4x4
;
333 vp8_subpixvariance_fn_t subpixvar8x8
;
334 vp8_subpixvariance_fn_t subpixvar8x16
;
335 vp8_subpixvariance_fn_t subpixvar16x8
;
336 vp8_subpixvariance_fn_t subpixvar16x16
;
337 vp8_variance_fn_t halfpixvar16x16_h
;
338 vp8_variance_fn_t halfpixvar16x16_v
;
339 vp8_variance_fn_t halfpixvar16x16_hv
;
340 vp8_subpixvariance_fn_t subpixmse16x16
;
342 vp8_getmbss_fn_t getmbss
;
343 vp8_variance_fn_t mse16x16
;
345 vp8_sad_fn_t get16x16prederror
;
346 vp8_variance2_fn_t get8x8var
;
347 vp8_variance2_fn_t get16x16var
;
348 vp8_sad_fn_t get4x4sse_cs
;
350 vp8_sad_multi_fn_t sad16x16x3
;
351 vp8_sad_multi_fn_t sad16x8x3
;
352 vp8_sad_multi_fn_t sad8x16x3
;
353 vp8_sad_multi_fn_t sad8x8x3
;
354 vp8_sad_multi_fn_t sad4x4x3
;
356 vp8_sad_multi1_fn_t sad16x16x8
;
357 vp8_sad_multi1_fn_t sad16x8x8
;
358 vp8_sad_multi1_fn_t sad8x16x8
;
359 vp8_sad_multi1_fn_t sad8x8x8
;
360 vp8_sad_multi1_fn_t sad4x4x8
;
362 vp8_sad_multi_d_fn_t sad16x16x4d
;
363 vp8_sad_multi_d_fn_t sad16x8x4d
;
364 vp8_sad_multi_d_fn_t sad8x16x4d
;
365 vp8_sad_multi_d_fn_t sad8x8x4d
;
366 vp8_sad_multi_d_fn_t sad4x4x4d
;
368 } vp8_variance_rtcd_vtable_t
;
373 vp8_variance_fn_t vf
;
374 vp8_subpixvariance_fn_t svf
;
375 vp8_variance_fn_t svf_halfpix_h
;
376 vp8_variance_fn_t svf_halfpix_v
;
377 vp8_variance_fn_t svf_halfpix_hv
;
378 vp8_sad_multi_fn_t sdx3f
;
379 vp8_sad_multi1_fn_t sdx8f
;
380 vp8_sad_multi_d_fn_t sdx4df
;
381 } vp8_variance_fn_ptr_t
;
383 #if CONFIG_RUNTIME_CPU_DETECT
384 #define VARIANCE_INVOKE(ctx,fn) (ctx)->fn
386 #define VARIANCE_INVOKE(ctx,fn) vp8_variance_##fn