Deprecate build_inter_predictors_single_buf()
Unify the function use case. Replace it with
av1_build_inter_predictor().
Change-Id: Ib1c52dc6e9291e007ecb333ed57f06a8970c7bb6
diff --git a/av1/common/reconinter.c b/av1/common/reconinter.c
index 12ae289..90a87ec 100644
--- a/av1/common/reconinter.c
+++ b/av1/common/reconinter.c
@@ -88,7 +88,7 @@
}
void av1_init_warp_params(InterPredParams *inter_pred_params,
- struct buf_2d *ref_buf,
+ const struct buf_2d *ref_buf,
const WarpTypesAllowed *warp_types, int ref,
const MACROBLOCKD *xd, const MB_MODE_INFO *mi) {
if (inter_pred_params->block_height < 8 || inter_pred_params->block_width < 8)
diff --git a/av1/common/reconinter.h b/av1/common/reconinter.h
index e85568f..2332c81 100644
--- a/av1/common/reconinter.h
+++ b/av1/common/reconinter.h
@@ -125,7 +125,7 @@
int_interpfilters interp_filters);
void av1_init_warp_params(InterPredParams *inter_pred_params,
- struct buf_2d *ref_buf,
+ const struct buf_2d *ref_buf,
const WarpTypesAllowed *warp_types, int ref,
const MACROBLOCKD *xd, const MB_MODE_INFO *mi);
diff --git a/av1/encoder/reconinter_enc.c b/av1/encoder/reconinter_enc.c
index b7a8300..e987ff7 100644
--- a/av1/encoder/reconinter_enc.c
+++ b/av1/encoder/reconinter_enc.c
@@ -453,60 +453,43 @@
dst_buf2, dst_stride2);
}
-// Builds the inter-predictor for the single ref case
-// for use in the encoder to search the wedges efficiently.
-static void build_inter_predictors_single_buf(MACROBLOCKD *xd, int plane,
- int bw, int bh, int mi_x,
- int mi_y, int ref,
- uint8_t *const ext_dst,
- int ext_dst_stride) {
- struct macroblockd_plane *const pd = &xd->plane[plane];
- const MB_MODE_INFO *mi = xd->mi[0];
-
- const struct scale_factors *const sf = xd->block_ref_scale_factors[ref];
- struct buf_2d *const pre_buf = &pd->pre[ref];
- uint8_t *const dst = get_buf_by_bd(xd, ext_dst);
- const MV mv = mi->mv[ref].as_mv;
-
- InterPredParams inter_pred_params;
- inter_pred_params.conv_params = get_conv_params(0, plane, xd->bd);
- WarpTypesAllowed warp_types;
- const WarpedMotionParams *const wm = &xd->global_motion[mi->ref_frame[ref]];
- warp_types.global_warp_allowed = is_global_mv_block(mi, wm->wmtype);
- warp_types.local_warp_allowed = mi->motion_mode == WARPED_CAUSAL;
- const int pre_x = (mi_x) >> pd->subsampling_x;
- const int pre_y = (mi_y) >> pd->subsampling_y;
- uint8_t *pre;
- SubpelParams subpel_params;
- calc_subpel_params(xd, sf, mv, plane, pre_x, pre_y, 0, 0, pre_buf, &pre,
- &subpel_params, bw, bh);
-
- av1_init_inter_params(&inter_pred_params, bw, bh, pre_y, pre_x,
- pd->subsampling_x, pd->subsampling_y, xd->bd,
- is_cur_buf_hbd(xd), mi->use_intrabc, sf,
- mi->interp_filters);
-
- av1_init_warp_params(&inter_pred_params, &pd->pre[ref], &warp_types, ref, xd,
- mi);
-
- av1_make_inter_predictor(pre, pre_buf->stride, dst, ext_dst_stride,
- &inter_pred_params, &subpel_params);
-}
-
void av1_build_inter_predictors_for_planes_single_buf(
MACROBLOCKD *xd, BLOCK_SIZE bsize, int plane_from, int plane_to, int mi_row,
int mi_col, int ref, uint8_t *ext_dst[3], int ext_dst_stride[3]) {
assert(bsize < BLOCK_SIZES_ALL);
+ const MB_MODE_INFO *mi = xd->mi[0];
int plane;
const int mi_x = mi_col * MI_SIZE;
const int mi_y = mi_row * MI_SIZE;
+ WarpTypesAllowed warp_types;
+ const WarpedMotionParams *const wm = &xd->global_motion[mi->ref_frame[ref]];
+ warp_types.global_warp_allowed = is_global_mv_block(mi, wm->wmtype);
+ warp_types.local_warp_allowed = mi->motion_mode == WARPED_CAUSAL;
+
for (plane = plane_from; plane <= plane_to; ++plane) {
- const BLOCK_SIZE plane_bsize = get_plane_block_size(
- bsize, xd->plane[plane].subsampling_x, xd->plane[plane].subsampling_y);
+ const struct macroblockd_plane *pd = &xd->plane[plane];
+ const BLOCK_SIZE plane_bsize =
+ get_plane_block_size(bsize, pd->subsampling_x, pd->subsampling_y);
const int bw = block_size_wide[plane_bsize];
const int bh = block_size_high[plane_bsize];
- build_inter_predictors_single_buf(xd, plane, bw, bh, mi_x, mi_y, ref,
- ext_dst[plane], ext_dst_stride[plane]);
+
+ InterPredParams inter_pred_params;
+
+ av1_init_inter_params(&inter_pred_params, bw, bh, mi_y, mi_x,
+ pd->subsampling_x, pd->subsampling_y, xd->bd,
+ is_cur_buf_hbd(xd), 0,
+ xd->block_ref_scale_factors[ref], mi->interp_filters);
+ inter_pred_params.conv_params = get_conv_params(0, plane, xd->bd);
+ av1_init_warp_params(&inter_pred_params, &pd->pre[ref], &warp_types, ref,
+ xd, mi);
+
+ const struct buf_2d *const pre_buf = &pd->pre[ref];
+ uint8_t *const dst = get_buf_by_bd(xd, ext_dst[plane]);
+ const MV mv = mi->mv[ref].as_mv;
+
+ av1_build_inter_predictor(pre_buf->buf, pre_buf->stride, dst,
+ ext_dst_stride[plane], &mv, mi_x, mi_y,
+ &inter_pred_params);
}
}