Skip to content

pr-ffstaging-31/softworkz/submit_qsv_sei-v6

Missing SEI information has always been a major drawback when using the QSV
decoders. It turned out that there's a hardly known api method that provides
access to all SEI (h264/hevc) or user data (mpeg2video).

This allows to get things like closed captions, frame packing, display
orientation, HDR data (mastering display, content light level, etc.) without
having to rely on those data being provided by the MSDK as extended buffers.

The commit "Implement SEI parsing for QSV decoders" includes some hard-coded
workarounds for MSDK bugs which I reported:
https://github.com/Intel-Media-SDK/MediaSDK/issues/2597#issuecomment-1072795311
If someone is interested in the details please contact me directly.

v5

 * Split out the first two commits as a separate patchset
   https://github.com/ffstaging/FFmpeg/pull/44
 * For mpeg12, parse A53 data in qsvdec directly
 * For h264 and hevc, factor out ff_hxxx_set_sei_to_frame functions to avoid
   being dependent on the full decoder contexts
 * Ensure sufficient padding for get_bits API
 * Addresses all points (1, 2, 3, 4) made by Andreas
   https://patchwork.ffmpeg.org/project/ffmpeg/cover/pull.31.v5.ffstaging.FFmpeg.1656708534.ffmpegagent@gmail.com/

v4

 * add new dependencies in makefile Now, build still works when someone uses
   configure --disable-decoder=h264 --disable-decoder=hevc
   --disable-decoder=mpegvideo --disable-decoder=mpeg1video
   --disable-decoder=mpeg2video --enable-libmfx

v3

 * frame.h: clarify doc text for av_frame_copy_side_data()

v2

 * qsvdec: make error handling consistent and clear
 * qsvdec: remove AV_CODEC_ID_MPEG1VIDEO constants
 * hevcdec: rename function to ff_hevc_set_side_data(), add doc text

v3

 * qsvdec: fix c/p error

softworkz (3):
  avcodec/hevcdec: factor out ff_hevc_set_set_to_frame
  avcodec/h264dec: make h264_export_frame_props() accessible
  avcodec/qsvdec: Implement SEI parsing for QSV decoders

 libavcodec/Makefile     |   2 +-
 libavcodec/h264_sei.c   | 197 ++++++++++++++++++++++++
 libavcodec/h264_sei.h   |   2 +
 libavcodec/h264_slice.c | 190 +-----------------------
 libavcodec/hevc_sei.c   | 252 +++++++++++++++++++++++++++++++
 libavcodec/hevc_sei.h   |   3 +
 libavcodec/hevcdec.c    | 249 +------------------------------
 libavcodec/qsvdec.c     | 321 ++++++++++++++++++++++++++++++++++++++++
 8 files changed, 782 insertions(+), 434 deletions(-)

base-commit: 882a17068fd8e62c7d38c14e6fb160d7c9fc446a

Submitted-As: https://master.gitmailbox.com/ffmpegdev/pull.31.v6.ffstaging.FFmpeg.1666670616.ffmpegagent@gmail.com
In-Reply-To: https://master.gitmailbox.com/ffmpegdev/pull.31.ffstaging.FFmpeg.1653552529.ffmpegagent@gmail.com
In-Reply-To: https://master.gitmailbox.com/ffmpegdev/pull.31.v2.ffstaging.FFmpeg.1654074366.ffmpegagent@gmail.com
In-Reply-To: https://master.gitmailbox.com/ffmpegdev/pull.31.v3.ffstaging.FFmpeg.1654106506.ffmpegagent@gmail.com
In-Reply-To: https://master.gitmailbox.com/ffmpegdev/pull.31.v4.ffstaging.FFmpeg.1656286888.ffmpegagent@gmail.com
In-Reply-To: https://master.gitmailbox.com/ffmpegdev/pull.31.v5.ffstaging.FFmpeg.1656708534.ffmpegagent@gmail.com
Assets 2