From: Lynne <dev@lynne.ee> To: Ffmpeg Devel <ffmpeg-devel@ffmpeg.org> Subject: [FFmpeg-devel] [PATCH] vulkan_decode: use coded_width/height instead of the non-coded width and h Date: Tue, 24 Oct 2023 06:37:03 +0200 (CEST) Message-ID: <NhUyBpG--3-9@lynne.ee> (raw) [-- Attachment #1: Type: text/plain, Size: 129 bytes --] Fixes several samples. There may be issues with cropping, but so far, I have not found any in my samples set. Patch attached. [-- Attachment #2: 0001-vulkan_decode-use-coded_width-height-instead-of-the-.patch --] [-- Type: text/x-diff, Size: 2446 bytes --] From b928053158ec5f63d3c07a9daa9b802cb9229858 Mon Sep 17 00:00:00 2001 From: Lynne <dev@lynne.ee> Date: Tue, 24 Oct 2023 06:33:07 +0200 Subject: [PATCH] vulkan_decode: use coded_width/height instead of the non-coded width and height Fixes several samples. There may be issues with cropping, but so far, I have not found any in my samples set. --- libavcodec/vulkan_decode.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libavcodec/vulkan_decode.c b/libavcodec/vulkan_decode.c index e6a0646139..3b9576c0a9 100644 --- a/libavcodec/vulkan_decode.c +++ b/libavcodec/vulkan_decode.c @@ -872,10 +872,10 @@ static int vulkan_decode_get_profile(AVCodecContext *avctx, AVBufferRef *frames_ " separate_references" : ""); /* Check if decoding is possible with the given parameters */ - if (avctx->width < caps->minCodedExtent.width || - avctx->height < caps->minCodedExtent.height || - avctx->width > caps->maxCodedExtent.width || - avctx->height > caps->maxCodedExtent.height) + 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) return AVERROR(EINVAL); if (!(avctx->hwaccel_flags & AV_HWACCEL_FLAG_IGNORE_LEVEL) && @@ -1027,8 +1027,8 @@ int ff_vk_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx) frames_ctx->user_opaque = prof; frames_ctx->free = free_profile_data; - frames_ctx->width = avctx->width; - frames_ctx->height = avctx->height; + frames_ctx->width = avctx->coded_width; + frames_ctx->height = avctx->coded_height; frames_ctx->format = AV_PIX_FMT_VULKAN; hwfc->format[0] = vkfmt; @@ -1224,8 +1224,8 @@ int ff_vk_decode_init(AVCodecContext *avctx) dpb_frames = (AVHWFramesContext *)ctx->dpb_hwfc_ref->data; dpb_frames->format = s->frames->format; dpb_frames->sw_format = s->frames->sw_format; - dpb_frames->width = s->frames->width; - dpb_frames->height = s->frames->height; + dpb_frames->width = avctx->coded_width; + dpb_frames->height = avctx->coded_height; dpb_hwfc = dpb_frames->hwctx; dpb_hwfc->create_pnext = (void *)ff_vk_find_struct(ctx->s.hwfc->create_pnext, -- 2.42.0 [-- Attachment #3: Type: text/plain, Size: 251 bytes --] _______________________________________________ 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".
next reply other threads:[~2023-10-24 4:37 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-10-24 4:37 Lynne [this message] 2023-10-24 19:04 ` Anton Khirnov 2023-10-24 23:38 ` Lynne
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=NhUyBpG--3-9@lynne.ee \ --to=dev@lynne.ee \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git