From patchwork Wed Feb 11 13:17:26 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 26130 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 D735BBDE6B for ; Wed, 11 Feb 2026 13:17:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id ECBE7621AB; Wed, 11 Feb 2026 14:17:45 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="dqIQlFNQ"; 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 59CB3620C9 for ; Wed, 11 Feb 2026 14:17:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770815863; 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=yEpTn/ox09RbEypypfNEs4L8Bf1Gb4n69pLptMJ8IJg=; b=dqIQlFNQQqYMaFPlcomI2vSn1MTfEsYUJAWxEomAcdisFFHwskM4j9Q1MYpL9K6MGAERAf xbooVAknXiflnH70MBUMqOs/LIpnHjsu0ni4ZNcCdYXcKzJ1YcRvcXgq1mkvGSeyW2nj/i IMdELiVqTTWNOtK9TeUnvGuZ9pjregA= 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-589-SRLWCMWePTicnR1yMkD2RQ-1; Wed, 11 Feb 2026 08:17:39 -0500 X-MC-Unique: SRLWCMWePTicnR1yMkD2RQ-1 X-Mimecast-MFC-AGG-ID: SRLWCMWePTicnR1yMkD2RQ_1770815858 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 8C71C1956056; Wed, 11 Feb 2026 13:17:38 +0000 (UTC) Received: from mzamazal-thinkpadp1gen7.tpbc.com (unknown [10.45.226.74]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 825B019560A3; Wed, 11 Feb 2026 13:17:36 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal , Kieran Bingham , Bryan O'Donoghue Subject: [PATCH 0/2] Fix black level handling in GPU ISP Date: Wed, 11 Feb 2026 14:17:26 +0100 Message-ID: <20260211131728.96413-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: N7jXeIccf4lPKnmQuhtu3aEX6wGlhHmrjrFg007naL0_1770815858 X-Mimecast-Originator: redhat.com content-type: text/plain; charset="US-ASCII"; x-default=true 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" There is an omission when applying black level in GPU ISP: the black level is subtracted but the resulting pixel values are not spread back to the whole 0..1 range. This prevents reaching maximum brightness with non-zero black level and can also lead to pinkish bright areas or other colour shifts. Milan Zamazal (2): ipa: simple: Limit the black level value libcamera: software_isp: Fix black level application in GPU ISP src/ipa/simple/algorithms/blc.cpp | 7 ++++--- src/libcamera/shaders/bayer_1x_packed.frag | 2 +- src/libcamera/shaders/bayer_unpacked.frag | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-)