summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
authorPaul Wilkins <paulwilkins@google.com>2016-09-27 14:08:28 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2016-09-27 14:08:29 +0000
commitb3ebea5e8a849a15ab3eb4b44f1d909f4119c552 (patch)
tree2608f9f8ab3b3cb8ae9f5e822dd2c99ccbc4d713 /vp9
parent70240a77b8decede28132fd4dbf1fa48713edea4 (diff)
parent0421d8e318016758942107c1bab820f480eb1be2 (diff)
downloadlibvpx-b3ebea5e8a849a15ab3eb4b44f1d909f4119c552.tar
libvpx-b3ebea5e8a849a15ab3eb4b44f1d909f4119c552.tar.gz
libvpx-b3ebea5e8a849a15ab3eb4b44f1d909f4119c552.tar.bz2
libvpx-b3ebea5e8a849a15ab3eb4b44f1d909f4119c552.zip
Merge "Limit max arf boost and scale motion breakout for image size."
Diffstat (limited to 'vp9')
-rw-r--r--vp9/encoder/vp9_firstpass.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c
index 1c716a102..557f773ac 100644
--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -2089,6 +2089,8 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
double mv_in_out_accumulator = 0.0;
double abs_mv_in_out_accumulator = 0.0;
double mv_ratio_accumulator_thresh;
+ double mv_in_out_thresh;
+ double abs_mv_in_out_thresh;
unsigned int allow_alt_ref = is_altref_enabled(cpi);
int f_boost = 0;
@@ -2132,6 +2134,8 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
// Motion breakout threshold for loop below depends on image size.
mv_ratio_accumulator_thresh =
(cpi->initial_height + cpi->initial_width) / 4.0;
+ mv_in_out_thresh = (cpi->initial_height + cpi->initial_width) / 300.0;
+ abs_mv_in_out_thresh = (cpi->initial_height + cpi->initial_width) / 200.0;
// Set a maximum and minimum interval for the GF group.
// If the image appears almost completely static we can extend beyond this.
@@ -2228,8 +2232,8 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
((rc->frames_to_key - i) >= rc->min_gf_interval) &&
(!flash_detected) &&
((mv_ratio_accumulator > mv_ratio_accumulator_thresh) ||
- (abs_mv_in_out_accumulator > 3.0) ||
- (mv_in_out_accumulator < -2.0) ||
+ (abs_mv_in_out_accumulator > abs_mv_in_out_thresh) ||
+ (mv_in_out_accumulator < -mv_in_out_thresh) ||
((boost_score - old_boost_score) < BOOST_BREAKOUT)))) {
boost_score = old_boost_score;
break;
@@ -2261,6 +2265,9 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
rc->source_alt_ref_pending = 0;
}
+ // Limit maximum boost based on interval length.
+ rc->gfu_boost = VPXMIN((int)rc->gfu_boost, i * 200);
+
// Set the interval until the next gf.
rc->baseline_gf_interval = i - (is_key_frame || rc->source_alt_ref_pending);