From patchwork Mon Nov 18 00:07:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 21942 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 3D047C32E0 for ; Mon, 18 Nov 2024 00:07:51 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9F01F658AC; Mon, 18 Nov 2024 01:07:49 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="mn6t4WMl"; 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 B5DE8600F2 for ; Mon, 18 Nov 2024 01:07:47 +0100 (CET) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 49FAB75A for ; Mon, 18 Nov 2024 01:07:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1731888451; bh=FWNETy+kvdQbwzaAYgBx/k/8nZcclgvs7HdsfkhOgL0=; h=From:To:Subject:Date:From; b=mn6t4WMlmnoNdQTKCdDgNDsAEZSSYKd2Kb1HlWno+DXHLE49aNHD83U0aVdG+z+5B KQYmgPWitUR30ceQNh1K0oq2BVBE7D046WMs3lbk4y3+aKGn3l01hrDgJkvyh+9iWJ erx+OsgPe6UObhuRDvS/ygXcHrNEFMGdkhfeuQlo= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Subject: [RFC PATCH v2 00/12] Improve linear algebra helpers in libipa Date: Mon, 18 Nov 2024 02:07:26 +0200 Message-ID: <20241118000738.18977-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.45.2 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" Hello, This patch series tries to simplify IPA linear algebra calculations by improving the Vector class API. Patches 01/12 to 09/12 improve the Vector class, patch 10/12 add a unit test for the class, and patches 11/12 to 12/12 showcase the improvements this can bring in the rkisp1 AWB algorithm. I'm relatively happy with the result. The only part I'm not sure about is the introduction of the RGB type alias. Please note the patches have been compile-tested only. Compared to v1, the Vector::normalize() function has been dropped, and the unit test was added in patch 10/12. Laurent Pinchart (12): ipa: libipa: vector: Add mutable x(), y() and z() accessors ipa: libipa: vector: Add r(), g() and b() accessors ipa: libipa: vector: Add copy constructor and assignment operator ipa: libipa: vector: Rename the dot product operator*() to dot() ipa: libipa: vector: Generalize arithmetic operators ipa: libipa: vector: Add missing binary arithemtic operators ipa: libipa: vector: Add compound assignment operators ipa: libipa: vector: Add element-wise min() and max() functions ipa: libipa: vector: Add sum() function test: libipa: Add Vector class test ipa: rkisp1: awb: Use RGB class to store colour gains ipa: rkisp1: awb: Replace manual calculations with Vector and Matrix src/ipa/libipa/vector.cpp | 256 ++++++++++++++++++++++++++---- src/ipa/libipa/vector.h | 252 +++++++++++++++++++++++------ src/ipa/rkisp1/algorithms/awb.cpp | 134 ++++++++-------- src/ipa/rkisp1/algorithms/awb.h | 2 +- src/ipa/rkisp1/ipa_context.cpp | 31 +--- src/ipa/rkisp1/ipa_context.h | 20 +-- test/ipa/libipa/meson.build | 2 + test/ipa/libipa/vector.cpp | 100 ++++++++++++ 8 files changed, 597 insertions(+), 200 deletions(-) create mode 100644 test/ipa/libipa/vector.cpp base-commit: 5c71df927ddaaa01204bff1e647c9d2bf653d95f