pub fn check_native_hdr_roundtrip<E, D>(enc: E, dec: D) -> ConformanceExpand description
Native HDR survives a round trip: for BT.2100 PQ and HLG, the CICP,
the HDR envelope (content light level + mastering display), the pixels, and
the decoded buffer’s HDR labelling all come back from a PreserveExact
encode → decode.
Skipped (Ok) unless both ends declare
hdr. For each transfer:
- encodes
Cicp::BT2100_PQ/Cicp::BT2100_HLGwithContentLightLevel(1000, 400)andMasteringDisplay::HDR10_REFERENCE, using a 16-bit RGB gradient when both ends declarenative_16bit(the 8-bit RGB gradient otherwise — the signaling path is exercised either way); - the decoded pixels must equal the input byte-for-byte;
- the decoded descriptor must carry the HDR transfer (
Pq/Hlg) — a PQ decode labelled sRGB is exactly the mislabel the descriptor exists to prevent — and on the 16-bit path must equalRGB16_BT2100_PQ/_HLG; - when both ends declare the
cicpchannel,Metadata.cicpmust equal the input; content_light_levelmust survive exactly andmastering_displaywithin container fixed-point precision (2e-5 on xy, 1e-5 relative on luminance).hdron both ends means the envelope reaches the encoder and comes back — silently dropping it is the “gain-map → native-HDR transcode loses the envelope” hazard indocs/correctness-model.md.
This is Phase 0 of the gain-map / HDR delivery scope
(docs/gainmap-pipeline-scope-2026-06-08.md): prove native HDR works with
zero new API before any gain-map encode surface is added. Part of
check_all.