From patchwork Wed Dec 2 15:13:00 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 29136 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 627E7C3304 for ; Wed, 2 Dec 2026 15:13:23 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7AD086AAD3; Wed, 2 Dec 2026 16:13:22 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="OqplOO6L"; 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 0A7766AAD3 for ; Wed, 2 Dec 2026 16:13:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796224401; 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=Kn6QytvgcilDAhwsgGtcAXrNngv1L6v6+o5D6VbaKNQ=; b=OqplOO6LZ8Eh3vbRccMM0hCq30SaRuhM6SABsQ9K7PeNeaPeRvWFBS9YgTBIis8XuFIQZe 9r+m8pVufFj36ugN91zqm2Rt60GoRs6GKosk5atsx2VZxRuzH+if9i1tpD9BZERFGNP8T3 tDvZThrsiOX9yCxGDf8dA9iDJSEcvxY= X-MC-Rep: binary re single Received: from mx-prod-mc-08.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-128-u3HTDgF-PCGV86CQgAqlAw-1; Wed, 2 Dec 2026 15:13:14 +0000 X-MC-Unique: u3HTDgF-PCGV86CQgAqlAw-1 X-Mimecast-MFC-AGG-ID: u3HTDgF-PCGV86CQgAqlAw_1796224393 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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 57F311834527; Wed, 2 Dec 2026 15:13:13 +0000 (UTC) Received: from mzamazal-thinkpadp1gen7.redhat.corp (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 899BE3000398; Wed, 2 Dec 2026 15:13:11 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal , Hans de Goede , Robert Mader , Kieran Bingham Subject: [PATCH v4 0/4] softisp tuning script for LSC Date: Wed, 2 Dec 2026 16:13:00 +0100 Message-ID: <20261202151305.132644-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: AY1uaHbxEQnwi3i5YkjgoTkW-jcA6nBXqMsnBqSCk-U_1796224393 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 This adds softisp tuning script. The script is based on rkisp1 tuning script but there are some differences (a different set of algorithms, LSC: gr+gb x g-only, output range). It’s probably not worth to make a common base class for rkisp1 and softisp; I selected the copy & edit approach. Additionally, support for variable, rather than fixed 17x17, LSC table size is added. Changes in v4: - Support for variable LSC table size. Changes in v3: - Wrong output algorithm order fixed. Changes in v2: - Wrong pixel value mapping fixed. - Data for all the softisp algorithms rather than only LSC, added by Hans. Milan Zamazal (4): utils: tuning: Add softisp script libcamera: software_isp: Use specified LSC grid size in debayering ipa: softisp: Support any LSC table sizes utils: tuning: Support variable softisp LSC size .../internal/software_isp/debayer_params.h | 21 +--- .../internal/software_isp/software_isp.h | 2 +- include/libcamera/ipa/softisp.mojom | 3 +- src/ipa/softisp/algorithms/lsc.cpp | 53 +++++++-- src/ipa/softisp/algorithms/lsc.h | 6 +- src/ipa/softisp/ipa_context.h | 1 + src/ipa/softisp/softisp.cpp | 10 +- src/libcamera/software_isp/debayer.cpp | 16 +-- src/libcamera/software_isp/debayer.h | 2 +- src/libcamera/software_isp/debayer_cpu.cpp | 2 +- src/libcamera/software_isp/debayer_cpu.h | 2 +- src/libcamera/software_isp/debayer_egl.cpp | 18 +-- src/libcamera/software_isp/debayer_egl.h | 4 +- src/libcamera/software_isp/software_isp.cpp | 12 +- utils/tuning/config-example.yaml | 5 +- .../tuning/libtuning/modules/lsc/__init__.py | 1 + utils/tuning/libtuning/modules/lsc/softisp.py | 109 ++++++++++++++++++ utils/tuning/softisp.py | 53 +++++++++ 18 files changed, 255 insertions(+), 65 deletions(-) create mode 100644 utils/tuning/libtuning/modules/lsc/softisp.py create mode 100755 utils/tuning/softisp.py