From: Alex Converse Date: Tue, 15 Mar 2016 22:04:14 +0000 (-0700) Subject: Add tests for VP9E_CONTENT_SCREEN. X-Git-Tag: v1.6.0~294 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9917842f07b16f2d59aeebb9783f473b644a6565;p=libvpx Add tests for VP9E_CONTENT_SCREEN. Change-Id: Id28007576205b7f46957b20eeacb5fda6872663e --- diff --git a/test/cpu_speed_test.cc b/test/cpu_speed_test.cc index 6a938a059..3592a7ee0 100644 --- a/test/cpu_speed_test.cc +++ b/test/cpu_speed_test.cc @@ -26,7 +26,8 @@ class CpuSpeedTest : EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)), set_cpu_used_(GET_PARAM(2)), - min_psnr_(kMaxPSNR) {} + min_psnr_(kMaxPSNR), + tune_content_(VP9E_CONTENT_DEFAULT) {} virtual ~CpuSpeedTest() {} virtual void SetUp() { @@ -49,6 +50,7 @@ class CpuSpeedTest ::libvpx_test::Encoder *encoder) { if (video->frame() == 1) { encoder->Control(VP8E_SET_CPUUSED, set_cpu_used_); + encoder->Control(VP9E_SET_TUNE_CONTENT, VP9E_CONTENT_SCREEN); if (encoding_mode_ != ::libvpx_test::kRealTime) { encoder->Control(VP8E_SET_ENABLEAUTOALTREF, 1); encoder->Control(VP8E_SET_ARNR_MAXFRAMES, 7); @@ -66,6 +68,7 @@ class CpuSpeedTest ::libvpx_test::TestMode encoding_mode_; int set_cpu_used_; double min_psnr_; + int tune_content_; }; TEST_P(CpuSpeedTest, TestQ0) { @@ -103,6 +106,21 @@ TEST_P(CpuSpeedTest, TestScreencastQ0) { EXPECT_GE(min_psnr_, kMaxPSNR); } +TEST_P(CpuSpeedTest, TestTuneScreen) { + ::libvpx_test::Y4mVideoSource video("screendata.y4m", 0, 25); + cfg_.g_timebase = video.timebase(); + cfg_.rc_2pass_vbr_minsection_pct = 5; + cfg_.rc_2pass_vbr_minsection_pct = 2000; + cfg_.rc_target_bitrate = 2000; + cfg_.rc_max_quantizer = 63; + cfg_.rc_min_quantizer = 0; + tune_content_ = VP9E_CONTENT_SCREEN; + + init_flags_ = VPX_CODEC_USE_PSNR; + + ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); +} + TEST_P(CpuSpeedTest, TestEncodeHighBitrate) { // Validate that this non multiple of 64 wide clip encodes and decodes // without a mismatch when passing in a very low max q. This pushes