This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

The following commit(s) were added to refs/heads/master by this push:
     new 1a6a186b80 avcodec/vulkan_decode: set H.264 pictureLayout from SPS 
frame_mbs_only_flag
1a6a186b80 is described below

commit 1a6a186b808a5bf65a408c700846d208227d6549
Author:     Tymur Boiko <[email protected]>
AuthorDate: Thu Aug 20 22:40:18 2026 +0200
Commit:     Lynne <[email protected]>
CommitDate: Fri Aug 21 14:06:57 2026 +0000

    avcodec/vulkan_decode: set H.264 pictureLayout from SPS frame_mbs_only_flag
    
    VkVideoDecodeH264ProfileInfoKHR::pictureLayout must match the sequence.
    ITU-T H.264 frame_mbs_only_flag==1 means frames only; ==0 allows field
    pictures and MBAFF. Vulkan PROGRESSIVE sessions are progressive-only;
    non-PROGRESSIVE enables interlaced field DPB (h264_decode / videocoding).
    
    pictureLayout values are mutually exclusive video profiles (vk.xml).
    Map with !frame_mbs_only_flag, then validate with
    vkGetPhysicalDeviceVideoCapabilitiesKHR:
    
    - frame_mbs_only_flag == 1, or no SPS -> PROGRESSIVE (one query)
    - frame_mbs_only_flag == 0 -> prefer INTERLACED_INTERLEAVED_LINES only
    
    Do not use avctx->field_order: MBAFF may still report progressive.
    
    Signed-off-by: Tymur Boiko <[email protected]>
---
 libavcodec/vulkan_decode.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/libavcodec/vulkan_decode.c b/libavcodec/vulkan_decode.c
index b954c78250..dd5fbb4496 100644
--- a/libavcodec/vulkan_decode.c
+++ b/libavcodec/vulkan_decode.c
@@ -24,6 +24,7 @@
 #include "libavutil/avassert.h"
 #include "libavutil/mem.h"
 #include "libavutil/vulkan_loader.h"
+#include "h264dec.h"
 
 #define DECODER_IS_SDR(codec_id) \
     (((codec_id) == AV_CODEC_ID_FFV1) || \
@@ -760,10 +761,12 @@ static VkResult vulkan_setup_profile(AVCodecContext 
*avctx,
         h264_profile->stdProfileIdc = cur_profile & 
~(AV_PROFILE_H264_CONSTRAINED |
                                                       AV_PROFILE_H264_INTRA);
 
-        h264_profile->pictureLayout = avctx->field_order == AV_FIELD_UNKNOWN ||
-                                      avctx->field_order == 
AV_FIELD_PROGRESSIVE ?
-                                      
VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_PROGRESSIVE_KHR :
-                                      
VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_INTERLEAVED_LINES_BIT_KHR;
+        h264_profile->pictureLayout =
+            VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_PROGRESSIVE_KHR;
+        const H264Context *h = avctx->priv_data;
+        if (h && h->ps.sps && !h->ps.sps->frame_mbs_only_flag)
+            h264_profile->pictureLayout =
+                
VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_INTERLEAVED_LINES_BIT_KHR;
     } else if (avctx->codec_id == AV_CODEC_ID_H265) {
         dec_caps->pNext = h265_caps;
         usage->pNext = h265_profile;
@@ -904,6 +907,15 @@ static int vulkan_decode_get_profile(AVCodecContext 
*avctx, AVBufferRef *frames_
                avcodec_get_name(avctx->codec_id),
                avcodec_profile_name(avctx->codec_id, cur_profile));
         return AVERROR(EINVAL);
+    } else if (ret == VK_ERROR_VIDEO_PICTURE_LAYOUT_NOT_SUPPORTED_KHR) {
+        if (avctx->codec_id == AV_CODEC_ID_H264)
+            av_log(avctx, AV_LOG_VERBOSE, "Unable to initialize video session: 
"
+                   "pictureLayout %#x not supported!\n",
+                   (unsigned)prof->h264_profile.pictureLayout);
+        else
+            av_log(avctx, AV_LOG_VERBOSE, "Unable to initialize video session: 
"
+                   "pictureLayout not supported!\n");
+        return AVERROR(EINVAL);
     } else if (ret == VK_ERROR_VIDEO_PROFILE_FORMAT_NOT_SUPPORTED_KHR) {
         av_log(avctx, AV_LOG_VERBOSE, "Unable to initialize video session: "
                "format (%s) not supported!\n",

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to