]> granicus.if.org Git - libvpx/commitdiff
Avoid setting rate multiplier as 0
authorhui su <huisu@google.com>
Mon, 24 Aug 2015 18:40:04 +0000 (11:40 -0700)
committerhui su <huisu@google.com>
Mon, 24 Aug 2015 18:47:36 +0000 (11:47 -0700)
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
vp9/encoder/vp9_rd.c

index 999a6ac26981098c901dd8459f4e9d308efb772f..dad1d2a6e3159d72457cff4e35b0449b66c4c029 100644 (file)
@@ -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;
 }
 
index 3ee6fbec343c72c24cac1dc10dbaf93250d91c3f..2f2f7c1bcbd9a77140c2673639b6cbe88b2b3354 100644 (file)
@@ -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;
 }