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 766AE47A1D for ; Thu, 30 Nov 2023 00:23:52 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 58AFB68D062; Thu, 30 Nov 2023 02:23:35 +0200 (EET) Received: from a27-237.smtp-out.us-west-2.amazonses.com (a27-237.smtp-out.us-west-2.amazonses.com [54.240.27.237]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0DC7168D05E for ; Thu, 30 Nov 2023 02:23:28 +0200 (EET) To: =?UTF-8?Q?ffmpeg-devel=40ffmpeg=2Eorg?= Date: Thu, 30 Nov 2023 00:23:26 +0000 Mime-Version: 1.0 In-Reply-To: <20231130002316.73504-1-cosmin@cosmin.at> References: <20231130002316.73504-1-cosmin@cosmin.at> <20231130002316.73504-2-cosmin@cosmin.at> X-Mailer: Amazon WorkMail Thread-Index: AQHaIyNrRPKJ9BURSnGRNaEm4d8hOwAAADrc Thread-Topic: [PATCH v2 1/3] avfilter/vf_bwdif: consider chroma subsampling when enforcing minimum dimensions X-Original-Mailer: git-send-email 2.42.1 X-Wm-Sent-Timestamp: 1701303805 Message-ID: <0101018c1d9beab2-9b0cc1e6-c7e1-4e20-af1c-2b5bac4822f2-000000@us-west-2.amazonses.com> Feedback-ID: 1.us-west-2.An468LAV0jCjQDrDLvlZjeAthld7qrhZr+vow8irkvU=:AmazonSES X-SES-Outgoing: 2023.11.30-54.240.27.237 Subject: [FFmpeg-devel] [PATCH v2 1/3] avfilter/vf_bwdif: 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 Fixes #10688 Signed-off-by: Cosmin Stejerean --- libavfilter/vf_bwdif.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/libavfilter/vf_bwdif.c b/libavfilter/vf_bwdif.c index 137cd5ef13..80aa85a48b 100644 --- a/libavfilter/vf_bwdif.c +++ b/libavfilter/vf_bwdif.c @@ -191,12 +191,19 @@ static int config_props(AVFilterLink *link) return ret; } - if (link->w < 3 || link->h < 4) { - av_log(ctx, AV_LOG_ERROR, "Video of less than 3 columns or 4 lines is not supported\n"); + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(link->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 < 4 || h_chroma < 4) { + av_log(ctx, AV_LOG_ERROR, "Video with planes less than 3 columns or 4 lines is not supported\n"); return AVERROR(EINVAL); } - yadif->csp = av_pix_fmt_desc_get(link->format); + yadif->csp = desc; yadif->filter = filter; ff_bwdif_init_filter_line(&s->dsp, yadif->csp->comp[0].depth); -- 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".