From patchwork Wed Nov 10 19:58:47 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: 14528 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 337ABBDB1C for ; Wed, 10 Nov 2021 19:59:09 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id BC52E6036F; Wed, 10 Nov 2021 20:59:07 +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="j9YCHt1A"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3AE536033C for ; Wed, 10 Nov 2021 20:59:06 +0100 (CET) Received: from tatooine.ideasonboard.com (unknown [IPv6:2a01:e0a:169:7140:7713:3465:89e6:c5cd]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id BFDFE8B6; Wed, 10 Nov 2021 20:59:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1636574345; bh=PY9HIq0BNxztZ+2bCidJMYhTqfXtRqXZ28jptptPRLw=; h=From:To:Cc:Subject:Date:From; b=j9YCHt1A/F9F8rjYUwtZDBZWGUtO1MYOohH6Q+U1ae8O+oUWDZGTCs4pwjBhZ4Ewy lT0YnNdtLhHf1ajtPj1+Eoquk7A5deSroM3fHqVyUJG9g9WkrnlqhJG9cioqk2ubjn G+0ro+hzdawIPart71rPM5Xfyf+v1da3srsyaVT0= From: Jean-Michel Hautbois To: libcamera-devel@lists.libcamera.org Date: Wed, 10 Nov 2021 20:58:47 +0100 Message-Id: <20211110195901.85597-1-jeanmichel.hautbois@ideasonboard.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 00/14] IPA: IPU3: Introduce per-frame controls 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 v2 of the patch series, but only half of v1 is here, as the second part, which adds the std::queue, is subject to discussion. This patch series is not only introducing per-frame controls, using the sensor controls directly in the EventStatReady, it also improves the AGC in some difficult cases (saturated scenes, backlight, etc.) thanks to the possibility to use the effective exposure and gains values for a given frame. The first two patches 1/14 and 2/14 are Han-Lin Chan series, splitted to keep only the sensor controls part. I have modified the first patch to remove the lens controls references, and another series containing only the lens controls should be sent separately as it requires a bit more review. in this v2, I also modified the patch 2/14 to call the reset on DelayedControl at start and not at configure. Next, from patches 3/14 to 9/14 we use those sensor controls as input when a EventStatReady event is received, by updating the frameContext values. With those values, we can be better at estimating the exposure value, and we introduce a brightness measure to have a better behaviour in saturated cases. Patches 10/14 to 14/14 are here to improve the per-frame control updates by the IPA, introducing the colour temperature control, and updating the ExposureTime and AnalogueGain controls. Han-Lin Chen (2): ipa: ipu3: Extend ipu3 ipa interface for sensor controls ipu3: ipa: Report effective sensor controls with statistics to IPA Jean-Michel Hautbois (12): ipa: ipu3: Use sensor controls to update frameContext ipa: ipu3: agc: Limit the number of saturated cells ipa: ipu3: agc: Compute the gain for each frame ipa: ipu3: agc: Refactor ev gain calculation and testing ipa: ipu3: agc: Improve gain calculation ipa: ipu3: agc: Update previous exposure value ipa: ipu3: agc: Use exposure in time for storage ipa: ipu3: awb: Add support for color temperature ipa: ipu3: Send color temperature in the metadata ipa: ipu3: Cache line duration at configure call ipa: ipu3: Move ExposureTime to IPA ipa: ipu3: Pass the AnalogueGain control include/libcamera/ipa/ipu3.mojom | 2 + src/ipa/ipu3/algorithms/agc.cpp | 188 ++++++++++++++++++++------- src/ipa/ipu3/algorithms/agc.h | 12 +- src/ipa/ipu3/algorithms/awb.cpp | 1 + src/ipa/ipu3/ipa_context.cpp | 3 + src/ipa/ipu3/ipa_context.h | 2 + src/ipa/ipu3/ipu3.cpp | 39 ++++-- src/libcamera/pipeline/ipu3/frames.h | 4 + src/libcamera/pipeline/ipu3/ipu3.cpp | 27 ++-- 9 files changed, 198 insertions(+), 80 deletions(-)