vp9_variance.h 3.73 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 15 16
#include "vpx/vpx_integer.h"

typedef unsigned int(*vp9_sad_fn_t)(const uint8_t *src_ptr,
17
                                    int source_stride,
18
                                    const uint8_t *ref_ptr,
19 20 21
                                    int ref_stride,
                                    unsigned int max_sad);

22
typedef void (*vp9_copy32xn_fn_t)(const uint8_t *src_ptr,
23
                                  int source_stride,
24
                                  const uint8_t *ref_ptr,
25 26 27
                                  int ref_stride,
                                  int n);

28
typedef void (*vp9_sad_multi_fn_t)(const uint8_t *src_ptr,
29
                                   int source_stride,
30
                                   const uint8_t *ref_ptr,
31 32 33
                                   int  ref_stride,
                                   unsigned int *sad_array);

34
typedef void (*vp9_sad_multi1_fn_t)(const uint8_t *src_ptr,
35
                                    int source_stride,
36
                                    const uint8_t *ref_ptr,
37 38 39
                                    int  ref_stride,
                                    unsigned short *sad_array);

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

45
typedef unsigned int (*vp9_variance_fn_t)(const uint8_t *src_ptr,
46
                                          int source_stride,
47
                                          const uint8_t *ref_ptr,
48 49 50
                                          int ref_stride,
                                          unsigned int *sse);

51
typedef unsigned int (*vp9_subpixvariance_fn_t)(const uint8_t *src_ptr,
52 53 54
                                                int source_stride,
                                                int xoffset,
                                                int yoffset,
55
                                                const uint8_t *ref_ptr,
56 57 58
                                                int Refstride,
                                                unsigned int *sse);

59
typedef void (*vp9_ssimpf_fn_t)(uint8_t *s, int sp, uint8_t *r,
60 61 62 63 64
                                int rp, unsigned long *sum_s,
                                unsigned long *sum_r, unsigned long *sum_sq_s,
                                unsigned long *sum_sq_r,
                                unsigned long *sum_sxr);

65
typedef unsigned int (*vp9_getmbss_fn_t)(const short *);
66

67
typedef unsigned int (*vp9_get16x16prederror_fn_t)(const uint8_t *src_ptr,
68
                                                   int source_stride,
69
                                                   const uint8_t *ref_ptr,
70 71
                                                   int  ref_stride);

72
typedef struct vp9_variance_vtable {
73 74 75 76 77 78 79 80 81
    vp9_sad_fn_t            sdf;
    vp9_variance_fn_t       vf;
    vp9_subpixvariance_fn_t svf;
    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;
    vp9_sad_multi1_fn_t     sdx8f;
    vp9_sad_multi_d_fn_t    sdx4df;
82
    vp9_copy32xn_fn_t       copymem;
83
} vp9_variance_fn_ptr_t;
John Koleszar's avatar
John Koleszar committed
84

85
#endif  // VP9_ENCODER_VP9_VARIANCE_H_