From patchwork Thu Nov 30 00:23:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cosmin Stejerean X-Patchwork-Id: 44845 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:a301:b0:181:818d:5e7f with SMTP id x1csp20907pzk; Wed, 29 Nov 2023 16:24:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IHxfwXWS2N0ufIknG8OPloI1R5pmVwWz6NXXKage++z2fVyMp6LKWRw5rSj1wom3RACkKM5 X-Received: by 2002:a17:906:3616:b0:a02:a2cc:66b5 with SMTP id q22-20020a170906361600b00a02a2cc66b5mr14309265ejb.76.1701303853917; Wed, 29 Nov 2023 16:24:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701303853; cv=none; d=google.com; s=arc-20160816; b=DLnhPM8zs2FczAUMcH8BO5xfKhGnABqUZgzVviloFp5l2tCCiw3uRFgYckIuCwO5Ax ioo6hlKF0ywOVynVwF8BwNvv02yTwhMSA73A8xo0ZFp74YHQpQb1YN22ckwGuTbCSIc+ QZ9tuPENP76outQcmtbwh66pRHHmciM3IUvG0mWbqzJDhdHTGfsdBmEBU04TBrLMt+tw EWdX5OqlAj7U7susbw6HiwDJiJ/H0WEWB19h6Sa9Z5iZTREoPy8+RWzSoANbXizmaqCb sCB4uqS71WpC8Mez6GIndzuqMAQlDQtterJwumdqycazh0LiwEcMRMnRc9K43L8/kWIy kd+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to:from :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:feedback-id:message-id:thread-topic :thread-index:references:in-reply-to:mime-version:date:to :delivered-to; bh=uDep9Cb64m7lb0CxY5lJsNoql04AJRilPXHKG8jNB8U=; fh=CBS/D0cB4KwqFBY8d8UQ4TY1w6HZ9TulitLE+VqI2+k=; b=uwoCbHkkljbwaJ14hMRPN93PQj0U62UapLxhtyoIIyQHnWRxHl9kDIz13Qe/mEWhXl V3dLQRwurl+6Q17No/n0uxa+qxxRpH65ELg/oeH/HecqVlxvM8v0Xzku8C1ChB1xJBDG 3KuggVgX+GZWbsO/emXGUHyy9iHNAIsowRaLUkd57R1bGtypXN1S9xk70JuOPMFjD7yo 5fql68g/YNZcLlhsKtVEUBNPPNallYyq0hb0pKaO4ASMq1M51HaRT8zms+kcx+/Ajy0b ndA9tQepzyz5VUZbaQR7et2MNrRuf4U0tmZFwMQLr0wrdjMUGqOtAS0xOTuxitYajFK5 5CHg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id n18-20020a170906841200b00a1765693d7asi33997ejx.607.2023.11.29.16.24.12; Wed, 29 Nov 2023 16:24:13 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AB3A568D065; Thu, 30 Nov 2023 02:24:09 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org 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: , X-Patchwork-Original-From: Cosmin Stejerean via ffmpeg-devel From: Cosmin Stejerean Reply-To: FFmpeg development discussions and patches Cc: =?utf-8?q?Cosmin_Stejerean?= Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: VRsEZy7BJHS6 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);