diff options
author | Paul Wilkins <paulwilkins@google.com> | 2013-12-19 11:38:04 +0000 |
---|---|---|
committer | Paul Wilkins <paulwilkins@google.com> | 2013-12-19 17:26:04 +0000 |
commit | ee29b7e85c10acdcebd59640bc9e0c1bb38bfbbf (patch) | |
tree | 769dd7623b98145fcec63ebcf860b6151a5236d7 | |
parent | cb8659981d0ca11e259946dd97269ad0a8ee0cb4 (diff) | |
download | libvpx-ee29b7e85c10acdcebd59640bc9e0c1bb38bfbbf.tar libvpx-ee29b7e85c10acdcebd59640bc9e0c1bb38bfbbf.tar.gz libvpx-ee29b7e85c10acdcebd59640bc9e0c1bb38bfbbf.tar.bz2 libvpx-ee29b7e85c10acdcebd59640bc9e0c1bb38bfbbf.zip |
Adjust gf_group_error_left for arf groups.
Take account of the fact that the overlay frame is usually
very cheap so distribute target bits among the other frames.
Change-Id: I120685122e8cbbe75da8d07d02932f7877059867
-rw-r--r-- | vp9/encoder/vp9_firstpass.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c index 2d7ac7ce5..0a451530a 100644 --- a/vp9/encoder/vp9_firstpass.c +++ b/vp9/encoder/vp9_firstpass.c @@ -1726,7 +1726,6 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) { } } - // Set the interval until the next gf or arf. cpi->rc.baseline_gf_interval = i; @@ -1932,15 +1931,18 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) { if (cpi->twopass.kf_group_bits < 0) cpi->twopass.kf_group_bits = 0; - // Note the error score left in the remaining frames of the group. - // For normal GFs we want to remove the error score for the first frame - // of the group (except in Key frame case where this has already - // happened) - if (!cpi->rc.source_alt_ref_pending && cpi->common.frame_type != KEY_FRAME) + // If this is an arf update we want to remove the score for the + // overlay frame at the end which will usually be very cheap to code. + // For normal GFs remove the score for the GF itself unless this is + // also a key frame in which case it has already been accounted for. + if (cpi->rc.source_alt_ref_pending) { + cpi->twopass.gf_group_error_left = (int64_t)gf_group_err - mod_frame_err; + } else if (cpi->common.frame_type != KEY_FRAME) { cpi->twopass.gf_group_error_left = (int64_t)(gf_group_err - gf_first_frame_err); - else + } else { cpi->twopass.gf_group_error_left = (int64_t)gf_group_err; + } cpi->twopass.gf_group_bits -= cpi->twopass.gf_bits - cpi->rc.min_frame_bandwidth; |