Skip to content

Commit

Permalink
Fix build for platforms with scalable vectors (#4025)
Browse files Browse the repository at this point in the history
(cherry picked from commit 24e12baf0e8e697fdde84a5250b2df32f18cf40b)
  • Loading branch information
eustas committed Dec 27, 2024
1 parent 66d9f98 commit ac19b28
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
6 changes: 4 additions & 2 deletions lib/extras/jpegli_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
7 changes: 4 additions & 3 deletions lib/extras/metrics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,10 @@ StatusOr<double> 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<double> 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);
Expand Down
8 changes: 4 additions & 4 deletions lib/extras/metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ float ButteraugliDistance(JxlMemoryManager* memory_manager,
StatusOr<double> 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<double> Butteraugli3Norm(JxlMemoryManager* memory_manager,
const extras::PackedPixelFile& a,
const extras::PackedPixelFile& b,
ThreadPool* pool = nullptr);

double ComputePSNR(JxlMemoryManager* memory_manager,
const extras::PackedPixelFile& a,
Expand Down

0 comments on commit ac19b28

Please sign in to comment.