From patchwork Wed Jan 5 13:59:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vittorio Giovara X-Patchwork-Id: 33086 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp748633iog; Wed, 5 Jan 2022 05:59:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJyLT7TMvWZ/kWdjYuRKn/1k18g3YRNItsPKFAa/eLowKNK71PWng5sLX+pJcarBT8o5e0nb X-Received: by 2002:a05:6402:268a:: with SMTP id w10mr52466746edd.257.1641391197645; Wed, 05 Jan 2022 05:59:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641391197; cv=none; d=google.com; s=arc-20160816; b=uewgAvy5TFSAu3ylXW7aZUyw2FgMTmJn7RtraOsDJRr1VbNIw1V/Uir3gwMgcFpApe Vx60z4+JH6t5sJJ37PXUqNwr6LCM9a7dVXiHxQqoMq8LbcGvtxAMErKHKC4xUk7dfL2b 3ZntK299oU7CZtvUJ2n1vR3UY8GVU5RUB0GMgxmfQHj/1t9X/Dx80swMSSnC6x+GqFsq L8TZuPazV+y1Xx9zDuStWE6sO4dfLWJU/QPpJZJzRyrEc17QA8gV6QoCV87/HJlMPfdN wCpBB+0DJxM/inp9LyP7+HCcaIPF2mO56W9fXJaamlLlaCMtQrAns5InYWVSZNwZFvBJ w+Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding: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=Hsrb9ALG70VSwDd7pXx9spoc8RSEHEMBKChMi20mlWQ=; b=MMndDY0c8TLJ84jdg9Pxodf8NedaSNyaQcocxykfGTJ2ugQYoplHz7v7HSvSx1jNRd gQpKLwv0Rm/GWBcv7KSMl9W35DrzCbQtr/idhnHzLqjUR60IqYCEQuk2yKsdzVlyy8Nx ruitO4XNvjcWeKXgFgopmBm88QK4VlD6Uu6qF9/4ZEYZH9HaYP6/cn2caFR3q2FBQLJU LHrz97VDu+OhzzXwmBTpOKsng6/S2qDi0hB0hHODShD8gn+hjsOoYO6FzPoBxM8wkzUg 9b3fy4WHMG04m5RElwpmjJhjiEqZRAmR9+YgFOTICsJw0GeyYXLxXRc77BqXXh0acM8N TnPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=X7clM5tb; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id hb19si20333004ejc.411.2022.01.05.05.59.57; Wed, 05 Jan 2022 05:59:57 -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=@gmail.com header.s=20210112 header.b=X7clM5tb; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 137EF68AD8B; Wed, 5 Jan 2022 15:59:55 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 729CF6806A3 for ; Wed, 5 Jan 2022 15:59:48 +0200 (EET) Received: by mail-ed1-f45.google.com with SMTP id z9so92449860edm.10 for ; Wed, 05 Jan 2022 05:59:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=AE+wTsvAksmTm+dIjNLATO7PYtJ30BxZq7XTr45R2bU=; b=X7clM5tbS3SJ3VkPIQsVwOSRqmEjMgHa9Mn9yz2UZDF+X/MqImBymMWoHOfXgu0zzf nesG+0d+CD0BJYcwzPxAndxasiNCAMeW4raXHVdgELg3+Fbsgct0ky4CkOBWDdks4n0J zy3fYdcUbik2C259dTK7cRQxAZKoL5u/C15+gt/c65C+x0AvY0kpQ2EoivIqE0nEd5IM Qhwp7bOnqVmGYBqz/d2h+HDCk9gkeck41Rop5Bwl0CVk8WPnkUldxX+TmpFoJhub9mj5 clxorSx+LYQoRJd0XHj/xq7qR8JaRtVLtnXZeQecoFY7wxtNSlHmwuQLVFigwK/Oo4TY t4Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=AE+wTsvAksmTm+dIjNLATO7PYtJ30BxZq7XTr45R2bU=; b=apFRyh8SnT7K10KW4kMU53FsoUnK2soWDXiLZCveET1dGXoFJ/RAqVlyAUGehc/pOl s+emBwJjixgbbbpA7sDo0N4ibaF6Kxt53vVKpimOzkyFZJK6su3o0k8TTv6nsGaz8dbP tdJmxGA4zEmJadkvJa3Izog1Nz8wuN4kMQgaUzhyJ5kSxLj1JbWgAAqbvGYq9O5MlhKo hfRo0zUDzH3Vkv4OHGDqY64l3ue8BD8KTThR/gMxDTcHG7+Pr2drnUwIB2hw986xJTc7 kBsaNTGY/wTPN4RR12m7YEUunN3n7yg36yjBc+7hOYBIvwjOx8W9kgQcKuL9X63VQ097 1O5Q== X-Gm-Message-State: AOAM532BoSa1GRA0Xj7YWtCnIY9B6glwWvBhmD9q9OCm4U395Upo7dH2 GkjCjQnhmX2GYdN9/r09AoDZ928wYdGjHMbH X-Received: by 2002:a17:907:2bc4:: with SMTP id gv4mr44019283ejc.646.1641391187797; Wed, 05 Jan 2022 05:59:47 -0800 (PST) Received: from vimacbookpro.vimeows.com ([2001:b07:a11:213c:a483:2d11:35e9:a6d6]) by smtp.gmail.com with ESMTPSA id 18sm3470585ejw.187.2022.01.05.05.59.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jan 2022 05:59:47 -0800 (PST) From: Vittorio Giovara To: ffmpeg-devel@ffmpeg.org Date: Wed, 5 Jan 2022 14:59:41 +0100 Message-Id: <20220105135941.85715-1-vittorio.giovara@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] vf_tonemap: Fix order of planes 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 9n6dvPvqa1hI This resulted in a dimmed tonemapping due to bad resulting luma calculation. Found by: Derek Buitenhuis Signed-off-by: Vittorio Giovara --- libavfilter/vf_tonemap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavfilter/vf_tonemap.c b/libavfilter/vf_tonemap.c index 363df8034b..c4ecf8a675 100644 --- a/libavfilter/vf_tonemap.c +++ b/libavfilter/vf_tonemap.c @@ -120,11 +120,11 @@ static void tonemap(TonemapContext *s, AVFrame *out, const AVFrame *in, const AVPixFmtDescriptor *desc, int x, int y, double peak) { const float *r_in = (const float *)(in->data[0] + x * desc->comp[0].step + y * in->linesize[0]); - const float *b_in = (const float *)(in->data[1] + x * desc->comp[1].step + y * in->linesize[1]); - const float *g_in = (const float *)(in->data[2] + x * desc->comp[2].step + y * in->linesize[2]); + const float *g_in = (const float *)(in->data[1] + x * desc->comp[1].step + y * in->linesize[1]); + const float *b_in = (const float *)(in->data[2] + x * desc->comp[2].step + y * in->linesize[2]); float *r_out = (float *)(out->data[0] + x * desc->comp[0].step + y * out->linesize[0]); - float *b_out = (float *)(out->data[1] + x * desc->comp[1].step + y * out->linesize[1]); - float *g_out = (float *)(out->data[2] + x * desc->comp[2].step + y * out->linesize[2]); + float *g_out = (float *)(out->data[1] + x * desc->comp[1].step + y * out->linesize[1]); + float *b_out = (float *)(out->data[2] + x * desc->comp[2].step + y * out->linesize[2]); float sig, sig_orig; /* load values */