From patchwork Thu Nov 10 04:52:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 17762 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 7CEDBBD16B for ; Thu, 10 Nov 2022 04:53:10 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C7FFF6307B; Thu, 10 Nov 2022 05:53:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1668055989; bh=PtZh4ZLrUMo5jP9F6M/h04IwA4i0iF4Amv7WO0EB7vE=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=KHRYrBIKvzWSMD0KVHLCmuaOC9I8waNBvpOlBisFiBm4Ee39ilAWMZxsfZmIjN8Lw N6NxZwSx4cBmcgBdQDxzDtus8jEHID9/VXUjwIwdYgktU1XCW4KLP7Jn7qu1kV2WTG 52Hp676CSBp9jFh4NTzaiFHZpSiKGE2jsDphAFuGlEMizftXwbFKNdsp1GVEbh1dTd sDReMnhQvSFd2ovR240Wsj1JS5xgMZQjvrB2UzJfSktuGXIqjQD9C2gu7SV4zSmTZV 6L24OVlL/7TFdbBHBc9SmX722YDfJciKqOtOy44UF56P1+APmpMAsHhz7REh5gRCZ2 DnBxRDFDmJVUg== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 265E161F38 for ; Thu, 10 Nov 2022 05:53:08 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="iWb81iWV"; dkim-atps=neutral Received: from pyrite.tail37cf.ts.net (h175-177-042-159.catv02.itscom.jp [175.177.42.159]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 8608A499; Thu, 10 Nov 2022 05:53:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1668055987; bh=PtZh4ZLrUMo5jP9F6M/h04IwA4i0iF4Amv7WO0EB7vE=; h=From:To:Cc:Subject:Date:From; b=iWb81iWVskFnQgPtSAbr3CAlX97kZH2APcKyM5VgQmLO9NjC8ncBLdbsZkI6CDiAR UIbF5OSA6CD5U88Oct/HQ90W10vfIRnAuniEDEkcIf/8BA6Aux2dmGXPnydPaTgIOD IZrqpbfFRG6zWUfQIkuIe1HNVwQT8/dCyVKlDxFQ= To: libcamera-devel@lists.libcamera.org Date: Thu, 10 Nov 2022 13:52:50 +0900 Message-Id: <20221110045253.1909648-1-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v6 0/2] Take into account color temperature during LSC algorithm for rkisp1 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Paul Elder via libcamera-devel From: Paul Elder Reply-To: Paul Elder Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" First brick to have an adaptive LSC algorithm on Rkisp1: add LSC coefficients sets in YAML tuning file depending of color temperature. For this version the computation of coefficients regarding the current computed color temperature is done inside prepare() method. For reference: the computation time has been measured at an average 135us on an Imx8Mp board. The different coefficients are computed by doing a linear interpolation with the two coefficients sets that have the closer color temperature values. In case the current color temperature is 'out of bound' the closest set is used. The LSC can work with a single set in case of monochrome sensor for example. The 'grad' and 'size' tables are now computed in configure() to gain some time by doing only a memcpy() of them during prepare(). v6 is more smaller fixes. Just a last confirmation before pushing. v5 is just small fixes. v4 fixes the conditions for skipping interpolation, and adds a rudimentary LSC table for imx219. Modifications in V3: - Rebased on top of "ipa: rkisp1: Remove initialized_ flags from algorithms" - Add specific check if there is a single LSC set: Remove out-of-bound access while looking for correct set. - Minor cleanup Modifications in V2: - The single commit has been splited into two commits. The first one only contains the move of LSC parameters computation in configure(). - LSC parameters are no more re-computed when there is small color temperature variations between two frames. - LSC parameters are not interpolated when the actual color temperature is close to one defined in the tuning parameters sets. - Minor typo/cleanups Florian Sylvestre (1): ipa: rkisp1: Take into account color temperature during LSC algorithm Paul Elder (1): ipa: rkisp1: Add rudimentary LSC tables for imx219 src/ipa/rkisp1/algorithms/lsc.cpp | 200 ++++++++++++++++++++++---- src/ipa/rkisp1/algorithms/lsc.h | 26 +++- src/ipa/rkisp1/data/imx219.yaml | 105 ++++++++++++++ src/ipa/rkisp1/data/ov5640.yaml | 231 ++++++++++++++++++++---------- 4 files changed, 457 insertions(+), 105 deletions(-)