Add a CPU based SwStats implementation for SoftwareISP / SoftIPA use. This implementation offers a configure function + functions to gather statistics on a line by line basis. This allows CPU based software debayering to call into interleave debayering and statistics gathering on a line by line basis while the input data is still hot in the cache. This implementation also allows specifying a window over which to gather statistics instead of processing the whole frame. Doxygen documentation by Dennis Bonke. Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> # sc8280xp Lenovo x13s Tested-by: Pavel Machek <pavel@ucw.cz> Reviewed-by: Pavel Machek <pavel@ucw.cz> Reviewed-by: Milan Zamazal <mzamazal@redhat.com> Co-developed-by: Andrey Konovalov <andrey.konovalov@linaro.org> Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org> Co-developed-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Pavel Machek <pavel@ucw.cz> Co-developed-by: Dennis Bonke <admin@dennisbonke.com> Signed-off-by: Dennis Bonke <admin@dennisbonke.com> Co-developed-by: Marttico <g.martti@gmail.com> Signed-off-by: Marttico <g.martti@gmail.com> Co-developed-by: Toon Langendam <t.langendam@gmail.com> Signed-off-by: Toon Langendam <t.langendam@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
46 lines
982 B
C++
46 lines
982 B
C++
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
|
/*
|
|
* Copyright (C) 2023, Linaro Ltd
|
|
*
|
|
* swisp_stats.h - Statistics data format used by the software ISP and software IPA
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <array>
|
|
#include <stdint.h>
|
|
|
|
namespace libcamera {
|
|
|
|
/**
|
|
* \brief Struct that holds the statistics for the Software ISP
|
|
*
|
|
* The struct value types are large enough to not overflow.
|
|
* Should they still overflow for some reason, no check is performed and they
|
|
* wrap around.
|
|
*/
|
|
struct SwIspStats {
|
|
/**
|
|
* \brief Holds the sum of all sampled red pixels
|
|
*/
|
|
uint64_t sumR_;
|
|
/**
|
|
* \brief Holds the sum of all sampled green pixels
|
|
*/
|
|
uint64_t sumG_;
|
|
/**
|
|
* \brief Holds the sum of all sampled blue pixels
|
|
*/
|
|
uint64_t sumB_;
|
|
/**
|
|
* \brief Number of bins in the yHistogram
|
|
*/
|
|
static constexpr unsigned int kYHistogramSize = 16;
|
|
/**
|
|
* \brief A histogram of luminance values
|
|
*/
|
|
std::array<uint32_t, kYHistogramSize> yHistogram;
|
|
};
|
|
|
|
} /* namespace libcamera */
|