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

Git pushed a commit to branch master
in repository ffmpeg.

commit 531e184944e34425c121dd00d2e13b6d398ca5bd
Author:     Benjamin Cheng <[email protected]>
AuthorDate: Tue Dec 30 14:39:08 2025 -0500
Commit:     Benjamin Cheng <[email protected]>
CommitDate: Tue Dec 30 14:39:08 2025 -0500

    lavc/vulkan_video: Drop sampler
    
    With the limiting of video usages on the image views, we no longer need
    a yuv sampler, since no multi-plane image will be created with the
    SAMPLED usage bit.
---
 libavcodec/vulkan_decode.c |  3 +--
 libavcodec/vulkan_video.c  | 32 +-------------------------------
 libavcodec/vulkan_video.h  |  2 --
 3 files changed, 2 insertions(+), 35 deletions(-)

diff --git a/libavcodec/vulkan_decode.c b/libavcodec/vulkan_decode.c
index 31ed14f517..eb76d5b052 100644
--- a/libavcodec/vulkan_decode.c
+++ b/libavcodec/vulkan_decode.c
@@ -1385,8 +1385,7 @@ int ff_vk_decode_init(AVCodecContext *avctx)
                                                            
VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR);
         dpb_hwfc->format[0]    = s->hwfc->format[0];
         dpb_hwfc->tiling       = VK_IMAGE_TILING_OPTIMAL;
-        dpb_hwfc->usage        = VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR |
-                                 VK_IMAGE_USAGE_SAMPLED_BIT; /* Shuts 
validator up. */
+        dpb_hwfc->usage        = VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR;
 
         if (ctx->common.layered_dpb)
             dpb_hwfc->nb_layers = ctx->caps.maxDpbSlots;
diff --git a/libavcodec/vulkan_video.c b/libavcodec/vulkan_video.c
index 1b6848e62e..674a0fdc3b 100644
--- a/libavcodec/vulkan_video.c
+++ b/libavcodec/vulkan_video.c
@@ -302,14 +302,9 @@ int ff_vk_create_view(FFVulkanContext *s, FFVkVideoCommon 
*common,
         .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO,
         .usage = usage,
     };
-    VkSamplerYcbcrConversionInfo yuv_sampler_info = {
-        .sType = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO,
-        .pNext = &usage_create_info,
-        .conversion = common->yuv_sampler,
-    };
     VkImageViewCreateInfo img_view_create_info = {
         .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
-        .pNext = &yuv_sampler_info,
+        .pNext = &usage_create_info,
         .viewType = common->layered_dpb && is_video_dpb ?
                     VK_IMAGE_VIEW_TYPE_2D_ARRAY : VK_IMAGE_VIEW_TYPE_2D,
         .format = vkf,
@@ -365,12 +360,6 @@ av_cold void ff_vk_video_common_uninit(FFVulkanContext *s,
     av_frame_free(&common->layered_frame);
 
     av_buffer_unref(&common->dpb_hwfc_ref);
-
-    if (common->yuv_sampler) {
-        vk->DestroySamplerYcbcrConversion(s->hwctx->act_dev, 
common->yuv_sampler,
-                                          s->hwctx->alloc);
-        common->yuv_sampler = VK_NULL_HANDLE;
-    }
 }
 
 av_cold int ff_vk_video_common_init(AVCodecContext *avctx, FFVulkanContext *s,
@@ -383,25 +372,6 @@ av_cold int ff_vk_video_common_init(AVCodecContext *avctx, 
FFVulkanContext *s,
     VkVideoSessionMemoryRequirementsKHR *mem = NULL;
     VkBindVideoSessionMemoryInfoKHR *bind_mem = NULL;
 
-    int cxpos = 0, cypos = 0;
-    VkSamplerYcbcrConversionCreateInfo yuv_sampler_info = {
-        .sType      = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO,
-        .components = ff_comp_identity_map,
-        .ycbcrModel = VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY,
-        .ycbcrRange = avctx->color_range == AVCOL_RANGE_MPEG, /* Ignored */
-        .format     = session_create->pictureFormat,
-    };
-
-    /* Create identity YUV sampler
-     * (VkImageViews of YUV image formats require it, even if it does nothing) 
*/
-    av_chroma_location_enum_to_pos(&cxpos, &cypos, 
avctx->chroma_sample_location);
-    yuv_sampler_info.xChromaOffset = cxpos >> 7;
-    yuv_sampler_info.yChromaOffset = cypos >> 7;
-    ret = vk->CreateSamplerYcbcrConversion(s->hwctx->act_dev, 
&yuv_sampler_info,
-                                           s->hwctx->alloc, 
&common->yuv_sampler);
-    if (ret != VK_SUCCESS)
-        return AVERROR_EXTERNAL;
-
     /* Create session */
     ret = vk->CreateVideoSessionKHR(s->hwctx->act_dev, session_create,
                                     s->hwctx->alloc, &common->session);
diff --git a/libavcodec/vulkan_video.h b/libavcodec/vulkan_video.h
index 14168b7cc8..d63bfae3fc 100644
--- a/libavcodec/vulkan_video.h
+++ b/libavcodec/vulkan_video.h
@@ -34,8 +34,6 @@ typedef struct FFVkVideoSession {
     VkDeviceMemory *mem;
     uint32_t nb_mem;
 
-    VkSamplerYcbcrConversion yuv_sampler;
-
     AVBufferRef *dpb_hwfc_ref;
     int layered_dpb;
     AVFrame *layered_frame;

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to