From 14c869c00fdd79a93d06b506546051716a2f4623 Mon Sep 17 00:00:00 2001 From: Florian Sylvestre Date: Mon, 3 Oct 2022 16:23:57 +0200 Subject: ipa: rkisp1: Take into account color temperature during LSC algorithm Add coefficients sets in the YAML tuning file to allow using different set depending of the image color temperature (provided by AWB algorithm). During processing, LSC algorithm computes coefficients by doing a linear interpolation between the two closer set. Signed-off-by: Florian Sylvestre Signed-off-by: Paul Elder Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- src/ipa/rkisp1/algorithms/lsc.h | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'src/ipa/rkisp1/algorithms/lsc.h') diff --git a/src/ipa/rkisp1/algorithms/lsc.h b/src/ipa/rkisp1/algorithms/lsc.h index da81ea53..e2a93a56 100644 --- a/src/ipa/rkisp1/algorithms/lsc.h +++ b/src/ipa/rkisp1/algorithms/lsc.h @@ -7,6 +7,8 @@ #pragma once +#include + #include "algorithm.h" namespace libcamera { @@ -26,17 +28,31 @@ public: rkisp1_params_cfg *params) override; private: - std::vector rData_; - std::vector grData_; - std::vector gbData_; - std::vector bData_; - + struct Components { + uint32_t ct; + std::vector r; + std::vector gr; + std::vector gb; + std::vector b; + }; + + 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, + const Components &set0, const Components &set1, + const uint32_t ct); + + std::map sets_; std::vector xSize_; std::vector ySize_; uint16_t xGrad_[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE]; uint16_t yGrad_[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE]; uint16_t xSizes_[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE]; uint16_t ySizes_[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE]; + struct { + uint32_t original; + uint32_t adjusted; + } lastCt_; }; } /* namespace ipa::rkisp1::algorithms */ -- cgit v1.2.1