diff options
author | Adrian Grange <agrange@google.com> | 2013-04-17 14:50:39 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@gerrit.golo.chromium.org> | 2013-04-17 14:50:39 -0700 |
commit | 3f2b254c38030d86dd6c4bda6a688397aa2b804f (patch) | |
tree | a6f2766de2291532650371fdee4ca535c939ed38 | |
parent | 1cf31428ff9ee3ac7c9b63685132369fb33b50b2 (diff) | |
parent | a4c0b3531ef6dab7421efb87916fdeb8a5135895 (diff) | |
download | libvpx-3f2b254c38030d86dd6c4bda6a688397aa2b804f.tar libvpx-3f2b254c38030d86dd6c4bda6a688397aa2b804f.tar.gz libvpx-3f2b254c38030d86dd6c4bda6a688397aa2b804f.tar.bz2 libvpx-3f2b254c38030d86dd6c4bda6a688397aa2b804f.zip |
Merge "Make alt_extra_bits a local variable" into experimental
-rw-r--r-- | vp9/encoder/vp9_firstpass.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c index e4e7b9a4e..04ef55513 100644 --- a/vp9/encoder/vp9_firstpass.c +++ b/vp9/encoder/vp9_firstpass.c @@ -1980,27 +1980,22 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) { // This condition could fail if there are two kfs very close together // despite (MIN_GF_INTERVAL) and would cause a divide by 0 in the - // calculation of cpi->twopass.alt_extra_bits. + // calculation of alt_extra_bits. if (cpi->baseline_gf_interval >= 3) { int boost = (cpi->source_alt_ref_pending) ? b_boost : cpi->gfu_boost; if (boost >= 150) { int pct_extra; + int alt_extra_bits; pct_extra = (boost - 100) / 50; pct_extra = (pct_extra > 20) ? 20 : pct_extra; - // TODO(agrange) Remove cpi->twopass.alt_extra_bits. - cpi->twopass.alt_extra_bits = (int) - ((cpi->twopass.gf_group_bits * pct_extra) / 100); - cpi->twopass.gf_group_bits -= cpi->twopass.alt_extra_bits; - cpi->twopass.alt_extra_bits /= - ((cpi->baseline_gf_interval - 1) >> 1); - } else - cpi->twopass.alt_extra_bits = 0; - } else - cpi->twopass.alt_extra_bits = 0; + alt_extra_bits = (int)((cpi->twopass.gf_group_bits * pct_extra) / 100); + cpi->twopass.gf_group_bits -= alt_extra_bits; + } + } } if (cpi->common.frame_type != KEY_FRAME) { |