From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 6128E46635 for ; Mon, 29 May 2023 02:08:26 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 277B368C1E0; Mon, 29 May 2023 05:08:24 +0300 (EEST) Received: from w4.tutanota.de (w4.tutanota.de [81.3.6.165]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 54C8768BEC9 for ; Mon, 29 May 2023 05:08:18 +0300 (EEST) Received: from tutadb.w10.tutanota.de (unknown [192.168.1.10]) by w4.tutanota.de (Postfix) with ESMTP id 67DA81060160 for ; Mon, 29 May 2023 02:08:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1685326097; s=s1; d=lynne.ee; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Cc:Date:Date:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:Sender; bh=9CRgZbSEpOwsTJBV2S3tSigDs5VehsmzYYsbkpxB3zc=; b=WXs3bJGpdDlX67kcGqUWp8iTD2BpBiIEsKpFvNtLeR5zFSdol3cm+753WRWqqQIs SD8Fck4FCw8oAKvrKh1xGvgvwnZR+YSiWs91sOvMZP0NXP6J6wBH1nSBs0xYjLsEmo3 dkQ0Ch7WrdmQD+1Ue93Tj8BoiVKZwczIbmpQAngO5Ve7mfzZG8IrVQQFwlU61QcqYRl wt8FzMH8QcfmvEcMrzNlq++JCT2AnSs6s2Te4kl51d6U5IZoYhB0ejwRFWz1NikFrdz AX19x3rqoRLsX1ungv+z+Yu2nbxRYPK4mMnNz4dt/GOZknyVj1jPEkhHHz+/Rm/npyH 63/VN+48rQ== Date: Mon, 29 May 2023 04:08:17 +0200 (CEST) From: Lynne To: Ffmpeg Devel Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_107486_662931013.1685326097939" Subject: [FFmpeg-devel] [PATCH] vulkan_decode: do not align the image dimensions X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: ------=_Part_107486_662931013.1685326097939 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit According to Dave Airlie: > but I think ignoring it should be fine, I can't see any > other way to get the imaeg extents correct for other usage > what width/height should be used for the images? > the final presentable dimensions, or the coded dimensions? > if you don't want noise I think the presentable dims > the driver should round up the allocations internally, > but if you are going to sample from the images then w/h have to be > the bounds of the image you want > since otherwise there's no way to stop the sampler from > going outside the edges ------=_Part_107486_662931013.1685326097939 Content-Type: text/x-diff; charset=us-ascii; name=0001-vulkan_decode-do-not-align-the-image-dimensions.patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0001-vulkan_decode-do-not-align-the-image-dimensions.patch >From ce6aa64eacfc9f7881571450a7bf8192c776f0ec Mon Sep 17 00:00:00 2001 From: Lynne Date: Mon, 29 May 2023 03:50:25 +0200 Subject: [PATCH] vulkan_decode: do not align the image dimensions According to Dave Airlie: > but I think ignoring it should be fine, I can't see any > other way to get the imaeg extents correct for other usage > what width/height should be used for the images? > the final presentable dimensions, or the coded dimensions? > if you don't want noise I think the presentable dims > the driver should round up the allocations internally, > but if you are going to sample from the images then w/h have to be > the bounds of the image you want > since otherwise there's no way to stop the sampler from > going outside the edges --- libavcodec/vulkan_decode.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/libavcodec/vulkan_decode.c b/libavcodec/vulkan_decode.c index 6138106fef..0acfb93aa0 100644 --- a/libavcodec/vulkan_decode.c +++ b/libavcodec/vulkan_decode.c @@ -702,7 +702,6 @@ static VkResult vulkan_setup_profile(AVCodecContext *avctx, } static int vulkan_decode_get_profile(AVCodecContext *avctx, AVBufferRef *frames_ref, - int *width_align, int *height_align, enum AVPixelFormat *pix_fmt, VkFormat *vk_fmt, int *dpb_dedicate) { @@ -841,10 +840,10 @@ static int vulkan_decode_get_profile(AVCodecContext *avctx, AVBufferRef *frames_ " separate_references" : ""); /* Check if decoding is possible with the given parameters */ - if (avctx->coded_width < caps->minCodedExtent.width || - avctx->coded_height < caps->minCodedExtent.height || - avctx->coded_width > caps->maxCodedExtent.width || - avctx->coded_height > caps->maxCodedExtent.height) + if (avctx->width < caps->minCodedExtent.width || + avctx->height < caps->minCodedExtent.height || + avctx->width > caps->maxCodedExtent.width || + avctx->height > caps->maxCodedExtent.height) return AVERROR(EINVAL); if (!(avctx->hwaccel_flags & AV_HWACCEL_FLAG_IGNORE_LEVEL) && @@ -956,8 +955,6 @@ static int vulkan_decode_get_profile(AVCodecContext *avctx, AVBufferRef *frames_ *pix_fmt = best_format; *vk_fmt = best_vkfmt; - *width_align = caps->pictureAccessGranularity.width; - *height_align = caps->pictureAccessGranularity.height; *dpb_dedicate = dec->dedicated_dpb; return 0; @@ -966,7 +963,7 @@ static int vulkan_decode_get_profile(AVCodecContext *avctx, AVBufferRef *frames_ int ff_vk_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx) { VkFormat vkfmt; - int err, width_align, height_align, dedicated_dpb; + int err, dedicated_dpb; AVHWFramesContext *frames_ctx = (AVHWFramesContext*)hw_frames_ctx->data; AVVulkanFramesContext *hwfc = frames_ctx->hwctx; FFVulkanDecodeContext *dec = avctx->internal->hwaccel_priv_data; @@ -983,14 +980,13 @@ int ff_vk_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx) prof = &ctx->profile_data; err = vulkan_decode_get_profile(avctx, hw_frames_ctx, - &width_align, &height_align, &frames_ctx->sw_format, &vkfmt, &dedicated_dpb); if (err < 0) return err; - frames_ctx->width = FFALIGN(avctx->coded_width, width_align); - frames_ctx->height = FFALIGN(avctx->coded_height, height_align); + frames_ctx->width = avctx->width; + frames_ctx->height = avctx->height; frames_ctx->format = AV_PIX_FMT_VULKAN; hwfc->format[0] = vkfmt; -- 2.40.1 ------=_Part_107486_662931013.1685326097939 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ------=_Part_107486_662931013.1685326097939--