From patchwork Sat Dec 2 20:17:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cosmin Stejerean X-Patchwork-Id: 44870 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:a301:b0:181:818d:5e7f with SMTP id x1csp1915746pzk; Sat, 2 Dec 2023 12:17:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IEKcGfxFZ3F9BUls0RbY4wMLaVjOY0cQv6v2fDgCIsN6jDzimLodIMn3CDRm14SD0ktKUmW X-Received: by 2002:a2e:8747:0:b0:2c9:f643:d6c8 with SMTP id q7-20020a2e8747000000b002c9f643d6c8mr333852ljj.95.1701548259795; Sat, 02 Dec 2023 12:17:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701548259; cv=none; d=google.com; s=arc-20160816; b=gutxaNbJdzDkrG9gHjBEHo1luBGfdwflv0EKw5XzpLVzaDHMxHsSkwbc2CmzO44nTG MI2jRX80hVOC1xP0qdmrnzwi4gOM/KpxBYarSjwJ+DanjOL4xYGqQ7wU8vsio7UHmi1U uvVpaoBLr6ZCWKrvtA+GLYCVyJM0i6lHujb2A0pvXwrpbLCX69WcD0wiQ4HMlWJUN15H erpclMPClYFHZw0rakdgYp5xoqqhodq3fe5d/HGfNofdFYdFiK5Ynr1erSwEoWlBjxNo fA6AgK0or9HkWH9zLYmjGSFg2Xltunxr2csXwyD/xZ+XbkUuqGg/5CPoJguh2u62N1EY +ZQw== 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=C3xxdNShD5SGDNTegI3nCiEgsqAWpV2utHkwWp/NhLM=; fh=CBS/D0cB4KwqFBY8d8UQ4TY1w6HZ9TulitLE+VqI2+k=; b=H3c8wSVB2BdsWAqkt4LegIRxwSTwAX/SGU+cHumK8YvV9cpH0yPqCd98pZtDqG+ZfO jcCAq8JwfxDcM0SZKV2/MyOGXzfJvbjwooQ+SZkF8oqSmbRZg7q9hC9RTFXYJL7M0caJ jC4LEmjEtFybe+mbqXk9c+DM2YZjd1uYML51XI3BXW4cvy2R84vcY7kzYIdDXNv38bSD O9RO6WRc4Bo6G+IFctr7HZf3NIEmSnPPcpcmL+Blpj/sNXp/wdoqFXV0L+y9jlzzUcZT MjH9R28GS/X68a5FG6pqUg7mI6JrBGLACmMtqi9P9f17Ws67L8Qw9XkM8icvvGUEDEE2 leYw== 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 hp11-20020a1709073e0b00b00a18f0495553si2860689ejc.248.2023.12.02.12.17.39; Sat, 02 Dec 2023 12:17:39 -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 C8E9768CCB4; Sat, 2 Dec 2023 22:17:25 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org 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 A60C168CAA4 for ; Sat, 2 Dec 2023 22:17:18 +0200 (EET) To: =?utf-8?q?ffmpeg-devel=40ffmpeg=2Eorg?= Date: Sat, 2 Dec 2023 20:17:15 +0000 Mime-Version: 1.0 In-Reply-To: <20231202201655.40450-1-cosmin@cosmin.at> References: <20231202201655.40450-1-cosmin@cosmin.at> <20231202201655.40450-2-cosmin@cosmin.at> X-Mailer: Amazon WorkMail Thread-Index: AQHaJVx/pw0LJ5SZTAe6kqN6vnwK6wAAAEGX Thread-Topic: [PATCH v3 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: 1701548235 Message-ID: <0101018c2c2d9cdb-e6505ea7-5210-438b-8801-dd75d12b59ce-000000@us-west-2.amazonses.com> Feedback-ID: 1.us-west-2.An468LAV0jCjQDrDLvlZjeAthld7qrhZr+vow8irkvU=:AmazonSES X-SES-Outgoing: 2023.12.02-54.240.27.237 Subject: [FFmpeg-devel] [PATCH v3 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: , 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: t0TgCx0ccDnU From: Cosmin Stejerean Fixes #10688 Signed-off-by: Cosmin Stejerean --- libavfilter/vf_bwdif.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libavfilter/vf_bwdif.c b/libavfilter/vf_bwdif.c index 137cd5ef13..353cd0b61a 100644 --- a/libavfilter/vf_bwdif.c +++ b/libavfilter/vf_bwdif.c @@ -191,13 +191,14 @@ 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"); + yadif->csp = av_pix_fmt_desc_get(link->format); + yadif->filter = filter; + + if (AV_CEIL_RSHIFT(link->w, yadif->csp->log2_chroma_w) < 3 || AV_CEIL_RSHIFT(link->h, yadif->csp->log2_chroma_h) < 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->filter = filter; ff_bwdif_init_filter_line(&s->dsp, yadif->csp->comp[0].depth); return 0;