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 4F7BD47233 for ; Thu, 30 Nov 2023 12:37:44 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2D95168D028; Thu, 30 Nov 2023 14:37:42 +0200 (EET) Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8EB2168C7BB for ; Thu, 30 Nov 2023 14:37:35 +0200 (EET) Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1cff3a03dfaso8056575ad.3 for ; Thu, 30 Nov 2023 04:37:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701347853; x=1701952653; darn=ffmpeg.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=W4AhAYTaYnTxlkWL55h9B49+V//dipJGzVGFOAEIVlY=; b=hNs2Suibl9XY7KqAbX62SCkN/B4GheU3C/EKJvHQPBcM49rRUbUId4UssnkNsAjNhz HJ93ph9lvroKJDTZjjnNr37j8y1BZ7PdKY2Su8KslAQJpE2GO73cq8P26RPyoQX7Rwx6 09k9T8+7nMEwz2EpeUyRKQGrfjaQ41upM2zwPiNENfkTK5Vrd9NnyML1fbtjnE51acSr dIhQOHNOfRCIFHwDDV72H9AZ8RAZ98uRxPTIFsft6cl5t5q3AZ8NkoU86vg7OMjlW0dF YI+4uUoSMa0BvS9HC1zHpFfxiOIzqt3OGT8nWDMG8g9kDXWMyeioOpGq+m77OAUkMBb/ B9NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701347853; x=1701952653; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=W4AhAYTaYnTxlkWL55h9B49+V//dipJGzVGFOAEIVlY=; b=hXpURDJJjYWyQEVJVpgXXyC1MEVEx/R2JfYq5YvItk+cV0qht7+TR5Zm7gi7HtdLaL IJGCaa5AN3OG2K+LwtBW96yKXGNc7JeLwtP3Za5mfhRxPJiof0SCC+8QYTl73ZlIIlu5 miOmSbCu5MMSawA9WgvbR78YddJy389GgtBzwsEZq1wZLYAhGSqp0I619nUIpNpBgQly TIEof/7Ysmw/x/xszZWD0M12MIho49Vy59TjO1UItD3pjhewvl/bIADb/XCRX4xk8C96 S5h+pKTzRU2IWz4pTK2h/N3toF4Y+glOyvY/V+St2Y8azZ1UPlQgBqcAEetYOhsbYVK+ j+lQ== X-Gm-Message-State: AOJu0YytpqQWCuB6Zof/0Vrgln4qxlIUFNqa56IArXwstYeTu1px89vK jEz+cAp9Md4d40KagxrkwZSAkq1iYGV/l9R6n2axxW23mhc28Q== X-Google-Smtp-Source: AGHT+IFYnh3gRkeuacw3l1aPAijtwM9kTWkZmSC98h40Son+YtQ2hOYJFBPVOk6LJWyYAiFdPWR/+64xLNrb2qEvwXM= X-Received: by 2002:a17:90b:4a50:b0:285:940a:b9b1 with SMTP id lb16-20020a17090b4a5000b00285940ab9b1mr22043881pjb.26.1701347853289; Thu, 30 Nov 2023 04:37:33 -0800 (PST) MIME-Version: 1.0 References: <20231130002316.73504-2-cosmin@cosmin.at> <20231130002316.73504-1-cosmin@cosmin.at> <0101018c1d9beab2-9b0cc1e6-c7e1-4e20-af1c-2b5bac4822f2-000000@us-west-2.amazonses.com> In-Reply-To: <0101018c1d9beab2-9b0cc1e6-c7e1-4e20-af1c-2b5bac4822f2-000000@us-west-2.amazonses.com> From: Thomas Mundt Date: Thu, 30 Nov 2023 13:37:28 +0100 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [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: , Reply-To: FFmpeg development discussions and patches Cc: 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: Am Do., 30. Nov. 2023 um 01:23 Uhr schrieb Cosmin Stejerean via ffmpeg-devel : > 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); > > I think mixed declarations are not allowed. Also log2_chroma_w/h should never be negative, so why not just do: if (AV_CEIL_RSHIFT(link->w, yadif->csp->log2_chroma_w) < 3 || AV_CEIL_RSHIFT(link->h, yadif->csp->log2_chroma_h) < 4) Regards, Thomas _______________________________________________ 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".