shithub: libvpx

Download patch

ref: 81cd335bb85164db0e4021bf4cf9198fd79d0990
parent: 2fd01596a550e2b280ea2913cb930c915807a096
author: Jingning Han <[email protected]>
date: Mon Jul 16 16:44:16 EDT 2018

Fix 32-bit build for tpl model

Clear system state to avoid encoding failure in 32-bit build.

BUG=webm:1547

Change-Id: Ia74c789d1993da09bc400baf24e971e19752e3c3

--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -3633,8 +3633,6 @@
 
   if (cpi->common.show_frame) return orig_rdmult;
 
-  r0 = cpi->rd.r0;
-
   for (row = mi_row; row < mi_row + mi_high; ++row) {
     for (col = mi_col; col < mi_col + mi_wide; ++col) {
       TplDepStats *this_stats = &tpl_stats[row * tpl_stride + col];
@@ -3648,6 +3646,9 @@
     }
   }
 
+  vpx_clear_system_state();
+
+  r0 = cpi->rd.r0;
   rk = (double)intra_cost / mc_dep_cost;
   beta = r0 / rk;
   dr = vp9_get_adaptive_rdmult(cpi, beta);
@@ -3656,6 +3657,7 @@
   dr = VPXMAX(dr, orig_rdmult * 1 / 2);
 
   dr = VPXMAX(1, dr);
+
   return dr;
 }
 
@@ -5458,6 +5460,8 @@
         mc_dep_cost_base += this_stats->mc_dep_cost;
       }
     }
+
+    vpx_clear_system_state();
 
     if (tpl_frame->is_valid)
       cpi->rd.r0 = (double)intra_cost_base / mc_dep_cost_base;