]> granicus.if.org Git - libvpx/blobdiff - test/vp9_ethread_test.cc
Merge "build/make/configure.sh: Fix armv7 builds in Xcode7."
[libvpx] / test / vp9_ethread_test.cc
index ea1e0d79f2609fad0796fbf8b4428cc237c7c43f..63f6dfea73f8af4ed04d3f40b9e46acc9a52d9e6 100644 (file)
 #include "test/y4m_video_source.h"
 
 namespace {
-class VP9EncoderThreadTest
+class VPxEncoderThreadTest
     : public ::libvpx_test::EncoderTest,
       public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
  protected:
-  VP9EncoderThreadTest()
+  VPxEncoderThreadTest()
       : EncoderTest(GET_PARAM(0)),
+        encoder_initialized_(false),
         tiles_(2),
         encoding_mode_(GET_PARAM(1)),
         set_cpu_used_(GET_PARAM(2)) {
@@ -35,7 +36,7 @@ class VP9EncoderThreadTest
 
     md5_.clear();
   }
-  virtual ~VP9EncoderThreadTest() {
+  virtual ~VPxEncoderThreadTest() {
     delete decoder_;
   }
 
@@ -57,9 +58,13 @@ class VP9EncoderThreadTest
     cfg_.rc_min_quantizer = 0;
   }
 
+  virtual void BeginPassHook(unsigned int /*pass*/) {
+    encoder_initialized_ = false;
+  }
+
   virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
                                   ::libvpx_test::Encoder *encoder) {
-    if (video->frame() == 0) {
+    if (!encoder_initialized_) {
       // Encode 4 column tiles.
       encoder->Control(VP9E_SET_TILE_COLUMNS, tiles_);
       encoder->Control(VP8E_SET_CPUUSED, set_cpu_used_);
@@ -70,7 +75,9 @@ class VP9EncoderThreadTest
         encoder->Control(VP8E_SET_ARNR_TYPE, 3);
       } else {
         encoder->Control(VP8E_SET_ENABLEAUTOALTREF, 0);
+        encoder->Control(VP9E_SET_AQ_MODE, 3);
       }
+      encoder_initialized_ = true;
     }
   }
 
@@ -90,6 +97,7 @@ class VP9EncoderThreadTest
     }
   }
 
+  bool encoder_initialized_;
   int tiles_;
   ::libvpx_test::TestMode encoding_mode_;
   int set_cpu_used_;
@@ -97,7 +105,7 @@ class VP9EncoderThreadTest
   std::vector<std::string> md5_;
 };
 
-TEST_P(VP9EncoderThreadTest, EncoderResultTest) {
+TEST_P(VPxEncoderThreadTest, EncoderResultTest) {
   std::vector<std::string> single_thr_md5, multi_thr_md5;
 
   ::libvpx_test::Y4mVideoSource video("niklas_1280_720_30.y4m", 15, 20);
@@ -122,8 +130,13 @@ TEST_P(VP9EncoderThreadTest, EncoderResultTest) {
 }
 
 VP9_INSTANTIATE_TEST_CASE(
-    VP9EncoderThreadTest,
+    VPxEncoderThreadTest,
     ::testing::Values(::libvpx_test::kTwoPassGood, ::libvpx_test::kOnePassGood,
                       ::libvpx_test::kRealTime),
     ::testing::Range(1, 9));
+
+VP10_INSTANTIATE_TEST_CASE(
+    VPxEncoderThreadTest,
+    ::testing::Values(::libvpx_test::kTwoPassGood, ::libvpx_test::kOnePassGood),
+    ::testing::Range(1, 3));
 }  // namespace