diff options
author | Paul Elder <paul.elder@ideasonboard.com> | 2024-06-14 20:37:57 +0900 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2024-06-17 12:18:57 +0300 |
commit | cbfdfa42cacc0c9b83abb604e19febaf505cf24f (patch) | |
tree | 98fbcedd40d82776944e5d62190e2a61d0c727a4 /src/ipa/rkisp1/algorithms/ccm.h | |
parent | f1959b9f313a33600eda575f32bbd06143a0cc45 (diff) |
ipa: rkisp1: algorithms: Add crosstalk algorithm
Add an algorithm module to the rkisp1 IPA for crosstalk correction.
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/ipa/rkisp1/algorithms/ccm.h')
-rw-r--r-- | src/ipa/rkisp1/algorithms/ccm.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/ipa/rkisp1/algorithms/ccm.h b/src/ipa/rkisp1/algorithms/ccm.h new file mode 100644 index 00000000..30cb8821 --- /dev/null +++ b/src/ipa/rkisp1/algorithms/ccm.h @@ -0,0 +1,49 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2024, Ideas On Board + * + * RkISP1 Color Correction Matrix control algorithm + */ + +#pragma once + +#include <linux/rkisp1-config.h> + +#include "libipa/matrix.h" +#include "libipa/matrix_interpolator.h" + +#include "algorithm.h" + +namespace libcamera { + +namespace ipa::rkisp1::algorithms { + +class Ccm : public Algorithm +{ +public: + Ccm() {} + ~Ccm() = default; + + int init(IPAContext &context, const YamlObject &tuningData) override; + 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: + void parseYaml(const YamlObject &tuningData); + void setParameters(rkisp1_params_cfg *params, + const Matrix<float, 3, 3> &matrix, + const Matrix<int16_t, 3, 1> &offsets); + + unsigned int ct_; + MatrixInterpolator<float, 3, 3> ccm_; + MatrixInterpolator<int16_t, 3, 1> offsets_; +}; + +} /* namespace ipa::rkisp1::algorithms */ + +} /* namespace libcamera */ |