From patchwork Mon May 23 09:24:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Sylvestre X-Patchwork-Id: 16002 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 BC644BD160 for ; Mon, 23 May 2022 09:24:50 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D46A86566D; Mon, 23 May 2022 11:24:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1653297890; bh=IOYq8ESWic3swOVBQrSCimHXwEZ4ZyhdhnWaNpOd7O0=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=eUht9LQh0yQd0IHsz8EuYqYjFSstBEe5VZVN0trJ0OzqXZHevaqwYFnKwZw46d6xv dNivQDafWqd5obwxmP1r8IaNptaH3Jgzbj081JakV/hJNBUsHymLjure2T96Gcheog jXysvtOjMdlJN/LtxQSAsUSC/Yeijds3Nca/16t+G1FzJAOoYXbNM73rhZq9x7flSL bnRTLqWPopa8TgCth1YWoslSHBwm/2SIBvgEC2rPQohELCrNM1dLN48klm5mKw/AA8 VcE6slrX8cA3sLWrwgU6VY9v7HvLLGwUUBd/B9sH95u5tZapJbxSFTUzibAnw3QGTg Cvg+is85iByeQ== Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 130666565E for ; Mon, 23 May 2022 11:24:46 +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="LyCRfCJZ"; dkim-atps=neutral Received: by mail-wm1-x32f.google.com with SMTP id o9so666937wmd.0 for ; Mon, 23 May 2022 02:24:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1DvUzTGwqBhOBuZt/0h7g+g5MxcYSFWLZ7UT0nopWWY=; b=LyCRfCJZ4x5EG/uHg5coLvLEkn0ElJkntmN7gLvlk6bOEushXqMHxV8vmdFtF6RFly gF3VUqQJP0hOif97qbIPEi8iX++dayyef9RjidVCseFk0RTpGBg7wUnMMxMzAiD2CjVx hX/r850NvFKJe5E+fko+YX0SE4noEXaVA/aUjuuuA1PBjbgm46cUnPhJYcAEtoy5wjO8 uC0OU/zFqejzynUlUCoooJ9QQUi5eJMs06sgNePl0I6G/58vR4yAXpR1EJOtcdDCsuCF zcMfQU46RBiKnGcq+hiN3hnxKFw83DmZwa/qG+Fp6/ikaeteWG+A/IMuEDBcI2viCjqz JmmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1DvUzTGwqBhOBuZt/0h7g+g5MxcYSFWLZ7UT0nopWWY=; b=sKC/01pG2TBbgtjI2QWK30PVGrG98q2FJ5xEKLgWyp40Hb9BJNLInIAFEbEOAwW6Tu Y0IEy7qYq2RM5X0+muaQO7zh9tOskONJud8FqmL0G0JBRlAdHLOy5d8dU0nRDTDsE6y+ NGZ4rRx3umNiGkzy8048iwfZ7j06Gd+nuEdIWgwCMkHc3Wz+80C5EzP0l/N0wyYZRHSd txYbxayx2q6uRJ7eo/3tWf6u63oXefy8uxQ55gLygv3SvAiULGQZVhHheMJsScZz6/Lm CkRr4NFDbE6w3K6/7K8oadJx7xVwt9o4YaP8sS3jmdZyLqTt3KQ0ODuTfXNeBvKhBmH4 pSpg== X-Gm-Message-State: AOAM533jyDjvQkEK/m/Yw99v5uOwA62XrLpUdS5nE9luRmdCcbcZXSai Am4VSeM5NeO9SwDV4DDWML3iOJae1qCYFQ== X-Google-Smtp-Source: ABdhPJxtsmjeaLCV5Yi/Ni5cZOoTaWivdnwW7xR9SWVilNj4+QThHyardifQDHQoCJ46Dlfp6QKJew== X-Received: by 2002:a05:600c:4fd2:b0:397:4c02:958f with SMTP id o18-20020a05600c4fd200b003974c02958fmr3550495wmq.180.1653297885369; Mon, 23 May 2022 02:24:45 -0700 (PDT) Received: from BL087.. ([2a01:e34:eea9:e630:1bc6:bcdb:60b7:f1d3]) by smtp.gmail.com with ESMTPSA id w22-20020a1cf616000000b003942a244eebsm8034250wmc.48.2022.05.23.02.24.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 02:24:44 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Mon, 23 May 2022 11:24:32 +0200 Message-Id: <20220523092435.475510-3-fsylvestre@baylibre.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220523092435.475510-1-fsylvestre@baylibre.com> References: <20220523092435.475510-1-fsylvestre@baylibre.com> MIME-Version: 1.0 Subject: [libcamera-devel] [libcamera-devel 2/5] ipa: libipa: Add init() function to the Algorithm class 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" Add the init() function that will be called during algorithm initialization to provide each algorithm the list of algorithms tuning data. Each algorithm will be responsible to grab their corresponding parameters. Signed-off-by: Florian Sylvestre Reviewed-by: Paul Elder --- src/ipa/libipa/algorithm.cpp | 15 +++++++++++++++ src/ipa/libipa/algorithm.h | 10 +++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/ipa/libipa/algorithm.cpp b/src/ipa/libipa/algorithm.cpp index 398d5372..269a4beb 100644 --- a/src/ipa/libipa/algorithm.cpp +++ b/src/ipa/libipa/algorithm.cpp @@ -29,6 +29,21 @@ namespace ipa { * to manage algorithms regardless of their specific type. */ +/** + * \fn Algorithm::init() + * \brief Configure the Algorithm with default parameters + * \param[in] context The shared IPA context + * \param[in] params The initial parameters used to tune algorithms + * + * This function is called once before the camera is running to get default + * algorithm parameters. + * + * Algorithms are responsible to read the parameters given and extract their + * parameter configuration. + * + * \return 0 if successful, an error code otherwise + */ + /** * \fn Algorithm::configure() * \brief Configure the Algorithm given an IPAConfigInfo diff --git a/src/ipa/libipa/algorithm.h b/src/ipa/libipa/algorithm.h index 766aee5d..f5be1caf 100644 --- a/src/ipa/libipa/algorithm.h +++ b/src/ipa/libipa/algorithm.h @@ -10,12 +10,20 @@ namespace libcamera { namespace ipa { -template +template + class Algorithm { public: virtual ~Algorithm() {} + virtual int init([[maybe_unused]] Context &context, + [[maybe_unused]] const TuningData *params) + { + return 0; + } + virtual int configure([[maybe_unused]] Context &context, [[maybe_unused]] const Config &configInfo) {