{"id":20507,"url":"https://patchwork.libcamera.org/api/1.1/covers/20507/?format=json","web_url":"https://patchwork.libcamera.org/cover/20507/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/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":"<20240703135000.242227-1-stefan.klug@ideasonboard.com>","date":"2024-07-03T13:49:48","name":"[v3,0/6] ipa: Add black level to camera sensor helpers","submitter":{"id":184,"url":"https://patchwork.libcamera.org/api/1.1/people/184/?format=json","name":"Stefan Klug","email":"stefan.klug@ideasonboard.com"},"mbox":"https://patchwork.libcamera.org/cover/20507/mbox/","series":[{"id":4436,"url":"https://patchwork.libcamera.org/api/1.1/series/4436/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4436","date":"2024-07-03T13:49:48","name":"ipa: Add black level to camera sensor helpers","version":3,"mbox":"https://patchwork.libcamera.org/series/4436/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/20507/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 4D64FBD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  3 Jul 2024 13:50:08 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 37AF262E22;\n\tWed,  3 Jul 2024 15:50:07 +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 206AD62C95\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  3 Jul 2024 15:50:06 +0200 (CEST)","from ideasonboard.com (unknown\n\t[IPv6:2a00:6020:448c:6c00:9263:c199:9587:576])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C47E23D6;\n\tWed,  3 Jul 2024 15:49:37 +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=\"t7mB1jaN\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1720014577;\n\tbh=xxaep0JbtP6HJ9SJeGefIJJd13m6qfg9ZnYcPGWw2vw=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=t7mB1jaNJxhtDD71w/qcp2U4KjJYpNIXH6sgXXADmYi4b4SuqjiNjAaFjRttUzU/5\n\tmdsP8ZDjAq1x6JmsTWsid5kux3JfmXDak1Yv2ZqzWMAm2lm7FL38TrHYJG1TJDKKjk\n\t9zkrU0Ydf4Lgef7cXtCt6BezojvWrhnbUHSBZihg=","From":"Stefan Klug <stefan.klug@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Stefan Klug <stefan.klug@ideasonboard.com>","Subject":"[PATCH v3 0/6] ipa: Add black level to camera sensor helpers","Date":"Wed,  3 Jul 2024 15:49:48 +0200","Message-ID":"<20240703135000.242227-1-stefan.klug@ideasonboard.com>","X-Mailer":"git-send-email 2.43.0","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","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":"For the tuning process and the BLC block, the sensor black level needs\nto be known. The black level usually consists of a pedestal value added\nby the sensor and additional physical effects like dark currents. The\nsensors are usually programmed with fixed pedestal value or to\ntarget a defined black level using internal algorithms. We are not aware\nof any sensor driver that changes these values from the defaults\nmentioned in the datasheets. It therefore makes sense to keep that\ninformation inside libcamera. When the need arises to be more flexible\nwe can extend the sensor drivers to report black level information.\n\nThis series adds black level support to the camera sensor helpers and\nthe corresponding metadata to the rkisp1 ipa. Aditionally it removes the\nblack level information from the existing tuning files. When we observe\nthat the hardcoded values are too far off from actual measurements an\nadditional offset can be added to the tuning files.\n\nMy tuning series will be rebased on top of this one.\n\nBest regards,\nStefan\n\nChanges in v2:\n- Store a single int16_t black level inside camera sensor helper. This\n  is sufficient for all known use cases.\n- Fix scaling from 16bit down to 12bit for the rkisp1.\n- Add more documentation text and (hopefully) clarify some commit\n  messages.\n- Reworked the tuning data handling as proposed by Laurent.\n- Updated all tuning files that contained black level values.\n\nChanges in v3:\n- Fixed incorrect shift direction in P3/6\n- Added missing docs for blackLevel_\n- Added comments to the black level values\n- Fixed some typos and review suggestions\n\nStefan Klug (6):\n  ipa: libipa: Add black levels to camera sensor helper\n  ipa: rkisp1: Move camHelper into IPAContext\n  ipa: rkisp1: blc: Query black levels from camera sensor helper\n  ipa: rkisp1: blc: Report sensor black levels in metadata\n  ipa: rkisp1: data: Update tuning files for imx219 and imx258\n  ipa: rkisp1: Move ov4689 and ov5640 black levels into sensor helpers\n\n src/ipa/libipa/camera_sensor_helper.cpp | 42 +++++++++++++\n src/ipa/libipa/camera_sensor_helper.h   |  3 +\n src/ipa/rkisp1/algorithms/blc.cpp       | 82 ++++++++++++++++++++++---\n src/ipa/rkisp1/algorithms/blc.h         |  5 +-\n src/ipa/rkisp1/data/imx219.yaml         |  4 --\n src/ipa/rkisp1/data/imx258.yaml         |  1 +\n src/ipa/rkisp1/data/ov4689.yaml         |  4 --\n src/ipa/rkisp1/data/ov5640.yaml         |  4 --\n src/ipa/rkisp1/data/uncalibrated.yaml   |  1 +\n src/ipa/rkisp1/ipa_context.h            |  6 ++\n src/ipa/rkisp1/rkisp1.cpp               | 26 ++++----\n 11 files changed, 143 insertions(+), 35 deletions(-)"}