From patchwork Mon Nov 13 15:32:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Haas X-Patchwork-Id: 44650 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:92a5:b0:181:818d:5e7f with SMTP id q37csp1385669pzg; Mon, 13 Nov 2023 07:33:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IHbQXuyW2RaL7vlmDr7PncBX/7K1+nCMSpQxtsZRRvhLkHtrGE2QxL/D2rYQnkEXwH4/4p7 X-Received: by 2002:a05:6402:b0f:b0:53f:c889:8f89 with SMTP id bm15-20020a0564020b0f00b0053fc8898f89mr5430659edb.36.1699889581513; Mon, 13 Nov 2023 07:33:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699889581; cv=none; d=google.com; s=arc-20160816; b=XINBAUb3leYFvfdGHokgAB7EUeVG1sTsebxFIhUY9+JyNYRHSuyH1j4j4zMPflWU+r et5J4Z8PY4Ro1RBhdQQVjXV5g5O0C7vKIrMgmcRFbCLNALTHKTVTx+/kZnwgsUI8YaPW evpG5hbv2Rmo74Qo6foBUm4bSJ1S7gzZ9UGQT8TtyDP2PLrYjglwUxvPJaXtt/6bWLO0 reI4xipGO50njSTjbZLebAXf7qk2DRSUOqvoxSktDGBpdUekSVusDNZd3OvBRb6xj76d OIVi5r+DzP1x5Iwgio1itWDNBdMVlcQqruGnqvl2RETcTLuGKE/i5e7RqxqOmN8ImVnm hQMw== 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:message-id:date:to:from :dkim-signature:delivered-to; bh=bHst0hgvk41vUaHCYw3AG6pwxsynLl6DiXRZjEfvMUE=; fh=xmAeKtysnShNOmkhiJmYkS30uw4Fu2hvBJ7qlIwukxQ=; b=HBIqqWkEOFaTTGt+mhqc7D344WpS3N6jzxUlUG29O/p9KYKq6sSqN5Ye6DKY1998M7 hG+PHj39fxo7wrEBv9JosFJDqHSms9gv9FEQkl62ciVdEjAoWE1hntreVB32NUHVY6gD JV8X8amOMa+rt7Y7cERzlAl+Hsxsii/0WAxBgPRpDPQ5JE6Spf2rNYMOeLvT0r9e7XYO G6sbv/vmO3eWvFrb1rcocZwG1WP6lXIdf/QG1MBVVks71JABaD80t6IzAYolO8WEPG9+ 9rI5puMjb4ejwrAaoPrM9qTx9ppPoUj/ZctAkdkSehSVeny/SGsPEdYOPnndUFZFl4L3 4Fdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=lERmQ9pu; 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 l24-20020a50d6d8000000b00540f04600bcsi2781475edj.332.2023.11.13.07.33.01; Mon, 13 Nov 2023 07:33:01 -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=lERmQ9pu; 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 CD6AA68CCFD; Mon, 13 Nov 2023 17:32:47 +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 B6D2868CCE7 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 AFD0B499B1; 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=1699889558; bh=gggRH8bGOBhi8qNgUO+lKEDCnMIdOyZKzTxxfvTrrMc=; h=From:To:Cc:Subject:Date:From; b=lERmQ9puak/n0zNKXeWGrOWGE6zckG+8C++hE6f6BGbqDeGAMkabfvsm5HdR0sde5 8JASEyd2GB7SLyHY+bpA5mK/ME18daW8N6DLn2NLX/oPoY8f1MCKnpkpQ606XHlIIK DmQWmoRw7YSqOAbW6n38HkLU0C1eou7pENeJUHWU= From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Mon, 13 Nov 2023 16:32:32 +0100 Message-ID: <20231113153234.8812-1-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/3] swscale: don't assign range converters for float 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: qc4ATYuEW0GF From: Niklas Haas This logic was incongruent with logic used elsewhere, where floating point formats are explicitly exempted from range conversion. Fixes an issue where floating point formats were not going through special unscaled converters even when it was otherwise possible. --- libswscale/swscale.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 46ba68fe6a..a66db22767 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -534,7 +534,8 @@ av_cold void ff_sws_init_range_convert(SwsContext *c) { c->lumConvertRange = NULL; c->chrConvertRange = NULL; - if (c->srcRange != c->dstRange && !isAnyRGB(c->dstFormat)) { + if (c->srcRange != c->dstRange && !isAnyRGB(c->dstFormat) && + !isFloat(c->srcFormat) && !isFloat(c->dstFormat)) { if (c->dstBpc <= 14) { if (c->srcRange) { c->lumConvertRange = lumRangeFromJpeg_c;