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 179BA471FB for ; Thu, 30 Nov 2023 00:23:43 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3C48668D055; Thu, 30 Nov 2023 02:23:33 +0200 (EET) Received: from a27-81.smtp-out.us-west-2.amazonses.com (a27-81.smtp-out.us-west-2.amazonses.com [54.240.27.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5105F68C7BB for ; Thu, 30 Nov 2023 02:23:25 +0200 (EET) To: =?UTF-8?Q?ffmpeg-devel=40ffmpeg=2Eorg?= Date: Thu, 30 Nov 2023 00:23:22 +0000 Mime-Version: 1.0 In-Reply-To: <20231130002316.73504-1-cosmin@cosmin.at> References: <20231130002316.73504-1-cosmin@cosmin.at> <20231130002316.73504-3-cosmin@cosmin.at> X-Mailer: Amazon WorkMail Thread-Index: AQHaIyNrRPKJ9BURSnGRNaEm4d8hOwAAAF4H Thread-Topic: [PATCH v2 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: 1701303801 Message-ID: <0101018c1d9bdaae-9d0e0673-0c35-4fe1-a981-98b365e78430-000000@us-west-2.amazonses.com> Feedback-ID: 1.us-west-2.An468LAV0jCjQDrDLvlZjeAthld7qrhZr+vow8irkvU=:AmazonSES X-SES-Outgoing: 2023.11.30-54.240.27.81 Subject: [FFmpeg-devel] [PATCH v2 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: , 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_cuda.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/libavfilter/vf_bwdif_cuda.c b/libavfilter/vf_bwdif_cuda.c index a5ecfbadb6..7d9bf861b7 100644 --- a/libavfilter/vf_bwdif_cuda.c +++ b/libavfilter/vf_bwdif_cuda.c @@ -296,13 +296,20 @@ 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"); + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(output_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 < 3 || w_chroma < 3 || h < 3 || h_chroma < 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; } - y->csp = av_pix_fmt_desc_get(output_frames->sw_format); + y->csp = desc; y->filter = filter; ret = CHECK_CU(cu->cuCtxPushCurrent(s->hwctx->cuda_ctx)); -- 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".