From patchwork Thu Nov 25 05:42:48 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: 14761 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 BE5A9BF415 for ; Thu, 25 Nov 2021 05:43:07 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3E61C603C2; Thu, 25 Nov 2021 06:43:06 +0100 (CET) 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="ttDA9a22"; 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 05A6C6011E for ; Thu, 25 Nov 2021 06:43:04 +0100 (CET) Received: from tatooine.ideasonboard.com (unknown [IPv6:2a01:e0a:169:7140:d9a5:5e40:3323:d95]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9D64990E; Thu, 25 Nov 2021 06:43:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1637818983; bh=rbStu20lar1aiv4IGOsIG50ntYZx+UsztZp7zR18KUs=; h=From:To:Cc:Subject:Date:From; b=ttDA9a22iBNsiZoCq+6/kDMb2DRpLtFIrcUWaL6mx2z21JEZUu1E8Uqxi/Li9l6Ru 6EFvO4TlYhl/4BqdPNrC7fO+o0ooygC/FUKRNRkaZKbKSZeYrz4wbsgu7K0FKFC+UP Dg8G2yr37qazz3Mbmfpe8Tomjp3VD/ePFATnF6Qw= From: Jean-Michel Hautbois To: libcamera-devel@lists.libcamera.org Date: Thu, 25 Nov 2021 06:42:48 +0100 Message-Id: <20211125054259.24792-1-jeanmichel.hautbois@ideasonboard.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 00/11] Introduce AGC for RkISP1 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 is the v5 of the RkISP1 AGC series which includes a correction of bad filtering usage in v4 for AGC, and some minor modifications. In v3, a template for the Algorithm class is introduced in patch 6/11 and 7/11 for the RkISP1 implementation. Now that AGC is working pretty nicely on IPU3, make it work on RkISP1 too. For that purpose, patches 1/11 to 5/11 reuse the concepts of Algorithm and IPAContext and make those part of the rkisp1 IPA. The effective sensor controls can then be reported with patch 8/11. In v4, the hw revision is included in IPAContext before the AGC uses it (patch 9/11). Patch 10/11 is a small adaptation of the IPU3 AGC: we reuse the relative luminance estimation, basing it on the Y mean measured by the ISP, and removes the histogram based calculation for now. In v2 the improvements from Laurent's series "ipa: ipu3: agc: Misc improvements" are also included. Patch 11/11 introduces a new prepare() call from the Algorithm class in AGC. Jean-Michel Hautbois (11): libipa: Correct IMX219 in CameraSensorHelper ipa: rkisp1: Pass IPASettings at init call ipa: Do not modify the sensor limits ipa: rkisp1: Instantiate CameraSensorHelper ipa: rkisp1: Introduce IPAContext ipa: libipa: Introduce Algorithm class template ipa: rkisp1: Use the Algorithm class ipa: rkisp1: Report and use sensor controls ipa: rkisp1: agc: Introduce HW revision in IPAContext ipa: rkisp1: Introduce AGC ipa: rkisp1: agc: Introduce prepare call include/libcamera/ipa/rkisp1.mojom | 6 +- src/ipa/ipu3/algorithms/algorithm.h | 12 +- src/ipa/ipu3/algorithms/awb.cpp | 9 + src/ipa/ipu3/algorithms/meson.build | 1 - src/ipa/ipu3/ipu3.cpp | 4 +- .../{ipu3/algorithms => libipa}/algorithm.cpp | 38 +-- src/ipa/libipa/algorithm.h | 38 +++ src/ipa/libipa/camera_sensor_helper.cpp | 2 +- src/ipa/libipa/meson.build | 1 + src/ipa/rkisp1/algorithms/agc.cpp | 282 ++++++++++++++++++ src/ipa/rkisp1/algorithms/agc.h | 47 +++ src/ipa/rkisp1/algorithms/algorithm.h | 26 ++ src/ipa/rkisp1/algorithms/meson.build | 5 + src/ipa/rkisp1/ipa_context.cpp | 111 +++++++ src/ipa/rkisp1/ipa_context.h | 52 ++++ src/ipa/rkisp1/meson.build | 11 +- src/ipa/rkisp1/rkisp1.cpp | 138 +++++---- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 5 +- 18 files changed, 691 insertions(+), 97 deletions(-) rename src/ipa/{ipu3/algorithms => libipa}/algorithm.cpp (75%) create mode 100644 src/ipa/libipa/algorithm.h create mode 100644 src/ipa/rkisp1/algorithms/agc.cpp create mode 100644 src/ipa/rkisp1/algorithms/agc.h create mode 100644 src/ipa/rkisp1/algorithms/algorithm.h create mode 100644 src/ipa/rkisp1/algorithms/meson.build create mode 100644 src/ipa/rkisp1/ipa_context.cpp create mode 100644 src/ipa/rkisp1/ipa_context.h