From patchwork Thu Jan 30 17:32:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 22690 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 53D90C324C for ; Thu, 30 Jan 2025 17:33:08 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6CAD368563; Thu, 30 Jan 2025 18:33:07 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="afeES0D3"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5E4386034C for ; Thu, 30 Jan 2025 18:33:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738258384; 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=FUQnZ8uiCc/Zg901dUEmLflPzFF791i7E+KeGJTuAk4=; b=afeES0D31X1FjCDEmqgzaq8qIEzMs4+BQX9IoAkRSSCkwDGaW9o2jlt15Lq1AqKFi8/c8d 6enQyCvR1O3NLhRqbUoc7mvcK9INTNleR2Q2rTYjH4M9Z78KV4p0oI80F6sK0AG433Rhwi M/RmZ7g39uIieNGQF3gyDGVskMnZGe0= Received: from mx-prod-mc-01.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-279-NHlxv99COHWW05mdrv4NgA-1; Thu, 30 Jan 2025 12:33:00 -0500 X-MC-Unique: NHlxv99COHWW05mdrv4NgA-1 X-Mimecast-MFC-AGG-ID: NHlxv99COHWW05mdrv4NgA Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 832DC19560BB; Thu, 30 Jan 2025 17:32:59 +0000 (UTC) Received: from mzamazal-thinkpadp1gen3.tpbc.com (unknown [10.45.224.122]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 788EF1956094; Thu, 30 Jan 2025 17:32:57 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal , Laurent Pinchart , Kieran Bingham , =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= Subject: [PATCH v4 0/6] ipa: simple: Introduce metadata reporting Date: Thu, 30 Jan 2025 18:32:47 +0100 Message-ID: <20250130173254.112895-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: lyjS6rsLvrHhNxzezp4q2_DoBkvctJoe4b6INAtSB0U_1738258379 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 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 | 23 +++- src/ipa/simple/algorithms/awb.h | 6 +- src/ipa/simple/algorithms/blc.cpp | 11 +- src/ipa/simple/algorithms/lut.cpp | 17 ++- 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 | 27 +++- 12 files changed, 227 insertions(+), 30 deletions(-)