shithub: libvpx

Download patch

ref: e9d2f44d12ad22db83ceb09e57c4c6940acbc8f4
parent: 4c79c3b92230b9be2169f46488bca77c4f5fcb3f
parent: 7a19f6afeaf7170d05dce92f11e4ec9b93fa3637
author: Deepa K G <deepa.kg@ittiam.com>
date: Tue Dec 11 23:47:56 EST 2018

Merge "Rescale arf bit budget calculation"

--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -2317,9 +2317,9 @@
 
     for (idx = 2; idx < MAX_ARF_LAYERS; ++idx) {
       if (arf_depth_boost[idx] == 0) break;
-      arf_depth_bits[idx] =
-          calculate_boost_bits(rc->baseline_gf_interval - total_arfs,
-                               arf_depth_boost[idx], total_group_bits);
+      arf_depth_bits[idx] = calculate_boost_bits(
+          rc->baseline_gf_interval - total_arfs - arf_depth_count[idx],
+          arf_depth_boost[idx], total_group_bits);
 
       total_group_bits -= arf_depth_bits[idx];
       total_arfs += arf_depth_count[idx];
@@ -2691,8 +2691,8 @@
   }
 
   // Calculate the extra bits to be used for boosted frame(s)
-  gf_arf_bits = calculate_boost_bits(rc->baseline_gf_interval, rc->gfu_boost,
-                                     gf_group_bits);
+  gf_arf_bits = calculate_boost_bits((rc->baseline_gf_interval - 1),
+                                     rc->gfu_boost, gf_group_bits);
 
   // Adjust KF group bits and error remaining.
   twopass->kf_group_error_left -= gf_group_err;