Change mv projection to signed rounding The numerator in the mv projection can be negative, e.g. cur_to_bwd or cur_to_alt2, since either bwdref or altref2 can be a forward predictive reference, whereas the denominator always stays positive. The rounding inside mv projection hence should use signed operation. Change-Id: I42a105835754a002dd31fcfa7c845e4c105ec54f
diff --git a/av1/common/mvref_common.c b/av1/common/mvref_common.c index d92585a..3f1d2c8 100644 --- a/av1/common/mvref_common.c +++ b/av1/common/mvref_common.c
@@ -1468,9 +1468,9 @@ // altogether. static void get_mv_projection(MV *output, MV ref, int num, int den) { output->row = - (int16_t)(ROUND_POWER_OF_TWO(ref.row * num * div_mult[den], 14)); + (int16_t)(ROUND_POWER_OF_TWO_SIGNED(ref.row * num * div_mult[den], 14)); output->col = - (int16_t)(ROUND_POWER_OF_TWO(ref.col * num * div_mult[den], 14)); + (int16_t)(ROUND_POWER_OF_TWO_SIGNED(ref.col * num * div_mult[den], 14)); } #define MAX_OFFSET_WIDTH 64