shithub: libvpx

Download patch

ref: 697a8e6fe606d67e84164de46e0dbb198531f613
parent: 41be09afee1cf24494776f9bc44ae71aeb8707e9
author: hui su <[email protected]>
date: Mon Aug 24 07:40:04 EDT 2015

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

--- a/vp10/encoder/rd.c
+++ b/vp10/encoder/rd.c
@@ -177,6 +177,8 @@
     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;
 }
 
--- a/vp9/encoder/vp9_rd.c
+++ b/vp9/encoder/vp9_rd.c
@@ -177,6 +177,8 @@
     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;
 }