shithub: libvpx

Download patch

ref: 94ecfa323f8fc5af68244a15058374a887758d5a
parent: 8101e82a1bbb5dfeaf9014c90f310337592e402a
author: Jingning Han <[email protected]>
date: Fri Oct 17 05:31:42 EDT 2014

Reset rate cost value in rd mode search

When early termination is triggered, properly reset the rate cost
to invalid value to avoid potential ioc issue.

Change-Id: I3444390be2e49a34bb02cf8a74c33d5dbd96d88d

--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -3394,6 +3394,7 @@
   }
 
   if (best_mode_index < 0 || best_rd >= best_rd_so_far) {
+    rd_cost->rate = INT_MAX;
     rd_cost->rdcost = INT64_MAX;
     return;
   }
@@ -3564,6 +3565,7 @@
   rd_cost->rdcost = this_rd;
 
   if (this_rd >= best_rd_so_far) {
+    rd_cost->rate = INT_MAX;
     rd_cost->rdcost = INT64_MAX;
     return;
   }
@@ -4115,6 +4117,7 @@
   }
 
   if (best_rd >= best_rd_so_far) {
+    rd_cost->rate = INT_MAX;
     rd_cost->rdcost = INT64_MAX;
     return;
   }