{"id":12811,"url":"https://patchwork.libcamera.org/api/patches/12811/?format=json","web_url":"https://patchwork.libcamera.org/patch/12811/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210706102918.682536-1-umang.jain@ideasonboard.com>","date":"2021-07-06T10:29:18","name":"[libcamera-devel] camera_sensor: Remove redundant aspect-ratio check","commit_ref":null,"pull_url":null,"state":"not-applicable","archived":false,"hash":"c67fcd1eec10672fcdeaf04df71282bfca36efba","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/?format=json","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"delegate":{"id":12,"url":"https://patchwork.libcamera.org/api/users/12/?format=json","username":"uajain","first_name":"Umang","last_name":"Jain","email":"umang.jain@ideasonboard.com"},"mbox":"https://patchwork.libcamera.org/patch/12811/mbox/","series":[{"id":2211,"url":"https://patchwork.libcamera.org/api/series/2211/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2211","date":"2021-07-06T10:29:18","name":"[libcamera-devel] camera_sensor: Remove redundant aspect-ratio check","version":1,"mbox":"https://patchwork.libcamera.org/series/2211/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/12811/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/12811/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 82C2EBD794\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  6 Jul 2021 10:29:27 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id ED2BD68502;\n\tTue,  6 Jul 2021 12:29:26 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D159F60288\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  6 Jul 2021 12:29:25 +0200 (CEST)","from perceval.ideasonboard.com (unknown [103.251.226.59])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 88982547;\n\tTue,  6 Jul 2021 12:29:24 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"veCC6OLf\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1625567365;\n\tbh=sowo62u9t1INJz5+t8GRpUf37d/26fcZRpBOSvz5+CA=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=veCC6OLfUzkt/ZfSnTo9G6eyYCIOp95vjVNHr8yntu+TZbiTXqVIHPsDanHWvuqSk\n\t8qQkwcAxO+43mAqKBnS5BfVQL7bSlNTlr2llQoz8qc17z5L7iV2z2HEZUg42us2Zct\n\tDPOK9NAq4sYlx6oZFsqINjvedDwvYmPERtH125RE=","From":"Umang Jain <umang.jain@ideasonboard.com>","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","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH] camera_sensor: Remove redundant\n\taspect-ratio check","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"While trying to find the best sensor resolution,\nCameraSensor::getFormat() tracks best aspect-ratio of the sensor-format\nit has seen beforehand, among other things. If a better aspect-ratio is\nfound, the code shall proceed to check other best-fit parameters.\nHowever, the check for aspect-ratio is occuring twice, eliminate one of\nthem.\n\nThis commit does not introduces any functional changes.\n\nSigned-off-by: Umang Jain <umang.jain@ideasonboard.com>\n---\n src/libcamera/camera_sensor.cpp | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)","diff":"diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\nindex cde431cc..1bf42acf 100644\n--- a/src/libcamera/camera_sensor.cpp\n+++ b/src/libcamera/camera_sensor.cpp\n@@ -572,7 +572,7 @@ V4L2SubdeviceFormat CameraSensor::getFormat(const std::vector<unsigned int> &mbu\n \t\t\tif (ratioDiff > bestRatio)\n \t\t\t\tcontinue;\n \n-\t\t\tif (ratioDiff < bestRatio || areaDiff < bestArea) {\n+\t\t\tif (areaDiff < bestArea) {\n \t\t\t\tbestRatio = ratioDiff;\n \t\t\t\tbestArea = areaDiff;\n \t\t\t\tbestSize = &sz;\n","prefixes":["libcamera-devel"]}