Skip to content

lavc/rkmppdec: export HDR10+ and HDR Vivid dynamic metadata - #268

Open
DXICM wants to merge 1 commit into
nyanmisaka:masterfrom
DXICM:pr2-hdr-dynamic
Open

lavc/rkmppdec: export HDR10+ and HDR Vivid dynamic metadata#268
DXICM wants to merge 1 commit into
nyanmisaka:masterfrom
DXICM:pr2-hdr-dynamic

Conversation

@DXICM

@DXICM DXICM commented Aug 10, 2026

Copy link
Copy Markdown

Export per-frame HDR dynamic metadata that the MPP decoder already parses
from HEVC and AV1 streams to the corresponding AVFrame side data:

  • SMPTE ST 2094-40 (HDR10+) -> AV_FRAME_DATA_DYNAMIC_HDR_PLUS
  • CUVA HDR Vivid -> AV_FRAME_DATA_DYNAMIC_HDR_VIVID

Static HDR export (mastering display / content light level) is also extended
from HEVC-only to AV1.

Implementation

  • mpp_frame_get_hdr_dynamic_meta() returns the SEI payload per frame;
    for HDR10+ the payload starts at the application mode byte, which is
    exactly what av_dynamic_hdr_plus_from_t35() expects (verified
    byte-for-byte against the soft decoder); for HDR Vivid the payload is the
    CUVA T.35 register segment parsed by
    ff_parse_itu_t_t35_to_dynamic_hdr_vivid() (guarded by CONFIG_HEVC_SEI).
  • Parse failures only log and drop the side data; decoding continues.
  • Dolby Vision payloads are skipped (no matching FFmpeg side data type for
    the RPU-only variant MPP exposes).
  • configure gains a hard symbol gate on mpp_frame_get_hdr_dynamic_meta
    (present in current MPP develop).

Verification (on-device)

  • HDR10+ HEVC: hw and soft decoder agree on 300/300 frames with side data;
    frame-0 metadata fields identical.
  • HDR10+ AV1 (mkv block-additions carrier): hw exports 300/300; native av1
    soft decoder cannot parse the carrier, so ground truth verified via OBU
    scan of the raw bitstream.
  • HDR Vivid HEVC: hw=sw=1 frame, fields match.
  • Plain HDR10 content: only static metadata, as expected.

Known upstream limitation (filed against MPP separately)

For streams where the dynamic SEI appears in multiple AUs, MPP only attaches
it to the first frame (h265 parser latches the SEI). Streams repeating the
SEI in every AU are unaffected.

@DXICM

DXICM commented Aug 10, 2026

Copy link
Copy Markdown
Author

Note on commit history: the original commits of this PR were made under a shared/company git identity from the development machine's config, rather than a personal one. The commits have been amended to be authored by DXICM, the account submitting this PR. Both identities belong to the same person and no code content was changed - this was only to unify the authorship under my personal account.

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