When decoding HEVC streams carrying per-frame HDR dynamic metadata SEI
(SMPTE ST 2094-40 / HDR10+ or CUVA HDR Vivid), mpp_frame_get_hdr_dynamic_meta()
only returns data for the first decoded frame; subsequent frames that carry the
same SEI report no dynamic metadata.
Evidence
mpi_dec_test on an HDR Vivid HEVC stream whose SEI repeats in multiple AUs:
with h265d_debug=8704 the hdr_meta log line only appears for poc 0, even
though the SEI is present in later AUs as well.
- Comparison with software decoding (FFmpeg
hevc decoder): the dynamic HDR
side data is present on N frames (e.g. 6) while hevc_rkmpp (via FFmpeg)
exports it on only 1 frame for the same file.
- Streams that repeat the SEI in every AU (e.g. typical HDR10+ UHD Blu-ray
rips) are unaffected because frame 0 still gets the metadata and every frame
carries it — but the parser appears to latch the SEI once instead of
refreshing it per AU.
Expected behavior
The parser should attach the HDR dynamic metadata SEI carried by each AU to the
corresponding MppFrame (as it already does for the first AU), so per-frame
dynamic tone-mapping works.
Environment
- MPP develop branch, v1.0.12 (8f922ed)
- RK3576 and RK3588
- Kernel 5.10 / 6.1 (both observed)
Suggested fix area
mpp/codec/dec/h265/h265d_sei.c (the dynamic-meta SEI callback stores into a
once-only context) / frame-export path in mpp/codec/dec/h265 where
KEY_HDR_INFO / hdr_dynamic_meta is attached to MppFrame.
When decoding HEVC streams carrying per-frame HDR dynamic metadata SEI
(SMPTE ST 2094-40 / HDR10+ or CUVA HDR Vivid),
mpp_frame_get_hdr_dynamic_meta()only returns data for the first decoded frame; subsequent frames that carry the
same SEI report no dynamic metadata.
Evidence
mpi_dec_teston an HDR Vivid HEVC stream whose SEI repeats in multiple AUs:with
h265d_debug=8704thehdr_metalog line only appears for poc 0, eventhough the SEI is present in later AUs as well.
hevcdecoder): the dynamic HDRside data is present on N frames (e.g. 6) while
hevc_rkmpp(via FFmpeg)exports it on only 1 frame for the same file.
rips) are unaffected because frame 0 still gets the metadata and every frame
carries it — but the parser appears to latch the SEI once instead of
refreshing it per AU.
Expected behavior
The parser should attach the HDR dynamic metadata SEI carried by each AU to the
corresponding
MppFrame(as it already does for the first AU), so per-framedynamic tone-mapping works.
Environment
Suggested fix area
mpp/codec/dec/h265/h265d_sei.c(the dynamic-meta SEI callback stores into aonce-only context) / frame-export path in
mpp/codec/dec/h265whereKEY_HDR_INFO/hdr_dynamic_metais attached toMppFrame.