summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
authorpaulwilkins <paulwilkins@google.com>2017-11-06 11:24:34 +0000
committerpaulwilkins <paulwilkins@google.com>2017-11-13 16:53:57 +0000
commit55fc4d95af8ef330b1156f513aa8797aa65fbc5f (patch)
tree6024d33d2ec62dc11e391954458fde6c4f1a67ec /vp9
parent2eddfb46a999badf6fa9561606f62b73bf4eccb3 (diff)
downloadlibvpx-55fc4d95af8ef330b1156f513aa8797aa65fbc5f.tar
libvpx-55fc4d95af8ef330b1156f513aa8797aa65fbc5f.tar.gz
libvpx-55fc4d95af8ef330b1156f513aa8797aa65fbc5f.tar.bz2
libvpx-55fc4d95af8ef330b1156f513aa8797aa65fbc5f.zip
Small parameter clean up.
Removed three parameters that are no longer needed in calls to calc_arf_boost() and associated minor changes. No impact on encode results. Change-Id: Ieaf31d0d2e1990b99cf69647170145a1bbfbb9fb
Diffstat (limited to 'vp9')
-rw-r--r--vp9/encoder/vp9_firstpass.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c
index d09acf78b..caa58e7a8 100644
--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -2010,8 +2010,7 @@ static double calc_kf_frame_boost(VP9_COMP *cpi,
return VPXMIN(frame_boost, max_boost * boost_q_correction);
}
-static int calc_arf_boost(VP9_COMP *cpi, int offset, int f_frames, int b_frames,
- int *f_boost, int *b_boost) {
+static int calc_arf_boost(VP9_COMP *cpi, int f_frames, int b_frames) {
TWO_PASS *const twopass = &cpi->twopass;
int i;
double boost_score = 0.0;
@@ -2026,7 +2025,7 @@ static int calc_arf_boost(VP9_COMP *cpi, int offset, int f_frames, int b_frames,
// Search forward from the proposed arf/next gf position.
for (i = 0; i < f_frames; ++i) {
- const FIRSTPASS_STATS *this_frame = read_frame_stats(twopass, i + offset);
+ const FIRSTPASS_STATS *this_frame = read_frame_stats(twopass, i);
if (this_frame == NULL) break;
// Update the motion related elements to the boost calculation.
@@ -2036,8 +2035,7 @@ static int calc_arf_boost(VP9_COMP *cpi, int offset, int f_frames, int b_frames,
// We want to discount the flash frame itself and the recovery
// frame that follows as both will have poor scores.
- flash_detected = detect_flash(twopass, i + offset) ||
- detect_flash(twopass, i + offset + 1);
+ flash_detected = detect_flash(twopass, i) || detect_flash(twopass, i + 1);
// Accumulate the effect of prediction quality decay.
if (!flash_detected) {
@@ -2053,7 +2051,7 @@ static int calc_arf_boost(VP9_COMP *cpi, int offset, int f_frames, int b_frames,
this_frame_mv_in_out, GF_MAX_BOOST);
}
- *f_boost = (int)boost_score;
+ arf_boost = (int)boost_score;
// Reset for backward looking loop.
boost_score = 0.0;
@@ -2066,7 +2064,7 @@ static int calc_arf_boost(VP9_COMP *cpi, int offset, int f_frames, int b_frames,
// Search backward towards last gf position.
for (i = -1; i >= -b_frames; --i) {
- const FIRSTPASS_STATS *this_frame = read_frame_stats(twopass, i + offset);
+ const FIRSTPASS_STATS *this_frame = read_frame_stats(twopass, i);
if (this_frame == NULL) break;
// Update the motion related elements to the boost calculation.
@@ -2076,8 +2074,7 @@ static int calc_arf_boost(VP9_COMP *cpi, int offset, int f_frames, int b_frames,
// We want to discount the the flash frame itself and the recovery
// frame that follows as both will have poor scores.
- flash_detected = detect_flash(twopass, i + offset) ||
- detect_flash(twopass, i + offset + 1);
+ flash_detected = detect_flash(twopass, i) || detect_flash(twopass, i + 1);
// Cumulative effect of prediction quality decay.
if (!flash_detected) {
@@ -2092,9 +2089,8 @@ static int calc_arf_boost(VP9_COMP *cpi, int offset, int f_frames, int b_frames,
calc_frame_boost(cpi, this_frame, &sr_accumulator,
this_frame_mv_in_out, GF_MAX_BOOST);
}
- *b_boost = (int)boost_score;
+ arf_boost += (int)boost_score;
- arf_boost = (*f_boost + *b_boost);
if (arf_boost < ((b_frames + f_frames) * 20))
arf_boost = ((b_frames + f_frames) * 20);
arf_boost = VPXMAX(arf_boost, MIN_ARF_GF_BOOST);
@@ -2439,8 +2435,6 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
const double av_err = get_distribution_av_err(cpi, twopass);
unsigned int allow_alt_ref = is_altref_enabled(cpi);
- int f_boost = 0;
- int b_boost = 0;
int flash_detected;
int active_max_gf_interval;
int active_min_gf_interval;
@@ -2606,8 +2600,7 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
: VPXMAX(0, rc->frames_to_key - i);
// Calculate the boost for alt ref.
- rc->gfu_boost =
- calc_arf_boost(cpi, 0, forward_frames, i - 1, &f_boost, &b_boost);
+ rc->gfu_boost = calc_arf_boost(cpi, forward_frames, (i - 1));
rc->source_alt_ref_pending = 1;
// Test to see if multi arf is appropriate.