aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLynne <dev@lynne.ee>2024-10-04 17:20:09 +0200
committerLynne <dev@lynne.ee>2024-10-06 01:21:45 +0200
commit4a557baaa1fa150663f20117b4a781392f65143e (patch)
tree71c55e09c1ebf62fedf9bbff0236750ac80d9ce4
parent893f3fde4cdeb4a28fce3833193b0c1c8f9fd33d (diff)
downloadffmpeg-4a557baaa1fa150663f20117b4a781392f65143e.tar.gz
vulkan_encode: do not align DPB buffer size
Per subsection B stroke 165 of Chapter 56, drivers are required to do the aligning, not users.
-rw-r--r--libavcodec/vulkan_encode.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/libavcodec/vulkan_encode.c b/libavcodec/vulkan_encode.c
index 6d1743c7d7..9ad02e8c52 100644
--- a/libavcodec/vulkan_encode.c
+++ b/libavcodec/vulkan_encode.c
@@ -220,8 +220,7 @@ static int vulkan_encode_issue(AVCodecContext *avctx,
.sType = VK_STRUCTURE_TYPE_VIDEO_PICTURE_RESOURCE_INFO_KHR,
.pNext = NULL,
.codedOffset = { 0 },
- .codedExtent = (VkExtent2D){ ctx->base.surface_width,
- ctx->base.surface_height },
+ .codedExtent = (VkExtent2D){ avctx->width, avctx->height },
.baseArrayLayer = ctx->common.layered_dpb ? slot_index : 0,
.imageViewBinding = vp->dpb.view,
};
@@ -565,8 +564,8 @@ static int vulkan_encode_create_dpb(AVCodecContext *avctx, FFVulkanEncodeContext
base_ctx->recon_frames->format = AV_PIX_FMT_VULKAN;
base_ctx->recon_frames->sw_format = dpb_format;
- base_ctx->recon_frames->width = base_ctx->surface_width;
- base_ctx->recon_frames->height = base_ctx->surface_height;
+ base_ctx->recon_frames->width = avctx->width;
+ base_ctx->recon_frames->height = avctx->height;
hwfc->format[0] = ctx->pic_format;
hwfc->create_pnext = &ctx->profile_list;
@@ -915,9 +914,9 @@ av_cold int ff_vulkan_encode_init(AVCodecContext *avctx, FFVulkanEncodeContext *
/* Setup width/height alignment */
base_ctx->surface_width = avctx->coded_width =
- FFALIGN(avctx->width, ctx->caps.pictureAccessGranularity.width);
+ FFALIGN(avctx->width, ctx->enc_caps.encodeInputPictureGranularity.width);
base_ctx->surface_height = avctx->coded_height =
- FFALIGN(avctx->height, ctx->caps.pictureAccessGranularity.height);
+ FFALIGN(avctx->height, ctx->enc_caps.encodeInputPictureGranularity.height);
/* Setup slice width/height */
base_ctx->slice_block_width = ctx->enc_caps.encodeInputPictureGranularity.width;