Hi,

MediaCodec decodes the HEVC base layer of a Dolby Vision stream but
never exposes the RPU, and there is no hwaccel layer that could pass
it back. Without it, profile 5 content is rendered with the wrong
colors because the IPTPQc2 mapping is never applied.

I have a working implementation that parses the RPU NAL units (type 62)
from the packets going through the decoder, reuses dovi_rpudec.c, and
attaches the metadata to the output frames. It lives in a new
libavcodec/mediacodec_dovi.c, so the generic wrapper only gains a few
calls, and it is verified on a Snapdragon 8 Gen 2 device (bit-exact
against the software decoder).

Before submitting: is the wrapper the right layer, or should this be
done generically?

1. Parse in the wrapper, since only it knows the hardware decoder
   dropped the metadata.
2. Add a packet side-data type (e.g. AV_PKT_DATA_DOVI_RPU) filled by
   the demuxer or a bitstream filter, consumed by any hardware decoder.
3. Something else.

Option 2 is cleaner and would also help VAAPI/Vulkan, but it is a much
larger change and needs agreement on the side-data ABI. I would rather
not write that if option 1 is acceptable for a decoder that cannot
expose the metadata any other way.

HEVC only for now. Dolby Vision in AV1 uses a different container
format.

Thanks,
_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to