ref: 07261e8c38ab709f86a279df996e9e0ec0e9c508
parent: 2d4711c9ead0ae1e03cf8fb06a50eb614dac0e52
author: Colin Lee <colinlee10@gmail.com>
date: Tue Jun 16 17:33:46 EDT 2020
Clean up fraction calculation
--- a/src/refmvs.c
+++ b/src/refmvs.c
@@ -182,8 +182,8 @@
};
assert(den > 0 && den < 32);
assert(num > -32 && num < 32);
- const int dm = div_mult[den];
- const int y = mv.y * num * dm, x = mv.x * num * dm;
+ const int frac = num * div_mult[den];
+ const int y = mv.y * frac, x = mv.x * frac;
// Round and clip according to AV1 spec section 7.9.3
return (union mv) { // 0x3fff == (1 << 14) - 1
.y = iclip((y + 8192 + (y >> 31)) >> 14, -0x3fff, 0x3fff),