From patchwork Mon Nov 13 15:32:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Haas X-Patchwork-Id: 44651 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:92a5:b0:181:818d:5e7f with SMTP id q37csp1385777pzg; Mon, 13 Nov 2023 07:33:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IEIM9RFxu30SJMZiU7baiGuXCv9PBlO/xcw5JgpsFu9LhVYFP9mvtkrgWbflpEOLdRupYhO X-Received: by 2002:a17:907:36c7:b0:9c6:287d:c59d with SMTP id bj7-20020a17090736c700b009c6287dc59dmr6386832ejc.28.1699889590524; Mon, 13 Nov 2023 07:33:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699889590; cv=none; d=google.com; s=arc-20160816; b=evxfqb1dLQbhIWxT9lKL+Sn1T6lH1qkPRNfvgeF8q7JtPVXzfIZKSsHxQjTCK63RmO YFhSy+2Bh3Qxsx5gg7NbBk40aeVJk6AHDrqGEwPxcQSlQCie9tZ3o7KtihokfQuHsrG5 u0wgfQ+/uNZF5Iw0xEPTtRLa60/gnKWDyytO0zbVDrc4n9FmTT0Ofq45kpfovvRZfAOQ hwEsbBH7JeuqPeEVgg/J/K3ONcQR8ilecsAYbI9PSP1UXK+SqZl+igjZqFtP7y0TtC0Y vqdiBVwmrFQGbmMlV2VB/D16uFAUyrPHucre6ENHZVjUkbRbP09rdANIKTBLup0weDhH 13vA== 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 :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=J3duze9IO/uNZxBuY7FpaA0gTUhI4khq6XU9Gt3Zvpw=; fh=xmAeKtysnShNOmkhiJmYkS30uw4Fu2hvBJ7qlIwukxQ=; b=oGo2wT1zgzlUQHCu3EJZU0JmKZN2qhyqPPhuHAzln4BlQF8mz1CmZJJfk9KCtwdUjf cG7afJpUCfomsmE7VcjEVRRNjajmOZCSbZhIWsv12D6YFeHO85QAVEe71reh1uXpnlgd lvo+4UsEpFtPzsybIbBdQFpe/VMEnup5eiLLuUvXnuyHtg1qnlimht7hiz+NBStxCnLE cmFkGmUwdBRfYAHV2/5E3yCyTDaPenEmULAjshV87j/8up6sHPxCaIyfEsLvlmgJ9G76 RGn3WcKuW5ajOOk9th0kdagWwzFukWk1hmGM0b4il2Tm5mYI/UZ/TKoXTplmz9h8UFi1 xQtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=DCphhWs3; 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 t27-20020a170906179b00b009d590659096si2888923eje.648.2023.11.13.07.33.10; Mon, 13 Nov 2023 07:33:10 -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; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=DCphhWs3; 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 D529E68CD05; Mon, 13 Nov 2023 17:32:48 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B983068CCEA for ; Mon, 13 Nov 2023 17:32:39 +0200 (EET) Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 01A2349B46; Mon, 13 Nov 2023 16:32:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1699889559; bh=Hmwl2kUulVnvDWz0U0sQuL2mLaCWxkVZEg6EGLzOT9g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DCphhWs3TGa5EssDRVYd9K4e2TO3ggeUIELiaTj2kKHwhuOkKnuQURe4xzEU3VHPv Cv0F+lzBH06t0efhz7l4IYhMaiA/qWNJEgYH5Jw0bVKFqHCQckQ8NP59Mr8nVS4nr1 3VKj7IResU3UE1ywPKYucODWq4kuPYdwJBP7XgCc= From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Mon, 13 Nov 2023 16:32:33 +0100 Message-ID: <20231113153234.8812-2-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231113153234.8812-1-ffmpeg@haasn.xyz> References: <20231113153234.8812-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/3] swscale/utils: correctly return from sws_init_single_context 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: Niklas Haas Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: t0b7zFsmImyv From: Niklas Haas Before cedf589, this function would return early return on RGB and float formats, as well as when range was equal. While this commit intentionally removed the early return for same-range YUV conversions, it missed that RGB and float formats that have an unscaled converter should always early return, no matter what the source range was set to. Fixes: cedf589c09c567b72bf4c1a58db53d94622567e1 --- libswscale/utils.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libswscale/utils.c b/libswscale/utils.c index ec822ff5d9..7ce86f83ea 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -1733,6 +1733,9 @@ static av_cold int sws_init_single_context(SwsContext *c, SwsFilter *srcFilter, av_log(c, AV_LOG_INFO, "unscaled %s -> %s special converter is available\n", av_get_pix_fmt_name(srcFormat), av_get_pix_fmt_name(dstFormat)); + + if (isAnyRGB(dstFormat) || isFloat(srcFormat) || isFloat(dstFormat)) + return 0; } }