From patchwork Fri Apr 16 07:49:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Michel Hautbois X-Patchwork-Id: 11957 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 209A0BD235 for ; Fri, 16 Apr 2021 07:49:14 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9173968803; Fri, 16 Apr 2021 09:49:13 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Xc2lKCyN"; 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 5785B605AE for ; Fri, 16 Apr 2021 09:49:12 +0200 (CEST) Received: from localhost.localdomain (unknown [IPv6:2a01:e0a:169:7140:5b63:445c:7960:347a]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id AD19D5A5; Fri, 16 Apr 2021 09:49:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1618559351; bh=6HIMCa3gCe3Jm9ttdjpIt6c102x9EV84YuCf/j1oQos=; h=From:To:Cc:Subject:Date:From; b=Xc2lKCyNdTO38jxVd/DL681YYg72x+A6PFM5l5xImdLNpZkM+XaLKXeKy7j/UxZyb 1ggrARSnXLfF4mbaGRXvJH45J7uB69hzMPf9PrXy1Sz6TPr4BBYbl731qXy5V2R8L2 8hTz1ws+D7zNa5BTxDyaqDWsKSaZLMzaHCc2O7Ao= From: Jean-Michel Hautbois To: libcamera-devel@lists.libcamera.org Date: Fri, 16 Apr 2021 09:49:05 +0200 Message-Id: <20210416074909.24218-1-jeanmichel.hautbois@ideasonboard.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 0/4] Implement IPA algorithms and demo with IPU3 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" Here is v5 of the IPA demonstration on IPU3. It demonstrates a conjunction of automatic exposure (AGC) and automatic white balance (AWB). The skeleton are extracted from RPi controller and probably subject to modifications and discussions : - are the mandatory methods really those ? - how to exchange data between algorithms ? - metadata like RPi? - IPC ? - public methods? - controller API ? - is the controller needed at all ? The implementation in IPU3 is tested on SGo2. It is not perfect but shows a really better behaviour than default. Right now, the AGC algorithm is part of the RPi one, adapted to the stats and parameters we have in IPU3 on SGo2. Changes in v5: - adress multiple issues found at review time - use RPi grey-world AWB algorithm and correct gains - prepare for a more generic ISP stat usage Changes in v4: - removed unneeded patch setting exposure and gains - improve documentation of Histogram class - take review comments Changes in v3: - introduce histogram class (for AGC) - add a patch to introduce parameter context saving - changes in AGC to simplify it using part of RPi work - changes in the AWB loop - calculate the grid for the parameters using the BDS size from pipeline handler In v2: - splits AWB and AEC/AGC algorithms. - remove unused Controller - remove unused variables/methods - rename most of the class members Jean-Michel Hautbois (4): ipa: Add a common interface for algorithm objects ipa: ipu3: Add a histogram class ipa: ipu3: Add support for IPU3 AWB algorithm ipa: ipu3: Add support for IPU3 AEC/AGC algorithm src/ipa/ipu3/ipu3.cpp | 96 +++++++++- src/ipa/ipu3/ipu3_agc.cpp | 206 ++++++++++++++++++++ src/ipa/ipu3/ipu3_agc.h | 62 +++++++ src/ipa/ipu3/ipu3_awb.cpp | 351 +++++++++++++++++++++++++++++++++++ src/ipa/ipu3/ipu3_awb.h | 91 +++++++++ src/ipa/ipu3/meson.build | 8 +- src/ipa/libipa/algorithm.cpp | 39 ++++ src/ipa/libipa/algorithm.h | 24 +++ src/ipa/libipa/histogram.cpp | 150 +++++++++++++++ src/ipa/libipa/histogram.h | 40 ++++ src/ipa/libipa/meson.build | 6 +- 11 files changed, 1063 insertions(+), 10 deletions(-) create mode 100644 src/ipa/ipu3/ipu3_agc.cpp create mode 100644 src/ipa/ipu3/ipu3_agc.h create mode 100644 src/ipa/ipu3/ipu3_awb.cpp create mode 100644 src/ipa/ipu3/ipu3_awb.h create mode 100644 src/ipa/libipa/algorithm.cpp create mode 100644 src/ipa/libipa/algorithm.h create mode 100644 src/ipa/libipa/histogram.cpp create mode 100644 src/ipa/libipa/histogram.h Tested-by: Jacopo Mondi