From patchwork Thu Sep 29 09:12:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Sylvestre X-Patchwork-Id: 17460 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 8E5DDBD16B for ; Thu, 29 Sep 2022 09:12:52 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D82B962386; Thu, 29 Sep 2022 11:12:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1664442771; bh=BkNtWUKDSi5FqusIG7rlLbVlfnpoHxFph3W6Sbp32o8=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=zthOk6H53SFX/xnSk294WPkP7BMyJtsPNwQkFXG4VLe7QwMaDdkN0GCE5a2P7Y3fz jRUaBXITcQbDbcijef3j+CKlgMPyNyA9eqVZQ9vO9yYCwiQ51xmysWek+KLRH/irwY AvCvU5cZxeh5WoAkGuOrUjOxjhrQp3njvCV0RK8Lo6ksW2DiORegOGe4NyCOAM2DWo //5fQf2xm39Uj7hpMJNE/eDgHXX2c6QFtCA9cT13olTZSL0mD1pa/09oG1eC7+n59T 6Y1RHYBxjpQfh0EsHB0C1EzbcjvG/SE8FMbvJsCOgYyqBdCDZvVQHuaxfXOLFnbP1h qD+l3lAKDRZCg== Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2DE616237B for ; Thu, 29 Sep 2022 11:12:50 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20210112.gappssmtp.com header.i=@baylibre-com.20210112.gappssmtp.com header.b="ha4neahR"; dkim-atps=neutral Received: by mail-wm1-x334.google.com with SMTP id e10-20020a05600c4e4a00b003b4eff4ab2cso2825544wmq.4 for ; Thu, 29 Sep 2022 02:12:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=VYUacobXJJ4/C8SqSpNapzZQkVmHe1k/WhBwcwtRAo4=; b=ha4neahRLfiY0ItpS9KnmD/+DkKYMVuJYr9c9ymHX3rxCjcxvhm2SvO3eEpaZbBpos JPKopV83WDZhNHsAt3hJeqYuhqQyOVjhZR9gBrneNQtkBOLO8un0blq7yTZszjxbWhUx FehNgWHBBKe5uv6N8d/twCCO7ETrIOWhaaJC1SG8DfiU9P4KMjF9adbsN9DXlK95VcVL nCm6pJsdGwo07CajCD7gHyaEESRiVMjvf0bOmK50cS6LqHZNQgtPGZFaBI8o0gAHyC81 nke7V0rWZc8LQy78m4SRYXZwy7cQ7L++U72hnM3gr0JdMZMRlGcoOXbFpBPX1rm20Zru v0dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=VYUacobXJJ4/C8SqSpNapzZQkVmHe1k/WhBwcwtRAo4=; b=3UZW/l2uTxc6Ctp7tHLEY7x9jFx9eFVuRw4shzQf87DgiJuTXtDrDiQl1ZnQv0urXK DoSd+XdUP/BE7ZwqioJP6aHuwfdk+4r8NBPd4Yn6+PDf2bKDe5OV+FmozJ1nkxHT4UFD C0LLlZtp0O0X7HxgMcTgM46FaFdtQgbXgOHvr3ObrgP5y7MtHT18jHqLqzeFlaPgLhFY LTm8yfbATbRL/oG3e0lUR9TZ4Iot9zkWwzqimdhMMuu54zV1D4B1ZXaSVF0F9DNVlWhK Q94hu50xTqlxm0qM1l3i4Gxb8QIPIE33npEFnFCoRNsoOny9jTbAFwADZc6I8TVuDY90 u8AQ== X-Gm-Message-State: ACrzQf2gm3K2pShuBDEMXLsjklyYKki9mdBxtqvC3Z2JzKV0eBKGtSLD pPBzTd1jxqgLi+haSGSup6NKD0ZSjdZ9BA== X-Google-Smtp-Source: AMsMyM6CkFaZLV767ss5xewF7/bkeyZP0rHKTDi6eulufe7wI1rBCtO0Avh83MLNRkKR3hc3aE4vDA== X-Received: by 2002:a05:600c:3d8f:b0:3b4:aab6:4a97 with SMTP id bi15-20020a05600c3d8f00b003b4aab64a97mr10029537wmb.82.1664442769522; Thu, 29 Sep 2022 02:12:49 -0700 (PDT) Received: from BL087.. ([2a01:e34:eea9:e630:71fe:49b1:81cf:acfb]) by smtp.gmail.com with ESMTPSA id g15-20020a5d554f000000b0022cc7c32309sm2454588wrw.115.2022.09.29.02.12.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Sep 2022 02:12:49 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Thu, 29 Sep 2022 11:12:43 +0200 Message-Id: <20220929091245.2159838-1-fsylvestre@baylibre.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 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: Florian Sylvestre via libcamera-devel From: Florian Sylvestre Reply-To: Florian Sylvestre 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(). 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 (2): ipa: rkisp1: Compute LSC algorithm parameter during configure ipa: rkisp1: Take into account color temperature during LSC algorithm src/ipa/rkisp1/algorithms/lsc.cpp | 183 ++++++++++++++++++----- src/ipa/rkisp1/algorithms/lsc.h | 28 +++- src/ipa/rkisp1/data/ov5640.yaml | 231 ++++++++++++++++++++---------- 3 files changed, 321 insertions(+), 121 deletions(-)