From patchwork Tue Jun 23 09:14:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 4141 Return-Path: Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id BC9BC609C2 for ; Tue, 23 Jun 2020 11:14:11 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="r2F+CVGE"; dkim-atps=neutral Received: by mail-wm1-x329.google.com with SMTP id g21so2419828wmg.0 for ; Tue, 23 Jun 2020 02:14:11 -0700 (PDT) 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=blzNJOKYHnrUW4DxPt8nCOhq186OUDTiJdxCE82eKU0=; b=r2F+CVGER/Q1cGEK1WHJ9F9Rt6lCFe55VJFaMe43Aq9kXVNXubgzKEI5f3wQjvwt40 8WXheColgZPPIpvZ+x9TOKIka8cmU8Z1xXykTJmhuASVpR2ICeF/w+KT3XnPk2TFTSzM 3ziF47812vQUxrnYIQ165tGpin13gh1+W1jQ+PbLjAGXN530ZAxwFygDza89mNKOwzPl 7sklbm2VmzEJDW+4/vQ3poF/1368mxCOt4tamFX5R+tDrUO23ZTda0d4GCxF2GQbCT4D 95TULs93ngre2i55rQYxhMI3mRbOs+2eSy71d08LJx/7jjwu7optv4+wprnvMFnZsRMn 9WsQ== 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=blzNJOKYHnrUW4DxPt8nCOhq186OUDTiJdxCE82eKU0=; b=I5eElgL4HW2FSFNgFyiEjPYLrbzGnZhS++uHeC1DFxZRFLrAJaR0b70hWXT/U/yMl5 fXsUkxqIu4+KfPA2m16CDuQ05F0vAt77FoRAJNx0kiV+61JXFSKpuDCx5uKsZk5fT3qv EfCKoS4POVbW2gM35c+PF6ffU5ge0jZnPuR5LzBQ1jIa7s28RbfW1l4sTWbQ0gKEIQbT 22dFK+UKFJpWAHWlKMKGLy9MRhm6ZT27/y0AGuuX/oqGyQNrxtVp1dbB29x13Iduh6EU CyJD3iPmcqwjZUPjcTv15oWo30j6nBpgAHYwE/3UYbOV277bPtG9Z3CMpj0bIT8Glt9m TD5A== X-Gm-Message-State: AOAM530c3BRy4omzsja7r4J7VDBZvFc5rNN0Ba9TN7NeVhPLvIYHhtZr l7pERcq0Qcb7DkY/LuGK5P9MWJhKKks= X-Google-Smtp-Source: ABdhPJz1bWZIBj+jvYKOtRSYQDfkZBlt43bCSgbr0cf8kyAJ5NA8cLpRM/FAi/UStBG+i+y7RtTy9w== X-Received: by 2002:a1c:3c1:: with SMTP id 184mr22244921wmd.40.1592903650869; Tue, 23 Jun 2020 02:14:10 -0700 (PDT) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id t125sm2931616wmf.10.2020.06.23.02.14.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jun 2020 02:14:10 -0700 (PDT) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Tue, 23 Jun 2020 10:14:02 +0100 Message-Id: <20200623091404.15155-3-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200623091404.15155-1-david.plowman@raspberrypi.com> References: <20200623091404.15155-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 2/4] libcamera: ipa: raspberrypi: Make sharpening mode_factor an ordinary double 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: , X-List-Received-Date: Tue, 23 Jun 2020 09:14:13 -0000 No need for it to be std::atomic as SwitchMode runs synchronously with Prepare. Signed-off-by: David Plowman --- src/ipa/raspberrypi/controller/rpi/sharpen.cpp | 7 +++---- src/ipa/raspberrypi/controller/rpi/sharpen.hpp | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ipa/raspberrypi/controller/rpi/sharpen.cpp b/src/ipa/raspberrypi/controller/rpi/sharpen.cpp index 086952f..4c2fdb3 100644 --- a/src/ipa/raspberrypi/controller/rpi/sharpen.cpp +++ b/src/ipa/raspberrypi/controller/rpi/sharpen.cpp @@ -44,13 +44,12 @@ void Sharpen::Read(boost::property_tree::ptree const ¶ms) void Sharpen::Prepare(Metadata *image_metadata) { - double mode_factor = mode_factor_; struct SharpenStatus status; // Binned modes seem to need the sharpening toned down with this // pipeline. - status.threshold = threshold_ * mode_factor; - status.strength = strength_ / mode_factor; - status.limit = limit_ / mode_factor; + status.threshold = threshold_ * mode_factor_; + status.strength = strength_ / mode_factor_; + status.limit = limit_ / mode_factor_; image_metadata->Set("sharpen.status", status); } diff --git a/src/ipa/raspberrypi/controller/rpi/sharpen.hpp b/src/ipa/raspberrypi/controller/rpi/sharpen.hpp index f871aa6..a3bf899 100644 --- a/src/ipa/raspberrypi/controller/rpi/sharpen.hpp +++ b/src/ipa/raspberrypi/controller/rpi/sharpen.hpp @@ -26,7 +26,7 @@ private: double threshold_; double strength_; double limit_; - std::atomic mode_factor_; + double mode_factor_; }; } // namespace RPi