From patchwork Thu Sep 10 17:21:18 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D. Manresa" X-Patchwork-Id: 28225 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 50A31BDCBE for ; Thu, 10 Sep 2026 17:21:10 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A9BA968661; Thu, 10 Sep 2026 19:21:08 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="QyUwHTlL"; dkim-atps=neutral Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5897A68615 for ; Thu, 10 Sep 2026 19:21:07 +0200 (CEST) Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-4843e9c5960so6927280f8f.0 for ; Thu, 10 Sep 2026 10:21:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789060867; x=1789665667; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=sjw8A8P6+85gZp8JqvUZc0OXLd8JZdKvpEepufXNIcM=; b=QyUwHTlL91zrGDQeJiNO27UXAtf3m4Kzskdxqj1uM8JA44QRO50RgVJi84Pfa+71Sh OfNZ30uMfkoSYY+3XONw04BY8kZomUvibnOV9TcUclPwdlTpyWQg7Ig/V7ipN3GGFV2M J2VJyxXKozxC7O3DAKndDcCPdCPY5Mbiek4Cs9xG3K1vlRoi45VZJxBOj/8GOSSYLSat PkGFV1XXj0L9iZXLMHnjnv5OHudc0gnTYqwGUumE0gtYxEpVLHWWyZcurDOFy4nffb7Q PCN2xg0lbbP9nUJQ41C2Lc99wzG4fbOH2ThdkkeWHF7HFmd8QyqO/JQfPLy3jW2JZFtN rmAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789060867; x=1789665667; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=sjw8A8P6+85gZp8JqvUZc0OXLd8JZdKvpEepufXNIcM=; b=Lq5VavaZGu34Wtm0R1WXwrjwBUSgMZO0E+C/yaG1xFigI6WNSomZHtr4lnTISNeBgI r5rZd3euzVE+q//umqO6Du2reqM/jAuXOb0aJwO6wY2FN7X3m/S26iKzPORFMKJDveDw ae22IuP9CAjx5Ryfc2IC//+3wl2Jxp7iTktc9rJr5qXLz1Ao06q9AodKnt+1adLFM2NB H3Q3vn2qpJqMeuh5gh3posZpa4jCnSsgWG0hK1E7RHAZGdD9THxNbGfUrgFQtKXAig3W XUwev/bGv4HkeC+v6pn7E8XUJepoqm0DIpStjRzdLIEPdahIfKsQ5e3EcewuTT7kkmqZ a7Vg== X-Gm-Message-State: AFuF++nLF0+wTtsqA/TLYekCXuGkkT+Oz+dYkcVyme+mw6X4BnnS8WER 1YU8MAg+tJdVy6CHVs68Foruqoo2nQ8COasl8rgSKRooNmhlD4S0tx8OaGlOT5w= X-Gm-Gg: AYBFou0rALVH0JPPpjQwsgheB5I+TPCcgB62wWZQ5BwU84LAT5SG+WTm36OyPyjPPUe RUPfws4Q3aEorOGadHLqfUxdkdP7f+cj/SAsrVjSqCWeWCbcj0yKmSPI7iPe7q3c507bEOVEiMX hRvSzIbkSfgJO4Miphfvcb4IXhUtLIrscfOlrpo0HgYHZCbd1Lh/4BEVAXR0adjO0TXh3VBTuyt joscuVAakCEDV5FomrA4asdsUhjHNf4tq/3pim4/h8tzS0CbjR03+SJ/kY7H6LhAKs+GLaKXWfl J1i/2Nontw0xjqAeqgQ57uWOiKhe3CZQBi7smB6mcGRD5l/EI629CKTk4mU9hSjSldx/rhY9NOW tKxMkcNY2dVOQsW/uX/ouXX3J+0vZcLeh/T8HZwKF1WFEyUPSCIspLza0fhwxFaaovVfzlsPYju MuHwAepkMYh0eJmx6qjHQ+4VHj456HkZ8Og/dtiPcXJH1SUwP5fmC6dKbKF4iGZI0GcfD7y+WUu Zxe1aJ5cHnou2ZnuQ0MVqSI4nLSAcNx1/1D68cmowrcJbl5Y+xb73dkcioDfHg6Im7fYuc= X-Received: by 2002:a05:6000:41d7:b0:485:8c16:5efd with SMTP id ffacd0b85a97d-4858c16611emr37348880f8f.55.1789060866473; Thu, 10 Sep 2026 10:21:06 -0700 (PDT) Received: from latitude7275 (84.124.213.91.dyn.user.ono.com. [84.124.213.91]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-485883c5bc5sm55236940f8f.24.2026.09.10.10.21.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2026 10:21:05 -0700 (PDT) From: "D. Manresa" To: libcamera-devel@lists.libcamera.org Cc: Daniel Scally Subject: [PATCH v3 0/2] ipa: ipu3: Take the OV5670 black level from the sensor helper Date: Thu, 10 Sep 2026 19:21:18 +0200 Message-ID: <20260910172120.73148-1-dmanresa@gmail.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260908163708.341308-1-dmanresa@gmail.com> References: <20260908163708.341308-1-dmanresa@gmail.com> MIME-Version: 1.0 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 black level of the OV5670 belongs in the camera sensor helper rather than in the tuning data, so: - add the OV5670 black level (64 at 10 bits) to camera_sensor_helper.cpp; - make the IPU3 BLC algorithm read it from the helper, converting the 16-bit value to the ImgU OB grid units (half a 10-bit LSB), and keep the old hard-coded 64 with a warning for sensors without a helper value. Measured on a Latitude 7275: with 64 the darkest percentile of Y is 32 with a U/V of 132/131 (a residual, colour-shifted pedestal); with 128 it is 15 with U/V 128/128. Changes in v3 (thanks Dan): - Use uint16_t for the default black level and for the member. - Move the explanation of the >> 5 conversion from the copydoc block into a comment next to the shift itself, and mention the OV5693 experiment that corroborates it. Changes in v2: - Rework as helper + algorithm change instead of a tuning parameter. D. Manresa (2): ipa: libipa: camera_sensor_helper: Add OV5670 black level ipa: ipu3: blc: Use the black level from the camera sensor helper src/ipa/ipu3/algorithms/blc.cpp | 60 +++++++++++++++++++++---- src/ipa/ipu3/algorithms/blc.h | 5 +++ src/ipa/libipa/camera_sensor_helper.cpp | 2 + 3 files changed, 58 insertions(+), 9 deletions(-)