2 * Copyright (c) 2015 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.
11 #ifndef VPX_DSP_VARIANCE_H_
12 #define VPX_DSP_VARIANCE_H_
14 #include "./vpx_config.h"
16 #include "vpx/vpx_integer.h"
23 #define FILTER_WEIGHT 128
25 typedef unsigned int (*vpx_sad_fn_t)(const uint8_t *a, int a_stride,
26 const uint8_t *b_ptr, int b_stride);
28 typedef unsigned int (*vpx_sad_avg_fn_t)(const uint8_t *a_ptr, int a_stride,
29 const uint8_t *b_ptr, int b_stride,
30 const uint8_t *second_pred);
32 typedef void (*vp8_copy32xn_fn_t)(const uint8_t *a, int a_stride, uint8_t *b,
35 typedef void (*vpx_sad_multi_fn_t)(const uint8_t *a, int a_stride,
36 const uint8_t *b, int b_stride,
37 unsigned int *sad_array);
39 typedef void (*vpx_sad_multi_d_fn_t)(const uint8_t *a, int a_stride,
40 const uint8_t *const b_array[],
41 int b_stride, unsigned int *sad_array);
43 typedef unsigned int (*vpx_variance_fn_t)(const uint8_t *a, int a_stride,
44 const uint8_t *b, int b_stride,
47 typedef unsigned int (*vpx_subpixvariance_fn_t)(const uint8_t *a, int a_stride,
48 int xoffset, int yoffset,
49 const uint8_t *b, int b_stride,
52 typedef unsigned int (*vpx_subp_avg_variance_fn_t)(
53 const uint8_t *a_ptr, int a_stride, int xoffset, int yoffset,
54 const uint8_t *b_ptr, int b_stride, unsigned int *sse,
55 const uint8_t *second_pred);
57 typedef struct variance_vtable {
60 vpx_subpixvariance_fn_t svf;
61 vpx_sad_multi_fn_t sdx3f;
62 vpx_sad_multi_fn_t sdx8f;
63 vpx_sad_multi_d_fn_t sdx4df;
64 #if ARCH_X86 || ARCH_X86_64
65 vp8_copy32xn_fn_t copymem;
67 } vp8_variance_fn_ptr_t;
71 typedef struct vp9_variance_vtable {
73 vpx_sad_avg_fn_t sdaf;
75 vpx_subpixvariance_fn_t svf;
76 vpx_subp_avg_variance_fn_t svaf;
77 vpx_sad_multi_d_fn_t sdx4df;
78 } vp9_variance_fn_ptr_t;
85 #endif // VPX_DSP_VARIANCE_H_