Fix division rounding in OPTFLOW_REFINEMENT This slightly improves the precision of refined MV. Change-Id: I46430346bbdc67d25270c554fc11bf38b8c8744a
diff --git a/av1/common/reconinter.h b/av1/common/reconinter.h index 5e459e8..a6afd5f 100644 --- a/av1/common/reconinter.h +++ b/av1/common/reconinter.h
@@ -295,8 +295,8 @@ if (use_optflow_refinement) { // optflow refinement always returns MVs with 1/16 precision so it is not // necessary to shift the MV before clamping - clamped_mv.row = (int16_t)(src_mv->row >> ss_y); - clamped_mv.col = (int16_t)(src_mv->col >> ss_x); + clamped_mv.row = (int16_t)ROUND_POWER_OF_TWO_SIGNED(src_mv->row, ss_y); + clamped_mv.col = (int16_t)ROUND_POWER_OF_TWO_SIGNED(src_mv->col, ss_x); } else { clamped_mv.row = (int16_t)(src_mv->row * (1 << (1 - ss_y)));