summaryrefslogtreecommitdiffstats
path: root/third_party/aom/test/end_to_end_test.cc
diff options
context:
space:
mode:
authortrav90 <travawine@palemoon.org>2018-10-19 21:52:15 -0500
committertrav90 <travawine@palemoon.org>2018-10-19 21:52:20 -0500
commitbbcc64772580c8a979288791afa02d30bc476d2e (patch)
tree437ce94c3fdd7497508e5b55de06c6d011678597 /third_party/aom/test/end_to_end_test.cc
parent14805f6ddbfb173c327768fff9f81f40ce5e81b0 (diff)
downloadUXP-bbcc64772580c8a979288791afa02d30bc476d2e.tar
UXP-bbcc64772580c8a979288791afa02d30bc476d2e.tar.gz
UXP-bbcc64772580c8a979288791afa02d30bc476d2e.tar.lz
UXP-bbcc64772580c8a979288791afa02d30bc476d2e.tar.xz
UXP-bbcc64772580c8a979288791afa02d30bc476d2e.zip
Update aom to v1.0.0
Update aom to commit id d14c5bb4f336ef1842046089849dee4a301fbbf0.
Diffstat (limited to 'third_party/aom/test/end_to_end_test.cc')
-rw-r--r--third_party/aom/test/end_to_end_test.cc102
1 files changed, 39 insertions, 63 deletions
diff --git a/third_party/aom/test/end_to_end_test.cc b/third_party/aom/test/end_to_end_test.cc
index e1a833ec4..1ac0ae931 100644
--- a/third_party/aom/test/end_to_end_test.cc
+++ b/third_party/aom/test/end_to_end_test.cc
@@ -7,7 +7,7 @@
* obtain it at www.aomedia.org/license/software. If the Alliance for Open
* Media Patent License 1.0 was not distributed with this source code in the
* PATENTS file, you can obtain it at www.aomedia.org/license/patent.
-*/
+ */
#include "third_party/googletest/src/googletest/include/gtest/gtest.h"
@@ -30,7 +30,7 @@ const double kPsnrThreshold[][5] = {
// AV1 HBD average PSNR is slightly lower than AV1.
// We make two cases here to enable the testing and
// guard picture quality.
-#if CONFIG_AV1_ENCODER && CONFIG_HIGHBITDEPTH
+#if CONFIG_AV1_ENCODER
{ 36.0, 37.0, 37.0, 37.0, 37.0 }, { 31.0, 36.0, 36.0, 36.0, 36.0 },
{ 31.0, 35.0, 35.0, 35.0, 35.0 }, { 31.0, 34.0, 34.0, 34.0, 34.0 },
{ 31.0, 33.0, 33.0, 33.0, 33.0 }, { 31.0, 32.0, 32.0, 32.0, 32.0 },
@@ -40,7 +40,7 @@ const double kPsnrThreshold[][5] = {
{ 34.0, 35.0, 35.0, 35.0, 35.0 }, { 33.0, 34.0, 34.0, 34.0, 34.0 },
{ 32.0, 33.0, 33.0, 33.0, 33.0 }, { 31.0, 32.0, 32.0, 32.0, 32.0 },
{ 30.0, 31.0, 31.0, 31.0, 31.0 }, { 29.0, 30.0, 30.0, 30.0, 30.0 },
-#endif // CONFIG_HIGHBITDEPTH && CONFIG_AV1_ENCODER
+#endif // CONFIG_AV1_ENCODER
};
typedef struct {
@@ -53,24 +53,20 @@ typedef struct {
const TestVideoParam kTestVectors[] = {
{ "park_joy_90p_8_420.y4m", 8, AOM_IMG_FMT_I420, AOM_BITS_8, 0 },
- { "park_joy_90p_8_422.y4m", 8, AOM_IMG_FMT_I422, AOM_BITS_8, 1 },
+ { "park_joy_90p_8_422.y4m", 8, AOM_IMG_FMT_I422, AOM_BITS_8, 2 },
{ "park_joy_90p_8_444.y4m", 8, AOM_IMG_FMT_I444, AOM_BITS_8, 1 },
- { "park_joy_90p_8_440.yuv", 8, AOM_IMG_FMT_I440, AOM_BITS_8, 1 },
-#if CONFIG_HIGHBITDEPTH
- { "park_joy_90p_10_420.y4m", 10, AOM_IMG_FMT_I42016, AOM_BITS_10, 2 },
- { "park_joy_90p_10_422.y4m", 10, AOM_IMG_FMT_I42216, AOM_BITS_10, 3 },
- { "park_joy_90p_10_444.y4m", 10, AOM_IMG_FMT_I44416, AOM_BITS_10, 3 },
- { "park_joy_90p_10_440.yuv", 10, AOM_IMG_FMT_I44016, AOM_BITS_10, 3 },
+ { "park_joy_90p_10_420.y4m", 10, AOM_IMG_FMT_I42016, AOM_BITS_10, 0 },
+ { "park_joy_90p_10_422.y4m", 10, AOM_IMG_FMT_I42216, AOM_BITS_10, 2 },
+ { "park_joy_90p_10_444.y4m", 10, AOM_IMG_FMT_I44416, AOM_BITS_10, 1 },
{ "park_joy_90p_12_420.y4m", 12, AOM_IMG_FMT_I42016, AOM_BITS_12, 2 },
- { "park_joy_90p_12_422.y4m", 12, AOM_IMG_FMT_I42216, AOM_BITS_12, 3 },
- { "park_joy_90p_12_444.y4m", 12, AOM_IMG_FMT_I44416, AOM_BITS_12, 3 },
- { "park_joy_90p_12_440.yuv", 12, AOM_IMG_FMT_I44016, AOM_BITS_12, 3 },
-#endif // CONFIG_HIGHBITDEPTH
+ { "park_joy_90p_12_422.y4m", 12, AOM_IMG_FMT_I42216, AOM_BITS_12, 2 },
+ { "park_joy_90p_12_444.y4m", 12, AOM_IMG_FMT_I44416, AOM_BITS_12, 2 },
};
// Encoding modes tested
const libaom_test::TestMode kEncodingModeVectors[] = {
- ::libaom_test::kTwoPassGood, ::libaom_test::kOnePassGood,
+ ::libaom_test::kTwoPassGood,
+ ::libaom_test::kOnePassGood,
::libaom_test::kRealTime,
};
@@ -150,6 +146,32 @@ class EndToEndTest
return kPsnrThreshold[cpu_used_][encoding_mode_];
}
+ void DoTest() {
+ cfg_.rc_target_bitrate = kBitrate;
+ cfg_.g_error_resilient = 0;
+ cfg_.g_profile = test_video_param_.profile;
+ cfg_.g_input_bit_depth = test_video_param_.input_bit_depth;
+ cfg_.g_bit_depth = test_video_param_.bit_depth;
+ init_flags_ = AOM_CODEC_USE_PSNR;
+ if (cfg_.g_bit_depth > 8) init_flags_ |= AOM_CODEC_USE_HIGHBITDEPTH;
+
+ testing::internal::scoped_ptr<libaom_test::VideoSource> video;
+ if (is_extension_y4m(test_video_param_.filename)) {
+ video.reset(new libaom_test::Y4mVideoSource(test_video_param_.filename, 0,
+ kFrames));
+ } else {
+ video.reset(new libaom_test::YUVVideoSource(
+ test_video_param_.filename, test_video_param_.fmt, kWidth, kHeight,
+ kFramerate, 1, 0, kFrames));
+ }
+ ASSERT_TRUE(video.get() != NULL);
+
+ ASSERT_NO_FATAL_FAILURE(RunLoop(video.get()));
+ const double psnr = GetAveragePsnr();
+ EXPECT_GT(psnr, GetPsnrThreshold())
+ << "cpu used = " << cpu_used_ << ", encoding mode = " << encoding_mode_;
+ }
+
TestVideoParam test_video_param_;
int cpu_used_;
@@ -161,55 +183,9 @@ class EndToEndTest
class EndToEndTestLarge : public EndToEndTest {};
-TEST_P(EndToEndTestLarge, EndtoEndPSNRTest) {
- cfg_.rc_target_bitrate = kBitrate;
- cfg_.g_error_resilient = 0;
- cfg_.g_profile = test_video_param_.profile;
- cfg_.g_input_bit_depth = test_video_param_.input_bit_depth;
- cfg_.g_bit_depth = test_video_param_.bit_depth;
- init_flags_ = AOM_CODEC_USE_PSNR;
- if (cfg_.g_bit_depth > 8) init_flags_ |= AOM_CODEC_USE_HIGHBITDEPTH;
-
- testing::internal::scoped_ptr<libaom_test::VideoSource> video;
- if (is_extension_y4m(test_video_param_.filename)) {
- video.reset(new libaom_test::Y4mVideoSource(test_video_param_.filename, 0,
- kFrames));
- } else {
- video.reset(new libaom_test::YUVVideoSource(
- test_video_param_.filename, test_video_param_.fmt, kWidth, kHeight,
- kFramerate, 1, 0, kFrames));
- }
- ASSERT_TRUE(video.get() != NULL);
+TEST_P(EndToEndTestLarge, EndtoEndPSNRTest) { DoTest(); }
- ASSERT_NO_FATAL_FAILURE(RunLoop(video.get()));
- const double psnr = GetAveragePsnr();
- EXPECT_GT(psnr, GetPsnrThreshold());
-}
-
-TEST_P(EndToEndTest, EndtoEndPSNRTest) {
- cfg_.rc_target_bitrate = kBitrate;
- cfg_.g_error_resilient = 0;
- cfg_.g_profile = test_video_param_.profile;
- cfg_.g_input_bit_depth = test_video_param_.input_bit_depth;
- cfg_.g_bit_depth = test_video_param_.bit_depth;
- init_flags_ = AOM_CODEC_USE_PSNR;
- if (cfg_.g_bit_depth > 8) init_flags_ |= AOM_CODEC_USE_HIGHBITDEPTH;
-
- testing::internal::scoped_ptr<libaom_test::VideoSource> video;
- if (is_extension_y4m(test_video_param_.filename)) {
- video.reset(new libaom_test::Y4mVideoSource(test_video_param_.filename, 0,
- kFrames));
- } else {
- video.reset(new libaom_test::YUVVideoSource(
- test_video_param_.filename, test_video_param_.fmt, kWidth, kHeight,
- kFramerate, 1, 0, kFrames));
- }
- ASSERT_TRUE(video.get() != NULL);
-
- ASSERT_NO_FATAL_FAILURE(RunLoop(video.get()));
- const double psnr = GetAveragePsnr();
- EXPECT_GT(psnr, GetPsnrThreshold());
-}
+TEST_P(EndToEndTest, EndtoEndPSNRTest) { DoTest(); }
AV1_INSTANTIATE_TEST_CASE(EndToEndTestLarge,
::testing::ValuesIn(kEncodingModeVectors),