diff options
author | John Koleszar <jkoleszar@google.com> | 2011-06-06 15:51:23 -0400 |
---|---|---|
committer | John Koleszar <jkoleszar@google.com> | 2011-06-06 15:51:23 -0400 |
commit | 84f5b14b0ed878739533dabe63498311582da4b1 (patch) | |
tree | ce8e5178aeb5c38acc4dcd2134dc731f2a564acf /vp8/encoder/firstpass.c | |
parent | be15a099806347111cf461371f4fef0e783fd548 (diff) | |
parent | d1c0ba8f7ac88336ce7bbfa7dadd5c7319953fd4 (diff) | |
download | libvpx-84f5b14b0ed878739533dabe63498311582da4b1.tar libvpx-84f5b14b0ed878739533dabe63498311582da4b1.tar.gz libvpx-84f5b14b0ed878739533dabe63498311582da4b1.tar.bz2 libvpx-84f5b14b0ed878739533dabe63498311582da4b1.zip |
Merge remote branch 'internal/upstream' into HEAD
Diffstat (limited to 'vp8/encoder/firstpass.c')
-rw-r--r-- | vp8/encoder/firstpass.c | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/vp8/encoder/firstpass.c b/vp8/encoder/firstpass.c index 6655a865e..3c4b8f4a0 100644 --- a/vp8/encoder/firstpass.c +++ b/vp8/encoder/firstpass.c @@ -1558,6 +1558,24 @@ static void define_gf_group(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame) cpi->gfu_boost = (int)(boost_score * 100.0) >> 4; + // Dont allow conventional gf too near the next kf + if ((cpi->twopass.frames_to_key - i) < MIN_GF_INTERVAL) + { + while (i < cpi->twopass.frames_to_key) + { + i++; + + if (EOF == input_stats(cpi, this_frame)) + break; + + if (i < cpi->twopass.frames_to_key) + { + mod_frame_err = calculate_modified_err(cpi, this_frame); + gf_group_err += mod_frame_err; + } + } + } + // Should we use the alternate refernce frame if (allow_alt_ref && (i >= MIN_GF_INTERVAL) && @@ -1680,25 +1698,6 @@ static void define_gf_group(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame) cpi->baseline_gf_interval = i; } - // Conventional GF - if (!cpi->source_alt_ref_pending) - { - // Dont allow conventional gf too near the next kf - if ((cpi->twopass.frames_to_key - cpi->baseline_gf_interval) < MIN_GF_INTERVAL) - { - while (cpi->baseline_gf_interval < cpi->twopass.frames_to_key) - { - if (EOF == input_stats(cpi, this_frame)) - break; - - cpi->baseline_gf_interval++; - - if (cpi->baseline_gf_interval < cpi->twopass.frames_to_key) - gf_group_err += calculate_modified_err(cpi, this_frame); - } - } - } - // Now decide how many bits should be allocated to the GF group as a proportion of those remaining in the kf group. // The final key frame group in the clip is treated as a special case where cpi->twopass.kf_group_bits is tied to cpi->twopass.bits_left. // This is also important for short clips where there may only be one key frame. |