[{"id":25169,"web_url":"https://patchwork.libcamera.org/comment/25169/","msgid":"<YzZLHOL8gdgxg9k3@pendragon.ideasonboard.com>","date":"2022-09-30T01:49:16","subject":"Re: [libcamera-devel] [PATCH v2 2/2] ipa: rkisp1: Take into account\n\tcolor temperature during LSC algorithm","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 Thu, Sep 29, 2022 at 11:12:45AM +0200, Florian Sylvestre via libcamera-devel wrote:\n> Add coefficients sets in the YAML tuning file to allow using different set\n> depending of the image color temperature (provided by AWB algorithm).\n> \n> During processing, LSC algorithm computes coefficients by doing a linear\n> interpolation between the two closer set.\n> \n> Signed-off-by: Florian Sylvestre <fsylvestre@baylibre.com>\n> ---\n>  src/ipa/rkisp1/algorithms/lsc.cpp | 137 +++++++++++++++---\n>  src/ipa/rkisp1/algorithms/lsc.h   |  24 +++-\n>  src/ipa/rkisp1/data/ov5640.yaml   | 231 ++++++++++++++++++++----------\n>  3 files changed, 289 insertions(+), 103 deletions(-)\n> \n> diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp\n> index b1f39dfd..3a45667c 100644\n> --- a/src/ipa/rkisp1/algorithms/lsc.cpp\n> +++ b/src/ipa/rkisp1/algorithms/lsc.cpp\n> @@ -7,6 +7,7 @@\n>  \n>  #include \"lsc.h\"\n>  \n> +#include <algorithm>\n>  #include <cmath>\n>  #include <numeric>\n>  \n> @@ -89,7 +90,7 @@ static std::vector<uint16_t> parseTable(const YamlObject &tuningData,\n>  }\n>  \n>  LensShadingCorrection::LensShadingCorrection()\n> -\t: initialized_(false)\n> +\t: initialized_(false), lastCt_(0)\n>  {\n>  }\n>  \n> @@ -105,14 +106,36 @@ int LensShadingCorrection::init([[maybe_unused]] IPAContext &context,\n>  \tif (xSize_.empty() || ySize_.empty())\n>  \t\treturn -EINVAL;\n>  \n> -\trData_ = parseTable(tuningData, \"r\");\n> -\tgrData_ = parseTable(tuningData, \"gr\");\n> -\tgbData_ = parseTable(tuningData, \"gb\");\n> -\tbData_ = parseTable(tuningData, \"b\");\n> +\t/* Get all defined sets to apply. */\n> +\tconst YamlObject &yamlSets = tuningData[\"sets\"];\n> +\tif (!yamlSets.isList()) {\n> +\t\tLOG(RkISP1Lsc, Error)\n> +\t\t\t<< \"'sets' parameter not found in tuning file\";\n> +\t\treturn -EINVAL;\n> +\t}\n> +\n> +\tconst auto &sets = yamlSets.asList();\n> +\tfor (const auto &[i, yamlSet] : utils::enumerate(sets)) {\n> +\t\tsets_.push_back({});\n> +\t\tComponents &set = sets_.back();\n> +\n> +\t\tset.ct = yamlSet[\"ct\"].get<uint32_t>(0);\n> +\t\tset.r = parseTable(yamlSet, \"r\");\n> +\t\tset.gr = parseTable(yamlSet, \"gr\");\n> +\t\tset.gb = parseTable(yamlSet, \"gb\");\n> +\t\tset.b = parseTable(yamlSet, \"b\");\n> +\n> +\t\tif (set.r.empty() || set.gr.empty() ||\n> +\t\t    set.gb.empty() || set.b.empty())\n> +\t\t\treturn -EINVAL;\n> +\t}\n>  \n> -\tif (rData_.empty() || grData_.empty() ||\n> -\t    gbData_.empty() || bData_.empty())\n> +\tif (!std::is_sorted(sets_.begin(), sets_.end(),\n> +\t    [](const auto &a, const auto &b) { return a.ct < b.ct; })) {\n> +\t\tLOG(RkISP1Lsc, Error)\n> +\t\t\t<< \"Entries in 'sets' must be in increasing ct order\";\n>  \t\treturn -EINVAL;\n> +\t}\n>  \n>  \tinitialized_ = true;\n>  \n> @@ -157,36 +180,108 @@ int LensShadingCorrection::configure(IPAContext &context,\n>  \treturn 0;\n>  }\n>  \n> +void LensShadingCorrection::copyTable(rkisp1_cif_isp_lsc_config &config,\n> +\t\t\t\t      const Components &set)\n> +{\n> +\tstd::copy(set.r.begin(), set.r.end(),\n> +\t\t  &config.r_data_tbl[0][0]);\n\nThis holds on a single line. Same below.\n\n> +\tstd::copy(set.gr.begin(), set.gr.end(),\n> +\t\t  &config.gr_data_tbl[0][0]);\n> +\tstd::copy(set.gb.begin(), set.gb.end(),\n> +\t\t  &config.gb_data_tbl[0][0]);\n> +\tstd::copy(set.b.begin(), set.b.end(),\n> +\t\t  &config.b_data_tbl[0][0]);\n> +}\n> +\n> +/*\n> + * Interpolate LSC parameters based on color temperature value.\n> + */\n> +void LensShadingCorrection::interpolateTable(rkisp1_cif_isp_lsc_config &config,\n> +\t\t\t\t\t     const Components &set0,\n> +\t\t\t\t\t     const Components &set1,\n> +\t\t\t\t\t     const uint32_t ct)\n> +{\n> +\tdouble coeff0 = (set1.ct - ct) / (set1.ct - set0.ct);\n> +\tdouble coeff1 = (ct - set0.ct) / (set1.ct - set0.ct);\n> +\n> +\tfor (unsigned int i = 0; i < RKISP1_CIF_ISP_LSC_SAMPLES_MAX; ++i) {\n> +\t\tfor (unsigned int j = 0; j < RKISP1_CIF_ISP_LSC_SAMPLES_MAX; ++j) {\n> +\t\t\tunsigned int sample = i * RKISP1_CIF_ISP_LSC_SAMPLES_MAX + j;\n> +\n> +\t\t\tconfig.r_data_tbl[i][j] =\n> +\t\t\t\tset0.r[sample] * coeff0 +\n> +\t\t\t\tset1.r[sample] * coeff1;\n> +\n> +\t\t\tconfig.gr_data_tbl[i][j] =\n> +\t\t\t\tset0.gr[sample] * coeff0 +\n> +\t\t\t\tset1.gr[sample] * coeff1;\n> +\n> +\t\t\tconfig.gb_data_tbl[i][j] =\n> +\t\t\t\tset0.gb[sample] * coeff0 +\n> +\t\t\t\tset1.gb[sample] * coeff1;\n> +\n> +\t\t\tconfig.b_data_tbl[i][j] =\n> +\t\t\t\tset0.b[sample] * coeff0 +\n> +\t\t\t\tset1.b[sample] * coeff1;\n> +\t\t}\n> +\t}\n> +}\n> +\n>  /**\n>   * \\copydoc libcamera::ipa::Algorithm::prepare\n>   */\n> -void LensShadingCorrection::prepare([[maybe_unused]] IPAContext &context,\n> -\t\t\t\t    const uint32_t frame,\n> +void LensShadingCorrection::prepare(IPAContext &context,\n> +\t\t\t\t    [[maybe_unused]] const uint32_t frame,\n>  \t\t\t\t    [[maybe_unused]] IPAFrameContext &frameContext,\n>  \t\t\t\t    rkisp1_params_cfg *params)\n>  {\n> -\tif (frame > 0)\n> -\t\treturn;\n> -\n>  \tif (!initialized_)\n>  \t\treturn;\n>  \n>  \tstruct rkisp1_cif_isp_lsc_config &config = params->others.lsc_config;\n>  \n> +\tuint32_t ct = context.activeState.awb.temperatureK;\n> +\tct = std::clamp(ct, sets_.front().ct, sets_.back().ct);\n> +\n> +\t/*\n> +\t * Return if the current color temperature value is closed to the\n> +\t * one used for previous computation.\n> +\t */\n> +\tif (utils::abs_diff(ct, lastCt_) < 0.01 * lastCt_)\n\nCan you define a static constexpr for the threshold ?\n\n> +\t\treturn;\n> +\n> +\t/*\n> +\t * Pick the sets to interpolate between, or if the colour temperate is\n> +\t * close enough to one of the sets, use that set without interpolation.\n> +\t */\n> +\tint index = 0;\n> +\twhile (ct > sets_[index + 1].ct)\n\nIf there's a single set you'll have an out-of-bound access.\n\n> +\t\tindex++;\n> +\tComponents &set0 = sets_[index];\n> +\tComponents &set1 = sets_[index + 1];\n> +\tuint32_t ct0 = set0.ct, ct1 = set1.ct;\n> +\n> +\tif (utils::abs_diff(ct0, ct) < 0.1 * ct0) {\n> +\t\tLOG(RkISP1Lsc, Error)\n\nDid you mean Debug ? Same below.\n\n> +\t\t\t<< \"using calibration for \" << ct0;\n> +\t\tcopyTable(config, set0);\n> +\t} else if (utils::abs_diff(ct1, ct) < 0.1 * ct1) {\n> +\t\tLOG(RkISP1Lsc, Error)\n> +\t\t\t<< \"using calibration for \" << ct1;\n> +\t\tcopyTable(config, set1);\n> +\t} else {\n> +\t\tLOG(RkISP1Lsc, Error)\n> +\t\t\t<< \"ct is \" << ct << \", interpolating between \"\n> +\t\t\t<< ct0 << \" and \" << ct1;\n> +\t\tinterpolateTable(config, set0, set1, ct);\n> +\t}\n\nBlank line.\n\n> +\tlastCt_ = ct;\n> +\n>  \tmemcpy(config.x_grad_tbl, xGrad_, sizeof(config.x_grad_tbl));\n>  \tmemcpy(config.y_grad_tbl, yGrad_, sizeof(config.y_grad_tbl));\n>  \tmemcpy(config.x_size_tbl, xSizes_, sizeof(config.x_size_tbl));\n>  \tmemcpy(config.y_size_tbl, ySizes_, sizeof(config.y_size_tbl));\n>  \n> -\tstd::copy(rData_.begin(), rData_.end(),\n> -\t\t  &config.r_data_tbl[0][0]);\n> -\tstd::copy(grData_.begin(), grData_.end(),\n> -\t\t  &config.gr_data_tbl[0][0]);\n> -\tstd::copy(gbData_.begin(), gbData_.end(),\n> -\t\t  &config.gb_data_tbl[0][0]);\n> -\tstd::copy(bData_.begin(), bData_.end(),\n> -\t\t  &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> diff --git a/src/ipa/rkisp1/algorithms/lsc.h b/src/ipa/rkisp1/algorithms/lsc.h\n> index b5cd5047..1cab42ce 100644\n> --- a/src/ipa/rkisp1/algorithms/lsc.h\n> +++ b/src/ipa/rkisp1/algorithms/lsc.h\n> @@ -15,6 +15,14 @@ namespace ipa::rkisp1::algorithms {\n>  \n>  class LensShadingCorrection : public Algorithm\n>  {\n> +\tstruct Components {\n> +\t\tuint32_t ct;\n> +\t\tstd::vector<uint16_t> r;\n> +\t\tstd::vector<uint16_t> gr;\n> +\t\tstd::vector<uint16_t> gb;\n> +\t\tstd::vector<uint16_t> b;\n> +\t};\n\nThis can be moved to the private section below.\n\n> +\n>  public:\n>  \tLensShadingCorrection();\n>  \t~LensShadingCorrection() = default;\n> @@ -24,21 +32,25 @@ public:\n>  \tvoid prepare(IPAContext &context, const uint32_t frame,\n>  \t\t     IPAFrameContext &frameContext,\n>  \t\t     rkisp1_params_cfg *params) override;\n> -\n> +\tvoid process(IPAContext &context, const uint32_t frame,\n> +\t\t     RkISP1FrameContext &frameCtx,\n> +\t\t     const rkisp1_stat_buffer *stats) override;\n>  private:\n> -\tbool initialized_;\n> +\tvoid copyTable(rkisp1_cif_isp_lsc_config &config, const Components &set0);\n> +\tvoid interpolateTable(rkisp1_cif_isp_lsc_config &config,\n> +\t\t\t      const Components &set0, const Components &set1,\n> +\t\t\t      const uint32_t ct);\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> +\tbool initialized_;\n>  \n> +\tstd::vector<Components> sets_;\n>  \tstd::vector<double> xSize_;\n>  \tstd::vector<double> ySize_;\n>  \tuint16_t xGrad_[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE];\n>  \tuint16_t yGrad_[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE];\n>  \tuint16_t xSizes_[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE];\n>  \tuint16_t ySizes_[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE];\n> +\tuint32_t lastCt_;\n>  };\n>  \n>  } /* namespace ipa::rkisp1::algorithms */\n> diff --git a/src/ipa/rkisp1/data/ov5640.yaml b/src/ipa/rkisp1/data/ov5640.yaml\n> index 33a672bc..d80c1655 100644\n> --- a/src/ipa/rkisp1/data/ov5640.yaml\n> +++ b/src/ipa/rkisp1/data/ov5640.yaml\n> @@ -20,82 +20,161 @@ algorithms:\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> +      sets:\n> +        - ct: 3000\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> +        - ct: 7000\n> +          r:  [\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +              ]\n> +          gr: [\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +              ]\n> +          gb: [\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +              ]\n> +          b:  [\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +              ]\n>    - DefectPixelClusterCorrection:\n>        fixed-set: false\n>        sets:","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 D8677BD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 30 Sep 2022 01:49:21 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1C92562395;\n\tFri, 30 Sep 2022 03:49:21 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AE13661F76\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 30 Sep 2022 03:49:19 +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 E840A47C;\n\tFri, 30 Sep 2022 03:49:18 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664502561;\n\tbh=X6k0Xz/wKkRi3AUfRxXP5LFU4opCfMXxGOz3GDPHShg=;\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=02X4jH5Q7BXtunuWsMJppcq/TMa2d6vW5bRGEb/dzED/021frMAiXzGsUvazMHY2w\n\tqKcdtKOo28Hu9NEFphx5tt66YqZCygtjDBeUj3+h3Q7DrMFuyckCXNGX7GdwndfiMZ\n\tO+lvux8poHz1KCXQTcilozhYwIs1Bibd+nA2Ulj5+XXJczdHdduS1d7jNNRnn3/ZUU\n\tJjeAwsHxdui3aw3AcNVNmoFn9T/QAD3YHxIw0QwHCoEoV2G1V9cpzSHUmNz+EGPtJD\n\t9rtShdVttBthldV+NPH1bjYUMhtQaOdJ6nHC/s1lS2B11Ntw6v4EcV0awaeTm6Ix2U\n\tyEcKHC/XSm2ZQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1664502559;\n\tbh=X6k0Xz/wKkRi3AUfRxXP5LFU4opCfMXxGOz3GDPHShg=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=avro42t8LAqTcyduO1dE9tU17mOvLwEgmSKbMZzBgK2O9ZAg0gdB2XOQgxX++dL5K\n\tud6eRB90Q8Bm+gBzEOmSUPsTjmG7eXO2AL7TCwFL9QiYpAU5oR7mM80w0XkMB1bQoC\n\tf6KgfjDsJxrooGfzQ4bq298Le8CBdWl6jPJZx+NA="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"avro42t8\"; dkim-atps=neutral","Date":"Fri, 30 Sep 2022 04:49:16 +0300","To":"Florian Sylvestre <fsylvestre@baylibre.com>","Message-ID":"<YzZLHOL8gdgxg9k3@pendragon.ideasonboard.com>","References":"<20220929091245.2159838-1-fsylvestre@baylibre.com>\n\t<20220929091245.2159838-3-fsylvestre@baylibre.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220929091245.2159838-3-fsylvestre@baylibre.com>","Subject":"Re: [libcamera-devel] [PATCH v2 2/2] ipa: rkisp1: Take into account\n\tcolor temperature during LSC algorithm","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>"}},{"id":25172,"web_url":"https://patchwork.libcamera.org/comment/25172/","msgid":"<20220930092805.rvxuf7hq27obpy6o@uno.localdomain>","date":"2022-09-30T09:28:05","subject":"Re: [libcamera-devel] [PATCH v2 2/2] ipa: rkisp1: Take into account\n\tcolor temperature during LSC algorithm","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Florian\n   a nit on top of Laurent's comment\n\nOn Thu, Sep 29, 2022 at 11:12:45AM +0200, Florian Sylvestre via libcamera-devel wrote:\n> Add coefficients sets in the YAML tuning file to allow using different set\n> depending of the image color temperature (provided by AWB algorithm).\n>\n> During processing, LSC algorithm computes coefficients by doing a linear\n> interpolation between the two closer set.\n>\n> Signed-off-by: Florian Sylvestre <fsylvestre@baylibre.com>\n> ---\n>  src/ipa/rkisp1/algorithms/lsc.cpp | 137 +++++++++++++++---\n>  src/ipa/rkisp1/algorithms/lsc.h   |  24 +++-\n>  src/ipa/rkisp1/data/ov5640.yaml   | 231 ++++++++++++++++++++----------\n>  3 files changed, 289 insertions(+), 103 deletions(-)\n>\n> diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp\n> index b1f39dfd..3a45667c 100644\n> --- a/src/ipa/rkisp1/algorithms/lsc.cpp\n> +++ b/src/ipa/rkisp1/algorithms/lsc.cpp\n> @@ -7,6 +7,7 @@\n>\n>  #include \"lsc.h\"\n>\n> +#include <algorithm>\n>  #include <cmath>\n>  #include <numeric>\n>\n> @@ -89,7 +90,7 @@ static std::vector<uint16_t> parseTable(const YamlObject &tuningData,\n>  }\n>\n>  LensShadingCorrection::LensShadingCorrection()\n> -\t: initialized_(false)\n> +\t: initialized_(false), lastCt_(0)\n>  {\n>  }\n>\n> @@ -105,14 +106,36 @@ int LensShadingCorrection::init([[maybe_unused]] IPAContext &context,\n>  \tif (xSize_.empty() || ySize_.empty())\n>  \t\treturn -EINVAL;\n>\n> -\trData_ = parseTable(tuningData, \"r\");\n> -\tgrData_ = parseTable(tuningData, \"gr\");\n> -\tgbData_ = parseTable(tuningData, \"gb\");\n> -\tbData_ = parseTable(tuningData, \"b\");\n> +\t/* Get all defined sets to apply. */\n> +\tconst YamlObject &yamlSets = tuningData[\"sets\"];\n> +\tif (!yamlSets.isList()) {\n> +\t\tLOG(RkISP1Lsc, Error)\n> +\t\t\t<< \"'sets' parameter not found in tuning file\";\n> +\t\treturn -EINVAL;\n> +\t}\n> +\n> +\tconst auto &sets = yamlSets.asList();\n> +\tfor (const auto &[i, yamlSet] : utils::enumerate(sets)) {\n> +\t\tsets_.push_back({});\n> +\t\tComponents &set = sets_.back();\n> +\n> +\t\tset.ct = yamlSet[\"ct\"].get<uint32_t>(0);\n> +\t\tset.r = parseTable(yamlSet, \"r\");\n> +\t\tset.gr = parseTable(yamlSet, \"gr\");\n> +\t\tset.gb = parseTable(yamlSet, \"gb\");\n> +\t\tset.b = parseTable(yamlSet, \"b\");\n> +\n> +\t\tif (set.r.empty() || set.gr.empty() ||\n> +\t\t    set.gb.empty() || set.b.empty())\n> +\t\t\treturn -EINVAL;\n\nMaybe an error message to state the tables are malformed ?\n\n> +\t}\n>\n> -\tif (rData_.empty() || grData_.empty() ||\n> -\t    gbData_.empty() || bData_.empty())\n> +\tif (!std::is_sorted(sets_.begin(), sets_.end(),\n> +\t    [](const auto &a, const auto &b) { return a.ct < b.ct; })) {\n> +\t\tLOG(RkISP1Lsc, Error)\n> +\t\t\t<< \"Entries in 'sets' must be in increasing ct order\";\n>  \t\treturn -EINVAL;\n> +\t}\n>\n>  \tinitialized_ = true;\n>\n> @@ -157,36 +180,108 @@ int LensShadingCorrection::configure(IPAContext &context,\n>  \treturn 0;\n>  }\n>\n> +void LensShadingCorrection::copyTable(rkisp1_cif_isp_lsc_config &config,\n> +\t\t\t\t      const Components &set)\n> +{\n> +\tstd::copy(set.r.begin(), set.r.end(),\n> +\t\t  &config.r_data_tbl[0][0]);\n> +\tstd::copy(set.gr.begin(), set.gr.end(),\n> +\t\t  &config.gr_data_tbl[0][0]);\n> +\tstd::copy(set.gb.begin(), set.gb.end(),\n> +\t\t  &config.gb_data_tbl[0][0]);\n> +\tstd::copy(set.b.begin(), set.b.end(),\n> +\t\t  &config.b_data_tbl[0][0]);\n> +}\n> +\n> +/*\n> + * Interpolate LSC parameters based on color temperature value.\n> + */\n> +void LensShadingCorrection::interpolateTable(rkisp1_cif_isp_lsc_config &config,\n> +\t\t\t\t\t     const Components &set0,\n> +\t\t\t\t\t     const Components &set1,\n> +\t\t\t\t\t     const uint32_t ct)\n> +{\n> +\tdouble coeff0 = (set1.ct - ct) / (set1.ct - set0.ct);\n> +\tdouble coeff1 = (ct - set0.ct) / (set1.ct - set0.ct);\n> +\n> +\tfor (unsigned int i = 0; i < RKISP1_CIF_ISP_LSC_SAMPLES_MAX; ++i) {\n> +\t\tfor (unsigned int j = 0; j < RKISP1_CIF_ISP_LSC_SAMPLES_MAX; ++j) {\n> +\t\t\tunsigned int sample = i * RKISP1_CIF_ISP_LSC_SAMPLES_MAX + j;\n> +\n> +\t\t\tconfig.r_data_tbl[i][j] =\n> +\t\t\t\tset0.r[sample] * coeff0 +\n> +\t\t\t\tset1.r[sample] * coeff1;\n> +\n> +\t\t\tconfig.gr_data_tbl[i][j] =\n> +\t\t\t\tset0.gr[sample] * coeff0 +\n> +\t\t\t\tset1.gr[sample] * coeff1;\n> +\n> +\t\t\tconfig.gb_data_tbl[i][j] =\n> +\t\t\t\tset0.gb[sample] * coeff0 +\n> +\t\t\t\tset1.gb[sample] * coeff1;\n> +\n> +\t\t\tconfig.b_data_tbl[i][j] =\n> +\t\t\t\tset0.b[sample] * coeff0 +\n> +\t\t\t\tset1.b[sample] * coeff1;\n> +\t\t}\n> +\t}\n> +}\n> +\n>  /**\n>   * \\copydoc libcamera::ipa::Algorithm::prepare\n>   */\n> -void LensShadingCorrection::prepare([[maybe_unused]] IPAContext &context,\n> -\t\t\t\t    const uint32_t frame,\n> +void LensShadingCorrection::prepare(IPAContext &context,\n> +\t\t\t\t    [[maybe_unused]] const uint32_t frame,\n>  \t\t\t\t    [[maybe_unused]] IPAFrameContext &frameContext,\n>  \t\t\t\t    rkisp1_params_cfg *params)\n>  {\n> -\tif (frame > 0)\n> -\t\treturn;\n> -\n>  \tif (!initialized_)\n>  \t\treturn;\n>\n>  \tstruct rkisp1_cif_isp_lsc_config &config = params->others.lsc_config;\n>\n> +\tuint32_t ct = context.activeState.awb.temperatureK;\n> +\tct = std::clamp(ct, sets_.front().ct, sets_.back().ct);\n> +\n> +\t/*\n> +\t * Return if the current color temperature value is closed to the\n> +\t * one used for previous computation.\n> +\t */\n> +\tif (utils::abs_diff(ct, lastCt_) < 0.01 * lastCt_)\n> +\t\treturn;\n> +\n> +\t/*\n> +\t * Pick the sets to interpolate between, or if the colour temperate is\n> +\t * close enough to one of the sets, use that set without interpolation.\n> +\t */\n> +\tint index = 0;\n> +\twhile (ct > sets_[index + 1].ct)\n> +\t\tindex++;\n> +\tComponents &set0 = sets_[index];\n> +\tComponents &set1 = sets_[index + 1];\n> +\tuint32_t ct0 = set0.ct, ct1 = set1.ct;\n> +\n> +\tif (utils::abs_diff(ct0, ct) < 0.1 * ct0) {\n> +\t\tLOG(RkISP1Lsc, Error)\n> +\t\t\t<< \"using calibration for \" << ct0;\n> +\t\tcopyTable(config, set0);\n> +\t} else if (utils::abs_diff(ct1, ct) < 0.1 * ct1) {\n> +\t\tLOG(RkISP1Lsc, Error)\n> +\t\t\t<< \"using calibration for \" << ct1;\n> +\t\tcopyTable(config, set1);\n> +\t} else {\n> +\t\tLOG(RkISP1Lsc, Error)\n> +\t\t\t<< \"ct is \" << ct << \", interpolating between \"\n> +\t\t\t<< ct0 << \" and \" << ct1;\n> +\t\tinterpolateTable(config, set0, set1, ct);\n> +\t}\n> +\tlastCt_ = ct;\n> +\n>  \tmemcpy(config.x_grad_tbl, xGrad_, sizeof(config.x_grad_tbl));\n>  \tmemcpy(config.y_grad_tbl, yGrad_, sizeof(config.y_grad_tbl));\n>  \tmemcpy(config.x_size_tbl, xSizes_, sizeof(config.x_size_tbl));\n>  \tmemcpy(config.y_size_tbl, ySizes_, sizeof(config.y_size_tbl));\n>\n> -\tstd::copy(rData_.begin(), rData_.end(),\n> -\t\t  &config.r_data_tbl[0][0]);\n> -\tstd::copy(grData_.begin(), grData_.end(),\n> -\t\t  &config.gr_data_tbl[0][0]);\n> -\tstd::copy(gbData_.begin(), gbData_.end(),\n> -\t\t  &config.gb_data_tbl[0][0]);\n> -\tstd::copy(bData_.begin(), bData_.end(),\n> -\t\t  &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> diff --git a/src/ipa/rkisp1/algorithms/lsc.h b/src/ipa/rkisp1/algorithms/lsc.h\n> index b5cd5047..1cab42ce 100644\n> --- a/src/ipa/rkisp1/algorithms/lsc.h\n> +++ b/src/ipa/rkisp1/algorithms/lsc.h\n> @@ -15,6 +15,14 @@ namespace ipa::rkisp1::algorithms {\n>\n>  class LensShadingCorrection : public Algorithm\n>  {\n> +\tstruct Components {\n> +\t\tuint32_t ct;\n> +\t\tstd::vector<uint16_t> r;\n> +\t\tstd::vector<uint16_t> gr;\n> +\t\tstd::vector<uint16_t> gb;\n> +\t\tstd::vector<uint16_t> b;\n> +\t};\n> +\n>  public:\n>  \tLensShadingCorrection();\n>  \t~LensShadingCorrection() = default;\n> @@ -24,21 +32,25 @@ public:\n>  \tvoid prepare(IPAContext &context, const uint32_t frame,\n>  \t\t     IPAFrameContext &frameContext,\n>  \t\t     rkisp1_params_cfg *params) override;\n> -\n> +\tvoid process(IPAContext &context, const uint32_t frame,\n> +\t\t     RkISP1FrameContext &frameCtx,\n> +\t\t     const rkisp1_stat_buffer *stats) override;\n>  private:\n> -\tbool initialized_;\n> +\tvoid copyTable(rkisp1_cif_isp_lsc_config &config, const Components &set0);\n> +\tvoid interpolateTable(rkisp1_cif_isp_lsc_config &config,\n> +\t\t\t      const Components &set0, const Components &set1,\n> +\t\t\t      const uint32_t ct);\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> +\tbool initialized_;\n>\n> +\tstd::vector<Components> sets_;\n>  \tstd::vector<double> xSize_;\n>  \tstd::vector<double> ySize_;\n>  \tuint16_t xGrad_[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE];\n>  \tuint16_t yGrad_[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE];\n>  \tuint16_t xSizes_[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE];\n>  \tuint16_t ySizes_[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE];\n> +\tuint32_t lastCt_;\n>  };\n>\n>  } /* namespace ipa::rkisp1::algorithms */\n> diff --git a/src/ipa/rkisp1/data/ov5640.yaml b/src/ipa/rkisp1/data/ov5640.yaml\n> index 33a672bc..d80c1655 100644\n> --- a/src/ipa/rkisp1/data/ov5640.yaml\n> +++ b/src/ipa/rkisp1/data/ov5640.yaml\n> @@ -20,82 +20,161 @@ algorithms:\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> +      sets:\n> +        - ct: 3000\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> +        - ct: 7000\n> +          r:  [\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +              ]\n> +          gr: [\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +              ]\n> +          gb: [\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +              ]\n> +          b:  [\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> +              ]\n>    - DefectPixelClusterCorrection:\n>        fixed-set: false\n>        sets:\n> --\n> 2.34.1\n>","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 0BD39BD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 30 Sep 2022 09:28:10 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6A3FA62399;\n\tFri, 30 Sep 2022 11:28:09 +0200 (CEST)","from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net\n\t[IPv6:2001:4b98:dc4:8::224])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 56F1E603DC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 30 Sep 2022 11:28:07 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id B4964E0005;\n\tFri, 30 Sep 2022 09:28:06 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664530089;\n\tbh=Urgzyros44FLBZqn4p6jmScGfFhOCZ96lQTKXWpPPQ4=;\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=sIgjxwNKgPlg3CQh/uuOHfK9Ie2KBYdZ3TQODYnRtSUiZPZ4BQMF7UBDuZx98rGU0\n\tQW03S/c/Ri+3CzxamPpSfqznhSWvixcVjOej22jpHadE+FOX502PC9K/13Gg85RpGW\n\tmmsfUf6Gjhs4FEgqj1I7lp+4P0lgtNnmy6UZJEuIdFq2K6rYqtC4A2WVvj7amwm1k5\n\tW5XE/LcqAQbSBtNuSnSXelOwUfKAoVPRUFqJeoyum/A/0F54p0s209wxkLHEVomVhQ\n\tSKeDVo6Z0roHCjaY30t5YI/aUY5o2ImoElBoJ1CwCnET9adsF9oL1ODNAzXLFJw7DX\n\tDQ3P3q6G7eefg==","Date":"Fri, 30 Sep 2022 11:28:05 +0200","To":"Florian Sylvestre <fsylvestre@baylibre.com>","Message-ID":"<20220930092805.rvxuf7hq27obpy6o@uno.localdomain>","References":"<20220929091245.2159838-1-fsylvestre@baylibre.com>\n\t<20220929091245.2159838-3-fsylvestre@baylibre.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220929091245.2159838-3-fsylvestre@baylibre.com>","Subject":"Re: [libcamera-devel] [PATCH v2 2/2] ipa: rkisp1: Take into account\n\tcolor temperature during LSC algorithm","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":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":25217,"web_url":"https://patchwork.libcamera.org/comment/25217/","msgid":"<CALzBHU7kO4ytU65mn7x+PV-iJaPyaNZoG9+O-JrUAm14Zd=exQ@mail.gmail.com>","date":"2022-10-03T07:25:27","subject":"Re: [libcamera-devel] [PATCH v2 2/2] ipa: rkisp1: Take into account\n\tcolor temperature during LSC algorithm","submitter":{"id":123,"url":"https://patchwork.libcamera.org/api/people/123/","name":"Florian Sylvestre","email":"fsylvestre@baylibre.com"},"content":"On Fri, 30 Sept 2022 at 11:28, Jacopo Mondi <jacopo@jmondi.org> wrote:\n>\n> Hi Florian\n>    a nit on top of Laurent's comment\n>\n> On Thu, Sep 29, 2022 at 11:12:45AM +0200, Florian Sylvestre via libcamera-devel wrote:\n> > Add coefficients sets in the YAML tuning file to allow using different set\n> > depending of the image color temperature (provided by AWB algorithm).\n> >\n> > During processing, LSC algorithm computes coefficients by doing a linear\n> > interpolation between the two closer set.\n> >\n> > Signed-off-by: Florian Sylvestre <fsylvestre@baylibre.com>\n> > ---\n> >  src/ipa/rkisp1/algorithms/lsc.cpp | 137 +++++++++++++++---\n> >  src/ipa/rkisp1/algorithms/lsc.h   |  24 +++-\n> >  src/ipa/rkisp1/data/ov5640.yaml   | 231 ++++++++++++++++++++----------\n> >  3 files changed, 289 insertions(+), 103 deletions(-)\n> >\n> > diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp\n> > index b1f39dfd..3a45667c 100644\n> > --- a/src/ipa/rkisp1/algorithms/lsc.cpp\n> > +++ b/src/ipa/rkisp1/algorithms/lsc.cpp\n> > @@ -7,6 +7,7 @@\n> >\n> >  #include \"lsc.h\"\n> >\n> > +#include <algorithm>\n> >  #include <cmath>\n> >  #include <numeric>\n> >\n> > @@ -89,7 +90,7 @@ static std::vector<uint16_t> parseTable(const YamlObject &tuningData,\n> >  }\n> >\n> >  LensShadingCorrection::LensShadingCorrection()\n> > -     : initialized_(false)\n> > +     : initialized_(false), lastCt_(0)\n> >  {\n> >  }\n> >\n> > @@ -105,14 +106,36 @@ int LensShadingCorrection::init([[maybe_unused]] IPAContext &context,\n> >       if (xSize_.empty() || ySize_.empty())\n> >               return -EINVAL;\n> >\n> > -     rData_ = parseTable(tuningData, \"r\");\n> > -     grData_ = parseTable(tuningData, \"gr\");\n> > -     gbData_ = parseTable(tuningData, \"gb\");\n> > -     bData_ = parseTable(tuningData, \"b\");\n> > +     /* Get all defined sets to apply. */\n> > +     const YamlObject &yamlSets = tuningData[\"sets\"];\n> > +     if (!yamlSets.isList()) {\n> > +             LOG(RkISP1Lsc, Error)\n> > +                     << \"'sets' parameter not found in tuning file\";\n> > +             return -EINVAL;\n> > +     }\n> > +\n> > +     const auto &sets = yamlSets.asList();\n> > +     for (const auto &[i, yamlSet] : utils::enumerate(sets)) {\n> > +             sets_.push_back({});\n> > +             Components &set = sets_.back();\n> > +\n> > +             set.ct = yamlSet[\"ct\"].get<uint32_t>(0);\n> > +             set.r = parseTable(yamlSet, \"r\");\n> > +             set.gr = parseTable(yamlSet, \"gr\");\n> > +             set.gb = parseTable(yamlSet, \"gb\");\n> > +             set.b = parseTable(yamlSet, \"b\");\n> > +\n> > +             if (set.r.empty() || set.gr.empty() ||\n> > +                 set.gb.empty() || set.b.empty())\n> > +                     return -EINVAL;\n>\n> Maybe an error message to state the tables are malformed ?\nThere is already an error message in the parseTable() function, do you\nthink there is some missing information there?\n>\n> > +     }\n> >\n> > -     if (rData_.empty() || grData_.empty() ||\n> > -         gbData_.empty() || bData_.empty())\n> > +     if (!std::is_sorted(sets_.begin(), sets_.end(),\n> > +         [](const auto &a, const auto &b) { return a.ct < b.ct; })) {\n> > +             LOG(RkISP1Lsc, Error)\n> > +                     << \"Entries in 'sets' must be in increasing ct order\";\n> >               return -EINVAL;\n> > +     }\n> >\n> >       initialized_ = true;\n> >\n> > @@ -157,36 +180,108 @@ int LensShadingCorrection::configure(IPAContext &context,\n> >       return 0;\n> >  }\n> >\n> > +void LensShadingCorrection::copyTable(rkisp1_cif_isp_lsc_config &config,\n> > +                                   const Components &set)\n> > +{\n> > +     std::copy(set.r.begin(), set.r.end(),\n> > +               &config.r_data_tbl[0][0]);\n> > +     std::copy(set.gr.begin(), set.gr.end(),\n> > +               &config.gr_data_tbl[0][0]);\n> > +     std::copy(set.gb.begin(), set.gb.end(),\n> > +               &config.gb_data_tbl[0][0]);\n> > +     std::copy(set.b.begin(), set.b.end(),\n> > +               &config.b_data_tbl[0][0]);\n> > +}\n> > +\n> > +/*\n> > + * Interpolate LSC parameters based on color temperature value.\n> > + */\n> > +void LensShadingCorrection::interpolateTable(rkisp1_cif_isp_lsc_config &config,\n> > +                                          const Components &set0,\n> > +                                          const Components &set1,\n> > +                                          const uint32_t ct)\n> > +{\n> > +     double coeff0 = (set1.ct - ct) / (set1.ct - set0.ct);\n> > +     double coeff1 = (ct - set0.ct) / (set1.ct - set0.ct);\n> > +\n> > +     for (unsigned int i = 0; i < RKISP1_CIF_ISP_LSC_SAMPLES_MAX; ++i) {\n> > +             for (unsigned int j = 0; j < RKISP1_CIF_ISP_LSC_SAMPLES_MAX; ++j) {\n> > +                     unsigned int sample = i * RKISP1_CIF_ISP_LSC_SAMPLES_MAX + j;\n> > +\n> > +                     config.r_data_tbl[i][j] =\n> > +                             set0.r[sample] * coeff0 +\n> > +                             set1.r[sample] * coeff1;\n> > +\n> > +                     config.gr_data_tbl[i][j] =\n> > +                             set0.gr[sample] * coeff0 +\n> > +                             set1.gr[sample] * coeff1;\n> > +\n> > +                     config.gb_data_tbl[i][j] =\n> > +                             set0.gb[sample] * coeff0 +\n> > +                             set1.gb[sample] * coeff1;\n> > +\n> > +                     config.b_data_tbl[i][j] =\n> > +                             set0.b[sample] * coeff0 +\n> > +                             set1.b[sample] * coeff1;\n> > +             }\n> > +     }\n> > +}\n> > +\n> >  /**\n> >   * \\copydoc libcamera::ipa::Algorithm::prepare\n> >   */\n> > -void LensShadingCorrection::prepare([[maybe_unused]] IPAContext &context,\n> > -                                 const uint32_t frame,\n> > +void LensShadingCorrection::prepare(IPAContext &context,\n> > +                                 [[maybe_unused]] const uint32_t frame,\n> >                                   [[maybe_unused]] IPAFrameContext &frameContext,\n> >                                   rkisp1_params_cfg *params)\n> >  {\n> > -     if (frame > 0)\n> > -             return;\n> > -\n> >       if (!initialized_)\n> >               return;\n> >\n> >       struct rkisp1_cif_isp_lsc_config &config = params->others.lsc_config;\n> >\n> > +     uint32_t ct = context.activeState.awb.temperatureK;\n> > +     ct = std::clamp(ct, sets_.front().ct, sets_.back().ct);\n> > +\n> > +     /*\n> > +      * Return if the current color temperature value is closed to the\n> > +      * one used for previous computation.\n> > +      */\n> > +     if (utils::abs_diff(ct, lastCt_) < 0.01 * lastCt_)\n> > +             return;\n> > +\n> > +     /*\n> > +      * Pick the sets to interpolate between, or if the colour temperate is\n> > +      * close enough to one of the sets, use that set without interpolation.\n> > +      */\n> > +     int index = 0;\n> > +     while (ct > sets_[index + 1].ct)\n> > +             index++;\n> > +     Components &set0 = sets_[index];\n> > +     Components &set1 = sets_[index + 1];\n> > +     uint32_t ct0 = set0.ct, ct1 = set1.ct;\n> > +\n> > +     if (utils::abs_diff(ct0, ct) < 0.1 * ct0) {\n> > +             LOG(RkISP1Lsc, Error)\n> > +                     << \"using calibration for \" << ct0;\n> > +             copyTable(config, set0);\n> > +     } else if (utils::abs_diff(ct1, ct) < 0.1 * ct1) {\n> > +             LOG(RkISP1Lsc, Error)\n> > +                     << \"using calibration for \" << ct1;\n> > +             copyTable(config, set1);\n> > +     } else {\n> > +             LOG(RkISP1Lsc, Error)\n> > +                     << \"ct is \" << ct << \", interpolating between \"\n> > +                     << ct0 << \" and \" << ct1;\n> > +             interpolateTable(config, set0, set1, ct);\n> > +     }\n> > +     lastCt_ = ct;\n> > +\n> >       memcpy(config.x_grad_tbl, xGrad_, sizeof(config.x_grad_tbl));\n> >       memcpy(config.y_grad_tbl, yGrad_, sizeof(config.y_grad_tbl));\n> >       memcpy(config.x_size_tbl, xSizes_, sizeof(config.x_size_tbl));\n> >       memcpy(config.y_size_tbl, ySizes_, sizeof(config.y_size_tbl));\n> >\n> > -     std::copy(rData_.begin(), rData_.end(),\n> > -               &config.r_data_tbl[0][0]);\n> > -     std::copy(grData_.begin(), grData_.end(),\n> > -               &config.gr_data_tbl[0][0]);\n> > -     std::copy(gbData_.begin(), gbData_.end(),\n> > -               &config.gb_data_tbl[0][0]);\n> > -     std::copy(bData_.begin(), bData_.end(),\n> > -               &config.b_data_tbl[0][0]);\n> > -\n> >       params->module_en_update |= RKISP1_CIF_ISP_MODULE_LSC;\n> >       params->module_ens |= RKISP1_CIF_ISP_MODULE_LSC;\n> >       params->module_cfg_update |= RKISP1_CIF_ISP_MODULE_LSC;\n> > diff --git a/src/ipa/rkisp1/algorithms/lsc.h b/src/ipa/rkisp1/algorithms/lsc.h\n> > index b5cd5047..1cab42ce 100644\n> > --- a/src/ipa/rkisp1/algorithms/lsc.h\n> > +++ b/src/ipa/rkisp1/algorithms/lsc.h\n> > @@ -15,6 +15,14 @@ namespace ipa::rkisp1::algorithms {\n> >\n> >  class LensShadingCorrection : public Algorithm\n> >  {\n> > +     struct Components {\n> > +             uint32_t ct;\n> > +             std::vector<uint16_t> r;\n> > +             std::vector<uint16_t> gr;\n> > +             std::vector<uint16_t> gb;\n> > +             std::vector<uint16_t> b;\n> > +     };\n> > +\n> >  public:\n> >       LensShadingCorrection();\n> >       ~LensShadingCorrection() = default;\n> > @@ -24,21 +32,25 @@ public:\n> >       void prepare(IPAContext &context, const uint32_t frame,\n> >                    IPAFrameContext &frameContext,\n> >                    rkisp1_params_cfg *params) override;\n> > -\n> > +     void process(IPAContext &context, const uint32_t frame,\n> > +                  RkISP1FrameContext &frameCtx,\n> > +                  const rkisp1_stat_buffer *stats) override;\n> >  private:\n> > -     bool initialized_;\n> > +     void copyTable(rkisp1_cif_isp_lsc_config &config, const Components &set0);\n> > +     void interpolateTable(rkisp1_cif_isp_lsc_config &config,\n> > +                           const Components &set0, const Components &set1,\n> > +                           const uint32_t ct);\n> >\n> > -     std::vector<uint16_t> rData_;\n> > -     std::vector<uint16_t> grData_;\n> > -     std::vector<uint16_t> gbData_;\n> > -     std::vector<uint16_t> bData_;\n> > +     bool initialized_;\n> >\n> > +     std::vector<Components> sets_;\n> >       std::vector<double> xSize_;\n> >       std::vector<double> ySize_;\n> >       uint16_t xGrad_[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE];\n> >       uint16_t yGrad_[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE];\n> >       uint16_t xSizes_[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE];\n> >       uint16_t ySizes_[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE];\n> > +     uint32_t lastCt_;\n> >  };\n> >\n> >  } /* namespace ipa::rkisp1::algorithms */\n> > diff --git a/src/ipa/rkisp1/data/ov5640.yaml b/src/ipa/rkisp1/data/ov5640.yaml\n> > index 33a672bc..d80c1655 100644\n> > --- a/src/ipa/rkisp1/data/ov5640.yaml\n> > +++ b/src/ipa/rkisp1/data/ov5640.yaml\n> > @@ -20,82 +20,161 @@ algorithms:\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> > +      sets:\n> > +        - ct: 3000\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> > +        - ct: 7000\n> > +          r:  [\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +              ]\n> > +          gr: [\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +              ]\n> > +          gb: [\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +              ]\n> > +          b:  [\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > +              ]\n> >    - DefectPixelClusterCorrection:\n> >        fixed-set: false\n> >        sets:\n> > --\n> > 2.34.1\n> >","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 6AA92C0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  3 Oct 2022 07:25:43 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 77B64623B5;\n\tMon,  3 Oct 2022 09:25:42 +0200 (CEST)","from mail-il1-x12b.google.com (mail-il1-x12b.google.com\n\t[IPv6:2607:f8b0:4864:20::12b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 88B37623B5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  3 Oct 2022 09:25:40 +0200 (CEST)","by mail-il1-x12b.google.com with SMTP id h18so4918741ilh.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 03 Oct 2022 00:25:40 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664781942;\n\tbh=PAxpyqrN9Tmx8N6YiYx9EJRWaXKAzV7bZ5t2l3JiUxs=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=xJba6/y1reEB64kCA4B/HLEP3+SCaExVZmAaiXFS3/nd2w66LNYFSt5zQ70mUffY9\n\tVZILQSpi7l+kJV2VEpRv5MmMpXZfbmyPmZ/dC97P/X2kmxwOR/MROXMMKX+KpuOiL0\n\tcQj0Je1+7eo7OllrDJ+Snxn1Wn8iCXBOXWOPeOP6iPjJJXyWfofrPtnZRCuaUbCDDR\n\tqwfSTtqoBsLktUQ9jypA02EMSp5PtbH4C5P1cVdjVTo7u04dBBCOXat64lO7E+XVJJ\n\tRqz1KShsI34LvyD95Bz91tGPucOYse97yWLbqs/jz6FbA7LPrGuqscc68ODYAEK3Kt\n\t0ZHWh5J/Tbjog==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=baylibre-com.20210112.gappssmtp.com; s=20210112;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date;\n\tbh=QiBYrXyaxF19RJBLz2shPLMuW6/D6MB74WXI96PChKs=;\n\tb=V16oU0tG5AtaAytbbNStT2Rv3F8nLe8TWZMIZFliyIMznr4/LMIMvUCJyaPEZ++mLO\n\tWBoOBrYdYS3pgzU35Eyf5DfQDrWYsASCb8zy6M8mOjypM51ghfR7r1/WZ0MHDNg9qtsa\n\t8qHNhmyT7dMvL9TScwb5g3O3zgG/eMSHkVc20/uYXcy+yfIIEkW+Sba0WpUrhWUcDbEg\n\t3pAl9y3EMkUeJDZj9Kvg63H/S+AKZfujFDMj4slxuvSMd8hN6VbjKIsBLswBpQioBQD7\n\tAXPbcHCGq8/+Loso2h0KdVxOZu+LwEY7K+aTV3t4YRZqPOlkirA9EGCakuiY271ePYVD\n\tVarQ=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected)\n\theader.d=baylibre-com.20210112.gappssmtp.com\n\theader.i=@baylibre-com.20210112.gappssmtp.com header.b=\"V16oU0tG\"; \n\tdkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date;\n\tbh=QiBYrXyaxF19RJBLz2shPLMuW6/D6MB74WXI96PChKs=;\n\tb=3dDVfoe/QJVvUdG5eFm/jojfLd1WRfuBvqZqvG0YEPrCscZOK0sVDLl9BlHD1xT3Bb\n\tAZrGfwD4dWt4OVNq0zqBZYFKkNrcSMUwzbd+FIMBhsd5FbIvsmr07rAosTq9Ch/md92C\n\tRcmQXlCzU1mPaCEzXVE4VDbThDkYczC8Bn2leQ8HXyWpKDbFwAk5WvLoulxqNWXZ8EUT\n\t8jlKjVnp+tZFVXqUSOSpU7hdtSMG+zG30Whkk0m5aUW+bUSqROuG6edQmrsYFM2lssxU\n\tCMXdj3SmEPHeikcLWg1/LZKvF1r8/+C6BmiEx00cvvsFraAYPKmjgnNX+RYoH+HFWltD\n\t3ibw==","X-Gm-Message-State":"ACrzQf3eT7VytA8MCdZls8rAeruD3Euow6/vEPlVwM8Gxsj7KUoK9Ls5\n\tXdok0Ke9pibAQTMU/gcvS1P9WB0flRB6rzVGbhQFM0Nm7zY9vg==","X-Google-Smtp-Source":"AMsMyM5GhWIBTnfM/IOxzhhvx35KYQA84XbQmis93vceaV8mDnQTA63PeX9rUJ0GwwgOPV1+pOK+g7mmY2M2suGzZ7Q=","X-Received":"by 2002:a05:6e02:1748:b0:2eb:e656:8123 with SMTP id\n\ty8-20020a056e02174800b002ebe6568123mr8781368ill.15.1664781938602;\n\tMon, 03 Oct 2022 00:25:38 -0700 (PDT)","MIME-Version":"1.0","References":"<20220929091245.2159838-1-fsylvestre@baylibre.com>\n\t<20220929091245.2159838-3-fsylvestre@baylibre.com>\n\t<20220930092805.rvxuf7hq27obpy6o@uno.localdomain>","In-Reply-To":"<20220930092805.rvxuf7hq27obpy6o@uno.localdomain>","Date":"Mon, 3 Oct 2022 09:25:27 +0200","Message-ID":"<CALzBHU7kO4ytU65mn7x+PV-iJaPyaNZoG9+O-JrUAm14Zd=exQ@mail.gmail.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH v2 2/2] ipa: rkisp1: Take into account\n\tcolor temperature during LSC algorithm","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":"Florian Sylvestre via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Florian Sylvestre <fsylvestre@baylibre.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":25218,"web_url":"https://patchwork.libcamera.org/comment/25218/","msgid":"<20221003072901.gdvref6jtfu5ti2y@uno.localdomain>","date":"2022-10-03T07:29:01","subject":"Re: [libcamera-devel] [PATCH v2 2/2] ipa: rkisp1: Take into account\n\tcolor temperature during LSC algorithm","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Florian\n\nOn Mon, Oct 03, 2022 at 09:25:27AM +0200, Florian Sylvestre wrote:\n> On Fri, 30 Sept 2022 at 11:28, Jacopo Mondi <jacopo@jmondi.org> wrote:\n> >\n> > Hi Florian\n> >    a nit on top of Laurent's comment\n> >\n> > On Thu, Sep 29, 2022 at 11:12:45AM +0200, Florian Sylvestre via libcamera-devel wrote:\n> > > Add coefficients sets in the YAML tuning file to allow using different set\n> > > depending of the image color temperature (provided by AWB algorithm).\n> > >\n> > > During processing, LSC algorithm computes coefficients by doing a linear\n> > > interpolation between the two closer set.\n> > >\n> > > Signed-off-by: Florian Sylvestre <fsylvestre@baylibre.com>\n> > > ---\n> > >  src/ipa/rkisp1/algorithms/lsc.cpp | 137 +++++++++++++++---\n> > >  src/ipa/rkisp1/algorithms/lsc.h   |  24 +++-\n> > >  src/ipa/rkisp1/data/ov5640.yaml   | 231 ++++++++++++++++++++----------\n> > >  3 files changed, 289 insertions(+), 103 deletions(-)\n> > >\n> > > diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp\n> > > index b1f39dfd..3a45667c 100644\n> > > --- a/src/ipa/rkisp1/algorithms/lsc.cpp\n> > > +++ b/src/ipa/rkisp1/algorithms/lsc.cpp\n> > > @@ -7,6 +7,7 @@\n> > >\n> > >  #include \"lsc.h\"\n> > >\n> > > +#include <algorithm>\n> > >  #include <cmath>\n> > >  #include <numeric>\n> > >\n> > > @@ -89,7 +90,7 @@ static std::vector<uint16_t> parseTable(const YamlObject &tuningData,\n> > >  }\n> > >\n> > >  LensShadingCorrection::LensShadingCorrection()\n> > > -     : initialized_(false)\n> > > +     : initialized_(false), lastCt_(0)\n> > >  {\n> > >  }\n> > >\n> > > @@ -105,14 +106,36 @@ int LensShadingCorrection::init([[maybe_unused]] IPAContext &context,\n> > >       if (xSize_.empty() || ySize_.empty())\n> > >               return -EINVAL;\n> > >\n> > > -     rData_ = parseTable(tuningData, \"r\");\n> > > -     grData_ = parseTable(tuningData, \"gr\");\n> > > -     gbData_ = parseTable(tuningData, \"gb\");\n> > > -     bData_ = parseTable(tuningData, \"b\");\n> > > +     /* Get all defined sets to apply. */\n> > > +     const YamlObject &yamlSets = tuningData[\"sets\"];\n> > > +     if (!yamlSets.isList()) {\n> > > +             LOG(RkISP1Lsc, Error)\n> > > +                     << \"'sets' parameter not found in tuning file\";\n> > > +             return -EINVAL;\n> > > +     }\n> > > +\n> > > +     const auto &sets = yamlSets.asList();\n> > > +     for (const auto &[i, yamlSet] : utils::enumerate(sets)) {\n> > > +             sets_.push_back({});\n> > > +             Components &set = sets_.back();\n> > > +\n> > > +             set.ct = yamlSet[\"ct\"].get<uint32_t>(0);\n> > > +             set.r = parseTable(yamlSet, \"r\");\n> > > +             set.gr = parseTable(yamlSet, \"gr\");\n> > > +             set.gb = parseTable(yamlSet, \"gb\");\n> > > +             set.b = parseTable(yamlSet, \"b\");\n> > > +\n> > > +             if (set.r.empty() || set.gr.empty() ||\n> > > +                 set.gb.empty() || set.b.empty())\n> > > +                     return -EINVAL;\n> >\n> > Maybe an error message to state the tables are malformed ?\n> There is already an error message in the parseTable() function, do you\n> think there is some missing information there?\n\nYou are right, it is enough. Sorry for the noise!\n\n> >\n> > > +     }\n> > >\n> > > -     if (rData_.empty() || grData_.empty() ||\n> > > -         gbData_.empty() || bData_.empty())\n> > > +     if (!std::is_sorted(sets_.begin(), sets_.end(),\n> > > +         [](const auto &a, const auto &b) { return a.ct < b.ct; })) {\n> > > +             LOG(RkISP1Lsc, Error)\n> > > +                     << \"Entries in 'sets' must be in increasing ct order\";\n> > >               return -EINVAL;\n> > > +     }\n> > >\n> > >       initialized_ = true;\n> > >\n> > > @@ -157,36 +180,108 @@ int LensShadingCorrection::configure(IPAContext &context,\n> > >       return 0;\n> > >  }\n> > >\n> > > +void LensShadingCorrection::copyTable(rkisp1_cif_isp_lsc_config &config,\n> > > +                                   const Components &set)\n> > > +{\n> > > +     std::copy(set.r.begin(), set.r.end(),\n> > > +               &config.r_data_tbl[0][0]);\n> > > +     std::copy(set.gr.begin(), set.gr.end(),\n> > > +               &config.gr_data_tbl[0][0]);\n> > > +     std::copy(set.gb.begin(), set.gb.end(),\n> > > +               &config.gb_data_tbl[0][0]);\n> > > +     std::copy(set.b.begin(), set.b.end(),\n> > > +               &config.b_data_tbl[0][0]);\n> > > +}\n> > > +\n> > > +/*\n> > > + * Interpolate LSC parameters based on color temperature value.\n> > > + */\n> > > +void LensShadingCorrection::interpolateTable(rkisp1_cif_isp_lsc_config &config,\n> > > +                                          const Components &set0,\n> > > +                                          const Components &set1,\n> > > +                                          const uint32_t ct)\n> > > +{\n> > > +     double coeff0 = (set1.ct - ct) / (set1.ct - set0.ct);\n> > > +     double coeff1 = (ct - set0.ct) / (set1.ct - set0.ct);\n> > > +\n> > > +     for (unsigned int i = 0; i < RKISP1_CIF_ISP_LSC_SAMPLES_MAX; ++i) {\n> > > +             for (unsigned int j = 0; j < RKISP1_CIF_ISP_LSC_SAMPLES_MAX; ++j) {\n> > > +                     unsigned int sample = i * RKISP1_CIF_ISP_LSC_SAMPLES_MAX + j;\n> > > +\n> > > +                     config.r_data_tbl[i][j] =\n> > > +                             set0.r[sample] * coeff0 +\n> > > +                             set1.r[sample] * coeff1;\n> > > +\n> > > +                     config.gr_data_tbl[i][j] =\n> > > +                             set0.gr[sample] * coeff0 +\n> > > +                             set1.gr[sample] * coeff1;\n> > > +\n> > > +                     config.gb_data_tbl[i][j] =\n> > > +                             set0.gb[sample] * coeff0 +\n> > > +                             set1.gb[sample] * coeff1;\n> > > +\n> > > +                     config.b_data_tbl[i][j] =\n> > > +                             set0.b[sample] * coeff0 +\n> > > +                             set1.b[sample] * coeff1;\n> > > +             }\n> > > +     }\n> > > +}\n> > > +\n> > >  /**\n> > >   * \\copydoc libcamera::ipa::Algorithm::prepare\n> > >   */\n> > > -void LensShadingCorrection::prepare([[maybe_unused]] IPAContext &context,\n> > > -                                 const uint32_t frame,\n> > > +void LensShadingCorrection::prepare(IPAContext &context,\n> > > +                                 [[maybe_unused]] const uint32_t frame,\n> > >                                   [[maybe_unused]] IPAFrameContext &frameContext,\n> > >                                   rkisp1_params_cfg *params)\n> > >  {\n> > > -     if (frame > 0)\n> > > -             return;\n> > > -\n> > >       if (!initialized_)\n> > >               return;\n> > >\n> > >       struct rkisp1_cif_isp_lsc_config &config = params->others.lsc_config;\n> > >\n> > > +     uint32_t ct = context.activeState.awb.temperatureK;\n> > > +     ct = std::clamp(ct, sets_.front().ct, sets_.back().ct);\n> > > +\n> > > +     /*\n> > > +      * Return if the current color temperature value is closed to the\n> > > +      * one used for previous computation.\n> > > +      */\n> > > +     if (utils::abs_diff(ct, lastCt_) < 0.01 * lastCt_)\n> > > +             return;\n> > > +\n> > > +     /*\n> > > +      * Pick the sets to interpolate between, or if the colour temperate is\n> > > +      * close enough to one of the sets, use that set without interpolation.\n> > > +      */\n> > > +     int index = 0;\n> > > +     while (ct > sets_[index + 1].ct)\n> > > +             index++;\n> > > +     Components &set0 = sets_[index];\n> > > +     Components &set1 = sets_[index + 1];\n> > > +     uint32_t ct0 = set0.ct, ct1 = set1.ct;\n> > > +\n> > > +     if (utils::abs_diff(ct0, ct) < 0.1 * ct0) {\n> > > +             LOG(RkISP1Lsc, Error)\n> > > +                     << \"using calibration for \" << ct0;\n> > > +             copyTable(config, set0);\n> > > +     } else if (utils::abs_diff(ct1, ct) < 0.1 * ct1) {\n> > > +             LOG(RkISP1Lsc, Error)\n> > > +                     << \"using calibration for \" << ct1;\n> > > +             copyTable(config, set1);\n> > > +     } else {\n> > > +             LOG(RkISP1Lsc, Error)\n> > > +                     << \"ct is \" << ct << \", interpolating between \"\n> > > +                     << ct0 << \" and \" << ct1;\n> > > +             interpolateTable(config, set0, set1, ct);\n> > > +     }\n> > > +     lastCt_ = ct;\n> > > +\n> > >       memcpy(config.x_grad_tbl, xGrad_, sizeof(config.x_grad_tbl));\n> > >       memcpy(config.y_grad_tbl, yGrad_, sizeof(config.y_grad_tbl));\n> > >       memcpy(config.x_size_tbl, xSizes_, sizeof(config.x_size_tbl));\n> > >       memcpy(config.y_size_tbl, ySizes_, sizeof(config.y_size_tbl));\n> > >\n> > > -     std::copy(rData_.begin(), rData_.end(),\n> > > -               &config.r_data_tbl[0][0]);\n> > > -     std::copy(grData_.begin(), grData_.end(),\n> > > -               &config.gr_data_tbl[0][0]);\n> > > -     std::copy(gbData_.begin(), gbData_.end(),\n> > > -               &config.gb_data_tbl[0][0]);\n> > > -     std::copy(bData_.begin(), bData_.end(),\n> > > -               &config.b_data_tbl[0][0]);\n> > > -\n> > >       params->module_en_update |= RKISP1_CIF_ISP_MODULE_LSC;\n> > >       params->module_ens |= RKISP1_CIF_ISP_MODULE_LSC;\n> > >       params->module_cfg_update |= RKISP1_CIF_ISP_MODULE_LSC;\n> > > diff --git a/src/ipa/rkisp1/algorithms/lsc.h b/src/ipa/rkisp1/algorithms/lsc.h\n> > > index b5cd5047..1cab42ce 100644\n> > > --- a/src/ipa/rkisp1/algorithms/lsc.h\n> > > +++ b/src/ipa/rkisp1/algorithms/lsc.h\n> > > @@ -15,6 +15,14 @@ namespace ipa::rkisp1::algorithms {\n> > >\n> > >  class LensShadingCorrection : public Algorithm\n> > >  {\n> > > +     struct Components {\n> > > +             uint32_t ct;\n> > > +             std::vector<uint16_t> r;\n> > > +             std::vector<uint16_t> gr;\n> > > +             std::vector<uint16_t> gb;\n> > > +             std::vector<uint16_t> b;\n> > > +     };\n> > > +\n> > >  public:\n> > >       LensShadingCorrection();\n> > >       ~LensShadingCorrection() = default;\n> > > @@ -24,21 +32,25 @@ public:\n> > >       void prepare(IPAContext &context, const uint32_t frame,\n> > >                    IPAFrameContext &frameContext,\n> > >                    rkisp1_params_cfg *params) override;\n> > > -\n> > > +     void process(IPAContext &context, const uint32_t frame,\n> > > +                  RkISP1FrameContext &frameCtx,\n> > > +                  const rkisp1_stat_buffer *stats) override;\n> > >  private:\n> > > -     bool initialized_;\n> > > +     void copyTable(rkisp1_cif_isp_lsc_config &config, const Components &set0);\n> > > +     void interpolateTable(rkisp1_cif_isp_lsc_config &config,\n> > > +                           const Components &set0, const Components &set1,\n> > > +                           const uint32_t ct);\n> > >\n> > > -     std::vector<uint16_t> rData_;\n> > > -     std::vector<uint16_t> grData_;\n> > > -     std::vector<uint16_t> gbData_;\n> > > -     std::vector<uint16_t> bData_;\n> > > +     bool initialized_;\n> > >\n> > > +     std::vector<Components> sets_;\n> > >       std::vector<double> xSize_;\n> > >       std::vector<double> ySize_;\n> > >       uint16_t xGrad_[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE];\n> > >       uint16_t yGrad_[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE];\n> > >       uint16_t xSizes_[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE];\n> > >       uint16_t ySizes_[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE];\n> > > +     uint32_t lastCt_;\n> > >  };\n> > >\n> > >  } /* namespace ipa::rkisp1::algorithms */\n> > > diff --git a/src/ipa/rkisp1/data/ov5640.yaml b/src/ipa/rkisp1/data/ov5640.yaml\n> > > index 33a672bc..d80c1655 100644\n> > > --- a/src/ipa/rkisp1/data/ov5640.yaml\n> > > +++ b/src/ipa/rkisp1/data/ov5640.yaml\n> > > @@ -20,82 +20,161 @@ algorithms:\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> > > +      sets:\n> > > +        - ct: 3000\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> > > +        - ct: 7000\n> > > +          r:  [\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +              ]\n> > > +          gr: [\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +              ]\n> > > +          gb: [\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +              ]\n> > > +          b:  [\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +                1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536,\n> > > +              ]\n> > >    - DefectPixelClusterCorrection:\n> > >        fixed-set: false\n> > >        sets:\n> > > --\n> > > 2.34.1\n> > >\n>\n>\n>\n> --\n> Florian Sylvestre","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 CF92BBD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  3 Oct 2022 07:29:06 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 27A6262CC8;\n\tMon,  3 Oct 2022 09:29:06 +0200 (CEST)","from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net\n\t[217.70.183.193])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B9CC7623B5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  3 Oct 2022 09:29:04 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id BE6E524000F;\n\tMon,  3 Oct 2022 07:29:03 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664782146;\n\tbh=BR15nC6PY1M9xtFVAzTwO0PC5mzTx5nr32VZPc4qf2Y=;\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=adJ2cYnrylEcIWMaYa10tvm29rsWv8Ir01hLcQFHN2GJVxii6MgYIh3w1ggBHVPYj\n\tRLjIumQnUoWj+9CLnN6d/0Wp59DnZ+ZoZAclUU8mMEBKSckIQaAhgiPH+2khMOwkMo\n\tAIpnEolykynKdwdJb/E/Qj7R8Zubamk/zw3F+M6IKCoEN4wiGbnYEWK64XqLa3aGhc\n\tPJT2Cy5LBPzDCoW2SwxJ0Tgz/BpPZ3ZNxgNuGXMwBRU7Q1dxoiiuSC0MuB01oard0L\n\tdhKBEHKiVdRdAgChjhIxkd3eY1hVGpCV+B7/XbwGdwTF+PRBu3loN2mtBTsIEe571r\n\tqJJeGUBOU5fqQ==","Date":"Mon, 3 Oct 2022 09:29:01 +0200","To":"Florian Sylvestre <fsylvestre@baylibre.com>","Message-ID":"<20221003072901.gdvref6jtfu5ti2y@uno.localdomain>","References":"<20220929091245.2159838-1-fsylvestre@baylibre.com>\n\t<20220929091245.2159838-3-fsylvestre@baylibre.com>\n\t<20220930092805.rvxuf7hq27obpy6o@uno.localdomain>\n\t<CALzBHU7kO4ytU65mn7x+PV-iJaPyaNZoG9+O-JrUAm14Zd=exQ@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<CALzBHU7kO4ytU65mn7x+PV-iJaPyaNZoG9+O-JrUAm14Zd=exQ@mail.gmail.com>","Subject":"Re: [libcamera-devel] [PATCH v2 2/2] ipa: rkisp1: Take into account\n\tcolor temperature during LSC algorithm","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":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]