shithub: libvpx

Download patch

ref: 0ae1628f7e52ab498a9582f4f96c36acbec7198e
parent: d46f614ca96e87db5098b77d7b3b1ddd0041ccf3
author: Jerome Jiang <[email protected]>
date: Mon Apr 16 10:25:51 EDT 2018

vp9: fix multiple run for vp9 datarate tests using one bitrate.

Change-Id: I1458bf25fadc23e8be5a9532a153d7129a53accf

--- a/test/vp9_datarate_test.cc
+++ b/test/vp9_datarate_test.cc
@@ -231,6 +231,22 @@
   }
 };
 
+// Params: test mode, speed setting.
+class DatarateTestVP9LargeOneBR
+    : public DatarateTestVP9,
+      public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
+ public:
+  DatarateTestVP9LargeOneBR() : DatarateTestVP9(GET_PARAM(0)) {}
+
+ protected:
+  virtual void SetUp() {
+    InitializeConfig();
+    SetMode(GET_PARAM(1));
+    set_cpu_used_ = GET_PARAM(2);
+    ResetModel();
+  }
+};
+
 // Check basic rate targeting for VBR mode with 0 lag.
 TEST_P(DatarateTestVP9Large, BasicRateTargetingVBRLagZero) {
   cfg_.rc_min_quantizer = 0;
@@ -365,7 +381,7 @@
 }
 
 // Check basic rate targeting for CBR mode, with 2 threads and dropped frames.
-TEST_P(DatarateTestVP9Large, BasicRateTargetingDropFramesMultiThreads) {
+TEST_P(DatarateTestVP9LargeOneBR, BasicRateTargetingDropFramesMultiThreads) {
   cfg_.rc_buf_initial_sz = 500;
   cfg_.rc_buf_optimal_sz = 500;
   cfg_.rc_buf_sz = 1000;
@@ -560,7 +576,8 @@
 // Check basic rate targeting for 3 temporal layers, with frame dropping.
 // Only for one (low) bitrate with lower max_quantizer, and somewhat higher
 // frame drop threshold, to force frame dropping.
-TEST_P(DatarateTestVP9Large, BasicRateTargeting3TemporalLayersFrameDropping) {
+TEST_P(DatarateTestVP9LargeOneBR,
+       BasicRateTargeting3TemporalLayersFrameDropping) {
   cfg_.rc_buf_initial_sz = 500;
   cfg_.rc_buf_optimal_sz = 500;
   cfg_.rc_buf_sz = 1000;
@@ -808,6 +825,11 @@
                           ::testing::Values(::libvpx_test::kOnePassGood,
                                             ::libvpx_test::kRealTime),
                           ::testing::Range(2, 9), ::testing::Range(0, 4));
+
+VP9_INSTANTIATE_TEST_CASE(DatarateTestVP9LargeOneBR,
+                          ::testing::Values(::libvpx_test::kOnePassGood,
+                                            ::libvpx_test::kRealTime),
+                          ::testing::Range(2, 9));
 
 VP9_INSTANTIATE_TEST_CASE(DatarateTestVP9RealTime, ::testing::Range(5, 9));