From patchwork Sat Oct 28 14:41:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Haas X-Patchwork-Id: 44407 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:dd83:b0:15d:8365:d4b8 with SMTP id kw3csp497966pzb; Sat, 28 Oct 2023 07:45:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFJXLTLN9+1zbGdm+MPmZal5migoJOF/4lmKQ8agEDfgSW+IIIgFYejP+5DDbSZwOn6fpC1 X-Received: by 2002:a17:907:3eaa:b0:9c1:9b3a:4cd1 with SMTP id hs42-20020a1709073eaa00b009c19b3a4cd1mr5224684ejc.3.1698504311725; Sat, 28 Oct 2023 07:45:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698504311; cv=none; d=google.com; s=arc-20160816; b=c7TU97cKIU4zK57ygM42TIb08TxyW2cabD4p8Wse3LPCjQjjnrqHq1SixC9bkUau/3 BmpeWFn2Vw9GIE952DrRuTnUXe1PN3tVuDPW7jaCmrM4bzidUw+e4xjd0tL0iJ4uENAT nh8bFI2XRCzczsFiwxNuWfirg1Gz6KDPUQetXxRrAe7awnwnQnZzOt7VxXWMDkqNBr/q nAIHsMnNXMHmSIZFy+mMZhVN4bxu5cMP3PnimxhEyvV5Kjicjj1G7uHLqTvoi4pQpOxX hLHMCxz518aj9Gvbyvowbr2cVsqjTQXOLhHF6rd0D9VYPxVWX95D6hEhNrRRR+UcIxYb rm4w== 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=X333W7vAsj+U7wbvm+EcnCWoLQsjI+gntBCB51i8Uws=; fh=xmAeKtysnShNOmkhiJmYkS30uw4Fu2hvBJ7qlIwukxQ=; b=TxBe1JBhizgk2zWoKv8Gfor5cx2kIm3DQHzi+bu/kyj9cNCLFNeEWkwL2UJah7aFqI n+ck4VPIhUrdAVDQIuly6ZDgpSvieGMvoQydrqwj9qiU7fuRzHTkak7OAJQAWDOZCv14 /juq+ctmj/djD0LVJ3k2TeBJ49xwQgBlUnJKnIDwgb1wg8X2ONeONx1xoyIqmW8QSSwv QXFKU4G8mBJ5GwwFVTjn105OstcuG33y2TuVzW9EHAtzefxphweMe8JQ/MQCrvSw1pZj PrBbyPeyMY9fse8zCKlIQ6FxClLfifKg0y4Zmhptfy9D2LRY76cbDCkwoh0ooyWKbviU ANtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=fK2UmXJj; 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 z26-20020a17090674da00b009be5c079196si1729653ejl.461.2023.10.28.07.45.11; Sat, 28 Oct 2023 07:45:11 -0700 (PDT) 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=fK2UmXJj; 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 9481168CBB3; Sat, 28 Oct 2023 17:44:44 +0300 (EEST) 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 DD31B68C96A for ; Sat, 28 Oct 2023 17:44:35 +0300 (EEST) Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id A12BE4B8AC; Sat, 28 Oct 2023 16:44:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1698504275; bh=uC4zSuPuu4RJxcCGYos+Sdc/5fAP8LQ8KM/YAShXyOE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fK2UmXJjuri9EQmyeSqqDb+2sPlWDJvMH2dMWZ+kp1ja/+F+ExaXyAK80ELtUH7Zd ZQ2DEvrQgsjei+XP1OKD+Z2Yal6nWl4FOztwGQVL7UYQsbvlHvN/TtTvGRXa6QGQVa /rLc0bMhsVul8CFdZ6JNRAHBaOm8cONf4rBelcgU= From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Sat, 28 Oct 2023 16:41:10 +0200 Message-ID: <20231028144430.60538-4-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231028144430.60538-1-ffmpeg@haasn.xyz> References: <20231028144430.60538-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 03/10] swscale/yuv2rgb: fix sws_getCoefficients for colorspace=0 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: e+FddqtdXd/i From: Niklas Haas The documentation states that invalid entries default to SWS_CS_DEFAULT. A value of 0 is not a valid SWS_CS_*, yet the code incorrectly hard-codes it to BT.709 coefficients instead of SWS_CS_DEFAULT. --- libswscale/yuv2rgb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c index 9c3f5e23c6..0a84b662f9 100644 --- a/libswscale/yuv2rgb.c +++ b/libswscale/yuv2rgb.c @@ -46,7 +46,7 @@ * where Y = cr * R + cg * G + cb * B and cr + cg + cb = 1. */ const int32_t ff_yuv2rgb_coeffs[11][4] = { - { 117489, 138438, 13975, 34925 }, /* no sequence_display_extension */ + { 104597, 132201, 25675, 53279 }, /* no sequence_display_extension */ { 117489, 138438, 13975, 34925 }, /* ITU-R Rec. 709 (1990) */ { 104597, 132201, 25675, 53279 }, /* unspecified */ { 104597, 132201, 25675, 53279 }, /* reserved */