2
0

vp9_reconinter.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. #ifndef VP9_COMMON_VP9_RECONINTER_H_
  11. #define VP9_COMMON_VP9_RECONINTER_H_
  12. #include "vp9/common/vp9_filter.h"
  13. #include "vp9/common/vp9_onyxc_int.h"
  14. #include "vpx/vpx_integer.h"
  15. #include "vpx_dsp/vpx_filter.h"
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. static INLINE void inter_predictor(const uint8_t *src, int src_stride,
  20. uint8_t *dst, int dst_stride,
  21. const int subpel_x, const int subpel_y,
  22. const struct scale_factors *sf, int w, int h,
  23. int ref, const InterpKernel *kernel, int xs,
  24. int ys) {
  25. sf->predict[subpel_x != 0][subpel_y != 0][ref](src, src_stride, dst,
  26. dst_stride, kernel, subpel_x,
  27. xs, subpel_y, ys, w, h);
  28. }
  29. #if CONFIG_VP9_HIGHBITDEPTH
  30. static INLINE void highbd_inter_predictor(
  31. const uint16_t *src, int src_stride, uint16_t *dst, int dst_stride,
  32. const int subpel_x, const int subpel_y, const struct scale_factors *sf,
  33. int w, int h, int ref, const InterpKernel *kernel, int xs, int ys, int bd) {
  34. sf->highbd_predict[subpel_x != 0][subpel_y != 0][ref](
  35. src, src_stride, dst, dst_stride, kernel, subpel_x, xs, subpel_y, ys, w,
  36. h, bd);
  37. }
  38. #endif // CONFIG_VP9_HIGHBITDEPTH
  39. MV average_split_mvs(const struct macroblockd_plane *pd, const MODE_INFO *mi,
  40. int ref, int block);
  41. MV clamp_mv_to_umv_border_sb(const MACROBLOCKD *xd, const MV *src_mv, int bw,
  42. int bh, int ss_x, int ss_y);
  43. void vp9_build_inter_predictors_sby(MACROBLOCKD *xd, int mi_row, int mi_col,
  44. BLOCK_SIZE bsize);
  45. void vp9_build_inter_predictors_sbp(MACROBLOCKD *xd, int mi_row, int mi_col,
  46. BLOCK_SIZE bsize, int plane);
  47. void vp9_build_inter_predictors_sbuv(MACROBLOCKD *xd, int mi_row, int mi_col,
  48. BLOCK_SIZE bsize);
  49. void vp9_build_inter_predictors_sb(MACROBLOCKD *xd, int mi_row, int mi_col,
  50. BLOCK_SIZE bsize);
  51. void vp9_build_inter_predictor(const uint8_t *src, int src_stride, uint8_t *dst,
  52. int dst_stride, const MV *mv_q3,
  53. const struct scale_factors *sf, int w, int h,
  54. int do_avg, const InterpKernel *kernel,
  55. enum mv_precision precision, int x, int y);
  56. #if CONFIG_VP9_HIGHBITDEPTH
  57. void vp9_highbd_build_inter_predictor(
  58. const uint16_t *src, int src_stride, uint16_t *dst, int dst_stride,
  59. const MV *mv_q3, const struct scale_factors *sf, int w, int h, int do_avg,
  60. const InterpKernel *kernel, enum mv_precision precision, int x, int y,
  61. int bd);
  62. #endif
  63. static INLINE int scaled_buffer_offset(int x_offset, int y_offset, int stride,
  64. const struct scale_factors *sf) {
  65. const int x = sf ? sf->scale_value_x(x_offset, sf) : x_offset;
  66. const int y = sf ? sf->scale_value_y(y_offset, sf) : y_offset;
  67. return y * stride + x;
  68. }
  69. static INLINE void setup_pred_plane(struct buf_2d *dst, uint8_t *src,
  70. int stride, int mi_row, int mi_col,
  71. const struct scale_factors *scale,
  72. int subsampling_x, int subsampling_y) {
  73. const int x = (MI_SIZE * mi_col) >> subsampling_x;
  74. const int y = (MI_SIZE * mi_row) >> subsampling_y;
  75. dst->buf = src + scaled_buffer_offset(x, y, stride, scale);
  76. dst->stride = stride;
  77. }
  78. void vp9_setup_dst_planes(struct macroblockd_plane planes[MAX_MB_PLANE],
  79. const YV12_BUFFER_CONFIG *src, int mi_row,
  80. int mi_col);
  81. void vp9_setup_pre_planes(MACROBLOCKD *xd, int idx,
  82. const YV12_BUFFER_CONFIG *src, int mi_row, int mi_col,
  83. const struct scale_factors *sf);
  84. #ifdef __cplusplus
  85. } // extern "C"
  86. #endif
  87. #endif // VP9_COMMON_VP9_RECONINTER_H_