shithub: libvpx

Download patch

ref: 4cf4c94ad1668dd140e2185497192d92c35d98ea
parent: 9da8a344373bd2503a1274fd0e096b6c8d4d0f47
author: Marco Paniconi <marpan@google.com>
date: Mon Oct 15 14:41:32 EDT 2012

Fix to rd cost computation for mv bias.

This prevents the rd cost from wrapping around and going negative.

Change-Id: Id61390537d2ad47762e410918bb4e18f6a0912d4

--- a/vp8/encoder/pickinter.c
+++ b/vp8/encoder/pickinter.c
@@ -513,7 +513,8 @@
             && x->e_mbd.mode_info_context->mbmi.ref_frame != LAST_FRAME)
             rd_adj = 100;
 
-        this_rd = this_rd * rd_adj/100;
+        // rd_adj <= 100
+        this_rd = ((int64_t)this_rd) * rd_adj / 100;
     }
 
     check_for_encode_breakout(*sse, x);