|
|
|
@ -437,8 +437,11 @@ static const VulkanOptExtension optional_device_exts[] = { |
|
|
|
|
|
|
|
|
|
/* Video encoding/decoding */ |
|
|
|
|
{ VK_KHR_VIDEO_QUEUE_EXTENSION_NAME, FF_VK_EXT_VIDEO_QUEUE }, |
|
|
|
|
{ VK_KHR_VIDEO_ENCODE_QUEUE_EXTENSION_NAME, FF_VK_EXT_VIDEO_ENCODE_QUEUE }, |
|
|
|
|
{ VK_KHR_VIDEO_DECODE_QUEUE_EXTENSION_NAME, FF_VK_EXT_VIDEO_DECODE_QUEUE }, |
|
|
|
|
{ VK_KHR_VIDEO_ENCODE_H264_EXTENSION_NAME, FF_VK_EXT_VIDEO_ENCODE_H264 }, |
|
|
|
|
{ VK_KHR_VIDEO_DECODE_H264_EXTENSION_NAME, FF_VK_EXT_VIDEO_DECODE_H264 }, |
|
|
|
|
{ VK_KHR_VIDEO_ENCODE_H265_EXTENSION_NAME, FF_VK_EXT_VIDEO_ENCODE_H265 }, |
|
|
|
|
{ VK_KHR_VIDEO_DECODE_H265_EXTENSION_NAME, FF_VK_EXT_VIDEO_DECODE_H265 }, |
|
|
|
|
{ VK_KHR_VIDEO_DECODE_AV1_EXTENSION_NAME, FF_VK_EXT_VIDEO_DECODE_AV1 }, |
|
|
|
|
}; |
|
|
|
@ -2078,6 +2081,7 @@ enum PrepMode { |
|
|
|
|
PREP_MODE_EXTERNAL_IMPORT, |
|
|
|
|
PREP_MODE_DECODING_DST, |
|
|
|
|
PREP_MODE_DECODING_DPB, |
|
|
|
|
PREP_MODE_ENCODING_DPB, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
static int prepare_frame(AVHWFramesContext *hwfc, FFVkExecPool *ectx, |
|
|
|
@ -2139,6 +2143,10 @@ static int prepare_frame(AVHWFramesContext *hwfc, FFVkExecPool *ectx, |
|
|
|
|
new_layout = VK_IMAGE_LAYOUT_VIDEO_DECODE_DPB_KHR; |
|
|
|
|
new_access = VK_ACCESS_TRANSFER_READ_BIT | VK_ACCESS_TRANSFER_WRITE_BIT; |
|
|
|
|
break; |
|
|
|
|
case PREP_MODE_ENCODING_DPB: |
|
|
|
|
new_layout = VK_IMAGE_LAYOUT_VIDEO_ENCODE_DPB_KHR; |
|
|
|
|
new_access = VK_ACCESS_TRANSFER_READ_BIT | VK_ACCESS_TRANSFER_WRITE_BIT; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ff_vk_frame_barrier(&p->vkctx, exec, &tmp_frame, img_bar, &nb_img_bar, |
|
|
|
@ -2399,6 +2407,8 @@ static AVBufferRef *vulkan_pool_alloc(void *opaque, size_t size) |
|
|
|
|
err = prepare_frame(hwfc, &fp->compute_exec, f, PREP_MODE_DECODING_DPB); |
|
|
|
|
else if (hwctx->usage & VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR) |
|
|
|
|
err = prepare_frame(hwfc, &fp->compute_exec, f, PREP_MODE_DECODING_DST); |
|
|
|
|
else if (hwctx->usage & VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR) |
|
|
|
|
err = prepare_frame(hwfc, &fp->compute_exec, f, PREP_MODE_ENCODING_DPB); |
|
|
|
|
else |
|
|
|
|
err = prepare_frame(hwfc, &fp->compute_exec, f, PREP_MODE_WRITE); |
|
|
|
|
if (err) |
|
|
|
|