shithub: libvpx

Download patch

ref: 94eaecaa91661dfc3ecd00a0963211b9704a5bd5
parent: f9ecdc35ece54ee418a3420701d7bf545f0629c7
parent: f1ce050f44c7f91ee941155c7e080e6640b12781
author: Paul Wilkins <[email protected]>
date: Tue Dec 12 06:56:10 EST 2017

Merge "Bug fix for second reference stats."

--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -2543,8 +2543,11 @@
       // Update the accumulator for second ref error difference.
       // This is intended to give an indication of how much the coded error is
       // increasing over time.
-      sr_accumulator += (next_frame.sr_coded_error - next_frame.coded_error);
-      sr_accumulator = VPXMAX(0.0, sr_accumulator);
+      if (i == 1) {
+        sr_accumulator += next_frame.coded_error;
+      } else {
+        sr_accumulator += (next_frame.sr_coded_error - next_frame.coded_error);
+      }
     }
 
     // Break out conditions.