From patchwork Wed Jun 26 07:20:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 20393 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 A148FBD87C for ; Wed, 26 Jun 2024 07:21:17 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id EBF80619E5; Wed, 26 Jun 2024 09:21:16 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="ZeXRuE79"; 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 3647A619E5 for ; Wed, 26 Jun 2024 09:21:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719386474; 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=jt7yq+7Aq44yAjVlGueGZkCYRhZfVm0E69BBzo/mqKY=; b=ZeXRuE798McdaTq8VRBRCx0Y6ZMNJirLnFNrPa48EtRGNt8OHjbcacOVRAgmXuGy2A5OTE geyrbmnf5CUwga9cOhuZg6MrgI7epmRD79aVcpmZwmBZE8W2rvb39t+5eWSij5osJZaAH3 kFP6gQRWu+gb8RP74TSZdsiZwWcLB7g= Received: from mx-prod-mc-03.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-605-vP2fU0bdOWuwmNSDIPAM0g-1; Wed, 26 Jun 2024 03:21:09 -0400 X-MC-Unique: vP2fU0bdOWuwmNSDIPAM0g-1 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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7882719560BD for ; Wed, 26 Jun 2024 07:21:08 +0000 (UTC) Received: from nuthatch.brq.redhat.com (unknown [10.43.17.159]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 45654300021A; Wed, 26 Jun 2024 07:21:07 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal Subject: [PATCH 00/19] Software ISP refactoring Date: Wed, 26 Jun 2024 09:20:41 +0200 Message-ID: <20240626072100.55497-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-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" The purpose of this patch series is to bring software ISP code structuring closer to the hardware pipelines. Most notably, the API around algorithm.h is used now. This should make software ISP easier to understand, extend, maintain, and code-share with the other pipelines. What is omitted in the patch series: - Any bigger or unrelated functional changes. The purpose of this series is code restructuring, which is enough already. - Stats and params buffers are still used in the original way. Making their handling closer to the hardware pipelines will be a subject of followup patches. This series is a preparation step for that. - Any IPA code sharing with hardware pipelines. If there is an opportunity for this, it can be addressed in followup patches. Milan Zamazal (19): libcamera: software_isp: Remove superfluous includes libcamera: software_isp: Move BlackLevel to libcamera::ipa::soft libcamera: simple: Fix a typo in a doc string libcamera: software_isp: Define skeletons for IPA refactoring libcamera: software_isp: Let IPASoftSimple inherit Module libcamera: software_isp: Make stats frame and buffer aware libcamera: software_isp: Remove dots in Debayer::process docstring libcamera: software_isp: Track and pass frame ids libcamera: software_isp: Create algorithms libcamera: software_isp: Call Algorithm::process libcamera: software_isp: Call Algorithm::prepare libcamera: software_isp: Call Algorithm::queueRequest libcamera: software_isp: Call Algorithm::configure libcamera: software_isp: Move black level to an algorithm module libcamera: software_isp: Move color handling to an algorithm module libcamera: software_isp: Use floating point for color parameters libcamera: software_isp: Use DelayedControls libcamera: software_isp: Move exposure+gain to an algorithm module libcamera: software_isp: Update black level only on exposure changes .../internal/software_isp/software_isp.h | 15 +- include/libcamera/ipa/soft.mojom | 10 +- src/ipa/simple/algorithms/agc.cpp | 139 +++++++++ src/ipa/simple/algorithms/agc.h | 36 +++ src/ipa/simple/algorithms/algorithm.h | 22 ++ src/ipa/simple/algorithms/blc.cpp | 84 ++++++ src/ipa/simple/algorithms/blc.h | 41 +++ src/ipa/simple/algorithms/colors.cpp | 121 ++++++++ src/ipa/simple/algorithms/colors.h | 46 +++ src/ipa/simple/algorithms/meson.build | 7 + src/ipa/simple/black_level.cpp | 88 ------ src/ipa/simple/black_level.h | 29 -- src/ipa/simple/data/uncalibrated.yaml | 4 + src/ipa/simple/ipa_context.h | 62 ++++ src/ipa/simple/meson.build | 8 +- src/ipa/simple/module.h | 31 ++ src/ipa/simple/soft_simple.cpp | 283 ++++++------------ src/libcamera/pipeline/simple/simple.cpp | 41 ++- src/libcamera/software_isp/TODO | 39 --- src/libcamera/software_isp/debayer.cpp | 11 +- src/libcamera/software_isp/debayer.h | 2 +- src/libcamera/software_isp/debayer_cpu.cpp | 9 +- src/libcamera/software_isp/debayer_cpu.h | 2 +- src/libcamera/software_isp/software_isp.cpp | 42 ++- src/libcamera/software_isp/swstats_cpu.cpp | 4 +- src/libcamera/software_isp/swstats_cpu.h | 4 +- 26 files changed, 778 insertions(+), 402 deletions(-) create mode 100644 src/ipa/simple/algorithms/agc.cpp create mode 100644 src/ipa/simple/algorithms/agc.h create mode 100644 src/ipa/simple/algorithms/algorithm.h create mode 100644 src/ipa/simple/algorithms/blc.cpp create mode 100644 src/ipa/simple/algorithms/blc.h create mode 100644 src/ipa/simple/algorithms/colors.cpp create mode 100644 src/ipa/simple/algorithms/colors.h create mode 100644 src/ipa/simple/algorithms/meson.build delete mode 100644 src/ipa/simple/black_level.cpp delete mode 100644 src/ipa/simple/black_level.h create mode 100644 src/ipa/simple/ipa_context.h create mode 100644 src/ipa/simple/module.h