Skip to content

Commit 9d50709

Browse files
committed
Fix negative MV diff rate calculation when allow_high_precision_mv is false
1 parent c113c00 commit 9d50709

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/me.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1506,7 +1506,7 @@ fn get_mv_rate(
15061506
) -> u32 {
15071507
#[inline(always)]
15081508
fn diff_to_rate(diff: i16, allow_high_precision_mv: bool) -> u32 {
1509-
let d = if allow_high_precision_mv { diff } else { diff >> 1 };
1509+
let d = if allow_high_precision_mv { diff } else { diff / 2 };
15101510
2 * d.abs().ilog() as u32
15111511
}
15121512

0 commit comments

Comments
 (0)