diff options
author | Erwin Jansen <jansene@google.com> | 2021-06-30 07:29:26 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2021-06-30 07:29:26 +0000 |
commit | 059cdc5996938f5f6b5343b6c969c12098275587 (patch) | |
tree | 6eacaffe4bebf8e00c290c1e1839e084b0c52e88 /third_party/libaom/source/libaom/test/ethread_test.cc | |
parent | 97e54a7e73c7b24e464ef06ef3c3b3716f21bb15 (diff) | |
parent | 16be34ae72cdb525c88c2b31b21b976f35fe36d8 (diff) | |
download | webrtc-059cdc5996938f5f6b5343b6c969c12098275587.tar.gz |
Merge "Merge upstream-master and enable ARM64" into emu-master-devemu-31-stable-releaseemu-31-release
Diffstat (limited to 'third_party/libaom/source/libaom/test/ethread_test.cc')
-rw-r--r-- | third_party/libaom/source/libaom/test/ethread_test.cc | 91 |
1 files changed, 64 insertions, 27 deletions
diff --git a/third_party/libaom/source/libaom/test/ethread_test.cc b/third_party/libaom/source/libaom/test/ethread_test.cc index 5bf8762052..78811b65cf 100644 --- a/third_party/libaom/source/libaom/test/ethread_test.cc +++ b/third_party/libaom/source/libaom/test/ethread_test.cc @@ -21,6 +21,9 @@ #include "av1/encoder/firstpass.h" namespace { +const unsigned int kCqLevel = 18; + +#if !CONFIG_REALTIME_ONLY const size_t kFirstPassStatsSz = sizeof(FIRSTPASS_STATS); class AVxFirstPassEncoderThreadTest : public ::libaom_test::CodecTestWith4Params<libaom_test::TestMode, int, @@ -196,6 +199,7 @@ TEST_P(AVxFirstPassEncoderThreadTest, FirstPassStatsTest) { // Comparison 4 (between threads=4 and threads=8). compare_fp_stats_md5(&firstpass_stats); } +#endif // !CONFIG_REALTIME_ONLY class AVxEncoderThreadTest : public ::libaom_test::CodecTestWith5Params<libaom_test::TestMode, int, @@ -227,11 +231,12 @@ class AVxEncoderThreadTest virtual void SetUp() { InitializeConfig(encoding_mode_); - if (encoding_mode_ != ::libaom_test::kRealTime) { + if (encoding_mode_ == ::libaom_test::kOnePassGood || + encoding_mode_ == ::libaom_test::kTwoPassGood) { cfg_.g_lag_in_frames = 6; cfg_.rc_2pass_vbr_minsection_pct = 5; cfg_.rc_2pass_vbr_maxsection_pct = 2000; - } else { + } else if (encoding_mode_ == ::libaom_test::kRealTime) { cfg_.g_error_resilient = 1; } cfg_.rc_max_quantizer = 56; @@ -248,18 +253,22 @@ class AVxEncoderThreadTest SetTileSize(encoder); encoder->Control(AOME_SET_CPUUSED, set_cpu_used_); encoder->Control(AV1E_SET_ROW_MT, row_mt_); - if (encoding_mode_ != ::libaom_test::kRealTime) { + if (encoding_mode_ == ::libaom_test::kOnePassGood || + encoding_mode_ == ::libaom_test::kTwoPassGood) { encoder->Control(AOME_SET_ENABLEAUTOALTREF, 1); encoder->Control(AOME_SET_ARNR_MAXFRAMES, 5); encoder->Control(AOME_SET_ARNR_STRENGTH, 5); encoder->Control(AV1E_SET_FRAME_PARALLEL_DECODING, 0); encoder->Control(AV1E_SET_MAX_GF_INTERVAL, 4); - } else { + } else if (encoding_mode_ == ::libaom_test::kRealTime) { encoder->Control(AOME_SET_ENABLEAUTOALTREF, 0); encoder->Control(AV1E_SET_AQ_MODE, 3); encoder->Control(AV1E_SET_COEFF_COST_UPD_FREQ, 2); encoder->Control(AV1E_SET_MODE_COST_UPD_FREQ, 2); encoder->Control(AV1E_SET_MV_COST_UPD_FREQ, 3); + encoder->Control(AV1E_SET_DV_COST_UPD_FREQ, 3); + } else { + encoder->Control(AOME_SET_CQ_LEVEL, kCqLevel); } encoder_initialized_ = true; } @@ -423,31 +432,60 @@ class AVxEncoderThreadTest std::vector<std::string> md5_dec_; }; -TEST_P(AVxEncoderThreadTest, EncoderResultTest) { +class AVxEncoderThreadRTTest : public AVxEncoderThreadTest {}; + +TEST_P(AVxEncoderThreadRTTest, EncoderResultTest) { cfg_.large_scale_tile = 0; decoder_->Control(AV1_SET_TILE_MODE, 0); DoTest(); } -class AVxEncoderThreadRTTest : public AVxEncoderThreadTest {}; +// For real time mode, test speed 6, 7, 8, 9. +AV1_INSTANTIATE_TEST_SUITE(AVxEncoderThreadRTTest, + ::testing::Values(::libaom_test::kRealTime), + ::testing::Values(6, 7, 8, 9), + ::testing::Values(0, 2), ::testing::Values(0, 2), + ::testing::Values(0, 1)); -TEST_P(AVxEncoderThreadRTTest, EncoderResultTest) { +#if !CONFIG_REALTIME_ONLY + +// The AVxEncoderThreadTestLarge takes up ~14% of total run-time of the +// Valgrind long tests. Exclude it; the smaller tests are still run. +#if !AOM_VALGRIND_BUILD +class AVxEncoderThreadTestLarge : public AVxEncoderThreadTest {}; + +TEST_P(AVxEncoderThreadTestLarge, EncoderResultTest) { cfg_.large_scale_tile = 0; decoder_->Control(AV1_SET_TILE_MODE, 0); DoTest(); } -class AVxEncoderThreadTestLarge : public AVxEncoderThreadTest {}; +// Test cpu_used 0, 1, 3 and 5. +AV1_INSTANTIATE_TEST_SUITE(AVxEncoderThreadTestLarge, + ::testing::Values(::libaom_test::kTwoPassGood, + ::libaom_test::kOnePassGood), + ::testing::Values(0, 1, 3, 5), + ::testing::Values(1, 6), ::testing::Values(1, 6), + ::testing::Values(0, 1)); +#endif // !AOM_VALGRIND_BUILD -TEST_P(AVxEncoderThreadTestLarge, EncoderResultTest) { +TEST_P(AVxEncoderThreadTest, EncoderResultTest) { cfg_.large_scale_tile = 0; decoder_->Control(AV1_SET_TILE_MODE, 0); DoTest(); } -class AVxEncoderThreadRTTestLarge : public AVxEncoderThreadTest {}; +class AVxEncoderThreadAllIntraTest : public AVxEncoderThreadTest {}; -TEST_P(AVxEncoderThreadRTTestLarge, EncoderResultTest) { +TEST_P(AVxEncoderThreadAllIntraTest, EncoderResultTest) { + cfg_.large_scale_tile = 0; + decoder_->Control(AV1_SET_TILE_MODE, 0); + DoTest(); +} + +class AVxEncoderThreadAllIntraTestLarge : public AVxEncoderThreadTest {}; + +TEST_P(AVxEncoderThreadAllIntraTestLarge, EncoderResultTest) { cfg_.large_scale_tile = 0; decoder_->Control(AV1_SET_TILE_MODE, 0); DoTest(); @@ -466,26 +504,20 @@ AV1_INSTANTIATE_TEST_SUITE(AVxEncoderThreadTest, ::testing::Values(2), ::testing::Values(0, 2), ::testing::Values(0, 2), ::testing::Values(0, 1)); -// Test cpu_used 7, 8, 9 here. -AV1_INSTANTIATE_TEST_SUITE(AVxEncoderThreadRTTest, - ::testing::Values(::libaom_test::kRealTime), - ::testing::Values(7, 8, 9), ::testing::Values(0, 2), +// For all intra mode, test speed 0, 2, 4, 6, 8. +// Only test cpu_used 6 here. +AV1_INSTANTIATE_TEST_SUITE(AVxEncoderThreadAllIntraTest, + ::testing::Values(::libaom_test::kAllIntra), + ::testing::Values(6), ::testing::Values(0, 2), ::testing::Values(0, 2), ::testing::Values(0, 1)); -// Test cpu_used 0, 1, 3 and 5. -AV1_INSTANTIATE_TEST_SUITE(AVxEncoderThreadTestLarge, - ::testing::Values(::libaom_test::kTwoPassGood, - ::libaom_test::kOnePassGood), - ::testing::Values(0, 1, 3, 5), - ::testing::Values(1, 6), ::testing::Values(1, 6), - ::testing::Values(0, 1)); - -// Test cpu_used 0, 2, 4 and 6. -AV1_INSTANTIATE_TEST_SUITE(AVxEncoderThreadRTTestLarge, - ::testing::Values(::libaom_test::kRealTime), - ::testing::Values(0, 2, 4, 6), +// Test cpu_used 0, 2, 4 and 8. +AV1_INSTANTIATE_TEST_SUITE(AVxEncoderThreadAllIntraTestLarge, + ::testing::Values(::libaom_test::kAllIntra), + ::testing::Values(0, 2, 4, 8), ::testing::Values(1, 6), ::testing::Values(1, 6), ::testing::Values(0, 1)); +#endif // !CONFIG_REALTIME_ONLY class AVxEncoderThreadLSTest : public AVxEncoderThreadTest { virtual void SetTileSize(libaom_test::Encoder *encoder) { @@ -512,6 +544,10 @@ TEST_P(AVxEncoderThreadLSTest, EncoderResultTest) { DoTest(); } +// AVxEncoderThreadLSTestLarge takes up about 2% of total run-time of +// the Valgrind long tests. Since we already run AVxEncoderThreadLSTest, +// skip this one for Valgrind. +#if !CONFIG_REALTIME_ONLY && !AOM_VALGRIND_BUILD class AVxEncoderThreadLSTestLarge : public AVxEncoderThreadLSTest {}; TEST_P(AVxEncoderThreadLSTestLarge, EncoderResultTest) { @@ -526,4 +562,5 @@ AV1_INSTANTIATE_TEST_SUITE(AVxEncoderThreadLSTestLarge, ::libaom_test::kOnePassGood), ::testing::Values(1, 3), ::testing::Values(0, 6), ::testing::Values(0, 6), ::testing::Values(1)); +#endif // !CONFIG_REALTIME_ONLY && !AOM_VALGRIND_BUILD } // namespace |