summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vp9/encoder/vp9_firstpass.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c
index b4c46014c..eefbdff51 100644
--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -2543,8 +2543,11 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
// 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.