diff --git a/lib/extras/jpegli_test.cc b/lib/extras/jpegli_test.cc index 7bac5228..cc3d9425 100644 --- a/lib/extras/jpegli_test.cc +++ b/lib/extras/jpegli_test.cc @@ -384,8 +384,10 @@ TEST_P(JpegliColorQuantTestParam, JpegliColorQuantizeTest) { dparams2.dither_mode = config.dither; ASSERT_TRUE(DecodeJpeg(compressed, dparams2, nullptr, &ppf2)); - double dist1 = Butteraugli3Norm(memory_manager, ppf0, ppf1); - double dist2 = Butteraugli3Norm(memory_manager, ppf0, ppf2); + JXL_TEST_ASSIGN_OR_DIE(double dist1, + Butteraugli3Norm(memory_manager, ppf0, ppf1)); + JXL_TEST_ASSIGN_OR_DIE(double dist2, + Butteraugli3Norm(memory_manager, ppf0, ppf2)); printf("distance: %f vs %f\n", dist2, dist1); if (config.passes == 1) { if (config.num_colors == 16 && config.dither == 2) { diff --git a/lib/extras/metrics.cc b/lib/extras/metrics.cc index 5813a1bc..7ddf50b0 100644 --- a/lib/extras/metrics.cc +++ b/lib/extras/metrics.cc @@ -306,9 +306,10 @@ StatusOr ComputeDistanceP(const ImageF& distmap, return HWY_DYNAMIC_DISPATCH(ComputeDistanceP)(distmap, params, p); } -float Butteraugli3Norm(JxlMemoryManager* memory_manager, - const extras::PackedPixelFile& a, - const extras::PackedPixelFile& b, ThreadPool* pool) { +StatusOr Butteraugli3Norm(JxlMemoryManager* memory_manager, + const extras::PackedPixelFile& a, + const extras::PackedPixelFile& b, + ThreadPool* pool) { ButteraugliParams params; ImageF distmap; ButteraugliDistance(memory_manager, a, b, params, &distmap, pool); diff --git a/lib/extras/metrics.h b/lib/extras/metrics.h index a5ca0b05..3f53a403 100644 --- a/lib/extras/metrics.h +++ b/lib/extras/metrics.h @@ -31,10 +31,10 @@ float ButteraugliDistance(JxlMemoryManager* memory_manager, StatusOr ComputeDistanceP(const ImageF& distmap, const ButteraugliParams& params, double p); -float Butteraugli3Norm(JxlMemoryManager* memory_manager, - const extras::PackedPixelFile& a, - const extras::PackedPixelFile& b, - ThreadPool* pool = nullptr); +StatusOr Butteraugli3Norm(JxlMemoryManager* memory_manager, + const extras::PackedPixelFile& a, + const extras::PackedPixelFile& b, + ThreadPool* pool = nullptr); double ComputePSNR(JxlMemoryManager* memory_manager, const extras::PackedPixelFile& a,