Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / libvpx / source / libvpx / vp9 / encoder / vp9_variance.h
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 #ifndef VP9_ENCODER_VP9_VARIANCE_H_
12 #define VP9_ENCODER_VP9_VARIANCE_H_
13
14 #include "vpx/vpx_integer.h"
15
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19
20 void variance(const uint8_t *a, int a_stride,
21               const uint8_t *b, int b_stride,
22               int  w, int  h,
23               unsigned int *sse, int *sum);
24
25 #if CONFIG_VP9_HIGHBITDEPTH
26 void highbd_variance(const uint8_t *a8, int a_stride,
27                      const uint8_t *b8, int b_stride,
28                      int w, int h,
29                      unsigned int *sse, int *sum);
30
31 void highbd_10_variance(const uint8_t *a8, int a_stride,
32                         const uint8_t *b8, int b_stride,
33                         int w, int h,
34                         unsigned int *sse, int *sum);
35
36 void highbd_12_variance(const uint8_t *a8, int a_stride,
37                         const uint8_t *b8, int b_stride,
38                         int w, int h,
39                         unsigned int *sse, int *sum);
40 #endif
41
42 typedef unsigned int(*vp9_sad_fn_t)(const uint8_t *src_ptr,
43                                     int source_stride,
44                                     const uint8_t *ref_ptr,
45                                     int ref_stride);
46
47 typedef unsigned int(*vp9_sad_avg_fn_t)(const uint8_t *src_ptr,
48                                         int source_stride,
49                                         const uint8_t *ref_ptr,
50                                         int ref_stride,
51                                         const uint8_t *second_pred);
52
53 typedef void (*vp9_sad_multi_fn_t)(const uint8_t *src_ptr,
54                                    int source_stride,
55                                    const uint8_t *ref_ptr,
56                                    int  ref_stride,
57                                    unsigned int *sad_array);
58
59 typedef void (*vp9_sad_multi_d_fn_t)(const uint8_t *src_ptr,
60                                      int source_stride,
61                                      const uint8_t* const ref_ptr[],
62                                      int  ref_stride, unsigned int *sad_array);
63
64 typedef unsigned int (*vp9_variance_fn_t)(const uint8_t *src_ptr,
65                                           int source_stride,
66                                           const uint8_t *ref_ptr,
67                                           int ref_stride,
68                                           unsigned int *sse);
69
70 typedef unsigned int (*vp9_subpixvariance_fn_t)(const uint8_t *src_ptr,
71                                                 int source_stride,
72                                                 int xoffset,
73                                                 int yoffset,
74                                                 const uint8_t *ref_ptr,
75                                                 int Refstride,
76                                                 unsigned int *sse);
77
78 typedef unsigned int (*vp9_subp_avg_variance_fn_t)(const uint8_t *src_ptr,
79                                                    int source_stride,
80                                                    int xoffset,
81                                                    int yoffset,
82                                                    const uint8_t *ref_ptr,
83                                                    int Refstride,
84                                                    unsigned int *sse,
85                                                    const uint8_t *second_pred);
86
87 typedef struct vp9_variance_vtable {
88   vp9_sad_fn_t               sdf;
89   vp9_sad_avg_fn_t           sdaf;
90   vp9_variance_fn_t          vf;
91   vp9_subpixvariance_fn_t    svf;
92   vp9_subp_avg_variance_fn_t svaf;
93   vp9_sad_multi_fn_t         sdx3f;
94   vp9_sad_multi_fn_t         sdx8f;
95   vp9_sad_multi_d_fn_t       sdx4df;
96 } vp9_variance_fn_ptr_t;
97
98 void vp9_comp_avg_pred(uint8_t *comp_pred, const uint8_t *pred, int width,
99                        int height, const uint8_t *ref, int ref_stride);
100
101 #if CONFIG_VP9_HIGHBITDEPTH
102 void vp9_highbd_comp_avg_pred(uint16_t *comp_pred, const uint8_t *pred,
103                               int width, int height,
104                               const uint8_t *ref, int ref_stride);
105 #endif
106
107 #ifdef __cplusplus
108 }  // extern "C"
109 #endif
110
111 #endif  // VP9_ENCODER_VP9_VARIANCE_H_