From patchwork Tue Nov 22 11:22:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 17829 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 2F1BBBE08B for ; Tue, 22 Nov 2022 11:22:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9939563314; Tue, 22 Nov 2022 12:22:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1669116148; bh=V0W1RsV/csGpYOjMSMj+lh47pS5612YD5a1Y84Rfs0k=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=twVl2/f9JrzRcXhyOfZU++M2GXWHLENvxPuDO052RCptuuCL/0MZV7qRV/mOB6nbZ h+a1Sgw35IE+3etwmTvfVL9TVmWWbeUEGv3a77dClq+FLPInwkO6HpoDAZ0DQxqceX rgkUuDtGaK9m2CfZLtbSGwiX5QpEclrCAN/Jox/lzq6LH0BA1UTOQRVx4Cr4bH7MYx G85AXo7iiWwvfvF0fynrIixAkesn8Uil+ujHVy/ISGMWm1BIh2OBsGoymh5uyqalJX zg8+6dzcklzv1ajcKcFX+xWhDgyN8mojS9iBfhJdOu7XYWs1KNo2f5FvFF2yAB1C1J mY0yBq4nT0Dcg== Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 80104603CE for ; Tue, 22 Nov 2022 12:22:27 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="g1bsSHVN"; dkim-atps=neutral Received: by mail-wm1-x32b.google.com with SMTP id o30so10492983wms.2 for ; Tue, 22 Nov 2022 03:22:27 -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=duc2Zu13c5P8hQUVb5xlsXn8EMMekYpWzwh3MMlKewU=; b=g1bsSHVNJYnGmBhgjAizvxQwpo5efxAPXs2827mcoXdEJr8ttL49sqXKEsIM5Z9d0r 7OMnEodyHzfCgHwdLXYVdQD4ZdOQVEdbJDHOpxbGcxwmtvEyKC59UJtPPROjQSrVRn6K na+oZHahPFviUIexXu0lOTFgIkmetOh9UVnyg1jLhNPKq1bpD4ZvQarW/pzNqqzPdhEB cUcYz7pMsqhIgDNxqcM9q34LwkwERk6tqZWmlNW85BTLbBtcJdHuN6iGkwybCSxG57OO gro6XiDPH5wOPEb4tmgxovBHng9bTKy3WJH34ep+071zcKccoH7lTLOkdsq/1S/6EnMO BpUQ== 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=duc2Zu13c5P8hQUVb5xlsXn8EMMekYpWzwh3MMlKewU=; b=x4HlhJ84t3bhf4qkwM3AjWFQmzmSjxPTBkWNnp1JXHEvzKmm7KqvqA6/ogMuRtcIV0 2wjOhbtgQZd00oldXx5nnpEVKZAc0HYqxLg9HJjmSPJFR7VgPhjCB0URarOLJUP6DJ2C 0mVuIXjCUd9DjyQzXiRftwzXDoCWgGjQiSMj8meK43sta+BpIhzaJcag2HuQRAla7ZB7 hb8scV8qU1MAYkpppT6+5n+ghg/XFEtCG4bcX1KhWMDjhJCMmLuJer2j4fzGP5c9TMK2 UL/Do4arfwESrys2iZT5BvzP+fVqqvqM1GVrkGMmJAF8mFgJHSZs12e+hc6aK+xWvMYA lLjA== X-Gm-Message-State: ANoB5pnJUNY0lBZY9BZcA/HT/q1E2cJuGpWDvj3HRdtj1Ua5jhVFFmfC Nu7eNsrMDtNvkVuXh6Lxwzz4pQ/3PgW/ow== X-Google-Smtp-Source: AA0mqf7bvAycqMgEaZfw/PNv0yxsFZ/4USg/kp8kUVfYNR0Pg0bqzYyCLKTlna6srkxh2KOP53XfGQ== X-Received: by 2002:a1c:ed17:0:b0:3cf:cfce:9d9e with SMTP id l23-20020a1ced17000000b003cfcfce9d9emr3644770wmh.66.1669116146810; Tue, 22 Nov 2022 03:22:26 -0800 (PST) Received: from naush-laptop.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id q125-20020a1c4383000000b003c6cd82596esm21400388wma.43.2022.11.22.03.22.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Nov 2022 03:22:26 -0800 (PST) To: libcamera-devel@lists.libcamera.org Date: Tue, 22 Nov 2022 11:22:19 +0000 Message-Id: <20221122112224.31691-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1 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, This patch series attempts to generalise our BCM2835 ISP statistics structure with the aim of removing any hardware specific structures, defines and header files from the algorithm source files. Patch 1 defines the generalised statistics structures. Patches 2 and 3 are some simple tidy-ups to prepare for the changes. Patch 4 converts our algorithms to use the generalised structures. Patch 5 is another tidy up to remove a platform specific define from the AGC. 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 | 109 ++++++++++++++++++ src/ipa/raspberrypi/controller/rpi/agc.cpp | 30 +++-- src/ipa/raspberrypi/controller/rpi/agc.h | 2 +- src/ipa/raspberrypi/controller/rpi/alsc.cpp | 33 +++--- 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 | 13 +-- src/ipa/raspberrypi/raspberrypi.cpp | 46 +++++++- src/ipa/raspberrypi/statistics.h | 72 ++++++++++++ 14 files changed, 292 insertions(+), 71 deletions(-) create mode 100644 src/ipa/raspberrypi/controller/region_stats.h create mode 100644 src/ipa/raspberrypi/statistics.h