From patchwork Fri Jan 22 13:14:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 10961 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 8EC04BD808 for ; Fri, 22 Jan 2021 13:15:00 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5A72768276; Fri, 22 Jan 2021 14:15:00 +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="P3CtaZAv"; dkim-atps=neutral Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E20BB68275 for ; Fri, 22 Jan 2021 14:14:58 +0100 (CET) Received: by mail-wr1-x433.google.com with SMTP id g10so5061408wrx.1 for ; Fri, 22 Jan 2021 05:14:58 -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=r60/x9D2wFvPc1qF59Lv1Xv7mQ0M3HtfAuQgufi2E88=; b=P3CtaZAvfwSD845bTsKBkduICCizP4uMck2N2wevyYJOoKvaxPzjG6XELU3cZfals4 HQOO8K7CZevZRg563Bk3nlhZMasZjzM/NZ1hakwjnjzag8JTKjepQKaXkYYn3RkagFhh a4lCEHUwSRjilU6KDIdXvOEyu9zbKEObEqcvLyWe8DpUj5pb9WJAHmLROrOgx0YvL49r vB1vQWAYYP26FL1B5WTdj/00q6q50EXPdll87IwFGdBODl4b5pBn6/MOjM3ekpYi0WZX xFQJspeBatd4tVzzQAu57IBrYUewpAkTOfgJyArDILvy8ah5u1RtVss8sKQT8sPgfsmR 2MGA== 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=r60/x9D2wFvPc1qF59Lv1Xv7mQ0M3HtfAuQgufi2E88=; b=NW46IgKsB84I1a305RbgdgNu5Wb72L7X8iGLFKm1F+8paoxSCQWQCLiPoBjcGWuu4f aQ18AqPxLdqLXEaL0HMjD61WIqybECe8X9EoCQRppS1Md+dNjVARiN/T2T6QXw0VuBpG L+/LD6kCfUZ62nMdSnmnqQl+VtH/Sr7cJHAzVSvAhqnCUcQxEJS07etbKkSZTiuYEDMG dLUuvBC6fiQEaWvqGx27TwSQGIcrwbOzm5ONHYQKdGTSNbWre6FH4E9Wl3N7w4KhBIaU BFKgDUNgpv65g2GL375rnD5pB4/lBjaeAjgXFL+YfKl2gBo+X16/QhlbBYYvsLiOY7tn +yPQ== X-Gm-Message-State: AOAM531Py8NFM6H+2YX98GQpxeNB0JJuaFORMQ1H49oKt3nsXdL7IDH8 p8wgQaAztMkXCWbd2rsd/8DOKFJE1bnXWA== X-Google-Smtp-Source: ABdhPJzh0ZZFfS0lJbUGaCVAzD0vqaJI8X8vQGvv+TQ+NJ8yaRUyPKbsKEDcF947h10JMp+yx4ZUvg== X-Received: by 2002:a5d:44c6:: with SMTP id z6mr4509391wrr.306.1611321298416; Fri, 22 Jan 2021 05:14:58 -0800 (PST) Received: from naushir-VirtualBox.patuck.local ([88.97.76.4]) by smtp.gmail.com with ESMTPSA id i8sm7228870wry.90.2021.01.22.05.14.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Jan 2021 05:14:57 -0800 (PST) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Fri, 22 Jan 2021 13:14:49 +0000 Message-Id: <20210122131451.726584-4-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210122131451.726584-1-naush@raspberrypi.com> References: <20210122131451.726584-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 4/6] ipa: raspberrypi: Rename SdnStatus to DenoiseStatus 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" This change is in anticipation of the addition of a DenoiseAlgorithm base class which the SDN class will derive from. We want to match the metadata object name with the base class algorithm name. This renames: - SdnStatus metadata object to DenoiseStatus - "sdn.status" metadata string key to "denoise.status" - sdn_status.h header file to denoise_status.h Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Kieran Bingham --- .../controller/{sdn_status.h => denoise_status.h} | 6 +++--- src/ipa/raspberrypi/controller/rpi/sdn.cpp | 6 +++--- src/ipa/raspberrypi/raspberrypi.cpp | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) rename src/ipa/raspberrypi/controller/{sdn_status.h => denoise_status.h} (65%) diff --git a/src/ipa/raspberrypi/controller/sdn_status.h b/src/ipa/raspberrypi/controller/denoise_status.h similarity index 65% rename from src/ipa/raspberrypi/controller/sdn_status.h rename to src/ipa/raspberrypi/controller/denoise_status.h index 871e0b62af1f..06d7cfb91ae8 100644 --- a/src/ipa/raspberrypi/controller/sdn_status.h +++ b/src/ipa/raspberrypi/controller/denoise_status.h @@ -1,8 +1,8 @@ /* SPDX-License-Identifier: BSD-2-Clause */ /* - * Copyright (C) 2019, Raspberry Pi (Trading) Limited + * Copyright (C) 2019-2021, Raspberry Pi (Trading) Limited * - * sdn_status.h - SDN (spatial denoise) control algorithm status + * denoise_status.h - Spatial Denoise control algorithm status */ #pragma once @@ -12,7 +12,7 @@ extern "C" { #endif -struct SdnStatus { +struct DenoiseStatus { double noise_constant; double noise_slope; double strength; diff --git a/src/ipa/raspberrypi/controller/rpi/sdn.cpp b/src/ipa/raspberrypi/controller/rpi/sdn.cpp index aa82830b02b4..d8c1521a6633 100644 --- a/src/ipa/raspberrypi/controller/rpi/sdn.cpp +++ b/src/ipa/raspberrypi/controller/rpi/sdn.cpp @@ -5,8 +5,8 @@ * sdn.cpp - SDN (spatial denoise) control algorithm */ +#include "../denoise_status.h" #include "../noise_status.h" -#include "../sdn_status.h" #include "sdn.hpp" @@ -44,11 +44,11 @@ void Sdn::Prepare(Metadata *image_metadata) RPI_LOG("Noise profile: constant " << noise_status.noise_constant << " slope " << noise_status.noise_slope); - struct SdnStatus status; + struct DenoiseStatus status; status.noise_constant = noise_status.noise_constant * deviation_; status.noise_slope = noise_status.noise_slope * deviation_; status.strength = strength_; - image_metadata->Set("sdn.status", status); + image_metadata->Set("denoise.status", status); RPI_LOG("Sdn: programmed constant " << status.noise_constant << " slope " << status.noise_slope << " strength " diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index 5ccc7a6551f5..220cf174aa4f 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -43,13 +43,13 @@ #include "contrast_algorithm.hpp" #include "contrast_status.h" #include "controller.hpp" +#include "denoise_status.h" #include "dpc_status.h" #include "focus_status.h" #include "geq_status.h" #include "lux_status.h" #include "metadata.hpp" #include "noise_status.h" -#include "sdn_status.h" #include "sharpen_algorithm.hpp" #include "sharpen_status.h" @@ -109,7 +109,7 @@ private: void applyBlackLevel(const struct BlackLevelStatus *blackLevelStatus, ControlList &ctrls); void applyGamma(const struct ContrastStatus *contrastStatus, ControlList &ctrls); void applyGEQ(const struct GeqStatus *geqStatus, ControlList &ctrls); - void applyDenoise(const struct SdnStatus *denoiseStatus, ControlList &ctrls); + void applyDenoise(const struct DenoiseStatus *denoiseStatus, ControlList &ctrls); void applySharpen(const struct SharpenStatus *sharpenStatus, ControlList &ctrls); void applyDPC(const struct DpcStatus *dpcStatus, ControlList &ctrls); void applyLS(const struct AlscStatus *lsStatus, ControlList &ctrls); @@ -899,7 +899,7 @@ void IPARPi::prepareISP(unsigned int bufferId) if (geqStatus) applyGEQ(geqStatus, ctrls); - SdnStatus *denoiseStatus = rpiMetadata_.GetLocked("sdn.status"); + DenoiseStatus *denoiseStatus = rpiMetadata_.GetLocked("denoise.status"); if (denoiseStatus) applyDenoise(denoiseStatus, ctrls); @@ -1083,7 +1083,7 @@ void IPARPi::applyGEQ(const struct GeqStatus *geqStatus, ControlList &ctrls) ctrls.set(V4L2_CID_USER_BCM2835_ISP_GEQ, c); } -void IPARPi::applyDenoise(const struct SdnStatus *denoiseStatus, ControlList &ctrls) +void IPARPi::applyDenoise(const struct DenoiseStatus *denoiseStatus, ControlList &ctrls) { bcm2835_isp_denoise denoise;