From 134072dbd37e0adac154fecf0a5434d538d5d096 Mon Sep 17 00:00:00 2001 From: Jingning Han Date: Mon, 12 Nov 2018 16:22:46 -0800 Subject: [PATCH] Rescale arf bit budget calculation 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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c index a8b410f..8400b09 100644 --- a/vp9/encoder/vp9_firstpass.c +++ b/vp9/encoder/vp9_firstpass.c @@ -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]; -- 2.7.4