From patchwork Tue Mar 15 17:53:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 15453 X-Patchwork-Delegate: kieran.bingham@ideasonboard.com 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 6B228BDE17 for ; Tue, 15 Mar 2022 17:53:57 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5C5FB632E9; Tue, 15 Mar 2022 18:53:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1647366835; bh=7AS/3W+JcRjGwq7NqYyLfTa+SB8XRCp4BPvzwC6i2uc=; 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=dMb06Hz/6ibompYHvXyzIl+lOC9hMEvD/GKBj2QrHEqL1rVQ6pdcb3lsG8IwfwFfB fTvoj3GNcwc/hCju91/e1pXH907/MS3fq48VH7UajKyrydTn6BcQv8zjDnwpOp8qab Ga7gQUMD+71AOHSDI99+GSQGX/uGVmORkiv+HB1CdYpEWmeiBveyRMStFbO/jr4PTS JEevJPMAmlr1C56V0H3BPna8VUH8yTTq6H8Rt1l7EX2pV0SWoqU/IcIZ+IahDcCjBT eCiwdchM8XMAKSlSC13DFtnG1WQoEmmXJQQPGu162FePndUu/BEK8gHvpI/xsGMd7r CJLFbibY1jbIw== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C79FC604DC for ; Tue, 15 Mar 2022 18:53:53 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="F7LIvDOq"; dkim-atps=neutral Received: from Monstersaurus.ksquared.org.uk.beta.tailscale.net (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6569F1C34; Tue, 15 Mar 2022 18:53:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1647366833; bh=7AS/3W+JcRjGwq7NqYyLfTa+SB8XRCp4BPvzwC6i2uc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F7LIvDOqnjbz5mqjKvV5WUZIutx2IGjzP08Ajkz2nusHGf2QKKG2CXmMeGtxRI1Z8 qrjeGQEg7RSZcNpSuWpxFD0skUo5tIQx+WNntuF0hMTWk8ZTnpVH9xKOm8M+7g7v8I Bx1+mPGD/HXxKmmPmEhmy4CqQPNVx1Ij0SuVFZUc= To: libcamera devel Date: Tue, 15 Mar 2022 17:53:43 +0000 Message-Id: <20220315175345.479951-2-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220315175345.479951-1-kieran.bingham@ideasonboard.com> References: <20220315175345.479951-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/3] ipa: ipu3: af: Move constants to implementation 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: Kieran Bingham via libcamera-devel From: Kieran Bingham Reply-To: Kieran Bingham Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" A selection of constants are imported from ChromiumOS. Move these out of the header, and simplify their documentation. Further more, add a direct reference to the location they were obtained from. Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/ipa/ipu3/algorithms/af.cpp | 73 ++++++++++------------------------ src/ipa/ipu3/algorithms/af.h | 11 ----- 2 files changed, 22 insertions(+), 62 deletions(-) diff --git a/src/ipa/ipu3/algorithms/af.cpp b/src/ipa/ipu3/algorithms/af.cpp index 0170a3728892..3cedf8cbd687 100644 --- a/src/ipa/ipu3/algorithms/af.cpp +++ b/src/ipa/ipu3/algorithms/af.cpp @@ -29,59 +29,30 @@ * \file af.h */ -/** - * \var kAfMinGridWidth - * \brief the minimum width of AF grid. - * The minimum grid horizontal dimensions. - */ - -/** - * \var kAfMinGridHeight - * \brief the minimum height of AF grid. - * The minimum grid vertical dimensions. - */ - -/** - * \var kAfMaxGridWidth - * \brief the maximum width of AF grid. - * The maximum grid horizontal dimensions. - */ - -/** - * \var kAfMaxGridHeight - * \brief The maximum height of AF grid. - * The maximum grid vertical dimensions. - */ - -/** - * \var kAfMinGridBlockWidth - * \brief The minimum block size of the width. - * The minimum value of Log2 of the width of the grid cell. - */ - -/** - * \var kAfMinGridBlockHeight - * \brief The minimum block size of the height. - * The minimum value of Log2 of the height of the grid cell. - */ - -/** - * \def kAfMaxGridBlockWidth - * \brief The maximum block size of the width. - * The maximum value of Log2 of the width of the grid cell. - */ - -/** - * \var kAfMaxGridBlockHeight - * \brief The maximum block size of the height. - * The maximum value of Log2 of the height of the grid cell. +/* + * Static variables from ChromiumOS Intel Camera HAL and ia_imaging library: + * - https://chromium.googlesource.com/chromiumos/platform/arc-camera/+/master/hal/intel/psl/ipu3/statsConverter/ipu3-stats.h + * - https://chromium.googlesource.com/chromiumos/platform/camera/+/refs/heads/main/hal/intel/ipu3/include/ia_imaging/af_public.h */ -/** - * \var kAfDefaultHeightPerSlice - * \brief The default number of blocks in vertical axis per slice. - * The number of blocks in vertical axis per slice. - */ +/** The minimum horizontal grid dimensions. */ +static constexpr uint8_t kAfMinGridWidth = 16; +/** The minimum vertical grid dimensions. */ +static constexpr uint8_t kAfMinGridHeight = 16; +/** The maximum horizontal grid dimensions. */ +static constexpr uint8_t kAfMaxGridWidth = 32; +/** The maximum vertical grid dimensions. */ +static constexpr uint8_t kAfMaxGridHeight = 24; +/** The minimum value of Log2 of the width of the grid cell. */ +static constexpr uint16_t kAfMinGridBlockWidth = 4; +/** The minimum value of Log2 of the height of the grid cell. */ +static constexpr uint16_t kAfMinGridBlockHeight = 3; +/** The maximum value of Log2 of the width of the grid cell. */ +static constexpr uint16_t kAfMaxGridBlockWidth = 6; +/** The maximum value of Log2 of the height of the grid cell. */ +static constexpr uint16_t kAfMaxGridBlockHeight = 6; +/** The number of blocks in vertical axis per slice. */ +static constexpr uint16_t kAfDefaultHeightPerSlice = 2; namespace libcamera { diff --git a/src/ipa/ipu3/algorithms/af.h b/src/ipa/ipu3/algorithms/af.h index 13c7e0e877fd..906f2843dd49 100644 --- a/src/ipa/ipu3/algorithms/af.h +++ b/src/ipa/ipu3/algorithms/af.h @@ -15,17 +15,6 @@ #include "algorithm.h" -/* Static variables from repo of chromium */ -static constexpr uint8_t kAfMinGridWidth = 16; -static constexpr uint8_t kAfMinGridHeight = 16; -static constexpr uint8_t kAfMaxGridWidth = 32; -static constexpr uint8_t kAfMaxGridHeight = 24; -static constexpr uint16_t kAfMinGridBlockWidth = 4; -static constexpr uint16_t kAfMinGridBlockHeight = 3; -static constexpr uint16_t kAfMaxGridBlockWidth = 6; -static constexpr uint16_t kAfMaxGridBlockHeight = 6; -static constexpr uint16_t kAfDefaultHeightPerSlice = 2; - namespace libcamera { namespace ipa::ipu3::algorithms {