]> granicus.if.org Git - libvpx/commitdiff
Fix to rd cost computation for mv bias.
authorMarco Paniconi <marpan@google.com>
Tue, 16 Oct 2012 01:41:32 +0000 (18:41 -0700)
committerMarco Paniconi <marpan@google.com>
Tue, 16 Oct 2012 20:37:38 +0000 (13:37 -0700)
This prevents the rd cost from wrapping around and going negative.

Change-Id: Id61390537d2ad47762e410918bb4e18f6a0912d4

vp8/encoder/pickinter.c

index 8ca77b971f40091a2d6c6807ce0adc7174fb1860..c4fa691a4623fb3dc3da9f29372c8a20cfcad2bc 100644 (file)
@@ -513,7 +513,8 @@ static int evaluate_inter_mode(unsigned int* sse, int rate2, int* distortion2,
             && 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);