22 #include "config_components.h"
24 #if CONFIG_H264_VULKAN_HWACCEL
27 #if CONFIG_HEVC_VULKAN_HWACCEL
30 #if CONFIG_AV1_VULKAN_HWACCEL
34 static const VkExtensionProperties *
dec_ext[] = {
35 #if CONFIG_H264_VULKAN_HWACCEL
38 #if CONFIG_HEVC_VULKAN_HWACCEL
41 #if CONFIG_AV1_VULKAN_HWACCEL
48 const VkVideoProfileListInfoKHR *profile_list;
50 VkStructureType profile_struct_type =
57 VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR);
61 for (
int i = 0;
i < profile_list->profileCount;
i++)
63 return &profile_list->pProfiles[
i];
87 VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR, 0,
125 VkSamplerYcbcrConversionInfo yuv_sampler_info = {
126 .sType = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO,
127 .conversion =
ctx->yuv_sampler,
129 VkImageViewCreateInfo img_view_create_info = {
130 .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
131 .pNext = &yuv_sampler_info,
133 VK_IMAGE_VIEW_TYPE_2D_ARRAY : VK_IMAGE_VIEW_TYPE_2D,
135 .image =
src->img[0],
136 .components = (VkComponentMapping) {
137 .r = VK_COMPONENT_SWIZZLE_IDENTITY,
138 .g = VK_COMPONENT_SWIZZLE_IDENTITY,
139 .b = VK_COMPONENT_SWIZZLE_IDENTITY,
140 .a = VK_COMPONENT_SWIZZLE_IDENTITY,
142 .subresourceRange = (VkImageSubresourceRange) {
143 .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
146 VK_REMAINING_ARRAY_LAYERS : 1,
151 ret = vk->CreateImageView(
ctx->s.hwctx->act_dev, &img_view_create_info,
152 ctx->s.hwctx->alloc, dst_view);
153 if (
ret != VK_SUCCESS)
156 *aspect = aspect_mask;
201 }
else if (alloc_dpb) {
212 dpb_hwfc->format[0], is_current);
219 if (!alloc_dpb || is_current) {
226 hwfc->format[0], is_current);
240 const uint8_t *
data,
size_t size,
int add_startcode,
241 uint32_t *nb_slices,
const uint32_t **
offsets)
246 static const uint8_t startcode_prefix[3] = { 0x0, 0x0, 0x1 };
247 const size_t startcode_len = add_startcode ?
sizeof(startcode_prefix) : 0;
248 const int nb = *nb_slices;
254 ctx->caps.minBitstreamBufferSizeAlignment;
255 new_size =
FFALIGN(new_size,
ctx->caps.minBitstreamBufferSizeAlignment);
258 (nb + 1)*
sizeof(slice_off));
266 if (!vkbuf || vkbuf->
buf.
size < new_size) {
271 VK_BUFFER_USAGE_VIDEO_DECODE_SRC_BIT_KHR,
272 ctx->s.hwfc->create_pnext, new_size);
290 memcpy(slices + vp->
slices_size, startcode_prefix, startcode_len);
307 VkVideoBeginCodingInfoKHR decode_start = {
308 .sType = VK_STRUCTURE_TYPE_VIDEO_BEGIN_CODING_INFO_KHR,
309 .videoSession =
ctx->common.session,
310 .videoSessionParameters =
ctx->empty_session_params,
312 VkVideoCodingControlInfoKHR decode_ctrl = {
313 .sType = VK_STRUCTURE_TYPE_VIDEO_CODING_CONTROL_INFO_KHR,
314 .
flags = VK_VIDEO_CODING_CONTROL_RESET_BIT_KHR,
317 .sType = VK_STRUCTURE_TYPE_VIDEO_END_CODING_INFO_KHR,
320 VkCommandBuffer cmd_buf;
325 vk->CmdBeginVideoCodingKHR(cmd_buf, &decode_start);
326 vk->CmdControlVideoCodingKHR(cmd_buf, &decode_ctrl);
327 vk->CmdEndVideoCodingKHR(cmd_buf, &
decode_end);
337 VkCommandBuffer cmd_buf;
350 VkVideoSessionParametersKHR *par = (VkVideoSessionParametersKHR *)dec->
session_params->
data;
351 VkVideoBeginCodingInfoKHR decode_start = {
352 .sType = VK_STRUCTURE_TYPE_VIDEO_BEGIN_CODING_INFO_KHR,
353 .videoSession =
ctx->common.session,
354 .videoSessionParameters = *par,
355 .referenceSlotCount = vp->
decode_info.referenceSlotCount,
356 .pReferenceSlots = vp->
decode_info.pReferenceSlots,
359 .sType = VK_STRUCTURE_TYPE_VIDEO_END_CODING_INFO_KHR,
362 VkImageMemoryBarrier2 img_bar[37];
365 ctx->caps.minBitstreamBufferSizeAlignment);
370 VkVideoReferenceSlotInfoKHR *cur_vk_ref;
371 cur_vk_ref = (
void *)&decode_start.pReferenceSlots[decode_start.referenceSlotCount];
373 cur_vk_ref[0].slotIndex = -1;
374 decode_start.referenceSlotCount++;
377 int64_t prev_sub_res = 0;
380 if (
ret != VK_NOT_READY &&
ret != VK_SUCCESS) {
386 if (
ret == VK_SUCCESS)
388 "Result of previous frame decoding: %"PRId64
"\n", prev_sub_res);
394 if (!(sd_buf->
buf.
flags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT)) {
395 VkMappedMemoryRange flush_buf = {
396 .sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE,
397 .memory = sd_buf->
buf.
mem,
400 ctx->s.props.properties.limits.nonCoherentAtomSize),
403 ret = vk->FlushMappedMemoryRanges(
ctx->s.hwctx->act_dev, 1, &flush_buf);
404 if (
ret != VK_SUCCESS) {
433 VK_PIPELINE_STAGE_2_VIDEO_DECODE_BIT_KHR,
434 VK_PIPELINE_STAGE_2_VIDEO_DECODE_BIT_KHR);
444 img_bar[nb_img_bar] = (VkImageMemoryBarrier2) {
445 .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2,
447 .srcStageMask = VK_PIPELINE_STAGE_2_VIDEO_DECODE_BIT_KHR,
448 .dstStageMask = VK_PIPELINE_STAGE_2_VIDEO_DECODE_BIT_KHR,
449 .srcAccessMask = VK_ACCESS_2_NONE,
450 .dstAccessMask = VK_ACCESS_2_VIDEO_DECODE_WRITE_BIT_KHR,
451 .oldLayout = vkf->
layout[0],
453 VK_IMAGE_LAYOUT_VIDEO_DECODE_DST_KHR :
454 VK_IMAGE_LAYOUT_VIDEO_DECODE_DPB_KHR,
456 .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
457 .image = vkf->
img[0],
458 .subresourceRange = (VkImageSubresourceRange) {
465 &img_bar[nb_img_bar], &nb_img_bar);
470 VK_PIPELINE_STAGE_2_VIDEO_DECODE_BIT_KHR,
471 VK_PIPELINE_STAGE_2_VIDEO_DECODE_BIT_KHR);
485 VK_PIPELINE_STAGE_2_VIDEO_DECODE_BIT_KHR,
486 VK_PIPELINE_STAGE_2_VIDEO_DECODE_BIT_KHR);
501 img_bar[nb_img_bar] = (VkImageMemoryBarrier2) {
502 .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2,
504 .srcStageMask = VK_PIPELINE_STAGE_2_VIDEO_DECODE_BIT_KHR,
505 .dstStageMask = VK_PIPELINE_STAGE_2_VIDEO_DECODE_BIT_KHR,
506 .srcAccessMask = VK_ACCESS_2_NONE,
507 .dstAccessMask = VK_ACCESS_2_VIDEO_DECODE_READ_BIT_KHR |
508 VK_ACCESS_2_VIDEO_DECODE_WRITE_BIT_KHR,
509 .oldLayout = rvkf->
layout[0],
510 .newLayout = VK_IMAGE_LAYOUT_VIDEO_DECODE_DPB_KHR,
512 .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
513 .image = rvkf->
img[0],
514 .subresourceRange = (VkImageSubresourceRange) {
521 &img_bar[nb_img_bar], &nb_img_bar);
528 VK_PIPELINE_STAGE_2_VIDEO_DECODE_BIT_KHR,
529 VK_PIPELINE_STAGE_2_VIDEO_DECODE_BIT_KHR);
535 vk->CmdPipelineBarrier2(cmd_buf, &(VkDependencyInfo) {
536 .sType = VK_STRUCTURE_TYPE_DEPENDENCY_INFO,
537 .dependencyFlags = VK_DEPENDENCY_BY_REGION_BIT,
538 .pImageMemoryBarriers = img_bar,
539 .imageMemoryBarrierCount = nb_img_bar,
543 vk->CmdBeginVideoCodingKHR(cmd_buf, &decode_start);
555 vk->CmdEndVideoCodingKHR(cmd_buf, &
decode_end);
565 VkSemaphoreWaitInfo
sem_wait = (VkSemaphoreWaitInfo) {
566 .sType = VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO,
567 .pSemaphores = &vp->
sem,
599 if (
ctx->layered_view)
600 vk->DestroyImageView(
s->hwctx->act_dev,
ctx->layered_view,
s->hwctx->alloc);
607 if (
ctx->empty_session_params)
608 vk->DestroyVideoSessionParametersKHR(
s->hwctx->act_dev,
609 ctx->empty_session_params,
614 if (
ctx->yuv_sampler)
615 vk->DestroySamplerYcbcrConversion(
s->hwctx->act_dev,
ctx->yuv_sampler,
645 VK_KHR_VIDEO_DECODE_QUEUE_EXTENSION_NAME);
664 VkVideoDecodeH264CapabilitiesKHR *h264_caps,
665 VkVideoDecodeH265CapabilitiesKHR *h265_caps,
667 VkVideoCapabilitiesKHR *caps,
668 VkVideoDecodeCapabilitiesKHR *dec_caps,
671 VkVideoDecodeUsageInfoKHR *
usage = &prof->
usage;
673 VkVideoProfileListInfoKHR *profile_list = &prof->
profile_list;
675 VkVideoDecodeH264ProfileInfoKHR *h264_profile = &prof->
h264_profile;
676 VkVideoDecodeH265ProfileInfoKHR *h265_profile = &prof->
h265_profile;
684 dec_caps->pNext = h264_caps;
685 usage->pNext = h264_profile;
686 h264_profile->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_INFO_KHR;
695 VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_PROGRESSIVE_KHR :
696 VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_INTERLEAVED_LINES_BIT_KHR;
698 dec_caps->pNext = h265_caps;
699 usage->pNext = h265_profile;
700 h265_profile->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_INFO_KHR;
701 h265_profile->stdProfileIdc = cur_profile;
703 dec_caps->pNext = av1_caps;
704 usage->pNext = av1_profile;
709 usage->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_USAGE_INFO_KHR;
710 usage->videoUsageHints = VK_VIDEO_DECODE_USAGE_DEFAULT_KHR;
712 profile->sType = VK_STRUCTURE_TYPE_VIDEO_PROFILE_INFO_KHR;
719 profile_list->sType = VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR;
720 profile_list->profileCount = 1;
721 profile_list->pProfiles =
profile;
724 caps->sType = VK_STRUCTURE_TYPE_VIDEO_CAPABILITIES_KHR;
725 caps->pNext = dec_caps;
726 dec_caps->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_CAPABILITIES_KHR;
729 return vk->GetPhysicalDeviceVideoCapabilitiesKHR(hwctx->
phys_dev,
profile,
739 int max_level, base_profile, cur_profile;
752 VkVideoCapabilitiesKHR *caps = &
ctx->caps;
753 VkVideoDecodeCapabilitiesKHR *dec_caps = &
ctx->dec_caps;
755 VkVideoDecodeH264CapabilitiesKHR h264_caps = {
756 .sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_KHR,
758 VkVideoDecodeH265CapabilitiesKHR h265_caps = {
759 .sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_KHR,
765 VkPhysicalDeviceVideoFormatInfoKHR fmt_info = {
766 .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_FORMAT_INFO_KHR,
769 VkVideoFormatPropertiesKHR *ret_info;
770 uint32_t nb_out_fmts = 0;
795 if (
ret == VK_ERROR_VIDEO_PROFILE_OPERATION_NOT_SUPPORTED_KHR &&
797 avctx->
profile != base_profile) {
799 "again with profile %s\n",
803 cur_profile = base_profile;
813 if (
ret == VK_ERROR_VIDEO_PROFILE_OPERATION_NOT_SUPPORTED_KHR) {
815 "%s profile \"%s\" not supported!\n",
819 }
else if (
ret == VK_ERROR_VIDEO_PROFILE_FORMAT_NOT_SUPPORTED_KHR) {
821 "format (%s) not supported!\n",
824 }
else if (
ret == VK_ERROR_FEATURE_NOT_PRESENT ||
825 ret == VK_ERROR_FORMAT_NOT_SUPPORTED) {
827 }
else if (
ret != VK_SUCCESS) {
840 max_level, avctx->
level);
842 caps->minCodedExtent.width, caps->maxCodedExtent.width);
844 caps->minCodedExtent.height, caps->maxCodedExtent.height);
846 caps->pictureAccessGranularity.width);
848 caps->pictureAccessGranularity.height);
850 caps->minBitstreamBufferOffsetAlignment);
852 caps->minBitstreamBufferSizeAlignment);
856 caps->maxActiveReferencePictures);
858 caps->stdHeaderVersion.extensionName,
860 av_log(avctx,
AV_LOG_VERBOSE,
" Codec header version: %i.%i.%i (driver), %i.%i.%i (compiled)\n",
861 CODEC_VER(caps->stdHeaderVersion.specVersion),
864 dec_caps->flags ?
"" :
866 dec_caps->flags & VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR ?
867 " reuse_dst_dpb" :
"",
868 dec_caps->flags & VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR ?
869 " dedicated_dpb" :
"");
873 caps->flags & VK_VIDEO_CAPABILITY_PROTECTED_CONTENT_BIT_KHR ?
875 caps->flags & VK_VIDEO_CAPABILITY_SEPARATE_REFERENCE_IMAGES_BIT_KHR ?
876 " separate_references" :
"");
879 if (avctx->
coded_width < caps->minCodedExtent.width ||
886 avctx->
level > max_level)
890 if (!(dec_caps->flags & (VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR |
891 VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR))) {
893 "VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR nor "
894 "VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR are set!\n");
896 }
else if ((dec_caps->flags & (VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR |
897 VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR) ==
898 VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR) &&
899 !(caps->flags & VK_VIDEO_CAPABILITY_SEPARATE_REFERENCE_IMAGES_BIT_KHR)) {
900 av_log(avctx,
AV_LOG_ERROR,
"Cannot initialize Vulkan decoding session, buggy driver: "
901 "VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR set "
902 "but VK_VIDEO_CAPABILITY_SEPARATE_REFERENCE_IMAGES_BIT_KHR is unset!\n");
904 }
else if (!(dec_caps->flags & VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR) &&
906 av_log(avctx,
AV_LOG_ERROR,
"Cannot initialize Vulkan decoding session, buggy driver: "
907 "codec is AV1, but VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR isn't set!\n");
912 dec->
dedicated_dpb = !(dec_caps->flags & VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR);
913 dec->
layered_dpb = !(caps->flags & VK_VIDEO_CAPABILITY_SEPARATE_REFERENCE_IMAGES_BIT_KHR);
917 fmt_info.imageUsage = VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR;
919 fmt_info.imageUsage = VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR |
920 VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR |
921 VK_IMAGE_USAGE_TRANSFER_SRC_BIT |
922 VK_IMAGE_USAGE_SAMPLED_BIT;
926 ret = vk->GetPhysicalDeviceVideoFormatPropertiesKHR(hwctx->
phys_dev,
929 if (
ret == VK_ERROR_FORMAT_NOT_SUPPORTED ||
930 (!nb_out_fmts &&
ret == VK_SUCCESS)) {
932 }
else if (
ret != VK_SUCCESS) {
938 ret_info =
av_mallocz(
sizeof(*ret_info)*nb_out_fmts);
942 for (
int i = 0;
i < nb_out_fmts;
i++)
943 ret_info[
i].sType = VK_STRUCTURE_TYPE_VIDEO_FORMAT_PROPERTIES_KHR;
945 ret = vk->GetPhysicalDeviceVideoFormatPropertiesKHR(hwctx->
phys_dev,
947 &nb_out_fmts, ret_info);
948 if (
ret == VK_ERROR_FORMAT_NOT_SUPPORTED ||
949 (!nb_out_fmts &&
ret == VK_SUCCESS)) {
952 }
else if (
ret != VK_SUCCESS) {
961 *vk_fmt = best_vkfmt = VK_FORMAT_UNDEFINED;
964 av_log(avctx,
AV_LOG_DEBUG,
"Choosing best pixel format for decoding from %i:\n", nb_out_fmts);
965 for (
int i = 0;
i < nb_out_fmts;
i++) {
973 if (
tmp == best_format)
974 best_vkfmt = ret_info[
i].format;
984 av_log(avctx,
AV_LOG_ERROR,
"No valid/compatible pixel format found for decoding!\n");
992 *vk_fmt = best_vkfmt;
1007 int err, dedicated_dpb;
1025 prof, &dedicated_dpb);
1038 hwfc->format[0] = vkfmt;
1039 hwfc->create_pnext = &prof->profile_list;
1040 hwfc->tiling = VK_IMAGE_TILING_OPTIMAL;
1041 hwfc->usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT |
1042 VK_IMAGE_USAGE_SAMPLED_BIT |
1043 VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR;
1045 if (!dec->dedicated_dpb)
1046 hwfc->usage |= VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR;
1055 VkVideoSessionParametersKHR *par = (VkVideoSessionParametersKHR *)
data;
1056 vk->DestroyVideoSessionParametersKHR(
ctx->s.hwctx->act_dev, *par,
1057 ctx->s.hwctx->alloc);
1062 const VkVideoSessionParametersCreateInfoKHR *session_params_create)
1064 VkVideoSessionParametersKHR *par =
av_malloc(
sizeof(*par));
1072 ret = vk->CreateVideoSessionParametersKHR(
ctx->s.hwctx->act_dev, session_params_create,
1073 ctx->s.hwctx->alloc, par);
1074 if (
ret != VK_SUCCESS) {
1075 av_log(logctx,
AV_LOG_ERROR,
"Unable to create Vulkan video session parameters: %s!\n",
1107 int err, qf, cxpos = 0, cypos = 0, nb_q = 0;
1113 const VkVideoProfileInfoKHR *
profile;
1115 VkVideoDecodeH264SessionParametersCreateInfoKHR h264_params = {
1116 .sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_CREATE_INFO_KHR,
1118 VkVideoDecodeH265SessionParametersCreateInfoKHR h265_params = {
1119 .sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_KHR,
1124 VkVideoSessionParametersCreateInfoKHR session_params_create = {
1125 .sType = VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_CREATE_INFO_KHR,
1131 VkVideoSessionCreateInfoKHR session_create = {
1132 .sType = VK_STRUCTURE_TYPE_VIDEO_SESSION_CREATE_INFO_KHR,
1134 VkSamplerYcbcrConversionCreateInfo yuv_sampler_info = {
1135 .sType = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO,
1137 .ycbcrModel = VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY,
1152 s->hwfc =
s->frames->hwctx;
1155 s->hwctx =
s->device->hwctx;
1171 if (!(
s->video_props[qf].videoCodecOperations &
1179 if (
s->query_props[qf].queryResultStatusSupport)
1182 session_create.flags = 0x0;
1183 session_create.queueFamilyIndex =
s->hwctx->queue_family_decode_index;
1184 session_create.maxCodedExtent =
ctx->caps.maxCodedExtent;
1185 session_create.maxDpbSlots =
ctx->caps.maxDpbSlots;
1186 session_create.maxActiveReferencePictures =
ctx->caps.maxActiveReferencePictures;
1187 session_create.pictureFormat =
s->hwfc->format[0];
1188 session_create.referencePictureFormat = session_create.pictureFormat;
1190 session_create.pVideoProfile =
profile;
1196 nb_q, VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR, 0,
1207 yuv_sampler_info.xChromaOffset = cxpos >> 7;
1208 yuv_sampler_info.yChromaOffset = cypos >> 7;
1209 yuv_sampler_info.format =
s->hwfc->format[0];
1210 ret = vk->CreateSamplerYcbcrConversion(
s->hwctx->act_dev, &yuv_sampler_info,
1211 s->hwctx->alloc, &
ctx->yuv_sampler);
1212 if (
ret != VK_SUCCESS) {
1223 if (!
ctx->dpb_hwfc_ref) {
1236 VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR);
1237 dpb_hwfc->
format[0] =
s->hwfc->format[0];
1238 dpb_hwfc->
tiling = VK_IMAGE_TILING_OPTIMAL;
1239 dpb_hwfc->
usage = VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR |
1240 VK_IMAGE_USAGE_SAMPLED_BIT;
1251 if (!
ctx->layered_frame) {
1258 s->hwfc->format[0], 0);
1264 session_params_create.videoSession =
ctx->common.session;
1265 ret = vk->CreateVideoSessionParametersKHR(
s->hwctx->act_dev, &session_params_create,
1266 s->hwctx->alloc, &
ctx->empty_session_params);
1267 if (
ret != VK_SUCCESS) {
1268 av_log(avctx,
AV_LOG_ERROR,
"Unable to create empty Vulkan video session parameters: %s!\n",