summaryrefslogtreecommitdiff
path: root/src/ipa/rkisp1/algorithms/agc.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ipa/rkisp1/algorithms/agc.h')
-rw-r--r--src/ipa/rkisp1/algorithms/agc.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/ipa/rkisp1/algorithms/agc.h b/src/ipa/rkisp1/algorithms/agc.h
new file mode 100644
index 00000000..07b9ea37
--- /dev/null
+++ b/src/ipa/rkisp1/algorithms/agc.h
@@ -0,0 +1,46 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ * Copyright (C) 2021, Ideas On Board
+ *
+ * agc.h - RkISP1 AGC/AEC mean-based control algorithm
+ */
+
+#pragma once
+
+#include <linux/rkisp1-config.h>
+
+#include <libcamera/base/utils.h>
+
+#include <libcamera/geometry.h>
+
+#include "algorithm.h"
+
+namespace libcamera {
+
+struct IPACameraSensorInfo;
+
+namespace ipa::rkisp1::algorithms {
+
+class Agc : public Algorithm
+{
+public:
+ Agc();
+ ~Agc() = default;
+
+ int configure(IPAContext &context, const IPACameraSensorInfo &configInfo) override;
+ void process(IPAContext &context, const rkisp1_stat_buffer *stats) override;
+
+private:
+ void computeExposure(IPAContext &Context, double yGain);
+ utils::Duration filterExposure(utils::Duration exposureValue);
+ double estimateLuminance(const rkisp1_cif_isp_ae_stat *ae, double gain);
+
+ uint64_t frameCount_;
+
+ uint32_t numCells_;
+
+ utils::Duration filteredExposure_;
+};
+
+} /* namespace ipa::rkisp1::algorithms */
+} /* namespace libcamera */