diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /third_party/jpeg-xl/lib/jxl/enc_gaborish.cc | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-upstream/125.0.1.tar.xz firefox-upstream/125.0.1.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/jpeg-xl/lib/jxl/enc_gaborish.cc')
-rw-r--r-- | third_party/jpeg-xl/lib/jxl/enc_gaborish.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/third_party/jpeg-xl/lib/jxl/enc_gaborish.cc b/third_party/jpeg-xl/lib/jxl/enc_gaborish.cc index 3f2ee32afd..7467a4d669 100644 --- a/third_party/jpeg-xl/lib/jxl/enc_gaborish.cc +++ b/third_party/jpeg-xl/lib/jxl/enc_gaborish.cc @@ -15,8 +15,8 @@ namespace jxl { -void GaborishInverse(Image3F* in_out, const Rect& rect, float mul[3], - ThreadPool* pool) { +Status GaborishInverse(Image3F* in_out, const Rect& rect, const float mul[3], + ThreadPool* pool) { WeightsSymmetric5 weights[3]; // Only an approximation. One or even two 3x3, and rank-1 (separable) 5x5 // are insufficient. The numbers here have been obtained by butteraugli @@ -47,7 +47,9 @@ void GaborishInverse(Image3F* in_out, const Rect& rect, float mul[3], // Note that we cannot *allocate* a plane, as doing so might cause Image3F to // have planes of different stride. Instead, we copy one plane in a temporary // image and reuse the existing planes of the in/out image. - ImageF temp(in_out->Plane(2).xsize(), in_out->Plane(2).ysize()); + ImageF temp; + JXL_ASSIGN_OR_RETURN( + temp, ImageF::Create(in_out->Plane(2).xsize(), in_out->Plane(2).ysize())); CopyImageTo(in_out->Plane(2), &temp); Rect xrect = rect.Extend(3, Rect(*in_out)); Symmetric5(in_out->Plane(0), xrect, weights[0], pool, &in_out->Plane(2), @@ -59,6 +61,7 @@ void GaborishInverse(Image3F* in_out, const Rect& rect, float mul[3], in_out->Plane(0).Swap(in_out->Plane(1)); // 2 1 0 in_out->Plane(0).Swap(in_out->Plane(2)); + return true; } } // namespace jxl |