From patchwork Tue Jan 20 12:26:05 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 25872 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 B600EBDCBF for ; Tue, 20 Jan 2026 12:26:13 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 695CB61FC5; Tue, 20 Jan 2026 13:26:13 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="WuuJ4lRt"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1F7CD61A35 for ; Tue, 20 Jan 2026 13:26:11 +0100 (CET) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:b09a:fcc3:e9a4:a9a8]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id A451A177D; Tue, 20 Jan 2026 13:25:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1768911939; bh=pRZh3bBXHXsOAobMAMUObad6Y1pIvvIZRMKnc0U1qTo=; h=From:Subject:Date:To:Cc:From; b=WuuJ4lRttmjPEGrjtvJGOA4RV9k6AWNMJWEinptXKvr5lm5qfT0GY4rdsSY3WZjpv xX3xsdUbe/zyd4Qt7JVEINaOjUXntSCbe3qjCbYAMUMMVV9ZFDxQADgBlG1rgUGw8Y s7FdqL9p+BBWrbi8KOpsBv+poiI+ngqg0X/DiFvE= From: Stefan Klug Subject: [PATCH v5 00/15] Add resampling support for polynomial LSC data Date: Tue, 20 Jan 2026 13:26:05 +0100 Message-Id: <20260120-sklug-lsc-resampling-v2-dev-v5-0-ef5cec7b299f@ideasonboard.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAF10b2kC/33OwQ6CMAyA4VcxOzuzjTHAk+9hPMBaYBEY2XTRE N7dQWLCQTk1fw9fOxGPzqAn58NEHAbjjR1ipMcD0W05NEgNxCaCCcU4y6i/d8+Gdl5Th77sx84 MDQ2CAgYKWZZKVvFMAZIojA5r81r16y12a/zDuvd6LIhl+3XzXTcORlHlArWsirxILgaw9Haob OngpG1PFj4kG5LLfTKJZM40CFlLAMX/kHJDCrZPykgKyXl8EhUo+EHO8/wB6zzI9nMBAAA= X-Change-ID: 20260107-sklug-lsc-resampling-v2-dev-d77540b176de To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug , =?utf-8?q?Barnab=C3=A1s_P?= =?utf-8?b?xZFjemU=?= , Rui Wang , Laurent Pinchart , Kieran Bingham , Jacopo Mondi X-Mailer: b4 0.14.2 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" In [1] support for polynomial lens shading tables was implement up to the same feature level of grid based lens shading tables. However resampling the LSC table for a given analog crop rectangle was never implemented. This series partially fixes that by implementing resampling for polynomial LSC data. Resampling for tabular LSC data is left open for implementation if need arises. Patches 1-7 apply some code cleanup that got mentioned on the last series after it was merged. Patches 8-10 apply further cleanup and are new in v2 of the series. Patches 11-13 implement the actual resampling. Patches 14-15 implement a LensShadingCorrectionEnable control that is necessary to assess the effect of LSC in practice. Patch 14 resurrects an old patch from Jacopo [2]. These last two patches could be stripped off the series if needed. Best regards, Stefan [1] https://patchwork.libcamera.org/project/libcamera/list/?series=4609&archive=both&state=* [2] https://patchwork.libcamera.org/project/libcamera/list/?series=3795&archive=both&state=* Signed-off-by: Stefan Klug --- Changes in v5: - Split patch 14 into two again to have a separate patch for the control id changes. - Link to v4: https://patchwork.libcamera.org/project/libcamera/list/?series=5720 Changes in v4: - Dropped removal of controls::draft::LensShadingMapMode and squashed patches 14 and 15 - Minor fixes from review (see local changelogs) - Link to v3: https://patchwork.libcamera.org/project/libcamera/list/?series=5707 Changes in v3: - Added LensShadingCorrectionEnable to metadata - Improved colour temperature quantization code - Tiny fixes (see local changelogs) - Link to v2: https://patchwork.libcamera.org/project/libcamera/list/?series=5697 Changes in v2: - Collected tags - Applied small fixes from review - Additional cleanup by patches 8-10 to improve the prepare() function - A bit more rework on the resampling patches due to preceding changes --- Stefan Klug (15): ipa: rkisp1: lsc: Drop unused member variable ipa: rkisp1: lsc: Drop unused function declaration ipa: rkisp1: lsc: Replace assert with ASSERT ipa: rkisp1: lsc: Rename res to positions ipa: rkisp1: lsc: Rename res to ret ipa: rkisp1: lsc: Rename res to samples ipa: rksip1: lsc: Move function definitions out of class ipa: rkisp1: lsc: Move local types into anonymous namespace ipa: rkisp1: lsc: Handle quantization locally ipa: libipa: interpolator: Drop key quantization ipa: rkisp1: lsc: Pass sampling positions into samplePolynomial ipa: rkisp1: lsc: Pass crop rectangle as parameter ipa: rkisp1: lsc: Resample polynomial lens shading tables at configure time libcamera: control_ids: Introduce LensShadingCorrectionEnable ipa: rkisp1: Implement LensShadingCorrectionEnable control src/ipa/libipa/interpolator.cpp | 25 +- src/ipa/libipa/interpolator.h | 14 +- src/ipa/rkisp1/algorithms/dpf.cpp | 2 +- src/ipa/rkisp1/algorithms/lsc.cpp | 505 +++++++++++++++++++++++------------- src/ipa/rkisp1/algorithms/lsc.h | 24 +- src/ipa/rkisp1/ipa_context.h | 13 +- src/libcamera/control_ids_core.yaml | 9 + test/ipa/libipa/interpolator.cpp | 7 - 8 files changed, 360 insertions(+), 239 deletions(-) --- base-commit: c63f2c72cd7b278584dcc70b8294063e89b01ca1 change-id: 20260107-sklug-lsc-resampling-v2-dev-d77540b176de Best regards,