Commit 74a77546 authored by Yue Chen's avatar Yue Chen
Browse files

Fix recon mismatches in GLOBAL_MOTION+MOTION_VAR

The offset of neighbors is communicated to av1_make_inter_predictors
so as to use the correct mi in gm warping

Change-Id: I471bbdf2112ed678969492b11730f15d9527eb7e
parent 4e18d403
...@@ -679,6 +679,9 @@ void av1_make_masked_inter_predictor(const uint8_t *pre, int pre_stride, ...@@ -679,6 +679,9 @@ void av1_make_masked_inter_predictor(const uint8_t *pre, int pre_stride,
subpel_y, sf, w, h, &conv_params, tmp_ipf, subpel_y, sf, w, h, &conv_params, tmp_ipf,
#if CONFIG_GLOBAL_MOTION #if CONFIG_GLOBAL_MOTION
is_global, p_col, p_row, plane, ref, is_global, p_col, p_row, plane, ref,
#if CONFIG_MOTION_VAR
0, 0,
#endif
#endif // CONFIG_GLOBAL_MOTION #endif // CONFIG_GLOBAL_MOTION
xs, ys, xd); xs, ys, xd);
#if CONFIG_COMPOUND_SEGMENT #if CONFIG_COMPOUND_SEGMENT
...@@ -719,6 +722,9 @@ void av1_make_masked_inter_predictor(const uint8_t *pre, int pre_stride, ...@@ -719,6 +722,9 @@ void av1_make_masked_inter_predictor(const uint8_t *pre, int pre_stride,
subpel_y, sf, w, h, &conv_params, tmp_ipf, subpel_y, sf, w, h, &conv_params, tmp_ipf,
#if CONFIG_GLOBAL_MOTION #if CONFIG_GLOBAL_MOTION
is_global, p_col, p_row, plane, ref, is_global, p_col, p_row, plane, ref,
#if CONFIG_MOTION_VAR
0, 0,
#endif
#endif // CONFIG_GLOBAL_MOTION #endif // CONFIG_GLOBAL_MOTION
xs, ys, xd); xs, ys, xd);
#if CONFIG_COMPOUND_SEGMENT #if CONFIG_COMPOUND_SEGMENT
...@@ -775,6 +781,9 @@ void av1_highbd_build_inter_predictor(const uint8_t *src, int src_stride, ...@@ -775,6 +781,9 @@ void av1_highbd_build_inter_predictor(const uint8_t *src, int src_stride,
sf, w, h, &conv_params, interp_filter, sf, w, h, &conv_params, interp_filter,
#if CONFIG_GLOBAL_MOTION #if CONFIG_GLOBAL_MOTION
is_global, p_col, p_row, plane, ref, is_global, p_col, p_row, plane, ref,
#if CONFIG_MOTION_VAR
0, 0,
#endif
#endif // CONFIG_GLOBAL_MOTION #endif // CONFIG_GLOBAL_MOTION
sf->x_step_q4, sf->y_step_q4, xd); sf->x_step_q4, sf->y_step_q4, xd);
} }
...@@ -808,6 +817,9 @@ void av1_build_inter_predictor(const uint8_t *src, int src_stride, uint8_t *dst, ...@@ -808,6 +817,9 @@ void av1_build_inter_predictor(const uint8_t *src, int src_stride, uint8_t *dst,
sf, w, h, conv_params, interp_filter, sf, w, h, conv_params, interp_filter,
#if CONFIG_GLOBAL_MOTION #if CONFIG_GLOBAL_MOTION
is_global, p_col, p_row, plane, ref, is_global, p_col, p_row, plane, ref,
#if CONFIG_MOTION_VAR
0, 0,
#endif
#endif // CONFIG_GLOBAL_MOTION #endif // CONFIG_GLOBAL_MOTION
sf->x_step_q4, sf->y_step_q4, xd); sf->x_step_q4, sf->y_step_q4, xd);
} }
...@@ -939,6 +951,9 @@ void build_inter_predictors(MACROBLOCKD *xd, int plane, ...@@ -939,6 +951,9 @@ void build_inter_predictors(MACROBLOCKD *xd, int plane,
#if CONFIG_GLOBAL_MOTION #if CONFIG_GLOBAL_MOTION
is_global[ref], (mi_x >> pd->subsampling_x) + x, is_global[ref], (mi_x >> pd->subsampling_x) + x,
(mi_y >> pd->subsampling_y) + y, plane, ref, (mi_y >> pd->subsampling_y) + y, plane, ref,
#if CONFIG_MOTION_VAR
mi_col_offset, mi_row_offset,
#endif
#endif // CONFIG_GLOBAL_MOTION #endif // CONFIG_GLOBAL_MOTION
xs, ys, xd); xs, ys, xd);
} }
...@@ -1042,6 +1057,9 @@ void build_inter_predictors(MACROBLOCKD *xd, int plane, ...@@ -1042,6 +1057,9 @@ void build_inter_predictors(MACROBLOCKD *xd, int plane,
#if CONFIG_GLOBAL_MOTION #if CONFIG_GLOBAL_MOTION
is_global[ref], (mi_x >> pd->subsampling_x) + x, is_global[ref], (mi_x >> pd->subsampling_x) + x,
(mi_y >> pd->subsampling_y) + y, plane, ref, (mi_y >> pd->subsampling_y) + y, plane, ref,
#if CONFIG_MOTION_VAR
mi_col_offset, mi_row_offset,
#endif
#endif // CONFIG_GLOBAL_MOTION #endif // CONFIG_GLOBAL_MOTION
subpel_params[ref].xs, subpel_params[ref].ys, xd); subpel_params[ref].xs, subpel_params[ref].ys, xd);
} }
...@@ -2867,6 +2885,9 @@ static void build_inter_predictors_single_buf(MACROBLOCKD *xd, int plane, ...@@ -2867,6 +2885,9 @@ static void build_inter_predictors_single_buf(MACROBLOCKD *xd, int plane,
#if CONFIG_GLOBAL_MOTION #if CONFIG_GLOBAL_MOTION
is_global, (mi_x >> pd->subsampling_x) + x, is_global, (mi_x >> pd->subsampling_x) + x,
(mi_y >> pd->subsampling_y) + y, plane, ref, (mi_y >> pd->subsampling_y) + y, plane, ref,
#if CONFIG_MOTION_VAR
0, 0,
#endif
#endif // CONFIG_GLOBAL_MOTION #endif // CONFIG_GLOBAL_MOTION
xs, ys, xd); xs, ys, xd);
} }
......
...@@ -275,12 +275,19 @@ static INLINE void av1_make_inter_predictor( ...@@ -275,12 +275,19 @@ static INLINE void av1_make_inter_predictor(
#endif #endif
#if CONFIG_GLOBAL_MOTION #if CONFIG_GLOBAL_MOTION
int is_global, int p_col, int p_row, int plane, int ref, int is_global, int p_col, int p_row, int plane, int ref,
#if CONFIG_MOTION_VAR
int mi_col_offset, int mi_row_offset,
#endif
#endif // CONFIG_GLOBAL_MOTION #endif // CONFIG_GLOBAL_MOTION
int xs, int ys, const MACROBLOCKD *xd) { int xs, int ys, const MACROBLOCKD *xd) {
(void)xd; (void)xd;
#if CONFIG_GLOBAL_MOTION #if CONFIG_GLOBAL_MOTION
if (is_global) { if (is_global) {
#if CONFIG_MOTION_VAR
const MODE_INFO *mi = xd->mi[mi_col_offset + xd->mi_stride * mi_row_offset];
#else
const MODE_INFO *mi = xd->mi[0]; const MODE_INFO *mi = xd->mi[0];
#endif
const struct macroblockd_plane *const pd = &xd->plane[plane]; const struct macroblockd_plane *const pd = &xd->plane[plane];
const struct buf_2d *const pre_buf = &pd->pre[ref]; const struct buf_2d *const pre_buf = &pd->pre[ref];
WarpedMotionParams *gm = &xd->global_motion[mi->mbmi.ref_frame[ref]]; WarpedMotionParams *gm = &xd->global_motion[mi->mbmi.ref_frame[ref]];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment