From: hui su Date: Mon, 24 Aug 2015 18:40:04 +0000 (-0700) Subject: Avoid setting rate multiplier as 0 X-Git-Tag: v1.5.0~234 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=697a8e6fe606d67e84164de46e0dbb198531f613;p=libvpx Avoid setting rate multiplier as 0 In high bitdepth setting, the rate multipier may be set as 0. In lossless mode, the RD cost would always be 0, resulting in bad partition and prediction mode choices. Change-Id: I297014dd8bfa8a07ff0ab480119f75678300ff68 --- diff --git a/vp10/encoder/rd.c b/vp10/encoder/rd.c index 999a6ac26..dad1d2a6e 100644 --- a/vp10/encoder/rd.c +++ b/vp10/encoder/rd.c @@ -177,6 +177,8 @@ int vp10_compute_rd_mult(const VP10_COMP *cpi, int qindex) { rdmult = (rdmult * rd_frame_type_factor[frame_type]) >> 7; rdmult += ((rdmult * rd_boost_factor[boost_index]) >> 7); } + if (rdmult < 1) + rdmult = 1; return (int)rdmult; } diff --git a/vp9/encoder/vp9_rd.c b/vp9/encoder/vp9_rd.c index 3ee6fbec3..2f2f7c1bc 100644 --- a/vp9/encoder/vp9_rd.c +++ b/vp9/encoder/vp9_rd.c @@ -177,6 +177,8 @@ int vp9_compute_rd_mult(const VP9_COMP *cpi, int qindex) { rdmult = (rdmult * rd_frame_type_factor[frame_type]) >> 7; rdmult += ((rdmult * rd_boost_factor[boost_index]) >> 7); } + if (rdmult < 1) + rdmult = 1; return (int)rdmult; }