From: Deepa K G Date: Wed, 5 Dec 2018 11:22:49 +0000 (+0530) Subject: Rescale arf bit budget calculation X-Git-Tag: v1.8.0~78^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7a19f6afeaf7170d05dce92f11e4ec9b93fa3637;p=libvpx Rescale arf bit budget calculation To compute the total budget for a depth layer, exclude the count of frames in the current layer. Change-Id: I9ffd1f63ea597de3ea95e0832b13f5b1f35cb086 --- diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c index e29e86576..344656d55 100644 --- a/vp9/encoder/vp9_firstpass.c +++ b/vp9/encoder/vp9_firstpass.c @@ -2301,9 +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 - 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]; @@ -2675,8 +2675,8 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) { } // 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;