From patchwork Tue Oct 14 14:24:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 24640 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id E7FBBBE080 for ; Tue, 14 Oct 2025 14:24:34 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 19684605F8; Tue, 14 Oct 2025 16:24:34 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="tdP8Fv5r"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 12358605DF for ; Tue, 14 Oct 2025 16:24:32 +0200 (CEST) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:61fb:8e55:ff1e:be62]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 9A664741; Tue, 14 Oct 2025 16:22:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1760451773; bh=J00LNuZDCG1mnww8Bb52KG2EfgICTeTylX+4r88SfdE=; h=From:To:Cc:Subject:Date:From; b=tdP8Fv5rjEssSrVHpGjBqwQhTPO6I53pkHolwKiKm/Eze2LqmgRs0xrzvrnqyiQK1 3omjNOtYJY7yepO/TsfisbKD67PUK+gx7NMWjmvczQOQMscECsSk6+scWVArxzHVdv D0greeeIy4HlFE11X5qr582jAzAJkuejvh0JVi8o= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug Subject: [PATCH v1 0/4] libipa: agc: Fix constraints yTarget handling and add PWL support Date: Tue, 14 Oct 2025 16:24:15 +0200 Message-ID: <20251014142427.3107490-1-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.48.1 MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hi all, This series introduces support for specifying the relativeLuminanceTarget based on the current lux level by using a PWL for the mapping. The typical use case is to ensure that images in a bright environment are regulated a tad brighter than images taken in a dark environment. This is a very subjective setting and should thereofre left for the customer. Mainlining this feature was already tried here [1] but got rejected at that time because there was no direct user of it. Meanwhile the lux algorithm got upstreamed and we have customers that actually miss that feature. So I start another try of upstreaming it (Patches 1-2). During implementation it turned out that the yTarget of AGC constraints never worked at all. So patches 3-4 fix that and also add PWL support for the constraints which is sensible to do if we support it for the relativeLuminanceTarget. Best regards, Stefan Stefan Klug (4): ipa: libipa: pwl: Add swap() function ipa: libipa: agc_mean_luminance: Change luminance target to piecewise linear function ipa: libipa: pwl: Add construction from initializer_list ipa: libipa: agc_mean_luminance: Fix yTarget handling in constraints src/ipa/libipa/agc_mean_luminance.cpp | 113 ++++++++++++++++++++++---- src/ipa/libipa/agc_mean_luminance.h | 16 ++-- src/ipa/libipa/pwl.cpp | 25 ++++++ src/ipa/libipa/pwl.h | 2 + src/ipa/rkisp1/algorithms/agc.cpp | 1 + src/ipa/rkisp1/algorithms/wdr.cpp | 3 +- 6 files changed, 136 insertions(+), 24 deletions(-)