From patchwork Wed Mar 8 16:40:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 18358 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 65159BE080 for ; Wed, 8 Mar 2023 16:40:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3520A626D1; Wed, 8 Mar 2023 17:40:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1678293644; bh=NblqHh0uIJhLvlMbbYFfNgZZBM/UvnmW/AeEoh9EpBQ=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=UxJASbGOO/no5rbvRq9xUTHmVjSQ+GYwgwmbMorHxFFcw5tmyNxr8lM4lhr/6cBaI z/zEyDUcGh9l2r5b52gwAbPlWRjGKlelNFcpRpU1MOiIoVddniG4JZAL+6fx9e8ux+ g79Y0tNVPgamHqg3PnshrIki3i0DNYoFxFxXbiLk6F85nz4pQl6yL49+6zm19tj+ku DjFyRj+cA9VdtNF6l4XK8qNicSOXKJNqIyTN2L8Ec2vJgM20YihPQhZLPZSV3wIG0O bSFx6eTpQl0PylfWYN1ZW3ImrHZG+WMPhEjJ5cFVtvsNc5VR/o/ko9+JSbo3Q2XFSN 4Kq6Wdcl1rrGw== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7D33662693 for ; Wed, 8 Mar 2023 17:40:42 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="jx3en1Wz"; dkim-atps=neutral Received: from uno.homenet.telecomitalia.it (host-79-47-54-87.retail.telecomitalia.it [79.47.54.87]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id BD127576; Wed, 8 Mar 2023 17:40:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1678293642; bh=NblqHh0uIJhLvlMbbYFfNgZZBM/UvnmW/AeEoh9EpBQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jx3en1Wz0ol7yxMyVIXd+9E1OiQyi3VcK09ywR+j7srYvSP86ctbmY3PnuQa45Gpq eqFW+vko5+jfX4gxBu26edsThHgkLp8PQXQjLYcizrppjQkPYJ2VQhhODGJUrWynpm 0cr9hI1eBkXggdapTkm3vkB3o8bmJMhfP51OMMoA= To: libcamera-devel@lists.libcamera.org Date: Wed, 8 Mar 2023 17:40:26 +0100 Message-Id: <20230308164028.235638-2-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230308164028.235638-1-jacopo.mondi@ideasonboard.com> References: <20230308164028.235638-1-jacopo.mondi@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/3] libcamera: control_ids: Introduce LensShadingEnable 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-Patchwork-Original-From: Jacopo Mondi via libcamera-devel From: Jacopo Mondi Reply-To: Jacopo Mondi Cc: Jacopo Mondi Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" From: Jacopo Mondi Introduce a control to enable and disable LSC and replace the draft android control. The control is used to report the algorithm current state when part of a completed Request metadata. Signed-off-by: Jacopo Mondi --- src/android/camera_capabilities.cpp | 4 ++-- src/libcamera/control_ids.yaml | 20 ++++++-------------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp index 1bfeaea4b121..040ad7347773 100644 --- a/src/android/camera_capabilities.cpp +++ b/src/android/camera_capabilities.cpp @@ -1187,10 +1187,10 @@ int CameraCapabilities::initializeStaticMetadata() { std::vector data; data.reserve(2); - const auto &infoMap = controlsInfo.find(&controls::draft::LensShadingMapMode); + const auto &infoMap = controlsInfo.find(&controls::LensShadingEnable); if (infoMap != controlsInfo.end()) { for (const auto &value : infoMap->second.values()) - data.push_back(value.get()); + data.push_back(value.get()); } else { data.push_back(ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_OFF); } diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml index adea5f90acc5..9457fb3de7b0 100644 --- a/src/libcamera/control_ids.yaml +++ b/src/libcamera/control_ids.yaml @@ -694,6 +694,12 @@ controls: Continuous AF is paused. No further state changes or lens movements will occur until the AfPauseResume control is sent. + - LensShadingEnable: + type: bool + description: | + Enable or disable the lens shading algorithm. When reported in the + Request metadata the control reflects the algorithm's current state. + # ---------------------------------------------------------------------------- # Draft controls section @@ -829,20 +835,6 @@ controls: row and the start of exposure of the last row. Currently identical to ANDROID_SENSOR_ROLLING_SHUTTER_SKEW - - LensShadingMapMode: - type: int32_t - draft: true - description: | - Control to report if the lens shading map is available. Currently - identical to ANDROID_STATISTICS_LENS_SHADING_MAP_MODE. - enum: - - name: LensShadingMapModeOff - value: 0 - description: No lens shading map mode is available. - - name: LensShadingMapModeOn - value: 1 - description: The lens shading map mode is available. - - SceneFlicker: type: int32_t draft: true From patchwork Wed Mar 8 16:40:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 18359 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 4DA03C3262 for ; Wed, 8 Mar 2023 16:40:47 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0ACB6626CA; Wed, 8 Mar 2023 17:40:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1678293645; bh=WyvDY9XJa9vonHalzYCuROWq39FoZBj+4EojS9hLbnk=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=EFBsNW4REs3wYOclvu3ajEN041vREV8qkzFIzujzC9YpyBpoz9hq8EogPve+JmkEk GDtWGvLsEBzGfCjk5TWXml9QMJxpHMKw1MA/bZjbrIcaTHL/yW7YzKhM+4yUp3OoZZ KOldvnwJnV73aMYcOr7a0A6sMRLPBU1/qhfmNwWd5e8xROjsbEORLuVJAc0uAOspNI 0LCv3NEcYvnzIhHjZ51KZVkh4c1hh+b5vJUb7d9hdaeeJ2d2n/2AVV/OLQENnINID1 ZG+5YluWOvm0yOMelEzKz+gMqikjwBrt7OKxjcNhIhTTQTsiPaKNpW2TwNRrpFGpIK lbZBlGL2ST+jg== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 11C8F62693 for ; Wed, 8 Mar 2023 17:40:43 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="dQ4wBaqO"; dkim-atps=neutral Received: from uno.homenet.telecomitalia.it (host-79-47-54-87.retail.telecomitalia.it [79.47.54.87]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6C8DF27C; Wed, 8 Mar 2023 17:40:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1678293642; bh=WyvDY9XJa9vonHalzYCuROWq39FoZBj+4EojS9hLbnk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dQ4wBaqOhjBv7VX7WNCeI5byt+eFHViZlpr9tZWRsEjMrT1VK4gxm9JJbuTjS8cVm kfJZhljtvhiWKSTD7Fi5I95C8MZMhSjSXKS6l2B4QD1eBWnFVVYpapPzg31abJmwwx XU5O6jmWQlt20y44jP4CLodWtTEaRs6sPgL6EivM= To: libcamera-devel@lists.libcamera.org Date: Wed, 8 Mar 2023 17:40:27 +0100 Message-Id: <20230308164028.235638-3-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230308164028.235638-1-jacopo.mondi@ideasonboard.com> References: <20230308164028.235638-1-jacopo.mondi@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/3] ipa: rkisp1: lsc: Enable/disable LSC algorithm 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-Patchwork-Original-From: Jacopo Mondi via libcamera-devel From: Jacopo Mondi Reply-To: Jacopo Mondi Cc: Jacopo Mondi Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Implement LSC algorithm enable/disable by parsing the "LensShadingEnable" control in queueRequest(). Start with the LSC algorithm enabled by default and disable it on application request. Signed-off-by: Jacopo Mondi --- src/ipa/rkisp1/algorithms/lsc.cpp | 54 ++++++++++++++++++++++++++++++- src/ipa/rkisp1/algorithms/lsc.h | 4 +++ src/ipa/rkisp1/ipa_context.h | 5 +++ src/ipa/rkisp1/rkisp1.cpp | 1 + 4 files changed, 63 insertions(+), 1 deletion(-) diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp index a7ccedb1ed3b..0c9f6cbd1dec 100644 --- a/src/ipa/rkisp1/algorithms/lsc.cpp +++ b/src/ipa/rkisp1/algorithms/lsc.cpp @@ -14,6 +14,8 @@ #include #include +#include + #include "libcamera/internal/yaml_parser.h" #include "linux/rkisp1-config.h" @@ -147,6 +149,8 @@ int LensShadingCorrection::init([[maybe_unused]] IPAContext &context, return -EINVAL; } + context.configuration.lsc.enabled = false; + return 0; } @@ -181,10 +185,20 @@ int LensShadingCorrection::configure(IPAContext &context, yGrad_[i] = std::round(32768 / ySizes_[i]); } - context.configuration.lsc.enabled = true; + /* Enable LSC on first run unless explicitly disabled by application. */ + context.activeState.lsc.enable = true; + context.activeState.lsc.active = false; + return 0; } +void LensShadingCorrection::disableLSC(rkisp1_params_cfg *params) +{ + params->module_en_update |= RKISP1_CIF_ISP_MODULE_LSC; + params->module_ens &= ~RKISP1_CIF_ISP_MODULE_LSC; + params->module_cfg_update |= RKISP1_CIF_ISP_MODULE_LSC; +} + void LensShadingCorrection::setParameters(rkisp1_params_cfg *params) { struct rkisp1_cif_isp_lsc_config &config = params->others.lsc_config; @@ -242,6 +256,25 @@ void LensShadingCorrection::interpolateTable(rkisp1_cif_isp_lsc_config &config, } } +/** + * \copydoc libcamera::ipa::Algorithm::queueRequest + */ +void LensShadingCorrection::queueRequest(IPAContext &context, + [[maybe_unused]] const uint32_t frame, + [[maybe_unused]] IPAFrameContext &frameContext, + const ControlList &controls) +{ + auto lsc = &context.activeState.lsc; + + const auto lscEnable = controls.get(controls::LensShadingEnable); + if (lscEnable && *lscEnable != lsc->enable) { + LOG(RkISP1Lsc, Debug) + << (*lscEnable ? "Enabling" : "Disabling") << " LSC"; + + lsc->enable = *lscEnable; + } +} + /** * \copydoc libcamera::ipa::Algorithm::prepare */ @@ -250,6 +283,25 @@ void LensShadingCorrection::prepare(IPAContext &context, [[maybe_unused]] IPAFrameContext &frameContext, rkisp1_params_cfg *params) { + auto lsc = &context.activeState.lsc; + + if (lsc->enable != lsc->active) { + /* If LSC has to be disabled, disable it and return here. */ + if (!lsc->enable) { + disableLSC(params); + lsc->active = false; + context.configuration.lsc.enabled = false; + return; + } + + lsc->active = true; + context.configuration.lsc.enabled = true; + } + + /* Nothing more to do here if LSC is not active. */ + if (!lsc->active) + return; + struct rkisp1_cif_isp_lsc_config &config = params->others.lsc_config; /* diff --git a/src/ipa/rkisp1/algorithms/lsc.h b/src/ipa/rkisp1/algorithms/lsc.h index e2a93a566973..4708065bcfb7 100644 --- a/src/ipa/rkisp1/algorithms/lsc.h +++ b/src/ipa/rkisp1/algorithms/lsc.h @@ -23,6 +23,9 @@ public: int init(IPAContext &context, const YamlObject &tuningData) override; int configure(IPAContext &context, const IPACameraSensorInfo &configInfo) override; + void queueRequest(IPAContext &context, const uint32_t frame, + IPAFrameContext &frameContext, + const ControlList &controls) override; void prepare(IPAContext &context, const uint32_t frame, IPAFrameContext &frameContext, rkisp1_params_cfg *params) override; @@ -36,6 +39,7 @@ private: std::vector b; }; + void disableLSC(rkisp1_params_cfg *params); void setParameters(rkisp1_params_cfg *params); void copyTable(rkisp1_cif_isp_lsc_config &config, const Components &set0); void interpolateTable(rkisp1_cif_isp_lsc_config &config, diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h index b9b2065328d6..ada995274ebf 100644 --- a/src/ipa/rkisp1/ipa_context.h +++ b/src/ipa/rkisp1/ipa_context.h @@ -98,6 +98,11 @@ struct IPAActiveState { uint8_t denoise; uint8_t sharpness; } filter; + + struct { + bool enable; + bool active; + } lsc; }; struct IPAFrameContext : public FrameContext { diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index 6544c925ba25..2772592eda66 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -106,6 +106,7 @@ const ControlInfoMap::Map rkisp1Controls{ { &controls::Saturation, ControlInfo(0.0f, 1.993f, 1.0f) }, { &controls::Sharpness, ControlInfo(0.0f, 10.0f, 1.0f) }, { &controls::draft::NoiseReductionMode, ControlInfo(controls::draft::NoiseReductionModeValues) }, + { &controls::LensShadingEnable, ControlInfo(false, true) }, }; } /* namespace */ From patchwork Wed Mar 8 16:40:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 18360 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 5A350C329C for ; Wed, 8 Mar 2023 16:40:48 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D69C562693; Wed, 8 Mar 2023 17:40:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1678293647; bh=iBNi0u69uVdRJlDumXUWDZNqrpAbl5ib8tzqFa8t/3c=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=Di+tsk6QhM2C3cYARog6rXTwL8sB6NKCFAw9UJnYQSFXGXonzw90bZBxYcFwI8TsR jNObwvN0RyKMAk9kvJ4Jw6amqITSPcjeN026dgjVKJXDzXRX+kYkZwkujO47lQ2gC0 m86mObnKWBdfwBAogh47tEQmRHN1QCeZb4q2VBm8dcLaf92Tl8tTS7mTvgjFY0Hp3/ n/8Gv9dMtlYjurjSQaVSs2/LH3rlWN6UXM+3M/HKLB4wvoHtjTVyl48OGqLop0y99U AQlFD7Ekqeld9vi/IqEH4jAVo8uWIqn3lUbQRaIBm1dQe8oEcfKqDT/J9r5toLckUW E3l7CYyakT8kQ== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C08E7626CD for ; Wed, 8 Mar 2023 17:40:43 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Frpb+AkS"; dkim-atps=neutral Received: from uno.homenet.telecomitalia.it (host-79-47-54-87.retail.telecomitalia.it [79.47.54.87]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 1178F576; Wed, 8 Mar 2023 17:40:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1678293643; bh=iBNi0u69uVdRJlDumXUWDZNqrpAbl5ib8tzqFa8t/3c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Frpb+AkSkXWRhNzWzCvTiYfcDMr2HXyIKMxH96+qhy5ncb2xPZUwZoSBsEoLZLKa8 6dBd8fo5skxJ7oZa292LOSnGyRKEz2ZdIfxaBeAyKtl2AvClWrag+OlF9hQQxh3YwE Dlz4GWT4QkU7fspHLNL3nbEZQ1V+F+fkox9wn2hs= To: libcamera-devel@lists.libcamera.org Date: Wed, 8 Mar 2023 17:40:28 +0100 Message-Id: <20230308164028.235638-4-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230308164028.235638-1-jacopo.mondi@ideasonboard.com> References: <20230308164028.235638-1-jacopo.mondi@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 3/3] ipa: rkisp1: lsc: Move 'enable' to activeState 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-Patchwork-Original-From: Jacopo Mondi via libcamera-devel From: Jacopo Mondi Reply-To: Jacopo Mondi Cc: Jacopo Mondi Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Now that the LSC algorithm can be enabled and disabled at run-time, move the 'enabled' flag from the context's configuration to the algorithm's active state. This allows to populate the LensShadingEnable metadata in the process() function implementation. Signed-off-by: Jacopo Mondi --- src/ipa/rkisp1/algorithms/dpf.cpp | 6 +++--- src/ipa/rkisp1/algorithms/lsc.cpp | 13 +++++++++---- src/ipa/rkisp1/algorithms/lsc.h | 4 ++++ src/ipa/rkisp1/ipa_context.h | 4 ---- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/ipa/rkisp1/algorithms/dpf.cpp b/src/ipa/rkisp1/algorithms/dpf.cpp index 5bd7e59f651c..8f181df5c6c4 100644 --- a/src/ipa/rkisp1/algorithms/dpf.cpp +++ b/src/ipa/rkisp1/algorithms/dpf.cpp @@ -222,7 +222,7 @@ void Dpf::prepare(IPAContext &context, const uint32_t frame, params->others.dpf_strength_config = strengthConfig_; const auto &awb = context.configuration.awb; - const auto &lsc = context.configuration.lsc; + const auto &lsc = context.activeState.lsc; auto &mode = params->others.dpf_config.gain.mode; /* @@ -233,11 +233,11 @@ void Dpf::prepare(IPAContext &context, const uint32_t frame, * LSC modules automatically when they are enabled. Use that * mode of operation as it simplifies control of the DPF. */ - if (awb.enabled && lsc.enabled) + if (awb.enabled && lsc.active) mode = RKISP1_CIF_ISP_DPF_GAIN_USAGE_AWB_LSC_GAINS; else if (awb.enabled) mode = RKISP1_CIF_ISP_DPF_GAIN_USAGE_AWB_GAINS; - else if (lsc.enabled) + else if (lsc.active) mode = RKISP1_CIF_ISP_DPF_GAIN_USAGE_LSC_GAINS; else mode = RKISP1_CIF_ISP_DPF_GAIN_USAGE_DISABLED; diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp index 0c9f6cbd1dec..8de49e4220ea 100644 --- a/src/ipa/rkisp1/algorithms/lsc.cpp +++ b/src/ipa/rkisp1/algorithms/lsc.cpp @@ -149,8 +149,6 @@ int LensShadingCorrection::init([[maybe_unused]] IPAContext &context, return -EINVAL; } - context.configuration.lsc.enabled = false; - return 0; } @@ -290,12 +288,10 @@ void LensShadingCorrection::prepare(IPAContext &context, if (!lsc->enable) { disableLSC(params); lsc->active = false; - context.configuration.lsc.enabled = false; return; } lsc->active = true; - context.configuration.lsc.enabled = true; } /* Nothing more to do here if LSC is not active. */ @@ -387,6 +383,15 @@ void LensShadingCorrection::prepare(IPAContext &context, lastCt_ = { ct, ct }; } +void LensShadingCorrection::process(IPAContext &context, + [[maybe_unused]] const uint32_t frame, + [[maybe_unused]] IPAFrameContext &frameContext, + [[maybe_unused]] const rkisp1_stat_buffer *stats, + ControlList &metadata) +{ + metadata.set(controls::LensShadingEnable, context.activeState.lsc.active); +} + REGISTER_IPA_ALGORITHM(LensShadingCorrection, "LensShadingCorrection") } /* namespace ipa::rkisp1::algorithms */ diff --git a/src/ipa/rkisp1/algorithms/lsc.h b/src/ipa/rkisp1/algorithms/lsc.h index 4708065bcfb7..e9770f4027f4 100644 --- a/src/ipa/rkisp1/algorithms/lsc.h +++ b/src/ipa/rkisp1/algorithms/lsc.h @@ -29,6 +29,10 @@ public: void prepare(IPAContext &context, const uint32_t frame, IPAFrameContext &frameContext, rkisp1_params_cfg *params) override; + void process(IPAContext &context, const uint32_t frame, + IPAFrameContext &frameContext, + const rkisp1_stat_buffer *stats, + ControlList &metadata) override; private: struct Components { diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h index ada995274ebf..bb72f0a40a12 100644 --- a/src/ipa/rkisp1/ipa_context.h +++ b/src/ipa/rkisp1/ipa_context.h @@ -30,10 +30,6 @@ struct IPASessionConfiguration { bool enabled; } awb; - struct { - bool enabled; - } lsc; - struct { utils::Duration minShutterSpeed; utils::Duration maxShutterSpeed;