From patchwork Mon Aug 23 12:49:30 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: 13435 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 DE6CBBD87D for ; Mon, 23 Aug 2021 12:49:44 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 31628688AE; Mon, 23 Aug 2021 14:49:44 +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="jlMZTZ8g"; 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 C741B6025B for ; Mon, 23 Aug 2021 14:49:42 +0200 (CEST) Received: from tatooine.ideasonboard.com (unknown [IPv6:2a01:e0a:169:7140:b920:776:a08c:1d1f]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 5504D2A5; Mon, 23 Aug 2021 14:49:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1629722982; bh=MAJIiKgENlRrZAfuxf1MUOTyjstQcqkaxh2naOltQfg=; h=From:To:Cc:Subject:Date:From; b=jlMZTZ8gHnLhitRcKwJJ08BAsZMi276hqCjgHqwz7Sv/jXHp5ndHFX79rMKkDkgzD NuSzHqxSOoBrtXnn1d7Zajo5il5vgqsPwqFcGbFtqp6XSB8GTONnXWs0hDhziPdxzP JsytV0jBCH2atoUdQaHXQBZ9Ktot8TXWTaOEvi4U= From: Jean-Michel Hautbois To: libcamera-devel@lists.libcamera.org Date: Mon, 23 Aug 2021 14:49:30 +0200 Message-Id: <20210823124937.253539-1-jeanmichel.hautbois@ideasonboard.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1 0/7] 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. Finally, we can introduce the Black level correction values in order to slightly improve the contrast (we still lack Lens Shading Correction and sensor linearization, though). Jean-Michel Hautbois (7): ipa: ipu3: Move the AWB stats structures ipa: ipu3: awb: Correct the relevant zones proportion ipa: ipu3: awb: Correct the gain multipliers ipa: ipu3: awb: Add some documentation on the algorithm used ipa: ipu3: rename AGC algorithm ipa: ipu3: Introduce a new AGC algorithm ipa: ipu3: Introduce Black Level Correction .../ipu3/algorithms/{agc.cpp => agc_mean.cpp} | 31 +- src/ipa/ipu3/algorithms/{agc.h => agc_mean.h} | 8 +- src/ipa/ipu3/algorithms/agc_metering.cpp | 336 ++++++++++++++++++ src/ipa/ipu3/algorithms/agc_metering.h | 81 +++++ src/ipa/ipu3/algorithms/awb.cpp | 59 ++- src/ipa/ipu3/algorithms/awb.h | 78 ++-- src/ipa/ipu3/algorithms/meson.build | 3 +- src/ipa/ipu3/ipa_context.h | 8 + src/ipa/ipu3/ipu3.cpp | 12 +- 9 files changed, 546 insertions(+), 70 deletions(-) rename src/ipa/ipu3/algorithms/{agc.cpp => agc_mean.cpp} (87%) 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