From: Harish Mahendrakar Date: Thu, 18 Apr 2019 18:14:22 +0000 (-0700) Subject: test_vector_test: Add row-mt and lpf-opt tests for vp9 decoder X-Git-Tag: v1.8.1~101^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4747e9fd50ed419618e6206439a91a3e74a0531a;p=libvpx test_vector_test: Add row-mt and lpf-opt tests for vp9 decoder BUG=webm:1619 Change-Id: I4e835a6375523da04a2c4febb2fb441a5f2d56c5 --- diff --git a/test/test_vector_test.cc b/test/test_vector_test.cc index f3e585dc9..5a9737122 100644 --- a/test/test_vector_test.cc +++ b/test/test_vector_test.cc @@ -32,9 +32,10 @@ namespace { const int kThreads = 0; -const int kFileName = 1; +const int kMtMode = 1; +const int kFileName = 2; -typedef std::tuple DecodeParam; +typedef std::tuple DecodeParam; class TestVectorTest : public ::libvpx_test::DecoderTest, public ::libvpx_test::CodecTestWithParam { @@ -57,6 +58,25 @@ class TestVectorTest : public ::libvpx_test::DecoderTest, << "Md5 file open failed. Filename: " << md5_file_name_; } +#if CONFIG_VP9_DECODER + virtual void PreDecodeFrameHook( + const libvpx_test::CompressedVideoSource &video, + libvpx_test::Decoder *decoder) { + if (video.frame_number() == 0 && mt_mode_ >= 0) { + if (mt_mode_ == 1) { + decoder->Control(VP9D_SET_LOOP_FILTER_OPT, 1); + decoder->Control(VP9D_SET_ROW_MT, 0); + } else if (mt_mode_ == 2) { + decoder->Control(VP9D_SET_LOOP_FILTER_OPT, 0); + decoder->Control(VP9D_SET_ROW_MT, 1); + } else { + decoder->Control(VP9D_SET_LOOP_FILTER_OPT, 0); + decoder->Control(VP9D_SET_ROW_MT, 0); + } + } + } +#endif + virtual void DecompressedFrameHook(const vpx_image_t &img, const unsigned int frame_number) { ASSERT_TRUE(md5_file_ != NULL); @@ -80,6 +100,7 @@ class TestVectorTest : public ::libvpx_test::DecoderTest, #if CONFIG_VP9_DECODER std::set resize_clips_; #endif + int mt_mode_; private: FILE *md5_file_; @@ -97,9 +118,10 @@ TEST_P(TestVectorTest, MD5Match) { char str[256]; cfg.threads = std::get(input); - - snprintf(str, sizeof(str) / sizeof(str[0]) - 1, "file: %s threads: %d", - filename.c_str(), cfg.threads); + mt_mode_ = std::get(input); + snprintf(str, sizeof(str) / sizeof(str[0]) - 1, + "file: %s threads: %d MT mode: %d", filename.c_str(), cfg.threads, + mt_mode_); SCOPED_TRACE(str); // Open compressed video file. @@ -134,7 +156,8 @@ TEST_P(TestVectorTest, MD5Match) { VP8_INSTANTIATE_TEST_CASE( TestVectorTest, ::testing::Combine( - ::testing::Values(1), // Single thread. + ::testing::Values(1), // Single thread. + ::testing::Values(-1), // LPF opt and Row MT is not applicable ::testing::ValuesIn(libvpx_test::kVP8TestVectors, libvpx_test::kVP8TestVectors + libvpx_test::kNumVP8TestVectors))); @@ -147,6 +170,7 @@ INSTANTIATE_TEST_CASE_P( static_cast(&libvpx_test::kVP8)), ::testing::Combine( ::testing::Range(2, 9), // With 2 ~ 8 threads. + ::testing::Values(-1), // LPF opt and Row MT is not applicable ::testing::ValuesIn(libvpx_test::kVP8TestVectors, libvpx_test::kVP8TestVectors + libvpx_test::kNumVP8TestVectors)))); @@ -157,7 +181,8 @@ INSTANTIATE_TEST_CASE_P( VP9_INSTANTIATE_TEST_CASE( TestVectorTest, ::testing::Combine( - ::testing::Values(1), // Single thread. + ::testing::Values(1), // Single thread. + ::testing::Values(-1), // LPF opt and Row MT is not applicable ::testing::ValuesIn(libvpx_test::kVP9TestVectors, libvpx_test::kVP9TestVectors + libvpx_test::kNumVP9TestVectors))); @@ -169,6 +194,10 @@ INSTANTIATE_TEST_CASE_P( static_cast(&libvpx_test::kVP9)), ::testing::Combine( ::testing::Range(2, 9), // With 2 ~ 8 threads. + ::testing::Range(0, 3), // With multi threads modes 0 ~ 2 + // 0: LPF opt and Row MT disabled + // 1: LPF opt enabled + // 2: Row MT enabled ::testing::ValuesIn(libvpx_test::kVP9TestVectors, libvpx_test::kVP9TestVectors + libvpx_test::kNumVP9TestVectors))));