From patchwork Fri Aug 27 08:02:23 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: 13535 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 48463BD87C for ; Fri, 27 Aug 2021 08:02:35 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A07A268939; Fri, 27 Aug 2021 10:02:33 +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="uHRRTnSk"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 46D7868891 for ; Fri, 27 Aug 2021 10:02:32 +0200 (CEST) Received: from tatooine.ideasonboard.com (unknown [IPv6:2a01:e0a:169:7140:ccf5:c267:eba8:cbb5]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D472D5A1; Fri, 27 Aug 2021 10:02:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1630051351; bh=ukBhr980cDxbYkv209L1V4DhdjK9XGurE95+AgAffYs=; h=From:To:Cc:Subject:Date:From; b=uHRRTnSkwrjyGk3xXc6xlWWLZ0FmrsLevI00RlVRpyOn15iIKNyJ3/2CfdgniSde3 I+OENyrz6KqOHsbQH6rQruAdae1jjN7a2NliDiBlN9I9fbuiogFWXp+FVu/GMZFwIU PmZqtsfeLaKDFizAevr2ZKabBGtRclWkfowtdlak= From: Jean-Michel Hautbois To: libcamera-devel@lists.libcamera.org Date: Fri, 27 Aug 2021 10:02:23 +0200 Message-Id: <20210827080227.26370-1-jeanmichel.hautbois@ideasonboard.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 0/4] IPU3: AWB and AGC improvements 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" Now that we have a full context share between algorithms when needed, and a modular algorithm instanciation, we can introduce a new AGC algorithm to demonstrate how one can chose between one or another (it could obviously be done with a configuration file). The algorithm comes from the RPi source code, and has been adapted but stays similar in its concepts. It uses the AWB gains calculated at each frame to adjust the exposure. As we need to access the AWB statistics, having the needed structures outside the AWB class sounds better. --- v2: Remove the AWB modifications of the gains because it introduces regressions on SGo2 Jean-Michel Hautbois (4): ipa: ipu3: Move the AWB stats structures ipa: ipu3: Rename AGC algorithm ipa: ipu3: Document AGC mean-based algorithm ipa: ipu3: Introduce a new AGC algorithm .../ipu3/algorithms/{agc.cpp => agc_mean.cpp} | 116 ++++- src/ipa/ipu3/algorithms/{agc.h => agc_mean.h} | 8 +- src/ipa/ipu3/algorithms/agc_metering.cpp | 427 ++++++++++++++++++ src/ipa/ipu3/algorithms/agc_metering.h | 78 ++++ src/ipa/ipu3/algorithms/awb.cpp | 47 +- src/ipa/ipu3/algorithms/awb.h | 81 ++-- src/ipa/ipu3/algorithms/meson.build | 3 +- src/ipa/ipu3/ipa_context.h | 7 + src/ipa/ipu3/ipu3.cpp | 15 +- 9 files changed, 693 insertions(+), 89 deletions(-) rename src/ipa/ipu3/algorithms/{agc.cpp => agc_mean.cpp} (61%) rename src/ipa/ipu3/algorithms/{agc.h => agc_mean.h} (90%) create mode 100644 src/ipa/ipu3/algorithms/agc_metering.cpp create mode 100644 src/ipa/ipu3/algorithms/agc_metering.h