Closed Bug 2073437 Opened 2 months ago Closed 1 month ago

fix up jxl wpt reftest fuzz

Categories

(Core :: Graphics: ImageLib, task)

task

Tracking

()

RESOLVED FIXED
158 Branch
Tracking Status
firefox158 --- fixed

People

(Reporter: tnikkel, Assigned: tnikkel)

References

Details

Attachments

(2 external files)

No description provided.

For progressive-1: we had to have fuzz to cover for the difference until a new (improved) reference got merged from wpt. It's merged now so we can remove.

For progressive-2 and progressive-3: jxl-rs changed dithering again. We need slightly more fuzz on these files then Chrome did when they updated the fuzz values.

For icc-uncommon-profile-reftest: the fuzz in the html file got updated and we no longer need our ini to pass.

Upstream tightened maxDifference to 3 in
https://github.com/web-platform-tests/wpt/pull/62575, which is what Chrome
hits. We need 9 because how qcms implements CMYK conversions is faster but less
precise, especially for CMYK values that lie outside of the destination color
space (sRGB).

Running through the calculation at one of the pixels that ends up 9 off is
illustrative of the issue. At (240, 321) the image has CMYK 194, 10, 104, 4
(out of 255, with 0 meaning no ink). At full precision the ICC profile's A2B0
tag takes that to L* 63.50, a* -40.66, b* -7.10. Converting that to linear sRGB
gives -0.0062, 0.4192, 0.3758. Negative red component means that sRGB cannot
quite reach this color. Clamping that negative to 0 and encoding gives 0,
which is what the reference PNG has.

qcms uses a 17x17x17x17 lookup table with interpolation to compute the whole
CMYK to encoded RGB conversion in one step, not just the A2B0 part. We run the
conversion above at each grid point and store it in the table. Then we use
tetrahedral interpolation between the closest grid points to compute the final
value. Because the table holds finished values, its points are stored already
clamped into the output gamut (ie non negative). The eight grid points around
our pixel (when we computed them) had true linear reds from -0.0326 to +0.0095,
with four of them being positive and four of them being negative (those are
stored as 0 after clamping and gamma encoding to sRGB). The +0.0095 (in [0,1],
linear sRGB) one encodes to 25 (in [0,255], sRGB). The slope near zero of sRGB
is steep so 1% of full scale in linear light becomes ~10% when gamma encoded.
Interpolation of eight values, four of which are 0, and four of which are
positive can never reasonably give back the 0 that we require for the
reference, so it comes out close to 10, which is the difference the fuzz has to
cover.

Trying to let the table hold negatives actually makes the image worse overall,
moving more pixels further away from the reference.

Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/62878 for changes under testing/web-platform/tests

Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 158 Branch

Upstream PR merged by moz-wptsync-bot

QA Whiteboard: [qa-triage-done-c159/b158]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: