From patchwork Sat Dec 2 20:16: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: 44868 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:a301:b0:181:818d:5e7f with SMTP id x1csp1915653pzk; Sat, 2 Dec 2023 12:17:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IGVLp50XFlCeoimnVD2+fHEMc3KroX6jEdZNvACDs3WV2q/3HRuqDc19aZZ+FR76heAGvAQ X-Received: by 2002:a2e:a7c2:0:b0:2c9:e35f:c85 with SMTP id x2-20020a2ea7c2000000b002c9e35f0c85mr1582134ljp.33.1701548241399; Sat, 02 Dec 2023 12:17:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701548241; cv=none; d=google.com; s=arc-20160816; b=oTyluW6WgD8z/6xUawluYPMiA4sqTK5qq89taNG8lRlrPmnZs5GFBzjSiRXosEN55y gJX5R1Q+RPz4ouSIF35jc6unS2ZycRqI/ZqR+gVswCUxfyeFjkQqbQQEAH4HGExFXIgD wNsQJrs1zaUaUR2HroEal589EMKpmKRx0dCuQQPQ4P2yZQmOebLRtKlDbNVQ1QV6Dblb JTOUc7enn+3id0anTVboAUjkbW7DciNJPSdac4e+EUBbfkJIFzg3zbJafs+cJuNh1yk/ j860E6JM43227Re9x5OhYsb3vblK/snnLqA2rv9eEDj7KrvOsm3hheTdttKrJ4oGceym sQAA== 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=p+Qqgi7piTZ/EB1/Gt+aUuuWN4b5RF4hyT8i9NV16t4=; fh=CBS/D0cB4KwqFBY8d8UQ4TY1w6HZ9TulitLE+VqI2+k=; b=TwQ7hmTh407/Loe0FQa3AnZjqO0Dp+A+e728UxN56KvWmvYcEjcWEgW6SpjGyLoHBp nOQDF+NzppRgbY6rVFJMrqKTeS/AasNYdtXP5NFtrF1Q3OwQBvzgN4cYYgol7Sen9fyy XTzLNtuDRjpAgib1LJFxoKoW+EUBacYyPaIQxZBhiMEin5s+k89mbaiiQLu4LBNLZ8n9 BrGIP2wVffG4nvYRVA0Mi6Vt20ExphdeL1cnJzr5nv1Awio63ROtRLmo+T6XINlbtt7l lE+2dS7b6IlE9tM2R0LATc7FMyGdLyAP1hUGjOMmM1+V9DXS6B5M96RDZwTIkpp4uGa2 tb2Q== 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 va10-20020a17090711ca00b009e6b2845851si2945028ejb.496.2023.12.02.12.17.21; Sat, 02 Dec 2023 12:17:21 -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 7A56668AAD5; Sat, 2 Dec 2023 22:17:09 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from a27-16.smtp-out.us-west-2.amazonses.com (a27-16.smtp-out.us-west-2.amazonses.com [54.240.27.16]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5312368CAA1 for ; Sat, 2 Dec 2023 22:17:02 +0200 (EET) To: =?utf-8?q?ffmpeg-devel=40ffmpeg=2Eorg?= Date: Sat, 2 Dec 2023 20:16:59 +0000 Mime-Version: 1.0 In-Reply-To: <20231202201655.40450-1-cosmin@cosmin.at> References: <20231202201655.40450-1-cosmin@cosmin.at> <20231202201655.40450-3-cosmin@cosmin.at> X-Mailer: Amazon WorkMail Thread-Index: AQHaJVx/pw0LJ5SZTAe6kqN6vnwK6wAAAGDd Thread-Topic: [PATCH v3 2/3] avfilter/vf_bwdif_cuda: consider chroma subsampling when enforcing minimum dimensions X-Original-Mailer: git-send-email 2.42.1 X-Wm-Sent-Timestamp: 1701548218 Message-ID: <0101018c2c2d5d62-1225137e-a53e-4f7c-beae-6123f9fd9e22-000000@us-west-2.amazonses.com> Feedback-ID: 1.us-west-2.An468LAV0jCjQDrDLvlZjeAthld7qrhZr+vow8irkvU=:AmazonSES X-SES-Outgoing: 2023.12.02-54.240.27.16 Subject: [FFmpeg-devel] [PATCH v3 2/3] avfilter/vf_bwdif_cuda: 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: YfK59z5fdAzs From: Cosmin Stejerean Signed-off-by: Cosmin Stejerean --- libavfilter/vf_bwdif_cuda.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libavfilter/vf_bwdif_cuda.c b/libavfilter/vf_bwdif_cuda.c index a5ecfbadb6..418f15f989 100644 --- a/libavfilter/vf_bwdif_cuda.c +++ b/libavfilter/vf_bwdif_cuda.c @@ -296,15 +296,16 @@ static int config_output(AVFilterLink *link) link->frame_rate = av_mul_q(ctx->inputs[0]->frame_rate, (AVRational){2, 1}); - if (link->w < 3 || link->h < 3) { - av_log(ctx, AV_LOG_ERROR, "Video of less than 3 columns or lines is not supported\n"); - ret = AVERROR(EINVAL); - goto exit; - } y->csp = av_pix_fmt_desc_get(output_frames->sw_format); y->filter = filter; + if (AV_CEIL_RSHIFT(link->w, y->csp->log2_chroma_w) < 3 || AV_CEIL_RSHIFT(link->h, y->csp->log2_chroma_h) < 3) { + av_log(ctx, AV_LOG_ERROR, "Video with planes less than 3 columns or lines is not supported\n"); + ret = AVERROR(EINVAL); + goto exit; + } + ret = CHECK_CU(cu->cuCtxPushCurrent(s->hwctx->cuda_ctx)); if (ret < 0) goto exit;