summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarco <marpan@google.com>2016-02-17 12:03:57 -0800
committerMarco <marpan@google.com>2016-07-18 15:20:17 -0700
commit05fe0f20a653c579f93545403815f12bbda5254f (patch)
treef90b6c378f14d45bd28a54d4558da37ec0756568 /test
parent3e04114f3d6d1bc746a376f375dc18c5a941e5aa (diff)
downloadlibvpx-05fe0f20a653c579f93545403815f12bbda5254f.tar
libvpx-05fe0f20a653c579f93545403815f12bbda5254f.tar.gz
libvpx-05fe0f20a653c579f93545403815f12bbda5254f.tar.bz2
libvpx-05fe0f20a653c579f93545403815f12bbda5254f.zip
vp9: Allow usage of lookahead for real-time, 1 pass vbr.
Allow usage of lookahead for VBR in real-time mode, for 1 pass vbr. Current usage is for fast checking of future scene cuts/changes, and adjusting rate control (gf interval and active_worst/target size). Added unittests (datarate) for 1 pass vbr mode, with non-zero lag. Added an experimental option to limit QP based on lookahead. Overall positive gain in metrics on ytlive set: avgPNSR/SSIM up on average ~1-3%; several clips up by 5, 7%. Change-Id: I960d57dfc89de121c4824b9a9bf88d2814e74b56
Diffstat (limited to 'test')
-rw-r--r--test/datarate_test.cc32
1 files changed, 29 insertions, 3 deletions
diff --git a/test/datarate_test.cc b/test/datarate_test.cc
index 220cbf3a3..0b188b5d7 100644
--- a/test/datarate_test.cc
+++ b/test/datarate_test.cc
@@ -450,8 +450,8 @@ class DatarateTestVP9Large : public ::libvpx_test::EncoderTest,
int denoiser_offon_period_;
};
-// Check basic rate targeting for VBR mode.
-TEST_P(DatarateTestVP9Large, BasicRateTargetingVBR) {
+// Check basic rate targeting for VBR mode with 0 lag.
+TEST_P(DatarateTestVP9Large, BasicRateTargetingVBRLagZero) {
cfg_.rc_min_quantizer = 0;
cfg_.rc_max_quantizer = 63;
cfg_.g_error_resilient = 0;
@@ -471,7 +471,33 @@ TEST_P(DatarateTestVP9Large, BasicRateTargetingVBR) {
}
}
-// Check basic rate targeting for CBR,
+// Check basic rate targeting for VBR mode with non-zero lag.
+TEST_P(DatarateTestVP9Large, BasicRateTargetingVBRLagNonZero) {
+ cfg_.rc_min_quantizer = 0;
+ cfg_.rc_max_quantizer = 63;
+ cfg_.g_error_resilient = 0;
+ cfg_.rc_end_usage = VPX_VBR;
+ // For non-zero lag, rate control will work (be within bounds) for
+ // real-time mode.
+ if (deadline_ == VPX_DL_REALTIME)
+ cfg_.g_lag_in_frames = 15;
+ else
+ cfg_.g_lag_in_frames = 0;
+
+ ::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
+ 30, 1, 0, 300);
+ for (int i = 400; i <= 800; i += 400) {
+ cfg_.rc_target_bitrate = i;
+ ResetModel();
+ 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.25)
+ << " The datarate for the file is greater than target by too much!";
+ }
+}
+
+// Check basic rate targeting for CBR mode.
TEST_P(DatarateTestVP9Large, BasicRateTargeting) {
cfg_.rc_buf_initial_sz = 500;
cfg_.rc_buf_optimal_sz = 500;