From patchwork Wed Jul 8 09:25:20 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 27298 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 0CC0FC3301 for ; Wed, 8 Jul 2026 09:25:45 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B4BAE660C5; Wed, 8 Jul 2026 11:25:44 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="YGEEPmFd"; 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 21849660AD for ; Wed, 8 Jul 2026 11:25:15 +0200 (CEST) Received: from [192.168.1.182] (93-46-82-201.ip106.fastwebnet.it [93.46.82.201]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 7E6471D18; Wed, 8 Jul 2026 11:24:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1783502665; bh=pKxxZ9cajwGg/4XFTEBKJ35/7Bmlg5h/GcltukR9A5Y=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=YGEEPmFdGlxy0Ok/QbREk3oQ/9s/GuDvefSfzdKaAVjAD+9bGOwUYTiAvFyPLwdYx x0MK+QqGYzHylmL0QO4LnJeem1B2uJ/HzAPSl3VwQKKZcAHz0xd3t30y4zvvP6J9kr E6nakEk0lY+hvDCJB5Zissid0b+PyfCEyuj+zYqg= From: Jacopo Mondi Date: Wed, 08 Jul 2026 11:25:20 +0200 Subject: [PATCH v4 33/35] ipa: libipa: lsc: Specialize Interpolator for uint8_t MIME-Version: 1.0 Message-Id: <20260708-libipa-algorithms-v4-33-f0e99f035294@ideasonboard.com> References: <20260708-libipa-algorithms-v4-0-f0e99f035294@ideasonboard.com> In-Reply-To: <20260708-libipa-algorithms-v4-0-f0e99f035294@ideasonboard.com> To: libcamera-devel@lists.libcamera.org, Stefan Klug Cc: Jacopo Mondi X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1736; i=jacopo.mondi@ideasonboard.com; h=from:subject:message-id; bh=pKxxZ9cajwGg/4XFTEBKJ35/7Bmlg5h/GcltukR9A5Y=; b=owEBbQKS/ZANAwAKAXI0Bo8WoVY8AcsmYgBqThdwvs+Wosshqjm/oUrexR4ZOqhR05t/X9loF Fmhr3P57iiJAjMEAAEKAB0WIQS1xD1IgJogio9YOMByNAaPFqFWPAUCak4XcAAKCRByNAaPFqFW PNKED/9gm2zF7iPWE86wDPBPsSVZ2JlVfX2ObVp96xxFeNk8Y4+UdVwXleG/tjfmS9luHwxaPcY W3pPI+Ea42Nggyr/QYqyrDJszzrkReHsmt90E0M6RKrTmu/EHZXEJ8eCy+XsZ21GAXt/E4Zredf +DKjknXRpOhU6+A4fBaXhRP/9sU+p+N2m/0Y2iTVfwvdJdbllu3cmIAcAmh1o2EGLdd5puGK7iy jZsCRalxHpXIbTm6WzZPHXNys2y3fVTmmjS3lswRg+rXAcqyg9lQKeVI+ngtKoZjHK+dCVhmm9s cnq68YXHHNjvA0SaJHfzJ3zQ3idp+m1+m09qyXTmTIUYXzlsZ2ZsPXE5Py1jOyH9qNnteRobWsY cCJCByrgHNWUKHg907zJinWSNo2IPSFYDYnMpo5IpNe1oZKDbRNUJ9vB6mBUqXGrTTMoSpQ8p+N yg6EUBrZYNXUxIF7CPNq8nndsIGKb39ZmA3QsI1T1tqxlBVvrtE1ihYn9XLIMIRYYgDeGV9yTDf cdTlQqmkZNALO23NW+6cmpXjViSvlNXbpkXWoOBkfzIRUrzU7np8chtTP7nrrnsYFse8Tamq+b4 TOGWrIZbzWCeaf+NaXi5PI3gqVWn0+cYa0HMMuVJyi5gywihFkTy5+JrnDgK+pTsX21/G0M/fEp ui16eY8ZuVnXTgA== X-Developer-Key: i=jacopo.mondi@ideasonboard.com; a=openpgp; fpr=72392EDC88144A65C701EA9BA5826A2587AD026B 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" The Mali-C55 LSC algorithm uses 8-bit gain values. Specialize Interpolator> for uint8_t to prevent the uint16_t specialization from being selected. Signed-off-by: Jacopo Mondi --- src/ipa/libipa/lsc_base.cpp | 11 +++++++++++ src/ipa/libipa/lsc_base.h | 7 +++++++ 2 files changed, 18 insertions(+) diff --git a/src/ipa/libipa/lsc_base.cpp b/src/ipa/libipa/lsc_base.cpp index c87e2680d973..a0b78ac5265b 100644 --- a/src/ipa/libipa/lsc_base.cpp +++ b/src/ipa/libipa/lsc_base.cpp @@ -63,6 +63,17 @@ namespace lsc { } /* namespace lsc */ #ifndef __DOXYGEN__ +template<> +void Interpolator>:: + interpolate(const lsc::Components &a, + const lsc::Components &b, + lsc::Components &dest, + double lambda) +{ + for (auto const &[k, v] : a) + interpolateVector(v, b.at(k), dest[k], lambda); +} + template<> void Interpolator>:: interpolate(const lsc::Components &a, diff --git a/src/ipa/libipa/lsc_base.h b/src/ipa/libipa/lsc_base.h index a25d951e8ddb..51f3dd91f547 100644 --- a/src/ipa/libipa/lsc_base.h +++ b/src/ipa/libipa/lsc_base.h @@ -49,6 +49,13 @@ void interpolateVector(const std::vector &a, const std::vector &b, dest[i] = a[i] * (1.0 - lambda) + b[i] * lambda; } +template<> +void Interpolator>:: + interpolate(const lsc::Components &a, + const lsc::Components &b, + lsc::Components &dest, + double lambda); + template<> void Interpolator>:: interpolate(const lsc::Components &a,