[{"id":35313,"web_url":"https://patchwork.libcamera.org/comment/35313/","msgid":"<175466411877.354573.11878411467569624408@localhost>","date":"2025-08-08T14:41:58","subject":"Re: [PATCH v2 00/16] Implement WDR algorithm","submitter":{"id":184,"url":"https://patchwork.libcamera.org/api/people/184/","name":"Stefan Klug","email":"stefan.klug@ideasonboard.com"},"content":"Oops, CI just told me that I broke pipelines (rpi, c55) that I don't\nusually build :-)\n\nI'll fix these for v3. This version is imho still fine for review.\n\nBest regards,\nStefan\n\nQuoting Stefan Klug (2025-08-08 16:12:38)\n> Hi all,\n> \n> This series implements a global tone mapping algorithm for rkisp1.  The\n> details of the algorithms are explained in patch 15/16, so I won't\n> repeat them here.\n> \n> v1 of the series was here:\n> https://patchwork.libcamera.org/project/libcamera/list/?series=5122\n> \n> Compared to v1 of the series there were quite some changes. The old\n> series contained mitigation for exposure quantization using the AWB\n> gains. During my work on HDR stitching support it got clear that we need\n> to use the compression curve from the companding block of the imx8mp.\n> That curve can serve as a way better gain than the AWB gains, so I added\n> a compression algorithm (patches 1-2) which then is used for the\n> quantization correction.  The quantization correction was generalized to\n> support exposure and gain quantization effects (patches 3-9). Patch 10\n> spilled over from the WDR preparation series and now has a (possibly)\n> better commit message.  The rest is the actual WDR implementation that\n> was mostly there in v1. I fixed a few bugs and included changes from\n> review (thanks Paul). The details are in the individual patches.\n> \n> Best regards,\n> Stefan\n> \n> Stefan Klug (16):\n>   ipa: rkisp1: Add basic compression algorithm\n>   tuning: rksip1: Add a static Compress entry\n>   libipa: camera_sensor_helper: Add quantizeGain() function\n>   libipa: exposure_mode_helper: Take exposure/gain quantization into\n>     account\n>   libipa: exposure_mode_helper: Remove double calculation of\n>     lastStageGain\n>   libipa: exposure_mode_helper: Remove unnecessary clamp calls\n>   libipa: agc_mean_luminance: Configure the exposure mode helpers\n>   libipa: exposure_mode_helper: Calculate quantization gain in\n>     splitExposure()\n>   ipa: rkisp1: agc: Add correction for exposure quantization\n>   pipeline: rkisp1: Add error log when parameter queuing fails\n>   include: linux: Partially update linux headers from\n>     v6.16-rc1-310-gd968e50b5c26\n>   libcamera: Add PID controller class\n>   ipa: rkisp1: Switch histogram to RGB combined mode\n>   pipeline: rkisp1: Query kernel for available params blocks\n>   ipa: rkisp1: Add WDR algorithm\n>   tuning: rksip1: Add a static WideDynamicRange entry\n> \n>  include/libcamera/internal/meson.build      |   1 +\n>  include/libcamera/internal/pid_controller.h |  46 ++\n>  include/libcamera/ipa/rkisp1.mojom          |   2 +-\n>  include/linux/rkisp1-config.h               | 108 ++++-\n>  include/linux/v4l2-controls.h               |  17 +-\n>  src/ipa/ipu3/algorithms/agc.cpp             |   4 +-\n>  src/ipa/libipa/agc_mean_luminance.cpp       |  22 +-\n>  src/ipa/libipa/agc_mean_luminance.h         |   3 +-\n>  src/ipa/libipa/camera_sensor_helper.cpp     |  23 +\n>  src/ipa/libipa/camera_sensor_helper.h       |   1 +\n>  src/ipa/libipa/exposure_mode_helper.cpp     | 103 ++--\n>  src/ipa/libipa/exposure_mode_helper.h       |  12 +-\n>  src/ipa/rkisp1/algorithms/agc.cpp           |  35 +-\n>  src/ipa/rkisp1/algorithms/compress.cpp      | 100 ++++\n>  src/ipa/rkisp1/algorithms/compress.h        |  33 ++\n>  src/ipa/rkisp1/algorithms/meson.build       |   2 +\n>  src/ipa/rkisp1/algorithms/wdr.cpp           | 510 ++++++++++++++++++++\n>  src/ipa/rkisp1/algorithms/wdr.h             |  64 +++\n>  src/ipa/rkisp1/ipa_context.h                |  23 +\n>  src/ipa/rkisp1/params.cpp                   |   1 +\n>  src/ipa/rkisp1/params.h                     |   2 +\n>  src/ipa/rkisp1/rkisp1.cpp                   |  20 +-\n>  src/libcamera/control_ids_debug.yaml        |   7 +-\n>  src/libcamera/control_ids_draft.yaml        |  70 +++\n>  src/libcamera/meson.build                   |   1 +\n>  src/libcamera/pid_controller.cpp            | 172 +++++++\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp    |  38 +-\n>  utils/tuning/rkisp1.py                      |   9 +-\n>  28 files changed, 1364 insertions(+), 65 deletions(-)\n>  create mode 100644 include/libcamera/internal/pid_controller.h\n>  create mode 100644 src/ipa/rkisp1/algorithms/compress.cpp\n>  create mode 100644 src/ipa/rkisp1/algorithms/compress.h\n>  create mode 100644 src/ipa/rkisp1/algorithms/wdr.cpp\n>  create mode 100644 src/ipa/rkisp1/algorithms/wdr.h\n>  create mode 100644 src/libcamera/pid_controller.cpp\n> \n> -- \n> 2.48.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 CB981BEFBE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  8 Aug 2025 14:42:03 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0E9AE6084D;\n\tFri,  8 Aug 2025 16:42:03 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E9F096084D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  8 Aug 2025 16:42:01 +0200 (CEST)","from ideasonboard.com (unknown\n\t[IPv6:2a00:6020:448c:6c00:3ea1:35ac:90da:a221])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id ED8BC185B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  8 Aug 2025 16:41:11 +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=\"a2jeii4l\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1754664072;\n\tbh=KCuXzC/DcqBnSUTX2VmyUAdR3i4VG2PMiBm0m+XOZ5E=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=a2jeii4ldbWU5MOn4fXWOFM6w3o8ZNew+itBSuAqotaNqxCW/Zez5spN3YEhwnWqh\n\tDoMjXm+o6MQJdFpE4r00K8dXOUkcYpt3uBz3N8RvZTCnuX0IerqdiQpNnuNRy03rqN\n\thqKrIHYH0uyw1nMo6fY5o1nKsrxpoVhGyneNVYKk=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20250808141315.413839-1-stefan.klug@ideasonboard.com>","References":"<20250808141315.413839-1-stefan.klug@ideasonboard.com>","Subject":"Re: [PATCH v2 00/16] Implement WDR algorithm","From":"Stefan Klug <stefan.klug@ideasonboard.com>","Cc":"","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 08 Aug 2025 16:41:58 +0200","Message-ID":"<175466411877.354573.11878411467569624408@localhost>","User-Agent":"alot/0.12.dev8+g2c003385c862.d20250602","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>"}}]