[{"id":24084,"web_url":"https://patchwork.libcamera.org/comment/24084/","msgid":"<Yt24khlZ1/OYhg7I@pendragon.ideasonboard.com>","date":"2022-07-24T21:24:34","subject":"Re: [libcamera-devel] [PATCH v2 3/5] ipa: rkisp1: Add support of\n\tLens Shading Correction control","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Florian,\n\nThank you for the patch.\n\nOn Fri, Jul 22, 2022 at 05:16:33PM +0200, Florian Sylvestre via libcamera-devel wrote:\n> The Lens Shading Correction algorithm applies a correction on the pixels based\n> on values defined in the YAML tuning file.\n\nLet's make that a but more descriptive:\n\nThe Lens Shading Correction algorithm applies multipliers to all pixels\nto compensate for the lens shading effect. The coefficients are\nspecified in a downscaled table in the YAML tuning file.\n\n> Signed-off-by: Florian Sylvestre <fsylvestre@baylibre.com>\n> ---\n>  src/ipa/rkisp1/algorithms/lsc.cpp     | 170 ++++++++++++++++++++++++++\n>  src/ipa/rkisp1/algorithms/lsc.h       |  38 ++++++\n>  src/ipa/rkisp1/algorithms/meson.build |   1 +\n>  src/ipa/rkisp1/data/ov5640.yaml       |  79 ++++++++++++\n>  src/ipa/rkisp1/ipa_context.h          |   1 +\n>  src/ipa/rkisp1/rkisp1.cpp             |   2 +\n>  6 files changed, 291 insertions(+)\n>  create mode 100644 src/ipa/rkisp1/algorithms/lsc.cpp\n>  create mode 100644 src/ipa/rkisp1/algorithms/lsc.h\n> \n> diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp\n> new file mode 100644\n> index 00000000..8a53bc74\n> --- /dev/null\n> +++ b/src/ipa/rkisp1/algorithms/lsc.cpp\n> @@ -0,0 +1,170 @@\n> +/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> +/*\n> + * Copyright (C) 2021-2022, Ideas On Board\n> + *\n> + * lsc.cpp - RkISP1 Lens Shading Correction control\n> + */\n> +\n> +#include \"lsc.h\"\n> +\n> +#include <math.h>\n\n#include <cmath>\n\nas the math functions in std:: use C++ overloads to automatically adjust\nto the argument type, which is less error-prone. You'll need to use\nstd::round() below instead of round().\n\n> +\n> +#include <libcamera/base/log.h>\n> +\n> +#include \"libcamera/internal/yaml_parser.h\"\n> +\n> +#include \"linux/rkisp1-config.h\"\n> +\n> +/**\n> + * \\file lsc.h\n> + */\n> +\n> +namespace libcamera {\n> +\n> +namespace ipa::rkisp1::algorithms {\n> +\n> +/**\n> + * \\class LensShadingCorrection\n> + * \\brief RkISP1 Lens Shading Correction control\n> + *\n> + * Due to the optical characteristics of the lens, the light intensity received\n> + * by the sensor is not uniform.\n> + *\n> + * The Lens Shading Correction algorithm applies a correction on the pixels for\n> + * each component based on measurement done during the camera tuning process.\n> + */\n> +\n> +LOG_DEFINE_CATEGORY(RkISP1Lsc)\n> +\n> +LensShadingCorrection::LensShadingCorrection()\n> +\t: initialized_(false)\n> +{\n> +}\n> +\n> +/**\n> + * \\copydoc libcamera::ipa::Algorithm::init\n> + */\n> +int LensShadingCorrection::init([[maybe_unused]] IPAContext &context,\n> +\t\t\t\tconst YamlObject &tuningData)\n> +{\n> +\txSize_ = tuningData[\"x-size\"].getList<double>();\n> +\tif (xSize_.size() != RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE) {\n> +\t\tLOG(RkISP1Lsc, Error)\n> +\t\t\t<< \"Issue while parsing 'x-size'\"\n> +\t\t\t<< \"in tuning file (list size:\"\n> +\t\t\t<< xSize_.size() << \"/\"\n> +\t\t\t<< RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE << \")\";\n\nTo match patch 2/5,\n\n\t\t\t<< \"Invalid 'x-size' values: expected \"\n\t\t\t<< RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE\n\t\t\t<< \" elements, got \" << xSize_.size();\n\nSame below.\n\n> +\t\treturn -EINVAL;\n> +\t}\n> +\n> +\tySize_ = tuningData[\"y-size\"].getList<double>();\n> +\tif (ySize_.size() != RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE) {\n> +\t\tLOG(RkISP1Lsc, Error)\n> +\t\t\t<< \"Issue while parsing 'y-size'\"\n> +\t\t\t<< \"in tuning file (list size:\"\n> +\t\t\t<< ySize_.size() << \"/\"\n> +\t\t\t<< RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE << \")\";\n> +\t\treturn -EINVAL;\n> +\t}\n> +\n\n\tstatic constexpr kLscNumSamples = RKISP1_CIF_ISP_LSC_SAMPLES_MAX\n\t\t\t\t\t* RKISP1_CIF_ISP_LSC_SAMPLES_MAX;\n\nwould allow reducing the size of quite a few lines below.\n\n> +\trData_ = tuningData[\"r\"].getList<uint16_t>();\n> +\tif (rData_.size() != RKISP1_CIF_ISP_LSC_SAMPLES_MAX * RKISP1_CIF_ISP_LSC_SAMPLES_MAX) {\n> +\t\tLOG(RkISP1Lsc, Error)\n> +\t\t\t<< \"Issue while parsing 'r'\"\n> +\t\t\t<< \"in tuning file (list size:\"\n> +\t\t\t<< rData_.size() << \"/\"\n> +\t\t\t<< RKISP1_CIF_ISP_LSC_SAMPLES_MAX * RKISP1_CIF_ISP_LSC_SAMPLES_MAX << \")\";\n> +\t\treturn -EINVAL;\n> +\t}\n> +\n> +\tgrData_ = tuningData[\"gr\"].getList<uint16_t>();\n> +\tif (grData_.size() != RKISP1_CIF_ISP_LSC_SAMPLES_MAX * RKISP1_CIF_ISP_LSC_SAMPLES_MAX) {\n> +\t\tLOG(RkISP1Lsc, Error)\n> +\t\t\t<< \"Issue while parsing 'gr'\"\n> +\t\t\t<< \"in tuning file (list size:\"\n> +\t\t\t<< grData_.size() << \"/\"\n> +\t\t\t<< RKISP1_CIF_ISP_LSC_SAMPLES_MAX * RKISP1_CIF_ISP_LSC_SAMPLES_MAX << \")\";\n> +\t\treturn -EINVAL;\n> +\t}\n> +\n> +\tgbData_ = tuningData[\"gb\"].getList<uint16_t>();\n> +\tif (gbData_.size() != RKISP1_CIF_ISP_LSC_SAMPLES_MAX * RKISP1_CIF_ISP_LSC_SAMPLES_MAX) {\n> +\t\tLOG(RkISP1Lsc, Error)\n> +\t\t\t<< \"Issue while parsing 'gb'\"\n> +\t\t\t<< \"in tuning file (list size:\"\n> +\t\t\t<< gbData_.size() << \"/\"\n> +\t\t\t<< RKISP1_CIF_ISP_LSC_SAMPLES_MAX * RKISP1_CIF_ISP_LSC_SAMPLES_MAX << \")\";\n> +\t\treturn -EINVAL;\n> +\t}\n> +\n> +\tbData_ = tuningData[\"b\"].getList<uint16_t>();\n> +\tif (bData_.size() != RKISP1_CIF_ISP_LSC_SAMPLES_MAX * RKISP1_CIF_ISP_LSC_SAMPLES_MAX) {\n> +\t\tLOG(RkISP1Lsc, Error)\n> +\t\t\t<< \"Issue while parsing 'b'\"\n> +\t\t\t<< \"in tuning file (list size:\"\n> +\t\t\t<< bData_.size() << \"/\"\n> +\t\t\t<< RKISP1_CIF_ISP_LSC_SAMPLES_MAX * RKISP1_CIF_ISP_LSC_SAMPLES_MAX << \")\";\n> +\t\treturn -EINVAL;\n> +\t}\n> +\n> +\tinitialized_ = true;\n> +\n> +\treturn 0;\n> +}\n> +\n> +/**\n> + * \\copydoc libcamera::ipa::Algorithm::prepare\n> + */\n> +void LensShadingCorrection::prepare(IPAContext &context,\n> +\t\t\t\t    rkisp1_params_cfg *params)\n> +{\n> +\tif (context.frameContext.frameCount > 0)\n> +\t\treturn;\n> +\n> +\tif (!initialized_)\n> +\t\treturn;\n> +\n> +\tSize total_size{};\n\ns/total_size/totalSize/\n\n> +\n> +\tfor (unsigned int i = 0; i < RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE; ++i) {\n> +\t\tstruct rkisp1_cif_isp_lsc_config &config = params->others.lsc_config;\n> +\t\tSize &size = context.configuration.sensor.size;\n\nconst\n\nThe two variables should be moved outside of the loop as they don't\ndepend on i.\n\n> +\n> +\t\tconfig.x_size_tbl[i] = xSize_[i] * size.width;\n> +\t\tconfig.y_size_tbl[i] = ySize_[i] * size.height;\n> +\t\ttotal_size.width += config.x_size_tbl[i];\n> +\t\ttotal_size.height += config.y_size_tbl[i];\n> +\n> +\t\t/*\n> +\t\t * To prevent unexpected behavior of the ISP, the sum of x_size_tbl and\n> +\t\t * y_size_tbl items shall be equal to respectively size.width/2 and\n> +\t\t * size.height/2. Enforce it by computing the last tables value.\n\nI'd mention that this is done to avoid rouding-related errors (see\nbelow).\n\n> +\t\t */\n> +\t\tif (i == RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE - 1) {\n> +\t\t\tconfig.x_size_tbl[i] += total_size.width - size.width / 2;\n> +\t\t\tconfig.y_size_tbl[i] += total_size.height - size.height / 2;\n> +\t\t}\n\nInstead of adjusting the value, you could also simply compute it.\n\n\t\tconfig.x_size_tbl[i] = xSize_[i] * size.width;\n\t\tconfig.y_size_tbl[i] = ySize_[i] * size.height;\n\n\t\t/*\n\t\t * To prevent unexpected behavior of the ISP, the sum of x_size_tbl and\n\t\t * y_size_tbl items shall be equal to respectively size.width/2 and\n\t\t * size.height/2. Enforce it by computing the last tables value to avoid\n\t\t * rounding-indiced errors.\n\t\t */\n\t\tif (i == RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE - 1) {\n\t\t\tconfig.x_size_tbl[i] = size.width / 2 - total_size.width;\n\t\t\tconfig.y_size_tbl[i] = size.height / 2 - total_size.height;\n\t\t}\n\n\t\ttotal_size.width += config.x_size_tbl[i];\n\t\ttotal_size.height += config.y_size_tbl[i];\n\nwhich would allow you to add, after the loop, a\n\n\tASSERT(size == total_size);\n\n> +\n> +\t\tconfig.x_grad_tbl[i] = round(32768 / config.x_size_tbl[i]);\n> +\t\tconfig.y_grad_tbl[i] = round(32768 / config.y_size_tbl[i]);\n> +\t}\n\nThis should probably be done in configure() later when we'll implement\nadaptive lens shading correction support, as the sizes and gradients\nwon't change per frame, but that's for latter.\n\n> +\n> +\tstd::copy(rData_.begin(), rData_.end(),\n> +\t\t  &params->others.lsc_config.r_data_tbl[0][0]);\n> +\tstd::copy(grData_.begin(), grData_.end(),\n> +\t\t  &params->others.lsc_config.gr_data_tbl[0][0]);\n> +\tstd::copy(gbData_.begin(), gbData_.end(),\n> +\t\t  &params->others.lsc_config.gb_data_tbl[0][0]);\n> +\tstd::copy(bData_.begin(), bData_.end(),\n> +\t\t  &params->others.lsc_config.b_data_tbl[0][0]);\n> +\n> +\tparams->module_en_update |= RKISP1_CIF_ISP_MODULE_LSC;\n> +\tparams->module_ens |= RKISP1_CIF_ISP_MODULE_LSC;\n> +\tparams->module_cfg_update |= RKISP1_CIF_ISP_MODULE_LSC;\n> +}\n> +\n> +REGISTER_IPA_ALGORITHM(LensShadingCorrection, \"LensShadingCorrection\")\n> +\n> +} /* namespace ipa::rkisp1::algorithms */\n> +\n> +} /* namespace libcamera */\n> diff --git a/src/ipa/rkisp1/algorithms/lsc.h b/src/ipa/rkisp1/algorithms/lsc.h\n> new file mode 100644\n> index 00000000..fdb2ec1d\n> --- /dev/null\n> +++ b/src/ipa/rkisp1/algorithms/lsc.h\n> @@ -0,0 +1,38 @@\n> +/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> +/*\n> + * Copyright (C) 2021-2022, Ideas On Board\n> + *\n> + * lsc.h - RkISP1 Lens Shading Correction control\n> + */\n> +\n> +#pragma once\n> +\n> +#include \"algorithm.h\"\n> +\n> +namespace libcamera {\n> +\n> +namespace ipa::rkisp1::algorithms {\n> +\n> +class LensShadingCorrection : public Algorithm\n> +{\n> +public:\n> +\tLensShadingCorrection();\n> +\t~LensShadingCorrection() = default;\n> +\n> +\tint init(IPAContext &context, const YamlObject &tuningData) override;\n> +\tvoid prepare(IPAContext &context, rkisp1_params_cfg *params) override;\n> +\n> +private:\n> +\tbool initialized_;\n> +\n> +\tstd::vector<uint16_t> rData_;\n> +\tstd::vector<uint16_t> grData_;\n> +\tstd::vector<uint16_t> gbData_;\n> +\tstd::vector<uint16_t> bData_;\n> +\n> +\tstd::vector<double> xSize_;\n> +\tstd::vector<double> ySize_;\n> +};\n> +\n> +} /* namespace ipa::rkisp1::algorithms */\n> +} /* namespace libcamera */\n> diff --git a/src/ipa/rkisp1/algorithms/meson.build b/src/ipa/rkisp1/algorithms/meson.build\n> index 0597c353..64e11dce 100644\n> --- a/src/ipa/rkisp1/algorithms/meson.build\n> +++ b/src/ipa/rkisp1/algorithms/meson.build\n> @@ -5,4 +5,5 @@ rkisp1_ipa_algorithms = files([\n>      'awb.cpp',\n>      'blc.cpp',\n>      'gsl.cpp',\n> +    'lsc.cpp',\n>  ])\n> diff --git a/src/ipa/rkisp1/data/ov5640.yaml b/src/ipa/rkisp1/data/ov5640.yaml\n> index 13f76412..fa2ae436 100644\n> --- a/src/ipa/rkisp1/data/ov5640.yaml\n> +++ b/src/ipa/rkisp1/data/ov5640.yaml\n> @@ -16,4 +16,83 @@ algorithms:\n>          red:   [ 0, 256, 512, 768, 1024, 1280, 1536, 1792, 2048, 2304, 2560, 2816, 3072, 3328, 3584, 3840, 4095 ]\n>          green: [ 0, 256, 512, 768, 1024, 1280, 1536, 1792, 2048, 2304, 2560, 2816, 3072, 3328, 3584, 3840, 4095 ]\n>          blue:  [ 0, 256, 512, 768, 1024, 1280, 1536, 1792, 2048, 2304, 2560, 2816, 3072, 3328, 3584, 3840, 4095 ]\n> +  - LensShadingCorrection:\n> +      x-size: [ 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625 ]\n> +      y-size: [ 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625 ]\n> +      r:  [\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +          ]\n> +      gr: [\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +          ]\n> +      gb: [\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +          ]\n> +      b:  [\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n> +          ]\n>  ...\n> diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h\n> index f387cace..3bfb262c 100644\n> --- a/src/ipa/rkisp1/ipa_context.h\n> +++ b/src/ipa/rkisp1/ipa_context.h\n> @@ -33,6 +33,7 @@ struct IPASessionConfiguration {\n>  \n>  \tstruct {\n>  \t\tutils::Duration lineDuration;\n> +\t\tSize size;\n\nThis fields need to be documented in src/ipa/rkisp1/ipa_context.cpp.\n\n>  \t} sensor;\n>  \n>  \tstruct {\n> diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\n> index 1c002939..af0f43f2 100644\n> --- a/src/ipa/rkisp1/rkisp1.cpp\n> +++ b/src/ipa/rkisp1/rkisp1.cpp\n> @@ -32,6 +32,7 @@\n>  #include \"algorithms/awb.h\"\n>  #include \"algorithms/blc.h\"\n>  #include \"algorithms/gsl.h\"\n> +#include \"algorithms/lsc.h\"\n\nI think you can drop this.\n\n>  #include \"libipa/camera_sensor_helper.h\"\n>  \n>  #include \"ipa_context.h\"\n> @@ -212,6 +213,7 @@ int IPARkISP1::configure([[maybe_unused]] const IPACameraSensorInfo &info,\n>  \t/* Set the hardware revision for the algorithms. */\n>  \tcontext_.configuration.hw.revision = hwRevision_;\n>  \n> +\tcontext_.configuration.sensor.size = info.outputSize;\n>  \tcontext_.configuration.sensor.lineDuration = info.lineLength * 1.0s / info.pixelRate;\n>  \n>  \t/*","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id AC7B9C3275\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 24 Jul 2022 21:24:39 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DFCE763312;\n\tSun, 24 Jul 2022 23:24:38 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E56DB6330B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 24 Jul 2022 23:24:37 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 485D1898;\n\tSun, 24 Jul 2022 23:24:37 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1658697878;\n\tbh=u/MKsKtTb1nXey0+BpPLz8C4RFEw7A7hPsVxkm/zCfY=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=L0zqzw+9IzfH3tyWumRSI33BhLDGOTfw3URlFCwsRYMbbvPza39OdbtsURJgimJTO\n\tRPub3XkvQ63PHjFLGNlq7gSPGBqUIoaRF7wOMDsJRe2n8WKfsfzzuiOPGK7ac83XSV\n\tbfPLt6JGGSP7c2G/ZRQgLHGHaru7Jny/1z0xjmpgEUvB4C6h5aX1obCEqmZfbMJlSa\n\ttbuz8k4uf66OHplzR4DN6d+7dQBpve379SxtqI/d7NaohC6HJf/IOgZM9iA2mAvf0H\n\tpNmmk2rZHXlZ3nMj78fGmRlhiM5vGgWlFLar+xXq0OsfJKtFzxLE/jmtPjEVsdOtzk\n\tNoSnAQVl4nEqA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1658697877;\n\tbh=u/MKsKtTb1nXey0+BpPLz8C4RFEw7A7hPsVxkm/zCfY=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=GucvkSWtED1wIFtG3C7uu21GsiYFxK8X8LmqmjbiKdj6QTE1MM/CM9P2lCOu65kPT\n\tuEWmDK9CQw0PCEent4L1aEP/1RGNpyczKJ90Ys/9q6xnmeTheZV7BJGyhoa5NiG7Ae\n\tWTwXHrOiUfxpeN51JfmSws19Cu+wMAyU9Me0/Yx8="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"GucvkSWt\"; dkim-atps=neutral","Date":"Mon, 25 Jul 2022 00:24:34 +0300","To":"Florian Sylvestre <fsylvestre@baylibre.com>","Message-ID":"<Yt24khlZ1/OYhg7I@pendragon.ideasonboard.com>","References":"<20220722151635.239221-1-fsylvestre@baylibre.com>\n\t<20220722151635.239221-4-fsylvestre@baylibre.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220722151635.239221-4-fsylvestre@baylibre.com>","Subject":"Re: [libcamera-devel] [PATCH v2 3/5] ipa: rkisp1: Add support of\n\tLens Shading Correction control","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]