summaryrefslogtreecommitdiff
path: root/src/ipa
diff options
context:
space:
mode:
authorMilan Zamazal <mzamazal@redhat.com>2025-03-26 10:08:46 +0100
committerKieran Bingham <kieran.bingham@ideasonboard.com>2025-03-26 10:45:01 +0000
commitac3068655643a8b2e9a5d002ad6fab104832e1c0 (patch)
tree5a868b04918937a6fb0cb88a58a4dd57af83b44a /src/ipa
parent0c53fe5f2f8a57fb026351cb72e50a635b200fb5 (diff)
libcamera: software_isp: Track whether CCM is enabled
Applying color correction matrix (CCM) in software ISP is optional due to performance reasons. CCM is applied if and only if `Ccm' algorithm is present in the tuning file. Software ISP debayering is a performance critical piece of code and we do not want to use dynamic conditionals there. Therefore we pass information about CCM application to debayering configuration and let it select the right versions of debayering functions using templates. This is a trick similar to the previously used one for adding or not adding an alpha channel to the output. Debayering gets this information but it ignores it in this patch. Actual processing with CCM is added in the followup patch. Signed-off-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/ipa')
-rw-r--r--src/ipa/simple/algorithms/ccm.cpp2
-rw-r--r--src/ipa/simple/ipa_context.h1
-rw-r--r--src/ipa/simple/soft_simple.cpp8
3 files changed, 9 insertions, 2 deletions
diff --git a/src/ipa/simple/algorithms/ccm.cpp b/src/ipa/simple/algorithms/ccm.cpp
index 86e0395c..d5ba928d 100644
--- a/src/ipa/simple/algorithms/ccm.cpp
+++ b/src/ipa/simple/algorithms/ccm.cpp
@@ -34,6 +34,8 @@ int Ccm::init([[maybe_unused]] IPAContext &context, const YamlObject &tuningData
return ret;
}
+ context.ccmEnabled = true;
+
return 0;
}
diff --git a/src/ipa/simple/ipa_context.h b/src/ipa/simple/ipa_context.h
index 67183b3e..17bcd4ca 100644
--- a/src/ipa/simple/ipa_context.h
+++ b/src/ipa/simple/ipa_context.h
@@ -82,6 +82,7 @@ struct IPAContext {
IPAActiveState activeState;
FCQueue<IPAFrameContext> frameContexts;
ControlInfoMap::Map ctrlMap;
+ bool ccmEnabled;
};
} /* namespace ipa::soft */
diff --git a/src/ipa/simple/soft_simple.cpp b/src/ipa/simple/soft_simple.cpp
index b26e4e15..a87c6cdd 100644
--- a/src/ipa/simple/soft_simple.cpp
+++ b/src/ipa/simple/soft_simple.cpp
@@ -51,7 +51,8 @@ public:
const SharedFD &fdStats,
const SharedFD &fdParams,
const ControlInfoMap &sensorInfoMap,
- ControlInfoMap *ipaControls) override;
+ ControlInfoMap *ipaControls,
+ bool *ccmEnabled) override;
int configure(const IPAConfigInfo &configInfo) override;
int start() override;
@@ -89,7 +90,8 @@ int IPASoftSimple::init(const IPASettings &settings,
const SharedFD &fdStats,
const SharedFD &fdParams,
const ControlInfoMap &sensorInfoMap,
- ControlInfoMap *ipaControls)
+ ControlInfoMap *ipaControls,
+ bool *ccmEnabled)
{
camHelper_ = CameraSensorHelperFactoryBase::create(settings.sensorModel);
if (!camHelper_) {
@@ -125,6 +127,8 @@ int IPASoftSimple::init(const IPASettings &settings,
if (ret)
return ret;
+ *ccmEnabled = context_.ccmEnabled;
+
params_ = nullptr;
stats_ = nullptr;