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 C2DB947A45 for ; Thu, 30 Nov 2023 00:24:11 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7C71C68D06E; Thu, 30 Nov 2023 02:24:09 +0200 (EET) Received: from a27-216.smtp-out.us-west-2.amazonses.com (a27-216.smtp-out.us-west-2.amazonses.com [54.240.27.216]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6351868BF3C for ; Thu, 30 Nov 2023 02:24:02 +0200 (EET) To: =?UTF-8?Q?ffmpeg-devel=40ffmpeg=2Eorg?= Date: Thu, 30 Nov 2023 00:23:59 +0000 Mime-Version: 1.0 In-Reply-To: <20231130002316.73504-1-cosmin@cosmin.at> References: <20231130002316.73504-1-cosmin@cosmin.at> <20231130002316.73504-4-cosmin@cosmin.at> X-Mailer: Amazon WorkMail Thread-Index: AQHaIyNrRPKJ9BURSnGRNaEm4d8hOwAAAIiW Thread-Topic: [PATCH v2 3/3] avfilter/vf_bwdif_vulkan: consider chroma subsampling when enforcing minimum dimensions X-Original-Mailer: git-send-email 2.42.1 X-Wm-Sent-Timestamp: 1701303838 Message-ID: <0101018c1d9c6bcb-6f87bd45-efc7-41f2-ac24-450704936b41-000000@us-west-2.amazonses.com> Feedback-ID: 1.us-west-2.An468LAV0jCjQDrDLvlZjeAthld7qrhZr+vow8irkvU=:AmazonSES X-SES-Outgoing: 2023.11.30-54.240.27.216 Subject: [FFmpeg-devel] [PATCH v2 3/3] avfilter/vf_bwdif_vulkan: consider chroma subsampling when enforcing minimum 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: , From: Cosmin Stejerean via ffmpeg-devel Reply-To: FFmpeg development discussions and patches Cc: =?UTF-8?Q?Cosmin_Stejerean?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: From: Cosmin Stejerean Signed-off-by: Cosmin Stejerean --- libavfilter/vf_bwdif_vulkan.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/libavfilter/vf_bwdif_vulkan.c b/libavfilter/vf_bwdif_vulkan.c index 690a89c4ba..6a886d11ac 100644 --- a/libavfilter/vf_bwdif_vulkan.c +++ b/libavfilter/vf_bwdif_vulkan.c @@ -362,13 +362,19 @@ static int bwdif_vulkan_config_output(AVFilterLink *outlink) outlink->frame_rate = av_mul_q(avctx->inputs[0]->frame_rate, (AVRational){2, 1}); - if (outlink->w < 4 || outlink->h < 4) { - av_log(avctx, AV_LOG_ERROR, "Video of less than 4 columns or lines is not " - "supported\n"); + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(vkctx->frames->sw_format); + + int h = link->h; + int w = link->w; + int h_chroma = AV_CEIL_RSHIFT(h, desc->log2_chroma_h); + int w_chroma = AV_CEIL_RSHIFT(w, desc->log2_chroma_w); + + if (w < 4 || w_chroma < 4 || h < 4 || h_chroma < 4) { + av_log(ctx, AV_LOG_ERROR, "Video with planes less than 4 columns or lines is not supported\n"); return AVERROR(EINVAL); } - y->csp = av_pix_fmt_desc_get(vkctx->frames->sw_format); + y->csp = desc; y->filter = bwdif_vulkan_filter_frame; return init_filter(avctx); -- 2.42.1 _______________________________________________ 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".