From patchwork Mon Jan 13 13:33:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 22528 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 BD727C32F6 for ; Mon, 13 Jan 2025 13:34:20 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2F7896851C; Mon, 13 Jan 2025 14:34:19 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="ehYNXOMJ"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 561B8684E7 for ; Mon, 13 Jan 2025 14:34:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1736775256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lV+rfj3x4/bVpnX2t7TSsM8lXXN23GcJihYHDVext7w=; b=ehYNXOMJhfpslt5cSckX44Qy8hglg5gOqjgBczVECNSjD5I1cGQ1wNhmpGdr9eRlMD+paw +56p7w/5CVvuVe0oEaKEZrW50+8dYBN0bzvuIrRb9o7WrXoPosgEotGnntLjIvT5afHLGG sLuxQMrIKcZ8n2WpPcKMMxRHFREjUSo= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-684-pBM2YVKWO0y_9Gxl7WvbjQ-1; Mon, 13 Jan 2025 08:34:14 -0500 X-MC-Unique: pBM2YVKWO0y_9Gxl7WvbjQ-1 X-Mimecast-MFC-AGG-ID: pBM2YVKWO0y_9Gxl7WvbjQ Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B0C461954202; Mon, 13 Jan 2025 13:34:13 +0000 (UTC) Received: from mzamazal-thinkpadp1gen3.tpbc.com (unknown [10.45.224.6]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6AA301955BE3; Mon, 13 Jan 2025 13:34:11 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal , Kieran Bingham , Laurent Pinchart , =?utf-8?b?QmFybmFiw6FzIFDFkWN6?= =?utf-8?q?e?= Subject: [PATCH v3 0/6] ipa: simple: Introduce metadata reporting Date: Mon, 13 Jan 2025 14:33:59 +0100 Message-ID: <20250113133405.12167-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: n-3yCY-tI9qW_zPkNs6CLuUclAN0ujGdDPLaXYXr8M0_1736775253 X-Mimecast-Originator: redhat.com content-type: text/plain; charset="US-ASCII"; x-default=true 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" Provide metadata reporting for the software ISP. Initially the Black Levels, ColourGains and Contrast are reported, but also serve as a direction to add further metadata or internal reporting of the software ISP. Running cam -c1 -C10 --metadata now produces the following: 1668.359684 (14.95 fps) cam0-stream0 seq: 000004 bytesused: 15069888 SensorBlackLevels = [ 4096, 4096, 4096, 4096 ] AnalogueGain = 10.240000 ColourGains = [ 0.001509, 0.001380 ] ExposureTime = 2127 SensorTimestamp = 1668359684000 Changes in v3: - Don't use dynamic allocation for SimpleFrames entries. - A tentative patch to add exposure/gain to metadata. Changes in v2: - Taken over from Kieran. - Updated for master. - Black level is reported as uint16_t, according to the control documentation. - Contrast value is reported in metadata. - The metadata used to proces the image is reported rather than the metadata determined from the image. - Metadata is reported using a new signal rather than (ab)using setIspParams; this change is less or more needed due to changed simple IPA structure since v1. - Frame -> request mapping is introduced to make sure the metadata is assigned to the right request. Kieran Bingham (3): ipa: simple: softisp: Extend to pass metadata ipa: simple: Report the ColourGains in metadata ipa: simple: Report black levels in metadata Milan Zamazal (3): libcamera: software_isp: Track frames and requests ipa: simple: Report contrast in metadata ipa: simple: Report exposure in metadata .../internal/software_isp/software_isp.h | 2 + include/libcamera/ipa/soft.mojom | 1 + src/ipa/simple/algorithms/agc.cpp | 7 +- src/ipa/simple/algorithms/awb.cpp | 11 +- src/ipa/simple/algorithms/blc.cpp | 9 +- src/ipa/simple/algorithms/lut.cpp | 11 ++ src/ipa/simple/algorithms/lut.h | 5 + src/ipa/simple/soft_simple.cpp | 7 +- src/libcamera/pipeline/simple/simple.cpp | 102 +++++++++++++++++- src/libcamera/software_isp/software_isp.cpp | 11 ++ 10 files changed, 151 insertions(+), 15 deletions(-)