From patchwork Thu Feb 25 17:01:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 11381 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 99281BD1F1 for ; Thu, 25 Feb 2021 17:01:50 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 20B7468A56; Thu, 25 Feb 2021 18:01:49 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="DxedQmy4"; dkim-atps=neutral Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 08F7E6040F for ; Thu, 25 Feb 2021 18:01:48 +0100 (CET) Received: by mail-wr1-x42c.google.com with SMTP id 7so5974172wrz.0 for ; Thu, 25 Feb 2021 09:01:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7kFYrabkLQwEOQ8GxfmBl8oPqftFuK/vgroR+kL72fw=; b=DxedQmy4hpEiKNdPSu3iQoHx+X0sXCuCLh9DBxv/PKn4Yj7rrfU2AOKQT8flbPNHgp LYBW6YjIlAhfzbmNBocbgRciXSa7/hS3hY/CaFEpQLV98jbuVxLOQ1+vjM+xOzhfNDyb l7K72Aj0aHC/IrFIeWZyIeRMYOkz/xhDx1AhuIV582Qtq7LDZBQqQLnoqAeQ2rVFExha HNOq72GQbkB29XdpsHVFZnPofZ0mUmQc/NK6KzgQLHvRYpSlH3hL4N8fuEQCy+1+pD0W jET5+t0GisEbwH6J0poG8VNL5/Ua6UAQtQYx7/h2oNpu1QsXIfqeG77eNzdQiHuIBB+0 Lt4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7kFYrabkLQwEOQ8GxfmBl8oPqftFuK/vgroR+kL72fw=; b=GkCHGWXejpFAarlLNig2Tmjm40xAq0gZ1y/xgc646OWx1jS6y/va03Ft7/tOp25ATK L9r+h+c1Q7sf/HU5UOWBaxBmcExDeze+P36gkPgp9rX4sqDpXr14aF3NkbL0Nt7Poy6v d3CAblaqgsaXf7vvLRSSh7QMqc6tREYL7BT1zzIv4+6DwLTLzzcMHLgbYeYYQSgJfYji KxF+GELhbuGmh81QjZTK/2hHWQEGJ3Bgp63R0FEIpDf6zCVL+COPOo+Fzxset1gzp/LV d2vPcT68RWXTQGPuN82g4cRX/4+w0FxlICgOrAodD8ayDanS3WVoVN2+VSRkvZ8e3Rpo 8AsQ== X-Gm-Message-State: AOAM530J6RQz5+g0Ak0ixcEcR3AmVpCtS2LlxlMUIp0+xVdg1Yomp59a 64g2pTOg+sihu8E9k1NcLkYw86E19v3yYLsS X-Google-Smtp-Source: ABdhPJz97Cc5f0kZUnASRMS32NjkEYAvNVTVqHeGtAge4OCcwvLJW6AohsDs+3/dg6Ra9W+FGBKmAA== X-Received: by 2002:adf:a703:: with SMTP id c3mr4363247wrd.379.1614272507482; Thu, 25 Feb 2021 09:01:47 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id e3sm1526337wrt.12.2021.02.25.09.01.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Feb 2021 09:01:46 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Thu, 25 Feb 2021 17:01:40 +0000 Message-Id: <20210225170141.5184-2-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210225170141.5184-1-david.plowman@raspberrypi.com> References: <20210225170141.5184-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/2] ipa: raspberrypi: AWB: Remove unused code 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" Some more code from pre-libcamera versions is removed. There is no functional change. Signed-off-by: David Plowman Reviewed-by: Naushir Patuck Reviewed-by: Kieran Bingham --- src/ipa/raspberrypi/controller/rpi/awb.cpp | 4 +--- src/ipa/raspberrypi/controller/rpi/awb.hpp | 7 +------ 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/ipa/raspberrypi/controller/rpi/awb.cpp b/src/ipa/raspberrypi/controller/rpi/awb.cpp index bb637f10..791a7039 100644 --- a/src/ipa/raspberrypi/controller/rpi/awb.cpp +++ b/src/ipa/raspberrypi/controller/rpi/awb.cpp @@ -21,8 +21,6 @@ LOG_DEFINE_CATEGORY(RPiAwb) #define AWB_STATS_SIZE_X DEFAULT_AWB_REGIONS_X #define AWB_STATS_SIZE_Y DEFAULT_AWB_REGIONS_Y -const double Awb::RGB::INVALID = -1.0; - // todo - the locking in this algorithm needs some tidying up as has been done // elsewhere (ALSC and AGC). @@ -340,7 +338,7 @@ static void generate_stats(std::vector &zones, double min_G) { for (int i = 0; i < AWB_STATS_SIZE_X * AWB_STATS_SIZE_Y; i++) { - Awb::RGB zone; // this is "invalid", unless R gets overwritten later + Awb::RGB zone; double counted = stats[i].counted; if (counted >= min_pixels) { zone.G = stats[i].g_sum / counted; diff --git a/src/ipa/raspberrypi/controller/rpi/awb.hpp b/src/ipa/raspberrypi/controller/rpi/awb.hpp index 45ba9e25..2fe59c37 100644 --- a/src/ipa/raspberrypi/controller/rpi/awb.hpp +++ b/src/ipa/raspberrypi/controller/rpi/awb.hpp @@ -90,21 +90,16 @@ public: void Prepare(Metadata *image_metadata) override; void Process(StatisticsPtr &stats, Metadata *image_metadata) override; struct RGB { - RGB(double _R = INVALID, double _G = INVALID, - double _B = INVALID) + RGB(double _R = -1.0, double _G = -1.0, double _B = -1.0) : R(_R), G(_G), B(_B) { } double R, G, B; - static const double INVALID; - bool Valid() const { return G != INVALID; } - bool Invalid() const { return G == INVALID; } RGB &operator+=(RGB const &other) { R += other.R, G += other.G, B += other.B; return *this; } - RGB Square() const { return RGB(R * R, G * G, B * B); } }; private: