From 9ebc8605dbb493d25247cf106b8760c6fccbd11d Mon Sep 17 00:00:00 2001 From: Marco Paniconi Date: Fri, 27 Apr 2018 10:38:15 -0700 Subject: [PATCH] vp9-realtime: Enable alt_ref at speed 5, for live. Enable alt_ref and compound prediction at speed 5. For 1 pass VBR mode, when lag > 0. Gain for Live set: ~3% gain on average, several clips have gains ~5-15%. Encoder fps decrease ~5-10%, on desktop with 4 threads. For now enable it only for resolutions <= 1280x720. Change-Id: I25e3d61a2244a3a01962624052c5adf4837965c7 --- test/vp9_datarate_test.cc | 2 +- vp9/encoder/vp9_speed_features.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/test/vp9_datarate_test.cc b/test/vp9_datarate_test.cc index c4dbcacbe..ada52ab41 100644 --- a/test/vp9_datarate_test.cc +++ b/test/vp9_datarate_test.cc @@ -294,7 +294,7 @@ TEST_P(DatarateTestVP9Large, BasicRateTargetingVBRLagNonZero) { ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); ASSERT_GE(effective_datarate_[0], cfg_.rc_target_bitrate * 0.75) << " The datarate for the file is lower than target by too much!"; - ASSERT_LE(effective_datarate_[0], cfg_.rc_target_bitrate * 1.30) + ASSERT_LE(effective_datarate_[0], cfg_.rc_target_bitrate * 1.35) << " The datarate for the file is greater than target by too much!"; } diff --git a/vp9/encoder/vp9_speed_features.c b/vp9/encoder/vp9_speed_features.c index 90da68726..47c1d43bb 100644 --- a/vp9/encoder/vp9_speed_features.c +++ b/vp9/encoder/vp9_speed_features.c @@ -537,8 +537,14 @@ static void set_rt_speed_feature_framesize_independent( if (cpi->use_svc && cpi->svc.spatial_layer_id > 0) sf->nonrd_keyframe = 1; if (cpi->oxcf.pass == 0 && cpi->oxcf.rc_mode == VPX_CBR && cm->frame_type != KEY_FRAME && cpi->resize_state == ORIG && - cpi->oxcf.content == VP9E_CONTENT_SCREEN) + cpi->oxcf.content == VP9E_CONTENT_SCREEN) { sf->re_encode_overshoot_rt = 1; + } + if (cpi->oxcf.rc_mode == VPX_VBR && cpi->oxcf.lag_in_frames > 0 && + cm->width <= 1280 && cm->height <= 720) { + sf->use_altref_onepass = 1; + sf->use_compound_nonrd_pickmode = 1; + } } if (speed >= 6) { -- 2.40.0