summaryrefslogtreecommitdiff
path: root/vp9/encoder
diff options
context:
space:
mode:
authorpaulwilkins <paulwilkins@google.com>2017-11-01 14:21:39 +0000
committerpaulwilkins <paulwilkins@google.com>2017-11-09 10:46:10 +0000
commitd6e29868ac4fc58eadc3c30f4baf45fea0b67f6c (patch)
tree913ab4a4a54bc1748f4b2c1877d5b3b4cf8215f8 /vp9/encoder
parenteb7d431cb55c8254fcd0a362e269c1d7a25409ba (diff)
downloadlibvpx-d6e29868ac4fc58eadc3c30f4baf45fea0b67f6c.tar
libvpx-d6e29868ac4fc58eadc3c30f4baf45fea0b67f6c.tar.gz
libvpx-d6e29868ac4fc58eadc3c30f4baf45fea0b67f6c.tar.bz2
libvpx-d6e29868ac4fc58eadc3c30f4baf45fea0b67f6c.zip
Fix to frames considered in arf boost calculation.
For a chosen interval "i" the existing arf boost calculation examined frames +/- (i-1) frames from the current location in the second pass. This change checks to make sure that the forward search does not extend beyond the next key frame in the event that the distance to the next key frame is < (i - 1). Small metrics gains on all our test sets but these are localized to a few clips (e.g. midres set psnr-hvs sintel -2.59% but overall average was only -0.185%) Change-Id: I26fc9ce582b6d58fa1113a238395e12ad3123cf6
Diffstat (limited to 'vp9/encoder')
-rw-r--r--vp9/encoder/vp9_firstpass.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c
index f9494dc51..e68fbe6e6 100644
--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -2604,9 +2604,13 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
// Should we use the alternate reference frame.
if (allow_alt_ref && (i < cpi->oxcf.lag_in_frames) &&
(i >= rc->min_gf_interval)) {
+ const int forward_frames = (rc->frames_to_key - i >= i - 1)
+ ? i - 1
+ : VPXMAX(0, rc->frames_to_key - i);
+
// Calculate the boost for alt ref.
rc->gfu_boost =
- calc_arf_boost(cpi, 0, (i - 1), (i - 1), &f_boost, &b_boost);
+ calc_arf_boost(cpi, 0, forward_frames, i - 1, &f_boost, &b_boost);
rc->source_alt_ref_pending = 1;
// Test to see if multi arf is appropriate.