shithub: libvpx

Download patch

ref: 9917842f07b16f2d59aeebb9783f473b644a6565
parent: 627a3ddcbef521fb85b1980e701d4d71fb177f40
author: Alex Converse <[email protected]>
date: Tue Mar 15 11:04:14 EDT 2016

Add tests for VP9E_CONTENT_SCREEN.

Change-Id: Id28007576205b7f46957b20eeacb5fda6872663e

--- a/test/cpu_speed_test.cc
+++ b/test/cpu_speed_test.cc
@@ -26,7 +26,8 @@
       : 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 @@
                                   ::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 @@
   ::libvpx_test::TestMode encoding_mode_;
   int set_cpu_used_;
   double min_psnr_;
+  int tune_content_;
 };
 
 TEST_P(CpuSpeedTest, TestQ0) {
@@ -101,6 +104,21 @@
 
   ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
   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) {