diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-09-18 12:44:16 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-09-22 11:42:52 +0200 |
| commit | a757fe63424074e9d3dfe7847a17bfe2b5fd93de (patch) | |
| tree | 3f2f1e10b7379f8a128060dc841ca821327467f6 /test/test.cc | |
| parent | 979e5cac8afd5681669b3e8897ecb7bd8d4eb609 (diff) | |
Rename check_one_frame -> check_one_frame_against_j2c
Diffstat (limited to 'test/test.cc')
| -rw-r--r-- | test/test.cc | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/test/test.cc b/test/test.cc index 143b00ca2..fb5f11902 100644 --- a/test/test.cc +++ b/test/test.cc @@ -823,8 +823,6 @@ check_ffmpeg (boost::filesystem::path ref, boost::filesystem::path check, int au BOOST_REQUIRE_EQUAL (WEXITSTATUS(r), 0); } -void -check_one_frame(boost::filesystem::path dcp_dir, int64_t index, boost::filesystem::path ref, int tolerance) { dcp::DCP dcp (dcp_dir); dcp.read (); @@ -834,18 +832,26 @@ check_one_frame(boost::filesystem::path dcp_dir, int64_t index, boost::filesyste dcp::MonoJ2KPictureFrame ref_frame(ref); auto image = frame->xyz_image (); +void +check_one_frame_against_j2c(boost::filesystem::path test, int64_t test_index, boost::filesystem::path ref, int tolerance) +{ + auto test_image = get_dcp_frame(test, test_index); + dcp::MonoJ2KPictureFrame ref_frame(ref); auto ref_image = ref_frame.xyz_image(); - BOOST_REQUIRE (image->size() == ref_image->size()); + BOOST_REQUIRE_MESSAGE( + test_image->size() == ref_image->size(), + "Reference is " << ref_image->size().width << "x" << ref_image->size().height + << ", test image is " << test_image->size().width << "x" << test_image->size().height); int off = 0; for (int y = 0; y < ref_image->size().height; ++y) { for (int x = 0; x < ref_image->size().width; ++x) { - auto x_error = std::abs(ref_image->data(0)[off] - image->data(0)[off]); + auto x_error = std::abs(ref_image->data(0)[off] - test_image->data(0)[off]); BOOST_REQUIRE_MESSAGE(x_error <= tolerance, "x component at " << x << "," << y << " differs by " << x_error); - auto y_error = std::abs(ref_image->data(1)[off] - image->data(1)[off]); + auto y_error = std::abs(ref_image->data(1)[off] - test_image->data(1)[off]); BOOST_REQUIRE_MESSAGE(y_error <= tolerance, "y component at " << x << "," << y << " differs by " << y_error); - auto z_error = std::abs(ref_image->data(2)[off] - image->data(2)[off]); + auto z_error = std::abs(ref_image->data(2)[off] - test_image->data(2)[off]); BOOST_REQUIRE_MESSAGE(z_error <= tolerance, "z component at " << x << "," << y << " differs by " << z_error); ++off; } |
