[{"id":39694,"web_url":"https://patchwork.libcamera.org/comment/39694/","msgid":"<178402670698.3603632.11801394093229625973@localhost>","date":"2026-07-14T10:58:26","subject":"Re: [PATCH v5 29/36] ipa: libipa: lsc: Document\n\tLscDescriptor::sensorSize usage","submitter":{"id":184,"url":"https://patchwork.libcamera.org/api/people/184/","name":"Stefan Klug","email":"stefan.klug@ideasonboard.com"},"content":"Hi Jacopo,\n\nQuoting Jacopo Mondi (2026-07-08 17:51:11)\n> Now that sensorSize_ has been removed from LscPolynomial and is\n> passed to the Lsc algorithm through LscDescriptor document its intended\n> purpose.\n> \n> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> ---\n>  src/ipa/libipa/lsc.cpp | 4 ++++\n>  1 file changed, 4 insertions(+)\n> \n> diff --git a/src/ipa/libipa/lsc.cpp b/src/ipa/libipa/lsc.cpp\n> index 1d2f8eb1b41b..13b1b738106b 100644\n> --- a/src/ipa/libipa/lsc.cpp\n> +++ b/src/ipa/libipa/lsc.cpp\n> @@ -179,6 +179,10 @@ namespace lsc {\n>   *          k4: 0.0\n>   * \\endcode\n>   *\n> + * The LSC tables or the polynomial definition are generated at tuning time\n> + * using an image of known resolution which needs to be specified in\n> + * LscDescriptor::sensorSize.\n> + *\n\nThis is not entirely correct (But also depends on the rectangle\ndiscussion). The generation might happen with something that is smaller\nthan sensor size. The values are then normalized to the physical\nsensor size in the tuning process (we could also carry the tuning crop\nrectangle in the tuning file and do the normalization here, but that is\nan implementation detail).\n\nWhat about:\n* The LSC polynomial definition is generated at tuning time in relation\n* to the full sensor pixel array. This needs to be specified in\n* LscDescriptor::sensorSize.\n\nThat is also not perfect, but breaks the assumption that sensorSize\nequals the tuning image size.\n\nWriting that I realize that it would be more transparent to include the\nsource crop information in the tuning file. But that should be done on\ntop.\n\nWith the docs change:\nReviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>\n\nBest regards,\nStefan\n\n\n>   * At LscAlgorithm::configure() time the LSC tables are re-sampled on the\n>   * sensor's crop rectangle in use to adapt them to the configuration in use for\n>   * a streaming session. Polynomial LSC tables support re-sampling and can be\n> \n> -- \n> 2.54.0\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 8D56EBF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 14 Jul 2026 10:58:31 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A93356613C;\n\tTue, 14 Jul 2026 12:58:30 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 50A0B66137\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 14 Jul 2026 12:58:29 +0200 (CEST)","from ideasonboard.com (unknown\n\t[IPv6:2a00:6020:448c:6c00:6c1f:355d:1c19:aba6])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 12BEB7CA;\n\tTue, 14 Jul 2026 12:57:35 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"LF/q+ufv\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1784026655;\n\tbh=ddKQg1eHLRIUTlNJ9XFzQMCk4q0hz03J68g114uZGRo=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=LF/q+ufvkfzuV1RQAcaebeCYyJYiGEhsbfWLRV4SvIWvXeQUxJdGzIGWWlTdn9qav\n\t1Ux/VpJQ50hr/wU6uVG9a2sJZKoVquBonuV5tiNwQFQVCJn7Dac4n5SZKJTXevInZU\n\taLMJCjlsZDBkMzijAhKgID++Wj29zwhFHBdSYJ7s=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20260708-libipa-algorithms-v5-29-0759d0359f52@ideasonboard.com>","References":"<20260708-libipa-algorithms-v5-0-0759d0359f52@ideasonboard.com>\n\t<20260708-libipa-algorithms-v5-29-0759d0359f52@ideasonboard.com>","Subject":"Re: [PATCH v5 29/36] ipa: libipa: lsc: Document\n\tLscDescriptor::sensorSize usage","From":"Stefan Klug <stefan.klug@ideasonboard.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Tue, 14 Jul 2026 12:58:26 +0200","Message-ID":"<178402670698.3603632.11801394093229625973@localhost>","User-Agent":"alot/0.12.dev43+g2cacc0d03","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":39704,"web_url":"https://patchwork.libcamera.org/comment/39704/","msgid":"<178404993084.3931061.9599178252672913858@ping.linuxembedded.co.uk>","date":"2026-07-14T17:25:30","subject":"Re: [PATCH v5 29/36] ipa: libipa: lsc: Document\n\tLscDescriptor::sensorSize usage","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Stefan Klug (2026-07-14 11:58:26)\n> Hi Jacopo,\n> \n> Quoting Jacopo Mondi (2026-07-08 17:51:11)\n> > Now that sensorSize_ has been removed from LscPolynomial and is\n> > passed to the Lsc algorithm through LscDescriptor document its intended\n> > purpose.\n> > \n> > Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> > ---\n> >  src/ipa/libipa/lsc.cpp | 4 ++++\n> >  1 file changed, 4 insertions(+)\n> > \n> > diff --git a/src/ipa/libipa/lsc.cpp b/src/ipa/libipa/lsc.cpp\n> > index 1d2f8eb1b41b..13b1b738106b 100644\n> > --- a/src/ipa/libipa/lsc.cpp\n> > +++ b/src/ipa/libipa/lsc.cpp\n> > @@ -179,6 +179,10 @@ namespace lsc {\n> >   *          k4: 0.0\n> >   * \\endcode\n> >   *\n> > + * The LSC tables or the polynomial definition are generated at tuning time\n> > + * using an image of known resolution which needs to be specified in\n> > + * LscDescriptor::sensorSize.\n> > + *\n> \n> This is not entirely correct (But also depends on the rectangle\n> discussion). The generation might happen with something that is smaller\n> than sensor size. The values are then normalized to the physical\n> sensor size in the tuning process (we could also carry the tuning crop\n> rectangle in the tuning file and do the normalization here, but that is\n> an implementation detail).\n> \n> What about:\n> * The LSC polynomial definition is generated at tuning time in relation\n> * to the full sensor pixel array. This needs to be specified in\n> * LscDescriptor::sensorSize.\n> \n> That is also not perfect, but breaks the assumption that sensorSize\n> equals the tuning image size.\n> \n> Writing that I realize that it would be more transparent to include the\n> source crop information in the tuning file. But that should be done on\n> top.\n\nI had wondered how we convey the 'range' (or scale?) of the polynomial.\nI guess there is currently an implicit assumption it's from \"the active\narea\" or such - but as these definitions seem to be difficult, and so\nyes I think adding more detail in the tuning file entries makes sense -\nbut that's not there currently so not part of this series:\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> \n> With the docs change:\n> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> \n> Best regards,\n> Stefan\n> \n> \n> >   * At LscAlgorithm::configure() time the LSC tables are re-sampled on the\n> >   * sensor's crop rectangle in use to adapt them to the configuration in use for\n> >   * a streaming session. Polynomial LSC tables support re-sampling and can be\n> > \n> > -- \n> > 2.54.0\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 74C6BBF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 14 Jul 2026 17:25:36 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6EDD46614D;\n\tTue, 14 Jul 2026 19:25:35 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CC7BB66145\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 14 Jul 2026 19:25:33 +0200 (CEST)","from monstersaurus.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 42427558;\n\tTue, 14 Jul 2026 19:24:39 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"DnqwppIW\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1784049879;\n\tbh=iPQNky0mAZEkO5I28RWoYa7Eqea6HFhdvrabDpKkxNQ=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=DnqwppIW8wXEnyu2w8snR+v5HcS+hgXIprTH09yhV8xZaPzo8kLHKwPNF0dJzM0Pm\n\txn0v7dGNDyiN5sK8pxT6t/DwViMe5X9iqKMLqXEFBO9+6k8max/VVmc2ZnqkcmvPOp\n\tKGozgeHiERulOL2l2ND4gqohPQ7bJ4JbLxHnnPkY=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<178402670698.3603632.11801394093229625973@localhost>","References":"<20260708-libipa-algorithms-v5-0-0759d0359f52@ideasonboard.com>\n\t<20260708-libipa-algorithms-v5-29-0759d0359f52@ideasonboard.com>\n\t<178402670698.3603632.11801394093229625973@localhost>","Subject":"Re: [PATCH v5 29/36] ipa: libipa: lsc: Document\n\tLscDescriptor::sensorSize usage","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tStefan Klug <stefan.klug@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Tue, 14 Jul 2026 18:25:30 +0100","Message-ID":"<178404993084.3931061.9599178252672913858@ping.linuxembedded.co.uk>","User-Agent":"alot/0.9.1","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]