From patchwork Wed Mar 26 12:48:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 23047 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 E53C4C3213 for ; Wed, 26 Mar 2025 12:49:06 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3C26C68950; Wed, 26 Mar 2025 13:49:06 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="DumckcOg"; 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 86CDB68950 for ; Wed, 26 Mar 2025 13:49:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1742993343; 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=D0lphh5OGMtr2ev6CiSiL/fFmiPwWiL5gqhOlDKIkYc=; b=DumckcOggVaAtyWHwjdsbT64uX63R1SJoepqZ6paaCz6EdLrRbtH5Eqc106BmQZIl0D/bt ZmOPogGay1vH8fpcj1tltZ3fkgmxa8XnHhwuyToEO2Ou6GE1W82qWbzZmQIaNRkJe0H080 dddDQXkY58p18meL6YiCuktvCgglZhQ= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-446-ETW5KVEsOZuBoNHDiUVjRA-1; Wed, 26 Mar 2025 08:49:02 -0400 X-MC-Unique: ETW5KVEsOZuBoNHDiUVjRA-1 X-Mimecast-MFC-AGG-ID: ETW5KVEsOZuBoNHDiUVjRA_1742993341 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 171A5180025B; Wed, 26 Mar 2025 12:49:01 +0000 (UTC) Received: from mzamazal-thinkpadp1gen7.tpbc.com (unknown [10.44.34.15]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0772030001A1; Wed, 26 Mar 2025 12:48:58 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal , Laurent Pinchart , Kieran Bingham Subject: [PATCH v5 0/6] ipa: simple: Introduce metadata reporting Date: Wed, 26 Mar 2025 13:48:49 +0100 Message-ID: <20250326124856.75709-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: LF2O5yyk2w76XSwWy0ZXc3qZUFdDo_E3K76C5-zxRtA_1742993341 X-Mimecast-Originator: redhat.com 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. This means reporting metadata itself from software ISP and adding relevant values to the metadata. Running ‘cam’ with --metadata now produces something like the following: SensorBlackLevels = [ 4096, 4096, 4096, 4096 ] ColourGains = [ 0.001153, 0.001145 ] ExposureTime = 66578 AnalogueGain = 10.666667 SensorTimestamp = 5466162537000 Changes in v5: - Updated for current master. Changes in v4: - SimpleCameraData::completeRequest just returns if frame info is not found. - SimpleCameraData::completeRequest split to completeRequest and tryCompleteRequest and checkCompleted argument removed. - SoftwareIsp::saveMetadata replaced by a lambda function. - blackLevels array initialization reflowed to 72 columns. - exposureTime converted to the right unit. - maybe_unused removed from a used argument. - Metadata is taken from frame contexts rather than from active states. 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 | 4 +- src/ipa/simple/algorithms/agc.cpp | 11 +- src/ipa/simple/algorithms/awb.cpp | 21 +++- src/ipa/simple/algorithms/awb.h | 6 +- src/ipa/simple/algorithms/blc.cpp | 11 +- src/ipa/simple/algorithms/lut.cpp | 15 ++- src/ipa/simple/algorithms/lut.h | 5 + src/ipa/simple/ipa_context.h | 11 +- src/ipa/simple/soft_simple.cpp | 24 ++-- src/libcamera/pipeline/simple/simple.cpp | 116 +++++++++++++++++- src/libcamera/software_isp/software_isp.cpp | 29 ++++- 12 files changed, 226 insertions(+), 29 deletions(-)