Rescale arf bit budget calculation
authorJingning Han <jingning@google.com>
Tue, 13 Nov 2018 00:22:46 +0000 (16:22 -0800)
committerJingning Han <jingning@google.com>
Tue, 13 Nov 2018 17:01:53 +0000 (09:01 -0800)
To compute the total budget for a depth layer, exclude the count of
frames that have been allocated the bit budget. This improves the
avg PSNR by 0.15% and overall PSNR by 0.25% for lowres and midres
test sets.

Change-Id: I5115e33e1422dc930179142cd29aeebe97425283

vp9/encoder/vp9_firstpass.c

index a8b410f..8400b09 100644 (file)
@@ -2301,8 +2301,9 @@ static void allocate_gf_group_bits(VP9_COMP *cpi, int64_t gf_group_bits,
 
     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, arf_depth_boost[idx], total_group_bits);
+      arf_depth_bits[idx] =
+          calculate_boost_bits(rc->baseline_gf_interval - total_arfs,
+                               arf_depth_boost[idx], total_group_bits);
 
       total_group_bits -= arf_depth_bits[idx];
       total_arfs += arf_depth_count[idx];