From 697a8e6fe606d67e84164de46e0dbb198531f613 Mon Sep 17 00:00:00 2001 From: hui su Date: Mon, 24 Aug 2015 11:40:04 -0700 Subject: [PATCH] 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 --- vp10/encoder/rd.c | 2 ++ vp9/encoder/vp9_rd.c | 2 ++ 2 files changed, 4 insertions(+) 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; } -- 2.40.0