From patchwork Mon Jan 26 10:42:50 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rick ten Wolde X-Patchwork-Id: 25960 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 8E25CC3200 for ; Mon, 26 Jan 2026 10:48:13 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2B85B61FD7; Mon, 26 Jan 2026 11:48:10 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Nya3gXE0"; dkim-atps=neutral Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7E24C61FC4 for ; Mon, 26 Jan 2026 11:43:04 +0100 (CET) Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-b8842e5a2a1so564059666b.2 for ; Mon, 26 Jan 2026 02:43:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769424184; x=1770028984; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wWSSzFiNiBf6L+Vthr8dkX7/VQuxHw04abSGipA7PkA=; b=Nya3gXE0EhFhxquIa9y/4qMAAE5sV3Zfgt1D4wv8MV5iIUcfYdsx767BCGjyWfk+lF 9Lfvrx+Wu3H+OxvAt7R8EBAtMGxe/t0b0bj7V5GYj6mKlJxo7ywRrpck2GL4EwX8xM/K GEVFYfTBGKkRn+vgaXdg2gT1S3DXFLXsQiZxjLLHBOpFh5aIUxThogpMe90HHJQiYg8g H38kWRJeZgGyjAvEt2T1KFyAgYJoWqVk04hevKxKZIs9OdWStNsrAhHTWL6W11/4EeO+ 6iPOTh/8lphCsQbdoYey6z8SWrhUrY3bllAeObOxhmy5D9gte/L/mB/OeKf8qMcG4hE3 OGOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769424184; x=1770028984; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=wWSSzFiNiBf6L+Vthr8dkX7/VQuxHw04abSGipA7PkA=; b=NHKC2xXh9MnZgjWG9O4FIqD8gRdiXGEPoZbuoSGYSaQfRKNlTdsmPusKfVeidfFLyU aI7WFkkt9kT1PT9lJNYir3isyYc19Wr7x1A3stPubQRsWrlJ1u4dPseQ/DoPiUFXaEe7 O9jGUMMdQOD8U98kqdinLYBkkEtVtErOo5qGrgZpXGu/uP0lmZUm+TpiZgPv/6/cMxZx 1AvETqNvU1XjyFOHsujKIEShcnefhNW/xX2Y9/d2Z2mAFoFXAwSOCeWKFe5i4t6TSJ+x fmZIT4nCz24ue7F5Y5wLrmicSf6mNlC4w+JNb3JIehlBOOlcAwsMw8LKN8/s1wZTvP0D sJBw== X-Gm-Message-State: AOJu0Yy2TOZtOpNJXCUJnUzuhb9DQs7I1whOxGALKmfanCXtIuHN7Bcr 64ccF+detilPbxismwsM1JMxL02qb6FYWdHmxxMhNa6JY6ej1qyK6uMaJ6ynvg== X-Gm-Gg: AZuq6aKfP3PPF1+dKod+zSWJLuoYxggbNutCRu/uRExVZStojvz/4cz7wDLrdIh7DXA mb+iUsX7MYnWj9MqRDI5dToF2xH7K7yQVuL1nrS+zuLpr/wwAUrwMQM3zuNN4k0gcdqj+biPjJi LtZBe04wiYoIpV31rKV+mk0tQMnkUmnrrQEsY3ljEFioapje02SAbo53SBYZalg1zWozoqJHAFx 8s7wb+cmUIwUUKXsYWxbt4cg12EsjO+Tc6lpEexztvcYnyTp1Ruq910A9+wDVJ5v9ePSgEX8iFF 3itMvYer0sKUbHitrguPmhk/5AQgu+QKAZiK7qfGaD6uYsUMG4pdx7Sr9c9ABZmJqlLt7hDGPAX MOyi+OSOTeyhcQIuD0lcHOjxc+l40kYHObt2+oVQkIaTHKP2eKxeeF7V/BpgStCdPh8nVf57f+S GV6KJvEmBrkg+H9IyirwUD0UntABT7syqQD2akdt9diZrnKNFrK/JREh8YTM0uHws= X-Received: by 2002:a17:907:709:b0:b87:73c9:3217 with SMTP id a640c23a62f3a-b8d4f75f70bmr232575966b.49.1769424183493; Mon, 26 Jan 2026 02:43:03 -0800 (PST) Received: from castortop.wolde.loc (195-240-110-192.fixed.kpn.net. [195.240.110.192]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b885b7661f7sm599220366b.54.2026.01.26.02.43.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jan 2026 02:43:03 -0800 (PST) From: Rick ten Wolde To: libcamera-devel@lists.libcamera.org Cc: xander.c.pronk@gmail.com, derekgielen@outlook.com, 22012540@student.hhs.nl, rick.w.ten.wolde@gmail.com, johannes.goede@oss.qualcomm.com, Rick ten Wolde Subject: [PATCH 2/7] libcamera: software_isp: Add LSC data to DebayerParams Date: Mon, 26 Jan 2026 11:42:50 +0100 Message-ID: <20260126104256.119697-3-rick.w.ten.wolde@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260126104256.119697-1-rick.w.ten.wolde@gmail.com> References: <20260126104256.119697-1-rick.w.ten.wolde@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 26 Jan 2026 11:48:05 +0100 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" From: Xander Pronk Add separate red, green and blue LSC tables to struct DebayerParams. Co-authored-by: Rick ten Wolde Signed-off-by: Rick ten Wolde Signed-off-by: Xander Pronk --- .../internal/software_isp/debayer_params.h | 6 ++++++ src/libcamera/software_isp/debayer.cpp | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/include/libcamera/internal/software_isp/debayer_params.h b/include/libcamera/internal/software_isp/debayer_params.h index 256c7d43..4252cd2d 100644 --- a/include/libcamera/internal/software_isp/debayer_params.h +++ b/include/libcamera/internal/software_isp/debayer_params.h @@ -30,6 +30,8 @@ struct DebayerParams { using LookupTable = std::array; using CcmLookupTable = std::array; + using LscLookupTable = uint8_t[16*16]; + /* * Color lookup tables when CCM is not used. * @@ -53,6 +55,10 @@ struct DebayerParams { CcmLookupTable blueCcm; LookupTable gammaLut; + LscLookupTable LSC_red; + LscLookupTable LSC_green; + LscLookupTable LSC_blue; + /* * Per frame corrections as calculated by the IPA */ diff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp index 65a1762d..7a8b3462 100644 --- a/src/libcamera/software_isp/debayer.cpp +++ b/src/libcamera/software_isp/debayer.cpp @@ -65,6 +65,11 @@ namespace libcamera { * \brief Type of the CCM lookup tables for red, green, blue values */ +/** + * \typedef DebayerParams::LscLookupTable + * \brief Type of the LSC lookup tables + */ + /** * \var DebayerParams::red * \brief Lookup table for red color, mapping input values to output values @@ -120,6 +125,19 @@ namespace libcamera { * \brief Contrast value for GPUISP */ +/** + * \var DebayerParams::LSC_red + * \brief Per frame Lens shading correction red channel + */ +/** + * \var DebayerParams::LSC_green + * \brief Per frame Lens shading correction red channel + */ +/** + * \var DebayerParams::LSC_blue + * \brief Per frame Lens shading correction red channel + */ + /** * \class Debayer * \brief Base debayering class