1 /* 2 * Copyright (c) 2015 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 VPX_DSP_VARIANCE_H_ 12 #define VPX_DSP_VARIANCE_H_ 13 14 #include "./vpx_config.h" 15 16 #include "vpx/vpx_integer.h" 17 18 #ifdef __cplusplus 19 extern "C" { 20 #endif 21 22 #define FILTER_BITS 7 23 #define FILTER_WEIGHT 128 24 25 typedef unsigned int (*vpx_sad_fn_t)(const uint8_t *a, int a_stride, 26 const uint8_t *b_ptr, int b_stride); 27 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); 31 32 typedef void (*vp8_copy32xn_fn_t)(const uint8_t *a, int a_stride, uint8_t *b, 33 int b_stride, int n); 34 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); 38 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); 42 43 typedef unsigned int (*vpx_variance_fn_t)(const uint8_t *a, int a_stride, 44 const uint8_t *b, int b_stride, 45 unsigned int *sse); 46 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, 50 unsigned int *sse); 51 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); 56 #if CONFIG_VP8 57 typedef struct variance_vtable { 58 vpx_sad_fn_t sdf; 59 vpx_variance_fn_t vf; 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; 66 #endif 67 } vp8_variance_fn_ptr_t; 68 #endif // CONFIG_VP8 69 70 #if CONFIG_VP9 71 typedef struct vp9_variance_vtable { 72 vpx_sad_fn_t sdf; 73 vpx_sad_avg_fn_t sdaf; 74 vpx_variance_fn_t vf; 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; 79 #endif // CONFIG_VP9 80 81 #ifdef __cplusplus 82 } // extern "C" 83 #endif 84 85 #endif // VPX_DSP_VARIANCE_H_ 86