vp9_variance.h 4.23 KB
Newer Older
John Koleszar's avatar
John Koleszar committed
1
/*
2
 *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
John Koleszar's avatar
John Koleszar committed
3
 *
4
 *  Use of this source code is governed by a BSD-style license
5
6
 *  that can be found in the LICENSE file in the root of the source
 *  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.
John Koleszar's avatar
John Koleszar committed
9
10
 */

11
12
#ifndef VP9_ENCODER_VP9_VARIANCE_H_
#define VP9_ENCODER_VP9_VARIANCE_H_
John Koleszar's avatar
John Koleszar committed
13

14
#include "vpx/vpx_integer.h"
15
16
17
18

#ifdef __cplusplus
extern "C" {
#endif
19

Dmitry Kovalev's avatar
Dmitry Kovalev committed
20
21
22
23
void variance(const uint8_t *a, int a_stride,
              const uint8_t *b, int b_stride,
              int  w, int  h,
              unsigned int *sse, int *sum);
24

25
typedef unsigned int(*vp9_sad_fn_t)(const uint8_t *src_ptr,
26
                                    int source_stride,
27
                                    const uint8_t *ref_ptr,
28
29
30
                                    int ref_stride,
                                    unsigned int max_sad);

31
32
33
34
35
36
37
typedef unsigned int(*vp9_sad_avg_fn_t)(const uint8_t *src_ptr,
                                        int source_stride,
                                        const uint8_t *ref_ptr,
                                        int ref_stride,
                                        const uint8_t *second_pred,
                                        unsigned int max_sad);

38
typedef void (*vp9_sad_multi_fn_t)(const uint8_t *src_ptr,
39
                                   int source_stride,
40
                                   const uint8_t *ref_ptr,
41
42
43
                                   int  ref_stride,
                                   unsigned int *sad_array);

44
typedef void (*vp9_sad_multi_d_fn_t)(const uint8_t *src_ptr,
45
                                     int source_stride,
46
                                     const uint8_t* const ref_ptr[],
47
48
                                     int  ref_stride, unsigned int *sad_array);

49
typedef unsigned int (*vp9_variance_fn_t)(const uint8_t *src_ptr,
50
                                          int source_stride,
51
                                          const uint8_t *ref_ptr,
52
53
54
                                          int ref_stride,
                                          unsigned int *sse);

55
typedef unsigned int (*vp9_subpixvariance_fn_t)(const uint8_t *src_ptr,
56
57
58
                                                int source_stride,
                                                int xoffset,
                                                int yoffset,
59
                                                const uint8_t *ref_ptr,
60
61
62
                                                int Refstride,
                                                unsigned int *sse);

63
64
65
66
67
68
69
70
71
typedef unsigned int (*vp9_subp_avg_variance_fn_t)(const uint8_t *src_ptr,
                                                   int source_stride,
                                                   int xoffset,
                                                   int yoffset,
                                                   const uint8_t *ref_ptr,
                                                   int Refstride,
                                                   unsigned int *sse,
                                                   const uint8_t *second_pred);

72
typedef unsigned int (*vp9_getmbss_fn_t)(const short *);
73

74
typedef unsigned int (*vp9_get16x16prederror_fn_t)(const uint8_t *src_ptr,
75
                                                   int source_stride,
76
                                                   const uint8_t *ref_ptr,
77
78
                                                   int  ref_stride);

79
typedef struct vp9_variance_vtable {
80
81
82
83
84
85
86
87
88
  vp9_sad_fn_t               sdf;
  vp9_sad_avg_fn_t           sdaf;
  vp9_variance_fn_t          vf;
  vp9_subpixvariance_fn_t    svf;
  vp9_subp_avg_variance_fn_t svaf;
  vp9_variance_fn_t          svf_halfpix_h;
  vp9_variance_fn_t          svf_halfpix_v;
  vp9_variance_fn_t          svf_halfpix_hv;
  vp9_sad_multi_fn_t         sdx3f;
Dmitry Kovalev's avatar
Dmitry Kovalev committed
89
  vp9_sad_multi_fn_t         sdx8f;
90
  vp9_sad_multi_d_fn_t       sdx4df;
91
} vp9_variance_fn_ptr_t;
John Koleszar's avatar
John Koleszar committed
92

93
94
95
void vp9_comp_avg_pred(uint8_t *comp_pred, const uint8_t *pred, int width,
                       int height, const uint8_t *ref, int ref_stride);

96
97
98
99
#ifdef __cplusplus
}  // extern "C"
#endif

100
#endif  // VP9_ENCODER_VP9_VARIANCE_H_