{"id":27623,"url":"https://patchwork.libcamera.org/api/covers/27623/?format=json","web_url":"https://patchwork.libcamera.org/cover/27623/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20260805-libipa-algorithms-v7-0-7425b5b795d4@ideasonboard.com>","date":"2026-08-05T16:12:42","name":"[v7,00/32] ipa: libipa: Introduce libipa algorithms","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/?format=json","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"mbox":"https://patchwork.libcamera.org/cover/27623/mbox/","series":[{"id":6110,"url":"https://patchwork.libcamera.org/api/series/6110/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=6110","date":"2026-08-05T16:12:42","name":"ipa: libipa: Introduce libipa algorithms","version":7,"mbox":"https://patchwork.libcamera.org/series/6110/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/27623/comments/","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 7E2E7C3308\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  5 Aug 2026 16:13:26 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 64FAE68129;\n\tWed,  5 Aug 2026 18:13:25 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B194568117\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  5 Aug 2026 18:13:24 +0200 (CEST)","from [192.168.125.177] (mob-109-113-25-35.net.vodafone.it\n\t[109.113.25.35])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 707455B3;\n\tWed,  5 Aug 2026 18:12:13 +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=\"DtXhHt5N\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1785946334;\n\tbh=bLK7GW7ZcrHN/LK+eL27oNFQi/IajI7gWQ6TavQyk0o=;\n\th=From:Subject:Date:To:Cc:From;\n\tb=DtXhHt5NR3brdsmNw7fDkBdUOY8rWzBFwNat/d8IZmgAernS/AAZDqtoKl/6VyY13\n\tra45rhqhivy+xURgpqtte913IAFFI2xN0vSP4Kx+Q8S12fwTriREaOERAWJTQHt9oi\n\t48R2Mh7pE2kTSVCrpspUTjovapg1ZYiUW4l6GKnc=","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Subject":"[PATCH v7 00/32] ipa: libipa: Introduce libipa algorithms","Date":"Wed, 05 Aug 2026 18:12:42 +0200","Message-Id":"<20260805-libipa-algorithms-v7-0-7425b5b795d4@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"7bit","X-B4-Tracking":"v=1; b=H4sIAPpgc2oC/4XQS27DIBAG4KtErEuFh5enq96j6gLwECMlJoLIa\n\thX57sXZ1Au7Xf4jzTePB6tUElX2dnqwQnOqKU8t2JcTC6ObzsTT0DIDAUaYTvNL8unmuLucc0n\n\t38Vq5RmOMD044iKz13QrF9PU0Pz5bHlO95/L9HDF3a/Uvbe644IQKA0qrAOg9DeRqnnx2ZXgN+\n\tcpWdIYNBHIPggZFtErK2AGpI0j+QlaYPUg2CE1vtfVC9t4fQGoL9XuQWjcShBiF1IDqANL/Qrp\n\tBwmocmoNRwwFkNhCIPciszw4UvJXtVWHvtGVZfgBGTzn8JgIAAA==","X-Change-ID":"20260615-libipa-algorithms-59666bca0a2f","To":"libcamera-devel@lists.libcamera.org, \n\tStefan Klug <stefan.klug@ideasonboard.com>, \n\tMilan Zamazal <mzamazal@redhat.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>, \n\tKieran Bingham <kieran.bingham@ideasonboard.com>, \n\tDaniel Scally <dan.scally@ideasonboard.com>, \n\tRobert Mader <robert.mader@collabora.com>, \n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","X-Mailer":"b4 0.16-dev","X-Developer-Signature":"v=1; a=openpgp-sha256; l=7183;\n\ti=jacopo.mondi@ideasonboard.com; h=from:subject:message-id;\n\tbh=bLK7GW7ZcrHN/LK+eL27oNFQi/IajI7gWQ6TavQyk0o=;\n\tb=owEBbQKS/ZANAwAKAXI0Bo8WoVY8AcsmYgBqc2EY3WTo5fVtDlN9kuimqfHyYb32nSCHSBYLS\n\tkeatlnAdQ+JAjMEAAEKAB0WIQS1xD1IgJogio9YOMByNAaPFqFWPAUCanNhGAAKCRByNAaPFqFW\n\tPIV/EACrkUi5CakwlksJrIrKKUPgN2J0/1RcuO6TvQ47kYpkdjXOB+vGcefWiGVwNN1N27eCB8v\n\tPKwJgEbqIT9BDv/EI58lWt5Ap2/9fZavkUgw9GllhcKUbvsvqQT9UK7UGTKx2PoIsyQXk/noFa9\n\tpM1ZWNczq+lzAG3VEiDCwpQ7mdMETYw10pcsafbQItblGICRNa/z1eRHIT3WL4vQp5I1O/ddmbl\n\tBi9xhHCNOfGAsLE3eipbfvDJ58gDy9dZL2QHpr/LgJ0RwGofeg+v39DPhiuCV4bS3My1lJH0zVo\n\tytMJeDFl+I34IVuNjky9ThMns8ObTX/FHLJ9Pt3dojq4SVJhTeppLQfwjiD2V+SWDzi8AXjhja4\n\tl5+SQILHFBUVwib7DuX+j+mRlaibZGo3tNiDCenYt0EmKdkfP+fbPb9gW+Nf+Jo0WmZ9OnKherJ\n\tn5gjg6Uog/oIanZdBtx5QzkUvRTIrTKqxvEvV3MAbZiodnTJM9LPfQvzDhvKMoLoSByUcGG9Tul\n\t9QVVSylSq2sZWtVwFBwp9UjRpl+qGE3mYMj6uEVGW7UaFbqwc1vXGRzxwtgKvGZ9enr1ewYnbQI\n\taEmMJbBXeG/B7+1zI4+3iNPB659+bnYSENfp7SFqJEVntsvvFblHcCrWI+9az6LF0ymzEUnGNeI\n\tb9sya9HJeD891NA==","X-Developer-Key":"i=jacopo.mondi@ideasonboard.com; a=openpgp;\n\tfpr=72392EDC88144A65C701EA9BA5826A2587AD026B","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>"},"content":"v7 builds on v6 but removes the requirement for IPA modules to define\ntheir own Interpolatator overloads.\n\nThe interface for IPA modules is similar to v5, but the quantization of\ngain values happens in LscAlgorithm like in v6.\n\nI think this is a nice compromise, and I hope we can move forwards with\nthis and merge it soon.\n\nMilan: I haven't take you Simple patches (as I promised to) because your\nseries has other commits that I know not much about. However, rebasing\nshould hopefully be simple enough ? Sorry for pulling you in too many\ndirections!\n\nSigned-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n---\nChanges in v7:\n- Address Barnabas' comments on using try_emplace and avoid copies when\n  populating maps\n- Move Components<> and ComponentsMap<> outside of LscAlgorithm to avoid\n  IPA to define their own Interpolator::interpolate<> overloads\n\nChanges in v6:\n- Address comments received on v5, mostly on documentation\n- Remove templating of LscPolynomial and perform quantization in\n  LscAlgorithm\n\nChanges in v5:\n- Add \"ipa: libipa: lsc_polynomial: Fix polynomial parsing error\"\n  to fix and exiting potential issue with Polynomial parsing\n- Fix Simple, which I broke in v4, thanks Milan\n\nChanges in v4:\n- s/awb/AWB in comments everywhere, same for CCM and LSC\n- Awb: changelog per patch\n  - Make AwbStats pure virtual and move stats parsing logic to the IPA\n    modules\n  - Reduce comments/renames to reduce patch size and comments\n- Collect tags\n\nChanges in v3:\n- Address comments on Awb from Stefan:\n  - Introduce AwbImplementation::Result\n  - Move AwbStats implementation to IPAs\n  - Drop AwbStats::rg()/bg() and re-implement AwbGray accordingly\n- Fix Saturation bug in Simple Ccm algorithm\n- Fix Simple Ccm gain limits using Q<2, 8>\n- Update Mali CCM and Gamma to latest uAPI patch version\n- Fix Mali CCM gain masking as reported by Dan\n- Break down libIPA Lsc implementation as requested by Stefan\n\nChanges in v2:\n- Introduce awb::Context to simplify ActiveState and FrameContext\n  definition\n- Add mali uAPI header for CCM and Gamma\n- Do not rename Mali functions for hardware configuration in awb and lsc\n- Spelling and documentation\n\n---\nJacopo Mondi (29):\n      ipa: libipa: awb: Reimplement AwbAlgorithm\n      ipa: mali-c55: awb: Port to use libipa AwbAlgorithm\n      ipa: libipa: Add CcmAlgorithm to libipa\n      ipa: rkisp1: ccm: Port to use CcmAlgorithm\n      include: linux: mali-c55: Update to support CCM and Gamma\n      ipa: mali-c55: Implement Ccm algorithm\n      ipa: rkisp1: lsc: Re-architecture Lsc support\n      ipa: libipa: Introduce lsc_base.h\n      ipa: libipa: lsc_polynomial: Fix polynomial parsing error\n      ipa: libipa: lsc_polynomial: Rename LscPolynomial\n      ipa: libipa: lsc_polynomial: Do not inline functions\n      ipa: libipa: lsc: Move Interpolator<lsc::Components> to lsc_base\n      ipa: rkisp1: lsc: Remove rogue empty line\n      ipa: libipa: lsc_polynomial: Move LscPolynomial from RkISP1\n      ipa: libipa: lsc_table: Move LscTable from RkISP1\n      ipa: libipa: lsc_base: Add sampleForCrop documentation\n      ipa: libipa: lsc: Introduce LscAlgorithm\n      ipa: libipa: lsc: Move sizesListToPositions() back to rkisp1\n      ipa: rkisp1: lsc: Port to use LscAlgorithm\n      ipa: libipa: lsc: Make Components a map<>\n      ipa: libipa: lsc: Document Components parsing\n      ipa: libipa: lsc_polynomial: Remove sensorSize_\n      ipa: libipa: lsc: Document LscDescriptor::sensorSize usage\n      ipa: libipa: lsc: Quantize gains in IPA\n      ipa: libipa: lsc: Quantize gains in LscAlgorithm\n      ipa: libipa: lsc: Re-sort LscAlgorithmBase documentation\n      ipa: mali-c55: Add sensorInfo to IPAContext\n      ipa: mali-c55: Port to use LscAlgorithm\n      ipa: libipa: lsc: Specialize Interpolator for uint8_t\n\nKieran Bingham (2):\n      ipa: simple: awb: Port to use libipa AwbAlgorithm\n      ipa: simple: Port to use libipa CcmAlgorithm\n\nLaurent Pinchart (1):\n      ipa: libipa: lsc_polynomial: Don't inline ValueNode accessor\n\n .../internal/software_isp/debayer_params.h         |   4 +-\n include/linux/media/arm/mali-c55-config.h          |  86 +++-\n src/ipa/libipa/awb.cpp                             | 418 ++++++++++++++++---\n src/ipa/libipa/awb.h                               | 100 ++++-\n src/ipa/libipa/awb_bayes.cpp                       |  52 +--\n src/ipa/libipa/awb_bayes.h                         |  12 +-\n src/ipa/libipa/awb_grey.cpp                        |  16 +-\n src/ipa/libipa/awb_grey.h                          |   6 +-\n src/ipa/libipa/ccm.cpp                             | 245 +++++++++++\n src/ipa/libipa/ccm.h                               |  77 ++++\n src/ipa/libipa/lsc.cpp                             | 447 +++++++++++++++++++++\n src/ipa/libipa/lsc.h                               | 137 +++++++\n src/ipa/libipa/lsc_base.cpp                        | 138 +++++++\n src/ipa/libipa/lsc_base.h                          |  52 +++\n src/ipa/libipa/lsc_polynomial.cpp                  | 202 +++++++++-\n src/ipa/libipa/lsc_polynomial.h                    | 100 ++---\n src/ipa/libipa/lsc_table.cpp                       | 117 ++++++\n src/ipa/libipa/lsc_table.h                         |  55 +++\n src/ipa/libipa/meson.build                         |   8 +\n src/ipa/mali-c55/algorithms/awb.cpp                | 223 +++++-----\n src/ipa/mali-c55/algorithms/awb.h                  |  28 +-\n src/ipa/mali-c55/algorithms/ccm.cpp                | 173 ++++++++\n src/ipa/mali-c55/algorithms/ccm.h                  |  66 +++\n src/ipa/mali-c55/algorithms/lsc.cpp                | 160 +++++---\n src/ipa/mali-c55/algorithms/lsc.h                  |  32 +-\n src/ipa/mali-c55/algorithms/meson.build            |   1 +\n src/ipa/mali-c55/ipa_context.cpp                   |   3 +\n src/ipa/mali-c55/ipa_context.h                     |  20 +-\n src/ipa/mali-c55/mali-c55.cpp                      |   2 +\n src/ipa/mali-c55/params.h                          |   2 +\n src/ipa/rkisp1/algorithms/awb.cpp                  | 191 ++-------\n src/ipa/rkisp1/algorithms/awb.h                    |  18 +-\n src/ipa/rkisp1/algorithms/ccm.cpp                  |  97 +----\n src/ipa/rkisp1/algorithms/ccm.h                    |  17 +-\n src/ipa/rkisp1/algorithms/lsc.cpp                  | 428 +++-----------------\n src/ipa/rkisp1/algorithms/lsc.h                    |  38 +-\n src/ipa/rkisp1/ipa_context.h                       |  49 +--\n src/ipa/simple/algorithms/awb.cpp                  | 140 +++++--\n src/ipa/simple/algorithms/awb.h                    |  28 ++\n src/ipa/simple/algorithms/blc.cpp                  |   2 +-\n src/ipa/simple/algorithms/ccm.cpp                  |  74 ++--\n src/ipa/simple/algorithms/ccm.h                    |  22 +-\n src/ipa/simple/ipa_context.h                       |  15 +-\n src/libcamera/software_isp/debayer_cpu.cpp         |  12 +-\n 44 files changed, 2976 insertions(+), 1137 deletions(-)\n---\nbase-commit: 93bed4da915c8c88d68d1a286048f10147cc831a\nchange-id: 20260615-libipa-algorithms-59666bca0a2f\n\nBest regards,\n--  \nJacopo Mondi <jacopo.mondi@ideasonboard.com>"}