{"id":26521,"url":"https://patchwork.libcamera.org/api/1.1/covers/26521/?format=json","web_url":"https://patchwork.libcamera.org/cover/26521/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20260420183949.110548-1-mzamazal@redhat.com>","date":"2026-04-20T18:39:38","name":"[RFC,v2,0/8] LSC for SoftISP simple pipeline","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/1.1/people/177/?format=json","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"mbox":"https://patchwork.libcamera.org/cover/26521/mbox/","series":[{"id":5883,"url":"https://patchwork.libcamera.org/api/1.1/series/5883/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5883","date":"2026-04-20T18:39:38","name":"LSC for SoftISP simple pipeline","version":2,"mbox":"https://patchwork.libcamera.org/series/5883/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/26521/comments/","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 7877BBDCBD\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 20 Apr 2026 18:40:03 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8808762EE2;\n\tMon, 20 Apr 2026 20:40:02 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DE90162EB2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 20 Apr 2026 20:39:59 +0200 (CEST)","from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com\n\t(ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63])\n\tby relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n\tcipher=TLS_AES_256_GCM_SHA384) id us-mta-688-_W2utBFiNUavfWNV5c7L9Q-1;\n\tMon, 20 Apr 2026 14:39:55 -0400","from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com\n\t(mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com\n\t[10.30.177.93])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\tkey-exchange X25519 server-signature RSA-PSS (2048 bits)\n\tserver-digest SHA256) (No client certificate requested)\n\tby mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTPS id 34FED195609F; Mon, 20 Apr 2026 18:39:54 +0000 (UTC)","from mzamazal-thinkpadp1gen7.tpbc.com (unknown [10.44.48.16])\n\tby mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTP id D890A180047F; Mon, 20 Apr 2026 18:39:52 +0000 (UTC)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"BkFWF1FK\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1776710398;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tcontent-transfer-encoding:content-transfer-encoding;\n\tbh=00rVL3RFNx2+oTiCN9hLw8Uy1WPbCk9/52FiQ0d96h4=;\n\tb=BkFWF1FKGpC5LP80RD7DtGUQ0wG34FTfaaHlRdjrJwn8lS+qAKVQWlRXSHbaM/y87+0R+t\n\tYPdA8PiHXRVxcPU8UecQsOn8DrC52tuoRqwi0FMGty/wsn1mC/4hSWpuD/txlVWkJSkdZz\n\t/izgdHanmp/pehZSPqeB5Ot//bRHEZo=","X-MC-Unique":"_W2utBFiNUavfWNV5c7L9Q-1","X-Mimecast-MFC-AGG-ID":"_W2utBFiNUavfWNV5c7L9Q_1776710394","From":"Milan Zamazal <mzamazal@redhat.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Milan Zamazal <mzamazal@redhat.com>,\n\tHans de Goede <johannes.goede@oss.qualcomm.com>","Subject":"[RFC PATCH v2 0/8] LSC for SoftISP simple pipeline","Date":"Mon, 20 Apr 2026 20:39:38 +0200","Message-ID":"<20260420183949.110548-1-mzamazal@redhat.com>","MIME-Version":"1.0","X-Scanned-By":"MIMEDefang 3.4.1 on 10.30.177.93","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"kLhgzYUzWNFYHbPw5B22W9Lcud8Q29TUKeYzCdFVmQo_1776710394","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Hi everyone,\n\nOver the last few months we (students from THUAS) have been working on adding LSC support to\nthe SoftISP simple pipline. These patches are the result of those\nefforts. The project was under the supervision of Hans de Goede.\n\nThere are patches to both the GpuISP and some scrips for generating the\ncorrections tables.\n\nThe changes to the GpuISP are integrated as an algorithm, including\nautomatically choosing a correction table based on the measured colour\ntemperature.\n\nThe current version of the LSC textures make use of the type GLubyte instead of float. This is because we could not get floating points values to play nice with the shader. The result is that the LSC factors ranging from 1.0 to 4.0 are maped to 0 to 255.\n\nThe last patch (HACK: Add test LSC to src/ipa/simple/data/uncalibrated.yaml) adds sample data to uncalibrated.yaml file for testing, and is a reference of how the tables should (currently) be structured.\n\nRegards,\nXander Pronk,\nRick ten Wolde,\nDerek Gielen,\nAron Dosti.\n\nv2 by Milan Zamazal:\n\n- Remaining issues from the reviews (hopefully) addressed.\n- Especially there is only a single texture now and LSC is fully\n  conditional.\n- Major cleanup, hacks removed or replaced, typo fixes, cosmetic\n  changes, making linters happy, etc.\n- See\n  https://lists.libcamera.org/pipermail/libcamera-devel/2026-January/056883.html\n  for an example how to add the grid data.\n\nIt’s posted as RFC because:\n\n- It’s not yet completely tested although it seems to be working in my\n  environment.\n- The GPU ISP is going to be changed to multipass soon, which may\n  require significant changes in this patch series.\n\nDerek Gielen (1):\n  utils/tuning: Add LSC scripts\n\nMilan Zamazal (2):\n  ipa: simple: Introduce default temperature value\n  libcamera: software_isp: Pass LSC availability to debayering\n\nXander Pronk (5):\n  libcamera: software_isp: egl: Add gl_scale_param to createTexture2D()\n  libcamera: software_isp: Add LSC data to DebayerParams\n  ipa: simple: Add LSC algorithm\n  libcamera: shaders: Add LSC support\n  libcamera: software_isp: debayer_egl: Add LSC support\n\n include/libcamera/internal/egl.h              |   3 +-\n .../internal/software_isp/debayer_params.h    |   5 +\n .../internal/software_isp/software_isp.h      |   1 +\n include/libcamera/ipa/soft.mojom              |   4 +-\n src/ipa/simple/algorithms/awb.cpp             |   4 +-\n src/ipa/simple/algorithms/awb.h               |   4 +-\n src/ipa/simple/algorithms/ccm.cpp             |   5 +-\n src/ipa/simple/algorithms/lsc.cpp             |  65 ++++++++++\n src/ipa/simple/algorithms/lsc.h               |  41 ++++++\n src/ipa/simple/algorithms/meson.build         |   1 +\n src/ipa/simple/ipa_context.h                  |   3 +-\n src/ipa/simple/soft_simple.cpp                |   7 +-\n src/libcamera/egl.cpp                         |   8 +-\n src/libcamera/shaders/bayer_1x_packed.frag    |   8 ++\n src/libcamera/shaders/bayer_unpacked.frag     |   8 ++\n src/libcamera/software_isp/debayer.cpp        |  19 +++\n src/libcamera/software_isp/debayer.h          |   3 +-\n src/libcamera/software_isp/debayer_cpu.cpp    |   3 +-\n src/libcamera/software_isp/debayer_cpu.h      |   3 +-\n src/libcamera/software_isp/debayer_egl.cpp    |  31 ++++-\n src/libcamera/software_isp/debayer_egl.h      |   9 +-\n src/libcamera/software_isp/software_isp.cpp   |   5 +-\n utils/tuning/exportTuningToLscShader.py       | 120 ++++++++++++++++++\n utils/tuning/generate_lsc_map_plot.py         |  76 +++++++++++\n 24 files changed, 415 insertions(+), 21 deletions(-)\n create mode 100644 src/ipa/simple/algorithms/lsc.cpp\n create mode 100644 src/ipa/simple/algorithms/lsc.h\n create mode 100644 utils/tuning/exportTuningToLscShader.py\n create mode 100644 utils/tuning/generate_lsc_map_plot.py"}