From patchwork Wed Sep 9 07:01:44 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D. Manresa" X-Patchwork-Id: 28211 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 D0E8DC3272 for ; Wed, 9 Sep 2026 07:01:48 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A4E7C68639; Wed, 9 Sep 2026 09:01:47 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qK10NZpJ"; dkim-atps=neutral Received: from mail-wm2-x10.google.com (mail-wm2-x10.google.com [IPv6:2a00:1450:4864:31::10]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 320FA68493 for ; Wed, 9 Sep 2026 09:01:46 +0200 (CEST) Received: by mail-wm2-x10.google.com with SMTP id 5b1f17b1804b1-49b912d37b6so3264015e9.0 for ; Wed, 09 Sep 2026 00:01:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1788937305; x=1789542105; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=rZHCvtBsgekX1CETadwbbMkibe0bf5s7IslqPASV7Cc=; b=qK10NZpJ797GzEkvoNxNDTPHuOD+ivVwf+Lrky6TtlvIAQ1pBgYZIyKgE4wHcC9BwS JUcyIMPpLE4AUARmr1JrfWkmzK+0V9HH+i4k/cVu1b2qwoaVdFXLDMZmVFQqjiMkgIzJ 8EXgVSnbnQJoD/Sp1ZuUz+8LL1AdY8poNoUNPj9BYAUhsT3SGQA8BTFDVnfZFOfIFWjC N0USRH57qlg+32E3iP3UuRWN859PmV67kCxOyz3ejDBo+2mnlVPyTq+DEztvfAOwabVR fUd/UbT4RYUNQq6ojpm2ZuxUzJ8Kp4cGsxdg/IFiOQuY03umVvJM4IoGBvo4FbaF2rjW OvGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788937305; x=1789542105; h=content-transfer-encoding:mime-version: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=rZHCvtBsgekX1CETadwbbMkibe0bf5s7IslqPASV7Cc=; b=fwGYtc/Zh5lrnZYP2V1lKfEqvDQKivnTMUbU5HQXx1riuuc2anPWBG8qkzBtY4Ou+2 BrcjCeafNwVdZ4gY6sb4Z7AMKwmN3WDva7C5sxpIbbY3TzIG9A+oDRxQ5/j48KQNZfBJ LuIq12jXDaxiGHM2UtI6D4947Mhl4r6O4g43jpXoWnvr7ZWm09x0HG5EmB7dRjumKFKE nUdbV0QoeZXcgwq85DW/7dC88ZaR5UXcNmlBql9p9+cmzFpVbTzjUnzl+7BJG20/CUh8 JpIFtZVVh9bAPSHhA506rniFSY/0DZho/Ih2+YQ9NLSyQhJu9rMIuB1i1Dp1jpEwe/WI TnIw== X-Gm-Message-State: AFuF++nNX4FsXS4zNGvKvFyYBQ4qEPPTMtefMg/ZFgwcPudIavky7+aq IvyghipHFxEy3YD1wowIZ+OHlVFA/xu/u1X0k7a/UN3alG4rA2Uh/ZCNmlEgDbQJkw== X-Gm-Gg: AYBFou3j3qr4B300ZviiKM40gHuf6piUkSId9/NBlu9kjxlWd+CUnABAK01S2gDgdbP eGwPQJYbzw6IA91P3RLosggtulu7IeqBWCUyAVjhY+mKHmUAbqNBC8h7ABTcsyj07ROtVTexdN6 2oG3IkGFMudv9iK+aUQgd+U9PMeL0vYAGRICu/I1Pi9n6aLmxYIKweMwHfJEvCQ77XIZ60Y/IX3 aykOnITINpHsJHhuy9FhOOy7fNJlS1qEq0IHgaC40prhiZ+yDZU/5kLnrhOPz6q5BhjCx3ALzjP UG7gRuuJB+fbqTtn5OI6YZzlpiQ+uQjcwQPJL+yxQ9sTbHjzyaDBgfiaVLF+YFfSTZlZrjTfQlP QQHI7U8XirOZ1qcwH9nVP4N/3QmvtEDgEsN91erHK9eg99ErC2ytoKUYhyw0kG3ZZHMmQUaleq/ Pz3gJdpWvaKE7GkJNVToHPtaOJWay45mY3678wG+iLP1B9fNP4yNjJZeCKlixk+zQ2pxu5A/2Up sfkEXBzTD0w3GQ/JxKACd37nPFk3P5naRY0NFZ413xSGmXs67IFSeyYABjwWs4UX7J+hA== X-Received: by 2002:a05:600c:604a:b0:49d:1012:893a with SMTP id 5b1f17b1804b1-49d1f320b72mr52702435e9.7.1788937305072; Wed, 09 Sep 2026 00:01:45 -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-48594172546sm33523472f8f.15.2026.09.09.00.01.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2026 00:01:40 -0700 (PDT) From: "D. Manresa" To: libcamera-devel@lists.libcamera.org Cc: Daniel Scally Subject: [PATCH 0/2] ipa: ipu3: Add Saturation and Sharpness algorithms Date: Wed, 9 Sep 2026 09:01:44 +0200 Message-ID: <20260909070146.18825-1-dmanresa@gmail.com> X-Mailer: git-send-email 2.55.0 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" These two algorithms expose the two ImgU blocks that currently run with the driver defaults and cannot be changed from libcamera: the Total Color Correction chroma gain (as controls::Saturation) and the IEFD sharpening (as controls::Sharpness). Both program the block with the ImgU driver defaults and scale them, so enabling them with the default value of 1.0 does not change the output; 0.0 gives greyscale / no sharpening. The series is based on Dan's "[PATCH v3 00/10] libipa: Re-work IPU3 IPA to use libipa algorithms" (patchwork series 6162), which introduces the IPAContext::ctrlMap the algorithms use to register their controls. It was built with werror=false because v3 still uses libcamera::Span on top of current master. A note on the Y_EE_NR block: dumping the binary headers of the ImgU firmware (irci_irci_ecr-master_20161208_0213_20170112_1500, and the 2015 css_fw.bin shipped with Dell's Windows driver) shows that no binary enables the yuvp1_b0 accelerator, while all of them enable yuvp1_c0 (IEFD) and yuvp2 (TCC). This is why programming Y_EE_NR has no visible effect and why the sharpening is done through IEFD here. Tested on a Dell Latitude 7275 (IPU3, OV5670), numbers in the commit messages. D. Manresa (2): ipa: ipu3: Add a Saturation algorithm ipa: ipu3: Add a Sharpness algorithm src/ipa/ipu3/algorithms/meson.build | 2 + src/ipa/ipu3/algorithms/saturation.cpp | 199 +++++++++++++++++++++++ src/ipa/ipu3/algorithms/saturation.h | 43 +++++ src/ipa/ipu3/algorithms/sharpness.cpp | 208 +++++++++++++++++++++++++ src/ipa/ipu3/algorithms/sharpness.h | 43 +++++ src/ipa/ipu3/data/uncalibrated.yaml | 2 + src/ipa/ipu3/ipa_context.h | 18 +++ 7 files changed, 515 insertions(+) create mode 100644 src/ipa/ipu3/algorithms/saturation.cpp create mode 100644 src/ipa/ipu3/algorithms/saturation.h create mode 100644 src/ipa/ipu3/algorithms/sharpness.cpp create mode 100644 src/ipa/ipu3/algorithms/sharpness.h