From patchwork Sun Oct 26 23:30:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 24823 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 EAC2EBE080 for ; Sun, 26 Oct 2025 23:30:56 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E5C2D60712; Mon, 27 Oct 2025 00:30:55 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="r/Y4O7W/"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AB930606CE for ; Mon, 27 Oct 2025 00:30:53 +0100 (CET) Received: from charm.hippo-penny.ts.net (unknown [209.38.108.23]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E56DFE1F; Mon, 27 Oct 2025 00:29:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1761521346; bh=ekUwKJCvQ+/BKz2K4P1qGhzcV5UD9Agu+CQDsi3Kp5Q=; h=From:To:Cc:Subject:Date:From; b=r/Y4O7W/m/vlEaoAYWom8m8iWGKysFP++gGjD5tIwm3ZReMOWeVCSqbWJyNLbVxC6 SXbYTMmnjmoeabBAwrAe4QBbyjq+lGvLeqCHBH4XpMOhE0HFWnHhFO9YVQFR8JMJM1 fBQHGgGF67fTMNNygRqAY92lf+qwR4/zcwWQzhsY= From: Kieran Bingham To: libcamera devel Cc: Kieran Bingham Subject: [PATCH 0/6] libipa: Introduce a Quantized type Date: Sun, 26 Oct 2025 23:30:37 +0000 Message-ID: <20251026233048.175689-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.51.0 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" This series superceeds [0] "rkisp1: cproc - Metadata and Hue developments" by introducing a new base type for libipa to be able to maintain values which are quantized for hardware. These data values often need to be converted, perhaps to a fixed-point format for configuration of hardware, but also then back to a floating point for returning as metadata. In particular this series builds to solve the review comment that blocked the original series at [1] The Quantized type provides a protected storage mechanism to make both of these storage representations visible to code that wishes to utilise the specific values, but only through read only accessors. Any write access must be performed through a Quantizer ... a derived type which introduces the mechanism to update the data store, always ensuring to update both values at the same time. The series then re-introduces the proposed updates to cproc using the new mechanisms. [0] https://patchwork.libcamera.org/project/libcamera/list/?series=5245 [1] https://patchwork.libcamera.org/patch/23645/#34626 If this new base Quantized type can be accepted, I believe a good next step is to provide a FixedPointQuantizer and extend the tests of the current fixed point helpers, allowing fixed point conversions to be simplified through out. Kieran Bingham (5): libipa: Provide a Quantized type and Quantizer support test: libipa: Add tests for Quantizers ipa: rkisp1: cproc: Convert to use Quantized types ipa: rkisp1: cproc: Report metadata ipa: rkisp1: cproc: Provide a Hue control van Veen, Stephan (1): libcamera: controls: Define a new core Hue control src/ipa/libipa/meson.build | 2 + src/ipa/libipa/quantized.cpp | 167 ++++++++++++++++++++++++++++ src/ipa/libipa/quantized.h | 90 +++++++++++++++ src/ipa/rkisp1/algorithms/cproc.cpp | 117 ++++++++++++++++--- src/ipa/rkisp1/algorithms/cproc.h | 4 + src/ipa/rkisp1/ipa_context.h | 15 ++- src/libcamera/control_ids_core.yaml | 13 +++ test/ipa/libipa/meson.build | 1 + test/ipa/libipa/quantized.cpp | 149 +++++++++++++++++++++++++ 9 files changed, 534 insertions(+), 24 deletions(-) create mode 100644 src/ipa/libipa/quantized.cpp create mode 100644 src/ipa/libipa/quantized.h create mode 100644 test/ipa/libipa/quantized.cpp