Turn on codec behavior unit tests for vp10
authorJingning Han <jingning@google.com>
Wed, 19 Aug 2015 21:13:18 +0000 (14:13 -0700)
committerJingning Han <jingning@google.com>
Sat, 22 Aug 2015 00:00:43 +0000 (00:00 +0000)
This commit adds codec behavior unit tests for vp10.

Change-Id: Ieb49cb66f0b29679ff2a3e2c0804d1ebbf48f986

test/borders_test.cc
test/cpu_speed_test.cc
test/encode_test_driver.cc
test/error_resilience_test.cc
test/superframe_test.cc
test/tile_independence_test.cc
test/vp9_arf_freq_test.cc
test/vp9_encoder_parms_get_to_decoder.cc
test/vp9_end_to_end_test.cc
test/vp9_ethread_test.cc
test/vp9_lossless_test.cc

index b30be45..6592375 100644 (file)
@@ -80,4 +80,7 @@ TEST_P(BordersTest, TestLowBitrate) {
 
 VP9_INSTANTIATE_TEST_CASE(BordersTest, ::testing::Values(
     ::libvpx_test::kTwoPassGood));
+
+VP10_INSTANTIATE_TEST_CASE(BordersTest, ::testing::Values(
+    ::libvpx_test::kTwoPassGood));
 }  // namespace
index 4477bf0..8baa2f9 100644 (file)
@@ -140,4 +140,9 @@ VP9_INSTANTIATE_TEST_CASE(
     ::testing::Values(::libvpx_test::kTwoPassGood, ::libvpx_test::kOnePassGood,
                       ::libvpx_test::kRealTime),
     ::testing::Range(0, 9));
+
+VP10_INSTANTIATE_TEST_CASE(
+    CpuSpeedTest,
+    ::testing::Values(::libvpx_test::kTwoPassGood, ::libvpx_test::kOnePassGood),
+    ::testing::Range(0, 3));
 }  // namespace
index e734bc9..be4ef9a 100644 (file)
@@ -43,6 +43,15 @@ void Encoder::InitEncoder(VideoSource *video) {
       ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
     } else
 #endif
+#if CONFIG_VP10_ENCODER
+    if (CodecInterface() == &vpx_codec_vp10_cx_algo) {
+      // Default to 1 tile column for VP10.
+      const int log2_tile_columns = 0;
+      res = vpx_codec_control_(&encoder_, VP9E_SET_TILE_COLUMNS,
+                               log2_tile_columns);
+      ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
+    } else
+#endif
     {
 #if CONFIG_VP8_ENCODER
       ASSERT_EQ(&vpx_codec_vp8_cx_algo, CodecInterface())
index 9a99a80..9e512ad 100644 (file)
@@ -583,4 +583,5 @@ VP8_INSTANTIATE_TEST_CASE(ErrorResilienceTestLarge, ONE_PASS_TEST_MODES);
 VP8_INSTANTIATE_TEST_CASE(ErrorResilienceTestLargeCodecControls,
                           ONE_PASS_TEST_MODES);
 VP9_INSTANTIATE_TEST_CASE(ErrorResilienceTestLarge, ONE_PASS_TEST_MODES);
+VP10_INSTANTIATE_TEST_CASE(ErrorResilienceTestLarge, ONE_PASS_TEST_MODES);
 }  // namespace
index c0f542d..a8102b7 100644 (file)
@@ -94,4 +94,7 @@ TEST_P(SuperframeTest, TestSuperframeIndexIsOptional) {
 
 VP9_INSTANTIATE_TEST_CASE(SuperframeTest, ::testing::Values(
     ::libvpx_test::kTwoPassGood));
+
+VP10_INSTANTIATE_TEST_CASE(SuperframeTest, ::testing::Values(
+    ::libvpx_test::kTwoPassGood));
 }  // namespace
index b9f879d..193bd45 100644 (file)
@@ -104,4 +104,5 @@ TEST_P(TileIndependenceTest, MD5Match) {
 
 VP9_INSTANTIATE_TEST_CASE(TileIndependenceTest, ::testing::Range(0, 2, 1));
 
+VP10_INSTANTIATE_TEST_CASE(TileIndependenceTest, ::testing::Range(0, 2, 1));
 }  // namespace
index aa3e34d..87ff15b 100644 (file)
@@ -229,4 +229,10 @@ VP9_INSTANTIATE_TEST_CASE(
     ::testing::ValuesIn(kTestVectors),
     ::testing::ValuesIn(kEncodeVectors),
     ::testing::ValuesIn(kMinArfVectors));
+
+VP10_INSTANTIATE_TEST_CASE(
+    ArfFreqTest,
+    ::testing::ValuesIn(kTestVectors),
+    ::testing::ValuesIn(kEncodeVectors),
+    ::testing::ValuesIn(kMinArfVectors));
 }  // namespace
index 2049466..a02070e 100644 (file)
@@ -86,17 +86,17 @@ int is_extension_y4m(const char *filename) {
     return !strcmp(dot, ".y4m");
 }
 
-class Vp9EncoderParmsGetToDecoder
+class VpxEncoderParmsGetToDecoder
     : public ::libvpx_test::EncoderTest,
       public ::libvpx_test::CodecTestWith2Params<EncodeParameters, \
                                                  EncodePerfTestVideo> {
  protected:
-  Vp9EncoderParmsGetToDecoder()
+  VpxEncoderParmsGetToDecoder()
       : EncoderTest(GET_PARAM(0)),
         encode_parms(GET_PARAM(1)) {
   }
 
-  virtual ~Vp9EncoderParmsGetToDecoder() {}
+  virtual ~VpxEncoderParmsGetToDecoder() {}
 
   virtual void SetUp() {
     InitializeConfig();
@@ -166,7 +166,7 @@ class Vp9EncoderParmsGetToDecoder
 
 // TODO(hkuang): This test conflicts with frame parallel decode. So disable it
 // for now until fix.
-TEST_P(Vp9EncoderParmsGetToDecoder, DISABLED_BitstreamParms) {
+TEST_P(VpxEncoderParmsGetToDecoder, DISABLED_BitstreamParms) {
   init_flags_ = VPX_CODEC_USE_PSNR;
 
   libvpx_test::VideoSource *video;
@@ -187,8 +187,12 @@ TEST_P(Vp9EncoderParmsGetToDecoder, DISABLED_BitstreamParms) {
 }
 
 VP9_INSTANTIATE_TEST_CASE(
-    Vp9EncoderParmsGetToDecoder,
+    VpxEncoderParmsGetToDecoder,
     ::testing::ValuesIn(kVP9EncodeParameterSet),
     ::testing::ValuesIn(kVP9EncodePerfTestVectors));
 
+VP10_INSTANTIATE_TEST_CASE(
+    VpxEncoderParmsGetToDecoder,
+    ::testing::ValuesIn(kVP9EncodeParameterSet),
+    ::testing::ValuesIn(kVP9EncodePerfTestVectors));
 }  // namespace
index 0fea603..e100eb9 100644 (file)
@@ -187,4 +187,9 @@ VP9_INSTANTIATE_TEST_CASE(
     ::testing::ValuesIn(kTestVectors),
     ::testing::ValuesIn(kCpuUsedVectors));
 
+VP10_INSTANTIATE_TEST_CASE(
+    EndToEndTestLarge,
+    ::testing::ValuesIn(kEncodingModeVectors),
+    ::testing::ValuesIn(kTestVectors),
+    ::testing::ValuesIn(kCpuUsedVectors));
 }  // namespace
index 20d5895..63f6dfe 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),
@@ -36,7 +36,7 @@ class VP9EncoderThreadTest
 
     md5_.clear();
   }
-  virtual ~VP9EncoderThreadTest() {
+  virtual ~VPxEncoderThreadTest() {
     delete decoder_;
   }
 
@@ -105,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);
@@ -130,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
index 4177393..09c1070 100644 (file)
@@ -127,4 +127,8 @@ VP9_INSTANTIATE_TEST_CASE(LosslessTest,
                           ::testing::Values(::libvpx_test::kRealTime,
                                             ::libvpx_test::kOnePassGood,
                                             ::libvpx_test::kTwoPassGood));
+
+VP10_INSTANTIATE_TEST_CASE(LosslessTest,
+                           ::testing::Values(::libvpx_test::kOnePassGood,
+                                             ::libvpx_test::kTwoPassGood));
 }  // namespace