From patchwork Tue Jul 6 10:29:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 12811 X-Patchwork-Delegate: umang.jain@ideasonboard.com 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 82C2EBD794 for ; Tue, 6 Jul 2021 10:29:27 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id ED2BD68502; Tue, 6 Jul 2021 12:29:26 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="veCC6OLf"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D159F60288 for ; Tue, 6 Jul 2021 12:29:25 +0200 (CEST) Received: from perceval.ideasonboard.com (unknown [103.251.226.59]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 88982547; Tue, 6 Jul 2021 12:29:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1625567365; bh=sowo62u9t1INJz5+t8GRpUf37d/26fcZRpBOSvz5+CA=; h=From:To:Cc:Subject:Date:From; b=veCC6OLfUzkt/ZfSnTo9G6eyYCIOp95vjVNHr8yntu+TZbiTXqVIHPsDanHWvuqSk 8qQkwcAxO+43mAqKBnS5BfVQL7bSlNTlr2llQoz8qc17z5L7iV2z2HEZUg42us2Zct DPOK9NAq4sYlx6oZFsqINjvedDwvYmPERtH125RE= From: Umang Jain To: libcamera-devel@lists.libcamera.org Date: Tue, 6 Jul 2021 15:59:18 +0530 Message-Id: <20210706102918.682536-1-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] camera_sensor: Remove redundant aspect-ratio check 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" While trying to find the best sensor resolution, CameraSensor::getFormat() tracks best aspect-ratio of the sensor-format it has seen beforehand, among other things. If a better aspect-ratio is found, the code shall proceed to check other best-fit parameters. However, the check for aspect-ratio is occuring twice, eliminate one of them. This commit does not introduces any functional changes. Signed-off-by: Umang Jain --- src/libcamera/camera_sensor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp index cde431cc..1bf42acf 100644 --- a/src/libcamera/camera_sensor.cpp +++ b/src/libcamera/camera_sensor.cpp @@ -572,7 +572,7 @@ V4L2SubdeviceFormat CameraSensor::getFormat(const std::vector &mbu if (ratioDiff > bestRatio) continue; - if (ratioDiff < bestRatio || areaDiff < bestArea) { + if (areaDiff < bestArea) { bestRatio = ratioDiff; bestArea = areaDiff; bestSize = &sz;