diff options
author | Dmitry Kovalev <dkovalev@google.com> | 2014-05-22 12:06:37 -0700 |
---|---|---|
committer | Dmitry Kovalev <dkovalev@google.com> | 2014-05-22 12:07:14 -0700 |
commit | da39b6a1af78ff200e1bc1d5f055a8522c521aee (patch) | |
tree | 7122464499206c2964f98a686e2ae93dcb3f38d2 /vp9/encoder/vp9_firstpass.c | |
parent | 56966ea8cedc6217d11a932e977f2165e39708f4 (diff) | |
download | libvpx-da39b6a1af78ff200e1bc1d5f055a8522c521aee.tar libvpx-da39b6a1af78ff200e1bc1d5f055a8522c521aee.tar.gz libvpx-da39b6a1af78ff200e1bc1d5f055a8522c521aee.tar.bz2 libvpx-da39b6a1af78ff200e1bc1d5f055a8522c521aee.zip |
Cleaning up calc_frame_boost().
Change-Id: I3ba9374de96dc31fb4e736742603ef988d8aaa5f
Diffstat (limited to 'vp9/encoder/vp9_firstpass.c')
-rw-r--r-- | vp9/encoder/vp9_firstpass.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c index a7c527af4..87c2819f8 100644 --- a/vp9/encoder/vp9_firstpass.c +++ b/vp9/encoder/vp9_firstpass.c @@ -1153,16 +1153,17 @@ static void accumulate_frame_motion_stats( } // Calculate a baseline boost number for the current frame. -static double calc_frame_boost(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame, +static double calc_frame_boost(const TWO_PASS *twopass, + const FIRSTPASS_STATS *this_frame, double this_frame_mv_in_out) { double frame_boost; // Underlying boost factor is based on inter intra error ratio. - if (this_frame->intra_error > cpi->twopass.gf_intra_err_min) + if (this_frame->intra_error > twopass->gf_intra_err_min) frame_boost = (IIFACTOR * this_frame->intra_error / DOUBLE_DIVIDE_CHECK(this_frame->coded_error)); else - frame_boost = (IIFACTOR * cpi->twopass.gf_intra_err_min / + frame_boost = (IIFACTOR * twopass->gf_intra_err_min / DOUBLE_DIVIDE_CHECK(this_frame->coded_error)); // Increase boost for frames where new data coming into frame (e.g. zoom out). @@ -1215,8 +1216,8 @@ static int calc_arf_boost(VP9_COMP *cpi, int offset, ? MIN_DECAY_FACTOR : decay_accumulator; } - boost_score += (decay_accumulator * - calc_frame_boost(cpi, &this_frame, this_frame_mv_in_out)); + boost_score += decay_accumulator * calc_frame_boost(twopass, &this_frame, + this_frame_mv_in_out); } *f_boost = (int)boost_score; @@ -1252,8 +1253,8 @@ static int calc_arf_boost(VP9_COMP *cpi, int offset, ? MIN_DECAY_FACTOR : decay_accumulator; } - boost_score += (decay_accumulator * - calc_frame_boost(cpi, &this_frame, this_frame_mv_in_out)); + boost_score += decay_accumulator * calc_frame_boost(twopass, &this_frame, + this_frame_mv_in_out); } *b_boost = (int)boost_score; @@ -1590,8 +1591,8 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) { } // Calculate a boost number for this frame. - boost_score += (decay_accumulator * - calc_frame_boost(cpi, &next_frame, this_frame_mv_in_out)); + boost_score += decay_accumulator * calc_frame_boost(twopass, &next_frame, + this_frame_mv_in_out); // Break out conditions. if ( |