variance.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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_DSP_VARIANCE_H_
  11. #define 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 *a, int a_stride,
  20. const uint8_t *b_ptr, int b_stride);
  21. typedef unsigned int (*vpx_sad_avg_fn_t)(const uint8_t *a_ptr, int a_stride,
  22. const uint8_t *b_ptr, int b_stride,
  23. const uint8_t *second_pred);
  24. typedef void (*vp8_copy32xn_fn_t)(const uint8_t *a, int a_stride, uint8_t *b,
  25. int b_stride, int n);
  26. typedef void (*vpx_sad_multi_fn_t)(const uint8_t *a, int a_stride,
  27. const uint8_t *b, int b_stride,
  28. unsigned int *sad_array);
  29. typedef void (*vpx_sad_multi_d_fn_t)(const uint8_t *a, int a_stride,
  30. const uint8_t *const b_array[],
  31. int b_stride, unsigned int *sad_array);
  32. typedef unsigned int (*vpx_variance_fn_t)(const uint8_t *a, int a_stride,
  33. const uint8_t *b, int b_stride,
  34. unsigned int *sse);
  35. typedef unsigned int (*vpx_subpixvariance_fn_t)(const uint8_t *a, int a_stride,
  36. int xoffset, int yoffset,
  37. const uint8_t *b, int b_stride,
  38. unsigned int *sse);
  39. typedef unsigned int (*vpx_subp_avg_variance_fn_t)(
  40. const uint8_t *a_ptr, int a_stride, int xoffset, int yoffset,
  41. const uint8_t *b_ptr, int b_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_DSP_VARIANCE_H_