From: Marco Paniconi Date: Tue, 16 Oct 2012 01:41:32 +0000 (-0700) Subject: Fix to rd cost computation for mv bias. X-Git-Tag: v1.2.0~50 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4cf4c94ad1668dd140e2185497192d92c35d98ea;p=libvpx Fix to rd cost computation for mv bias. This prevents the rd cost from wrapping around and going negative. Change-Id: Id61390537d2ad47762e410918bb4e18f6a0912d4 --- diff --git a/vp8/encoder/pickinter.c b/vp8/encoder/pickinter.c index 8ca77b971..c4fa691a4 100644 --- a/vp8/encoder/pickinter.c +++ b/vp8/encoder/pickinter.c @@ -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);