JPEG XL: PQ intensity_target tone mapping sampler

#568825290 Original fix: CL 8519837 Blink>Image

Background

CL 8519837 reported a JPEG XL codestream's intensity_target as CLLI MaxCLL unconditionally. But encoders write 10000 cd/m² (the PQ nominal peak) by default, and 255 means the field is absent from the codestream - neither value states the content's peak. Typical PQ files (e.g. the jpegxl.info HDR test page) were suddenly tone mapped from 10000 instead of the 1000 cd/m² default and rendered dim. Follow-up change: only an informative value (above 255 and below 10000) is reported as content peak.

Automated check

Three JXL files hold the same flat 588 cd/m² BT.2100 PQ patch; only the stated intensity_target differs. Each is drawn to an SDR canvas and the mean of the red channel is printed.

fileintensity_targetmean red
expectationresult

broken M155..M157 pre-fix: the 10000 and 255 files tone map from their stated value - 10000 is dim, 255 is clipped - and the second expectation fails.

fixed With the follow-up fix (and in M154 and earlier): 10000 and 255 fall back to the 1000 cd/m² default and render identically; 600 is still honored as a deliberate peak.

Before / after proof (headless screenshots)

Luca's jixel sample (P3 PQ, intensity_target 10000) rendered by headless content shell builds of the same revision, with and without the fix. Tone mapping to SDR from a claimed 10000 cd/m² peak dims the HDR highlights - the neon tubes and letters - while the shadows barely move.

Highlight crop - broken vs fixed

highlight crop before/after

Crop mean brightness: broken 72.5, fixed 77.6. Full-frame RMSE 2.9%.

Broken (CLLI=10000)

broken rendering

Fixed (1000 nit default)

fixed rendering

abs difference x6

amplified difference

The difference is confined to the HDR highlights.

Note: an HDR-headroom capture would show no difference at all - with a 10000 cd/m² output target neither build tone maps. The regression is visible exactly where headroom is scarce: SDR displays and HDR displays with less headroom than the claimed peak.

Real-world samples (view on an HDR display)

jixel sample (P3 PQ, it=10000)

jixel sample

Broken build: dim, crushed highlights. Fixed: tone mapped from the 1000 cd/m² default again.

sunrise-PQ.jxl (it=10000)

sunrise PQ

From jpegxl.info HDR test page.

test_pattern-PQ.jxl (it=10000)

test pattern PQ

From jpegxl.info HDR test page.

Downloads

⬇ it absent (255) ⬇ it=600 ⬇ it=10000 ⬇ jixel sample