Commit e3e00797 authored by Debargha Mukherjee's avatar Debargha Mukherjee

Some refactoring and improvements to gobal motion

To facilitate further experiments.
Fixes border, uses standard interpolation filters for
translation only global model, and some refactoring.

Change-Id: I38af6cb83723f92baed23e28d7fc9a0a9544757e
parent 2837b417
......@@ -152,12 +152,12 @@ static INLINE TransformationType get_gmtype(const WarpedMotionParams *gm) {
return AFFINE;
}
static INLINE void set_default_gmparams(WarpedMotionParams *gm) {
static const int32_t default_gm_params[8] = {
static INLINE void set_default_gmparams(WarpedMotionParams *wm) {
static const int32_t default_wm_mat[8] = {
0, 0, (1 << WARPEDMODEL_PREC_BITS), 0, 0, (1 << WARPEDMODEL_PREC_BITS), 0, 0
};
memcpy(gm->wmmat, default_gm_params, sizeof(gm->wmmat));
gm->wmtype = IDENTITY;
memcpy(wm->wmmat, default_wm_mat, sizeof(wm->wmmat));
wm->wmtype = IDENTITY;
}
#endif // CONFIG_GLOBAL_MOTION
......
......@@ -558,7 +558,7 @@ void build_inter_predictors(MACROBLOCKD *xd, int plane,
for (ref = 0; ref < 1 + is_compound; ++ref) {
gm[ref] = &xd->global_motion[mi->mbmi.ref_frame[ref]];
is_global[ref] =
(get_y_mode(mi, block) == ZEROMV && gm[ref]->wmtype != IDENTITY);
(get_y_mode(mi, block) == ZEROMV && gm[ref]->wmtype > TRANSLATION);
}
// TODO(sarahparker) remove these once gm works with all experiments
(void)gm;
......
......@@ -531,8 +531,8 @@ static double highbd_warp_erroradv(WarpedMotionParams *wm, uint8_t *ref8,
gm_err = dst[(j - p_col) + (i - p_row) * p_stride] -
highbd_warp_interpolate(ref, out[0], out[1], width, height,
stride, bd);
no_gm_err = dst[(j - p_col) + (i - p_row) * p_stride] -
ref[(j - p_col) + (i - p_row) * stride];
no_gm_err =
dst[(j - p_col) + (i - p_row) * p_stride] - ref[j + i * stride];
gm_sumerr += highbd_error_measure(gm_err, bd);
no_gm_sumerr += highbd_error_measure(no_gm_err, bd);
}
......@@ -596,8 +596,8 @@ static double warp_erroradv(WarpedMotionParams *wm, uint8_t *ref, int width,
out[1] = ROUND_POWER_OF_TWO_SIGNED(out[1] * y_scale, 4);
gm_err = dst[(j - p_col) + (i - p_row) * p_stride] -
warp_interpolate(ref, out[0], out[1], width, height, stride);
no_gm_err = dst[(j - p_col) + (i - p_row) * p_stride] -
ref[(j - p_col) + (i - p_row) * stride];
no_gm_err =
dst[(j - p_col) + (i - p_row) * p_stride] - ref[j + i * stride];
gm_sumerr += error_measure(gm_err);
no_gm_sumerr += error_measure(no_gm_err);
}
......
This diff is collapsed.
Markdown is supported
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