Skip to content

Add support for extension metadata levels 15-18 - #362

Draft
quietvoid wants to merge 5 commits into
mainfrom
level15-18
Draft

Add support for extension metadata levels 15-18#362
quietvoid wants to merge 5 commits into
mainfrom
level15-18

Conversation

@quietvoid

Copy link
Copy Markdown
Owner

No description provided.

@saindriches

Copy link
Copy Markdown
Contributor

Just curious, are they already being used, or do they only exist in the verifier?

@quietvoid

Copy link
Copy Markdown
Owner Author

Never seen any so probably verifier only.
Need to test if anything happens on playback.

@quietvoid

Copy link
Copy Markdown
Owner Author

Added L17 chroma_lift from latest verifier version.

@quietvoid

Copy link
Copy Markdown
Owner Author

Looks like this will most likely tie in with Dolby Vision 2 which was just announced.

@MeeeetRain

Copy link
Copy Markdown

Hi @quietvoid, thanks for this branch — I picked up level15-18 and rebased it onto current main, since it had fallen ~39 commits behind and the C-FFI mapping was still // TODO.

What I did (branch: https://github.com/MeeeetRain/dovi_tool/tree/dv2-level15-18-capi):

  • Rebased all four blocks (L15/L16/L17/L18) onto main (2.3.3 / dolby_vision 3.4.0), resolving the conflicts in cmv40.rs, blocks/mod.rs, vdr_dm_data.rs and c_structs/extension_metadata.rs. Your block struct definitions are kept as-is.
  • Completed the libdovi C-FFI that was left as // TODO stubs — L15/L16/L17/L18 are now wired into the DmData C struct (field + set_blocks + drop + Default), so FFmpeg/Kodi/CoreELEC can read them through the C ABI.
  • Wired the new blocks into the export --levels CSV/JSON exporter (added on main after this branch forked).
  • Added a round-trip test using assets/tests/l15_to_l18.bin.

Validation: I verified every field against the Dolby Vision TV SDK v6.0 official test vectors (Metadata Spec v1.5.1). All four blocks parse correctly; L15 and L16 round-trip byte-identically. Full upstream test suite passes (110 tests).

One extra finding while validating: the L11.reserved_byte3 == 0 check (still present after #384 relaxed byte 2) rejects every DV2 stream carrying Authentic Motion metadata — per Spec v1.5.1 / HDMI v5.1.1 PB[13], byte 3 carries frc_strength[3:0] + frc_type[4]. I relaxed that check and added accessors in a separate commit.

Happy to open this as a PR against main, or to rebase onto your level15-18 branch directly if you prefer to keep authorship/history on this PR. Let me know which you would prefer.

MeeeetRain added a commit to MeeeetRain/dovi_tool that referenced this pull request Aug 6, 2026
Rebases and completes quietvoid#362 on top of current main:

- Add ExtMetadataBlockLevel15 (Dolby Image Engine, Standard mode):
  confidence / precision_rendering_strength / d_local_contrast /
  d_brightness / d_saturation / d_contrast (+ *_no_pr variants).
  11 bytes / 88 bits.
- Add ExtMetadataBlockLevel16 (Reference mode Image Engine): variable
  length, revision + count + Level16Params[] (contrast_target /
  precision_rendering_strength / d_local_contrast / max_d_brightness /
  max_d_saturation_plus_one).
- Add ExtMetadataBlockLevel17 (up-mapping metadata): 10 bytes / 80 bits.
  Kept for forward compatibility; DM ignores it (Metadata Spec v1.5.1
  removed the L17 grammar, superseded by L18).
- Add ExtMetadataBlockLevel18 (Precision Black / creative environment):
  4x 12-bit PQ luminance (surround / min_preserved / adaptation /
  max_preserved) + revision. 7 bytes / 56 bits.
- Wire dispatch in cmv40.rs (ALLOWED_BLOCK_LEVELS + parse arms),
  ExtMetadataBlock enum + trait match arms, vdr_dm_data replace path,
  and the CSV/JSON exporter.
- Complete the libdovi C-FFI mapping (c_structs/extension_metadata.rs)
  that was left as // TODO stubs, so FFmpeg/Kodi/CoreELEC can read the
  new blocks through the C ABI.
- Add a round-trip test against a real DV2 sample (l15_to_l18.bin).
@quietvoid

Copy link
Copy Markdown
Owner Author

Dolby Vision TV SDK v6.0 official test vectors
Metadata Spec v1.5.1

I have no interest in merging any new information without specifications or way to verify what you're saying.

@quietvoid
quietvoid force-pushed the level15-18 branch 2 times, most recently from 53aada3 to 3af11f8 Compare August 6, 2026 10:12
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.

3 participants