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 VP8_COMMON_VARIANCE_H_
13#define VP8_COMMON_VARIANCE_H_
14
15#include "vpx_config.h"
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21typedef unsigned int(*vp8_sad_fn_t)(
22    const unsigned char *src_ptr,
23    int source_stride,
24    const unsigned char *ref_ptr,
25    int ref_stride,
26    unsigned int max_sad);
27
28typedef void (*vp8_copy32xn_fn_t)(
29    const unsigned char *src_ptr,
30    int source_stride,
31    const unsigned char *ref_ptr,
32    int ref_stride,
33    int n);
34
35typedef void (*vp8_sad_multi_fn_t)(
36    const unsigned char *src_ptr,
37    int source_stride,
38    const unsigned char *ref_ptr,
39    int  ref_stride,
40    unsigned int *sad_array);
41
42typedef void (*vp8_sad_multi1_fn_t)
43    (
44     const unsigned char *src_ptr,
45     int source_stride,
46     const unsigned char *ref_ptr,
47     int  ref_stride,
48     unsigned short *sad_array
49    );
50
51typedef void (*vp8_sad_multi_d_fn_t)
52    (
53     const unsigned char *src_ptr,
54     int source_stride,
55     const unsigned char * const ref_ptr[],
56     int  ref_stride,
57     unsigned int *sad_array
58    );
59
60typedef unsigned int (*vp8_variance_fn_t)
61    (
62     const unsigned char *src_ptr,
63     int source_stride,
64     const unsigned char *ref_ptr,
65     int  ref_stride,
66     unsigned int *sse
67    );
68
69typedef unsigned int (*vp8_subpixvariance_fn_t)
70    (
71      const unsigned char  *src_ptr,
72      int  source_stride,
73      int  xoffset,
74      int  yoffset,
75      const unsigned char *ref_ptr,
76      int Refstride,
77      unsigned int *sse
78    );
79
80typedef void (*vp8_ssimpf_fn_t)
81      (
82        unsigned char *s,
83        int sp,
84        unsigned char *r,
85        int rp,
86        unsigned long *sum_s,
87        unsigned long *sum_r,
88        unsigned long *sum_sq_s,
89        unsigned long *sum_sq_r,
90        unsigned long *sum_sxr
91      );
92
93typedef unsigned int (*vp8_getmbss_fn_t)(const short *);
94
95typedef unsigned int (*vp8_get16x16prederror_fn_t)
96    (
97     const unsigned char *src_ptr,
98     int source_stride,
99     const unsigned char *ref_ptr,
100     int  ref_stride
101    );
102
103typedef struct variance_vtable
104{
105    vp8_sad_fn_t            sdf;
106    vp8_variance_fn_t       vf;
107    vp8_subpixvariance_fn_t svf;
108    vp8_variance_fn_t       svf_halfpix_h;
109    vp8_variance_fn_t       svf_halfpix_v;
110    vp8_variance_fn_t       svf_halfpix_hv;
111    vp8_sad_multi_fn_t      sdx3f;
112    vp8_sad_multi1_fn_t     sdx8f;
113    vp8_sad_multi_d_fn_t    sdx4df;
114#if ARCH_X86 || ARCH_X86_64
115    vp8_copy32xn_fn_t       copymem;
116#endif
117} vp8_variance_fn_ptr_t;
118
119#ifdef __cplusplus
120}  // extern "C"
121#endif
122
123#endif  // VP8_COMMON_VARIANCE_H_
124