Skip to content

feat: parse clli and mdcv HDR metadata boxes - #2

Merged
kornelski merged 1 commit into
kornelski:mainfrom
lilith:feat/hdr-metadata
Feb 9, 2026
Merged

kornelski merged 1 commit into
kornelski:mainfrom
lilith:feat/hdr-metadata

Conversation

@lilith

@lilith lilith commented Feb 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Parse Content Light Level Information (clli) and Mastering Display Colour Volume (mdcv) property boxes from the AVIF container
  • Expose parsed values on AvifData as content_light_level: Option<ContentLightLevel> and mastering_display: Option<MasteringDisplayColourVolume>
  • Both are ISOBMFF § 12.1.5 properties, essential for HDR10/PQ content

Details

clli carries MaxCLL and MaxFALL (4 bytes, per CEA-861.3). mdcv carries mastering display primaries, white point, and luminance range (24 bytes, per SMPTE ST 2086). Neither is a FullBox — no version/flags.

New public types: ContentLightLevel and MasteringDisplayColourVolume, both Copy + 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

  • 4 roundtrip tests (clli-only, mdcv-only, both, neither)
  • Existing tests pass (2 pre-existing failures from missing av1-avif/testFiles fixture dir)
  • cargo clippy clean

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
lilith force-pushed the feat/hdr-metadata branch from 8296860 to 95fe891 Compare February 8, 2026 21:21
@kornelski
kornelski merged commit e7b852f into kornelski:main Feb 9, 2026
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.

2 participants