From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 40E714263C for ; Wed, 5 Jan 2022 15:15:18 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5154D68A785; Wed, 5 Jan 2022 17:15:16 +0200 (EET) Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 54D63687FCE for ; Wed, 5 Jan 2022 17:15:09 +0200 (EET) Received: by mail-ed1-f47.google.com with SMTP id j21so163206733edt.9 for ; Wed, 05 Jan 2022 07:15:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Uv+yajco3nTBQh8rca/LDtny8XGQp/3xgsJNASHET9s=; b=lovSna8IYeCQpvLOCfwdVH0SUKPI8vP6ip+VGQJXeKjJD5ekIQObpOd77wC4oG7AG+ nc5/6LY/urugoUMB4fGWzAz4xwovslR5Qlm+qPQKde6yegXdeKT3ebjTrQE0qK7hEpru DaTTvdwaYCt57IcPcwBnDdhA7r25AB6ATVuhe70orQoAcnL02NPnACy3H8y9daYNt23n hLxY8rQpydin7RL259P+pxeqLeFiVz8Au88+et0mJHEMZd2DDjA64ON0D3baMYAr9pee GxfXi+y/AiqqxGbZSpyCrZQkNAtQNjCclvliu7DXGRpQpe7kijd5TPyMS9tcETfzMusg Y3Qw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=Uv+yajco3nTBQh8rca/LDtny8XGQp/3xgsJNASHET9s=; b=ndX9rVwqeGJHffARzl5u75UqH4xB5OIr0XiKQFmp2BqhDPhInLI0ikpchA52bGrUaQ c4pTsJ272qf5E71Jr+69Iy6DhAYMNNMn1EBZPY58z6ffbKrRB12gkQi8usDShFhrVwdV UKI6EmHYEgiQ4Q+XDUK/Ih5jDUSZi9gZ0FZWREhVRjWQiki5PR40zHC8dA2W2XIhHg2i mV5/3moonkYkJNEckygzFsN2kWmBNy3LHcR37u92jT3MagSarw/I4cbLzkwUfAJ6Yiym SDucj5g7rdJCDRqD6atNCB7EpnUoSVoPSjtp8mAFOsJwLL2Gjh9z60bV/h2t4cfKXLi8 oJFw== X-Gm-Message-State: AOAM5328u6fKpwz4E6c2hGNhzeof4h0I6jgrN/STOyj4E0Tw1vLWiPZy +YdfQbdr+5EtJ0+fTaHng+Oay4COa7m67aV+ X-Google-Smtp-Source: ABdhPJz6PPhY9DiROwKKBAk3NEPKFmLgMy/l1jOm23bgt9SGimc8dVt8MM7zXeVQ+ef2ZL63ytlseA== X-Received: by 2002:a17:906:3bd7:: with SMTP id v23mr45803045ejf.395.1641395708701; Wed, 05 Jan 2022 07:15:08 -0800 (PST) Received: from vimacbookpro.vimeows.com ([2001:b07:a11:213c:a483:2d11:35e9:a6d6]) by smtp.gmail.com with ESMTPSA id s26sm12281390eja.152.2022.01.05.07.15.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jan 2022 07:15:08 -0800 (PST) From: Vittorio Giovara To: ffmpeg-devel@ffmpeg.org Date: Wed, 5 Jan 2022 16:15:06 +0100 Message-Id: <20220105151506.74794-1-vittorio.giovara@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220105135941.85715-1-vittorio.giovara@gmail.com> References: <20220105135941.85715-1-vittorio.giovara@gmail.com> 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: 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 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libavfilter/vf_tonemap.c b/libavfilter/vf_tonemap.c index 363df8034b..644c9fd9e3 100644 --- a/libavfilter/vf_tonemap.c +++ b/libavfilter/vf_tonemap.c @@ -120,17 +120,17 @@ 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 */ *r_out = *r_in; - *b_out = *b_in; *g_out = *g_in; + *b_out = *b_in; /* desaturate to prevent unnatural colors */ if (s->desat > 0) { -- 2.34.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".