From patchwork Fri Jun 20 12:42:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 23611 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 A6590BDE6B for ; Fri, 20 Jun 2025 12:45:11 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4B8BC68DF8; Fri, 20 Jun 2025 14:45:07 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="HfV76mwc"; dkim-atps=neutral Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D217B68DE9 for ; Fri, 20 Jun 2025 14:44:59 +0200 (CEST) Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4530e6f4db4so721425e9.2 for ; Fri, 20 Jun 2025 05:44:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1750423499; x=1751028299; 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; bh=7EfgoST468pTOcCeNOjVH8kfATETd/PEr3m+VpAYBV0=; b=HfV76mwcaIwsMl9JkkXdZBGkpqDvNwaHlnOEF5d1+jO+gkwRUF0BTg6+G5nUYpad0+ 1kOPp2KAKNCmDC3iUxIckHzWUq779knnvyRxDPO6ownfGIFs7D+j+weDppqmoNyV61lK mLkhOAzII6wI15IYc3LatdWDrFw/yeU8Gnns4zROgPG2HfxeDubZNuyqSz9QOCPmELKR BgOIOUvzEBeiffiEGb+aJhJ3Io1f4VAHgSVt22RXgiJHSi5PZ8gBTJ6t8pwPOuFkcxkG 4dT6zIDr/LFOG6jaSzAS9uuZQM3UyHZNhd5IEV0ZHCSUh8Lv4+VIQNSgqDYKOasU9cCE K2mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750423499; x=1751028299; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7EfgoST468pTOcCeNOjVH8kfATETd/PEr3m+VpAYBV0=; b=ADnguLDiRCGLjorg6cCqWxm8mIQYoSzMxWWBWB76K94l3sfyCqgnAOP65DlzStwlTd UCx1WQcXDMwsaIBajRs+kDGZ5KHbYEimpcf+Qq3Y4J8ostqPyCPXkCRt5A7r0NaxoT/t FoFHhlU1hPq2tPmNZXFea+SI97s1nziRIcZXTaCWRjLWVxrn8qsseIKrXvbRXmYn1AIB kdS+mVhgrhnLetjCG2NBiNImLUPs+hpDxCdVA3sI96xIHSsgDf4pq/NxMQUt02/g8+co lNk0RhsfeHBZ+Amvmm7rgUOtzLoUQSwJmuSAY6l/i3DX4zJDwRToWuJkt1AyWGVPVxnk iMTg== X-Gm-Message-State: AOJu0YwlqrrvjUjiz+dG4qgBJFun727MNkHjk9AkWltsK444PJ+g/VkZ AJDW7/xkrsSfs2wlYiZaTYm2aG6jr2mBFZehvQUTpojRqpMFnucjDUwfv4twTk7Xob5GGPKEGMO 1R4XD X-Gm-Gg: ASbGnctr7/i8DAi18IPP9XRiPE0VSpgQ5kiM6cFMzxEx5nJWWr8E4lREnEmmfnBnWso kIAN3j+LS2IMV40coY0wfC9qZsM/e0qzT1jnyY14TtT9KVoLa5jdmKmrUhlRJVhlSNTB9Ge7R/C v9WvktVRqnS7HVWkQASwdAJZ5xlKubGWIfQwVwhwvUwQXrfGkOnCrSHRO9Ny/KqlaUC/6c4NxRb G+RoknWyoOWJoFjuqDnqtJ3uXqlm2Vo/o3buwGv2pZ6nd6WRtv1Mn7gbiNoHbX3XoIGlxNOPxo9 ZY2ECw1n1HBG4dXVEqxWYivr9SNOzxKTTqCGFTmJ62exmNvJL3vFEi/vYSXmzF+0CNU2WBQyMJq R/4860A== X-Google-Smtp-Source: AGHT+IF9wwYwGwYNbkAajQ1zS+nRolfRzaKEe6S2d2c3N6e7wmajiq4JO2r4PHKFVbnQDaf+tS/5Ig== X-Received: by 2002:a05:600c:c042:b0:451:df07:f41e with SMTP id 5b1f17b1804b1-45367307cd9mr3191595e9.1.1750423499015; Fri, 20 Jun 2025 05:44:59 -0700 (PDT) Received: from NAUSH-P-DELL.pitowers.org ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45361461375sm41561525e9.14.2025.06.20.05.44.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Jun 2025 05:44:58 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Nick Hollinghurst , Naushir Patuck Subject: [PATCH v1 3/8] ipa: rpi: controller: AutoFocus weighting tweak Date: Fri, 20 Jun 2025 13:42:24 +0100 Message-ID: <20250620124452.557855-4-naush@raspberrypi.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250620124452.557855-1-naush@raspberrypi.com> References: <20250620124452.557855-1-naush@raspberrypi.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" From: Nick Hollinghurst In getPhase(), stop using different weights for sumWc and sumWcp. This should improve linearity e.g. in earlyTerminationByPhase(). Phases are slightly larger but confidence values slightly reduced. Signed-off-by: Nick Hollinghurst Signed-off-by: Naushir Patuck Reviewed-by: Naushir Patuck --- src/ipa/rpi/controller/rpi/af.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ipa/rpi/controller/rpi/af.cpp b/src/ipa/rpi/controller/rpi/af.cpp index 8df614ed7b6b..5304f54ca967 100644 --- a/src/ipa/rpi/controller/rpi/af.cpp +++ b/src/ipa/rpi/controller/rpi/af.cpp @@ -328,9 +328,8 @@ bool Af::getPhase(PdafRegions const ®ions, double &phase, double &conf) if (c >= cfg_.confThresh) { if (c > cfg_.confClip) c = cfg_.confClip; - c -= (cfg_.confThresh >> 2); + c -= (cfg_.confThresh >> 1); sumWc += w * c; - c -= (cfg_.confThresh >> 2); sumWcp += (int64_t)(w * c) * (int64_t)data.phase; } }