Skip to content

Preserve HDR endpoint mode bits after downward quantization - #758

Merged
solidpixel merged 1 commit into
mainfrom
opt-hdr-quantization-bits
Nov 12, 2026
Merged

solidpixel merged 1 commit into
mainfrom
opt-hdr-quantization-bits

Conversation

@solidpixel

@solidpixel solidpixel commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Some bits in a packed HDR colors tell the decoder how to interpret the other bits. Rounding must accurately preserve those control bits. When rounding down changed them, the old code tried to correct this by moving the value further down. The fix moves it up instead, restoring the intended bit pattern.

That fixes the packing mistake, however it can result in a less accurate color. The encoder accepts the first layout that fits, rather than comparing all usable layouts (which is a significant cost for limited quality gain - I tried it). So even with this fix, quality can regress slightly for some images, as the compressor choses a different sub-format, but it's mostly in the noise margin.

@solidpixel solidpixel self-assigned this Nov 11, 2026
@solidpixel
solidpixel merged commit d6639ff into main Nov 12, 2026
20 checks passed
@solidpixel
solidpixel deleted the opt-hdr-quantization-bits branch November 12, 2026 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant