2
0

variance.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. #ifndef VPX_VPX_DSP_VARIANCE_H_
  11. #define VPX_VPX_DSP_VARIANCE_H_
  12. #include "./vpx_config.h"
  13. #include "vpx/vpx_integer.h"
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. #define FILTER_BITS 7
  18. #define FILTER_WEIGHT 128
  19. typedef unsigned int (*vpx_sad_fn_t)(const uint8_t *src_ptr, int src_stride,
  20. const uint8_t *ref_ptr, int ref_stride);
  21. typedef unsigned int (*vpx_sad_avg_fn_t)(const uint8_t *src_ptr, int src_stride,
  22. const uint8_t *ref_ptr, int ref_stride,
  23. const uint8_t *second_pred);
  24. typedef void (*vp8_copy32xn_fn_t)(const uint8_t *src_ptr, int src_stride,
  25. uint8_t *ref_ptr, int ref_stride, int n);
  26. typedef void (*vpx_sad_multi_fn_t)(const uint8_t *src_ptr, int src_stride,
  27. const uint8_t *ref_ptr, int ref_stride,
  28. unsigned int *sad_array);
  29. typedef void (*vpx_sad_multi_d_fn_t)(const uint8_t *src_ptr, int src_stride,
  30. const uint8_t *const b_array[],
  31. int ref_stride, unsigned int *sad_array);
  32. typedef unsigned int (*vpx_variance_fn_t)(const uint8_t *src_ptr,
  33. int src_stride,
  34. const uint8_t *ref_ptr,
  35. int ref_stride, unsigned int *sse);
  36. typedef unsigned int (*vpx_subpixvariance_fn_t)(
  37. const uint8_t *src_ptr, int src_stride, int x_offset, int y_offset,
  38. const uint8_t *ref_ptr, int ref_stride, unsigned int *sse);
  39. typedef unsigned int (*vpx_subp_avg_variance_fn_t)(
  40. const uint8_t *src_ptr, int src_stride, int x_offset, int y_offset,
  41. const uint8_t *ref_ptr, int ref_stride, unsigned int *sse,
  42. const uint8_t *second_pred);
  43. #if CONFIG_VP8
  44. typedef struct variance_vtable {
  45. vpx_sad_fn_t sdf;
  46. vpx_variance_fn_t vf;
  47. vpx_subpixvariance_fn_t svf;
  48. vpx_sad_multi_fn_t sdx3f;
  49. vpx_sad_multi_fn_t sdx8f;
  50. vpx_sad_multi_d_fn_t sdx4df;
  51. #if ARCH_X86 || ARCH_X86_64
  52. vp8_copy32xn_fn_t copymem;
  53. #endif
  54. } vp8_variance_fn_ptr_t;
  55. #endif // CONFIG_VP8
  56. #if CONFIG_VP9
  57. typedef struct vp9_variance_vtable {
  58. vpx_sad_fn_t sdf;
  59. vpx_sad_avg_fn_t sdaf;
  60. vpx_variance_fn_t vf;
  61. vpx_subpixvariance_fn_t svf;
  62. vpx_subp_avg_variance_fn_t svaf;
  63. vpx_sad_multi_d_fn_t sdx4df;
  64. } vp9_variance_fn_ptr_t;
  65. #endif // CONFIG_VP9
  66. #ifdef __cplusplus
  67. } // extern "C"
  68. #endif
  69. #endif // VPX_VPX_DSP_VARIANCE_H_