From patchwork Mon Jun 22 13:55:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 4110 Return-Path: Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2D1D1609A7 for ; Mon, 22 Jun 2020 15:56:02 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="C3f6E5ky"; dkim-atps=neutral Received: by mail-wr1-x429.google.com with SMTP id v3so9295489wrc.1 for ; Mon, 22 Jun 2020 06:56:02 -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=C3f6E5kyzGuCh2jEeLZGQZ8s3URPOGdqmUmrUkIUN6+zU6CnHuvwgIqdBHjDNdw6Bj xF0lictHjyS/1ajVmU4JiNh4UW3nbaKrBH1a9figrLuR+41ikHgvyo7U/TsJWi8DVMhj TOoqTK+X3oAeEEwbn1EKyiMJmOVyJ+x8+nutE4sNaAkc+3fKvyOCAigfej8yzJya/k51 441sCSpvQqQmrVWSPcjtVgfbjRwBrJdpIg8k/JqUfG7nWNYwf68Xvz4D9SqpILoBmjo5 Ho83qH5du+t0Z9ofXhemcxZ3bOkoe+ArPVGk477l3kvfkTbVdGhvD9t+YXbi5+UUwIMx eUWw== 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=HZ4gjwXhpbjAqmacGcPsricQ3sKfzYbyMomJ9vBj/JRBhxMXGqydwUUxEwPluLfMCN N/N14xuQU0P1ZqIbWF0KxFhHqQWKGwQmxsiloo166csei3XZOZIGq5pmWRm3U0HVSFoJ lqoLVXov3rO0nHqFQYJSFFErqLTBvptr9TPlXpRciq3m+1Qmz4IgNx+OJMiq3V+7+dBi HBKADPXeJj7W4MpBPFswhRf5MGYlJT870ocSxkfvQBKVoidB+UP7polS9M9LZqtKv4Cc hn9L/tm1efp83j/cUGwupvED55j+M/4WA4unwSMCrdqUzTZ9+ag0Ct5+bCTZnMnPsc1b TkRA== X-Gm-Message-State: AOAM532Ygu88BQHr4UfpuZL2GvsyKXmQ8raGvjm/ivuicauwWvNEUbKM tg88K6vSN+hVo/veUeJQwD+2+DuL/7o= X-Google-Smtp-Source: ABdhPJxIBzk1eV2arJ/9xuLKMRKccUVIgZ9jmT98ImGVBuoSI7I50WycgKGL699A+7thK8jhuOs5Ww== X-Received: by 2002:a05:6000:128c:: with SMTP id f12mr7315068wrx.67.1592834161664; Mon, 22 Jun 2020 06:56:01 -0700 (PDT) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id c201sm12742903wmd.4.2020.06.22.06.56.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 06:56:01 -0700 (PDT) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Mon, 22 Jun 2020 14:55:48 +0100 Message-Id: <20200622135550.10788-3-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200622135550.10788-1-david.plowman@raspberrypi.com> References: <20200622135550.10788-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 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: Mon, 22 Jun 2020 13:56:02 -0000 No need for it to be std::atomic as SwitchMode runs synchronously with Prepare. Signed-off-by: David Plowman Reviewed-by: Laurent Pinchart --- 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