-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright 2024 Google LLC | ||
// SPDX-License-Identifier: BSD-2-Clause | ||
|
||
#include "avif/avif.h" | ||
#include "aviftest_helpers.h" | ||
#include "gtest/gtest.h" | ||
|
||
namespace avif { | ||
namespace { | ||
|
||
// Used to pass the data folder path to the GoogleTest suites. | ||
const char* data_path = nullptr; | ||
|
||
//------------------------------------------------------------------------------ | ||
|
||
TEST(IlocTest, TwoExtents) { | ||
if (!testutil::Av1DecoderAvailable()) { | ||
GTEST_SKIP() << "AV1 Codec unavailable, skip test."; | ||
} | ||
|
||
const ImagePtr source = | ||
testutil::ReadImage(data_path, "ArcTriomphe-cHRM-orig.png"); | ||
const ImagePtr decoded = | ||
testutil::DecodeFile(std::string(data_path) + | ||
"arc_triomphe_extent1000_nullbyte_extent1310.avif"); | ||
ASSERT_NE(source, nullptr); | ||
ASSERT_NE(decoded, nullptr); | ||
const double psnr = testutil::GetPsnr(*source, *decoded); | ||
EXPECT_GT(psnr, 30.0); | ||
EXPECT_LT(psnr, 45.0); | ||
} | ||
|
||
//------------------------------------------------------------------------------ | ||
|
||
} // namespace | ||
} // namespace avif | ||
|
||
int main(int argc, char** argv) { | ||
::testing::InitGoogleTest(&argc, argv); | ||
if (argc != 2) { | ||
std::cerr << "There must be exactly one argument containing the path to " | ||
"the test data folder" | ||
<< std::endl; | ||
return 1; | ||
} | ||
avif::data_path = argv[1]; | ||
return RUN_ALL_TESTS(); | ||
} |