[NORMATIVE] Clamp projected mfmv to 15 bits Clamp the projected mfmv to 15 bits range. BUG=aomedia:1676 Change-Id: Id29024f51017b2b79d00b52fc6188371feb15d40
diff --git a/av1/common/mvref_common.c b/av1/common/mvref_common.c index 00e1120..250d3ec 100644 --- a/av1/common/mvref_common.c +++ b/av1/common/mvref_common.c
@@ -34,8 +34,10 @@ : AOMMAX(num, -MAX_FRAME_DISTANCE); int mv_row = ROUND_POWER_OF_TWO_SIGNED(ref.row * num * div_mult[den], 14); int mv_col = ROUND_POWER_OF_TWO_SIGNED(ref.col * num * div_mult[den], 14); - output->row = (int16_t)clamp(mv_row, INT16_MIN, INT16_MAX); - output->col = (int16_t)clamp(mv_col, INT16_MIN, INT16_MAX); + const int clamp_max = (1 << 14) - 1; + const int clamp_min = -(1 << 14); + output->row = (int16_t)clamp(mv_row, clamp_min, clamp_max); + output->col = (int16_t)clamp(mv_col, clamp_min, clamp_max); } void av1_copy_frame_mvs(const AV1_COMMON *const cm, MODE_INFO *mi, int mi_row,