Repository navigation
Accept BT.601 HEVC colour in bounded decoding - #31
Merged
Merged
Conversation
Samsung HEICs carry no colr box and signal BT.601 primaries in the HEVC VUI. The full decoder renders these as untagged sRGB, but the bounded path rejected them as unprofiled colour. Treat VUI primaries 5 and 6 like 1 and 2 so bounded output matches the full decoder; wide-gamut VUI-only colour is still rejected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Samsung HEICs have no
colrbox and signal BT.601 colour (primaries 5, transfer 6, matrix 5, full range) only in the HEVC stream. The full decoder returns these as untagged RGB, butdecode_boundedrejected them withUnsupported("unprofiled HEVC color"). It now treats stream-signalled BT.601 primaries (5 and 6) like sRGB, as it already did for 1 and 2. Images whose stream signals a wide gamut (BT.2020, P3) with nocolrbox are still rejected.On a Galaxy S22 motion-photo HEIC (3000×4000),
decode_boundednow matchesdecode_bytes_to_rgb8exactly. Apple's ImageIO also reports this file as sRGB. Converting the BT.601 primaries to sRGB instead would have moved the output away from both: it differs from the full decoder by up to 14 levels, and agreement with ImageIO within ±1 drops from 97.3% to 90.2% of samples.Source fork PR: laurens-pilot#20
@laurenspriem