From patchwork Thu Nov 24 10:38:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 17861 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 6635CBDE6B for ; Thu, 24 Nov 2022 10:38:43 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9DC896331E; Thu, 24 Nov 2022 11:38:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1669286322; bh=wSfpZ2VCSv4ZA+Hwc6NuLAoaCq/V52QKMihwq7QkBaU=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=3RVajHaG9pBzStyFBbWBko6vp3Hn2yes7fccnbC/Cj+gX3M0oNmZ+nhNsXv3Iai7l 4kzWpLtUbh+TN+aX+POTld0y2ncaw5gPZc7gWUqYJDjPPnLLSPPOCnCLxig8cVZ3+O CS81ziNx1gvzXnIOMgDBSYsK/ZgVn4gLI/lGP5RQwwoEZ4Y83VxTmC8ygCJYHWZA+L UeniH6ha5L7DglVnVBgX/ruTTeAwzxIFN6aNlTiNi1YXb47GjDwm7jddxJPbkiYqIS +P6+VrPJu3xjwnV866ooK5vRDn+qCFhI0jSoz6rdakntjSUMF85TKjcJXBxHpVHkmX PNjhHoPsEV3hQ== Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0E81D6330A for ; Thu, 24 Nov 2022 11:38:40 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="AKYaibZn"; dkim-atps=neutral Received: by mail-wr1-x42c.google.com with SMTP id v1so1818514wrt.11 for ; Thu, 24 Nov 2022 02:38:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Wz0hlK1jdeOG7mJiWEHwQj+sDAJP3LhczFaDGYfPx9g=; b=AKYaibZnWXSngLcUbKi8b+OWUHMHFqTAN1HKHZfrpC4Z6CfGjKQX6xrc01ItiPe3l9 Ptem3t8VUaW+EFlvkVXXnm35fl8O0/NMr9AGrJUz0GgInWNQB2KMbcW/tkBf+DZ915bj E7w9b3qjFkrOUCsLwCfzAz8eRNv/YhOX/icLlXX5WERu1ZFfUI0XsrdkPyhkZrbNoswP Y3vI9/7175RjC89WRlF2tOm1FsYd9sPt8ncA4gYnjTkAt/xBcuY9qzj8uRT6eew128pf 01IZATMP69VHgGdiX9mKtFm0tEjiu2nYm+ieGWyyyOnJc4Mft1z8HdERHlvprDHxjYZn JUOg== 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:message-id :reply-to; bh=Wz0hlK1jdeOG7mJiWEHwQj+sDAJP3LhczFaDGYfPx9g=; b=F4ESii0c6OFlr/kLeym6/kuSS79HwtVEXs3k7o2xrQ7kyMc1w8nSQvVWHDwy2v7mAE ca6KA5luIN31yhAHesTSoySJyi2SSCQejCXONGld/W3PnTI+JXgN2yiXkaHNu9/iHKiY wwCiAfBOMJauc4/58v0l6qN4kpS47imlGnI1Tm7UQqV12eIBVYkKo1STIzG5DWHwJuI5 AbdiWsDj82MPuXnHFoW5yFQ2oW21hUhEOZT8g6bBrBcsdMoupFSzh+C3PD5XyXJ9q05t RSo18gBE8hCiBWsw2I/FrXHOvPaFYdxiIPebqYrGSRG/0OYRfz7LMVVpRG7UPfaVJ2Lf SO9Q== X-Gm-Message-State: ANoB5plEKPqSmuh+YoGGcewD7tsyjOINRwITWYon1tjvUV9L829MGr9S gDPUuY6Ur6sZWlDuZ7gaAngM4sWx4uk50g== X-Google-Smtp-Source: AA0mqf4hondAJSa0JPA81Ot358GNoPd08q8mcqAtRZ1inEbB0YhNdq64tacpYy0vXpoIsJM+QSMMtQ== X-Received: by 2002:a5d:6912:0:b0:241:ecf8:d34d with SMTP id t18-20020a5d6912000000b00241ecf8d34dmr4428763wru.73.1669286319357; Thu, 24 Nov 2022 02:38:39 -0800 (PST) Received: from naush-laptop.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id s16-20020adff810000000b002368a6deaf8sm995103wrp.57.2022.11.24.02.38.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Nov 2022 02:38:38 -0800 (PST) To: libcamera-devel@lists.libcamera.org Date: Thu, 24 Nov 2022 10:38:27 +0000 Message-Id: <20221124103832.6172-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 0/5] Raspberry Pi: Generalise statistics 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: Naushir Patuck via libcamera-devel From: Naushir Patuck Reply-To: Naushir Patuck Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hi, Quick turn-around for v2 as we had some internal discussions on some API changes to the RegionStats structure in patch 1/5: 1) This now uses utils::Size and utils::Point throughout. 2) The caller now provides a Region struct in set(), and gets the Region struct through get(). This avoids the need for having more parameters in the prototype for counted/uncounted values. In future, we will add position to the Region structure as well. All other patches remain functionally the same, only using the new RegionStats API. Thanks, Naush Naushir Patuck (5): ipa: raspberrypi: Generalise statistics ipa: raspberrypi: histogram: Add a constructor for an empty histogram ipa: raspberrypi: awb: Delay release of the statistics buffer ipa: raspberrypi: Use the generic statistics structure in the algorithms ipa: raspberrypi: Normalise region sums to 16-bits src/ipa/raspberrypi/controller/controller.h | 4 +- src/ipa/raspberrypi/controller/histogram.h | 5 + src/ipa/raspberrypi/controller/region_stats.h | 123 ++++++++++++++++++ src/ipa/raspberrypi/controller/rpi/agc.cpp | 31 ++--- src/ipa/raspberrypi/controller/rpi/agc.h | 2 +- src/ipa/raspberrypi/controller/rpi/alsc.cpp | 32 ++--- src/ipa/raspberrypi/controller/rpi/alsc.h | 3 +- src/ipa/raspberrypi/controller/rpi/awb.cpp | 30 ++--- src/ipa/raspberrypi/controller/rpi/awb.h | 1 + .../raspberrypi/controller/rpi/contrast.cpp | 8 +- src/ipa/raspberrypi/controller/rpi/focus.cpp | 7 +- src/ipa/raspberrypi/controller/rpi/lux.cpp | 14 +- src/ipa/raspberrypi/raspberrypi.cpp | 48 ++++++- src/ipa/raspberrypi/statistics.h | 72 ++++++++++ 14 files changed, 304 insertions(+), 76 deletions(-) create mode 100644 src/ipa/raspberrypi/controller/region_stats.h create mode 100644 src/ipa/raspberrypi/statistics.h