diff options
author | Adrian Grange <agrange@google.com> | 2013-04-17 11:07:12 -0700 |
---|---|---|
committer | Adrian Grange <agrange@google.com> | 2013-04-17 11:07:12 -0700 |
commit | a4c0b3531ef6dab7421efb87916fdeb8a5135895 (patch) | |
tree | 6d6989bfa128eef0b29b6362315e40b3480930ca | |
parent | 9b84d113566216b700e65487cd2fbc5293be492c (diff) | |
download | libvpx-a4c0b3531ef6dab7421efb87916fdeb8a5135895.tar libvpx-a4c0b3531ef6dab7421efb87916fdeb8a5135895.tar.gz libvpx-a4c0b3531ef6dab7421efb87916fdeb8a5135895.tar.bz2 libvpx-a4c0b3531ef6dab7421efb87916fdeb8a5135895.zip |
Make alt_extra_bits a local variable
alt_extra_bits is now only used in a local context so
remove it from the twopass_rc structure.
Change-Id: I5bbf0a3dba9712a3da45760f7bb865243705b53e
-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 ddedb37bc..d333e8e31 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) { |