Commit 11273449 authored by Zoe Liu's avatar Zoe Liu

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
parent dcb3cff5
......@@ -1468,9 +1468,9 @@ static int div_mult[32] = {
// 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));
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