feat: parse clli and mdcv HDR metadata boxes - #2
Merged
Merged
Conversation
Parse Content Light Level Information (clli) and Mastering Display Colour Volume (mdcv) property boxes from the AVIF container. These ISOBMFF § 12.1.5 properties are essential for HDR content. Parsed values are exposed on AvifData as content_light_level and mastering_display fields. Tests use pre-generated fixture files (267-300 bytes each).
lilith
force-pushed
the
feat/hdr-metadata
branch
from
February 8, 2026 21:21
8296860 to
95fe891
Compare
kornelski
approved these changes
Feb 9, 2026
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.
Summary
clli) and Mastering Display Colour Volume (mdcv) property boxes from the AVIF containerAvifDataascontent_light_level: Option<ContentLightLevel>andmastering_display: Option<MasteringDisplayColourVolume>Details
cllicarries MaxCLL and MaxFALL (4 bytes, per CEA-861.3).mdcvcarries mastering display primaries, white point, and luminance range (24 bytes, per SMPTE ST 2086). Neither is a FullBox — no version/flags.New public types:
ContentLightLevelandMasteringDisplayColourVolume, bothCopy + Debug + Clone + PartialEq + Eq.This is the parser counterpart to kornelski/avif-serialize#17 which adds serialization support for the same boxes. The roundtrip tests use the avif-serialize fork as a dev-dependency; this can be switched to a crates.io version once #17 is merged and released.
Test plan
av1-avif/testFilesfixture dir)cargo clippyclean