23#include "libcamera/internal/global_configuration.h"
24#include "libcamera/internal/shared_mem_object.h"
25#include "libcamera/internal/software_isp/swisp_stats.h"
32class MappedFrameBuffer;
33struct StreamConfiguration;
49 bool isValid()
const {
return sharedStats_.fd().isValid(); }
58 void finishFrame(uint32_t frame, uint32_t bufferId);
61 void processLine0(uint32_t frame,
unsigned int y,
const uint8_t *src[],
unsigned int statsBufferIndex = 0)
66 if ((y & ySkipMask_) || y <
static_cast<unsigned int>(window_.
y) ||
67 y >= (window_.
y + window_.
height))
70 (this->*stats0_)(src, stats_[statsBufferIndex]);
73 void processLine2(uint32_t frame,
unsigned int y,
const uint8_t *src[],
unsigned int statsBufferIndex = 0)
78 if ((y & ySkipMask_) || y <
static_cast<unsigned int>(window_.
y) ||
79 y >= (window_.
y + window_.
height))
82 (this->*stats2_)(src, stats_[statsBufferIndex]);
93 void statsBGGR8Line0(
const uint8_t *src[],
SwIspStats &stats);
95 void statsBGGR10Line0(
const uint8_t *src[],
SwIspStats &stats);
97 void statsBGGR12Line0(
const uint8_t *src[],
SwIspStats &stats);
99 void statsBGGR10PLine0(
const uint8_t *src[],
SwIspStats &stats);
100 void statsGBRG10PLine0(
const uint8_t *src[],
SwIspStats &stats);
104 processFrameFn processFrame_;
107 statsProcessFn stats0_;
108 statsProcessFn stats2_;
111 unsigned int ySkipMask_;
117 unsigned int xShift_;
118 unsigned int stride_;
120 std::vector<SwIspStats> stats_;
Simple builtin benchmark.
Definition benchmark.h:22
Frame buffer data and its associated dynamic metadata.
Definition framebuffer.h:50
Support for global libcamera configuration.
Definition global_configuration.h:22
Map a FrameBuffer using the MappedBuffer interface.
Definition mapped_framebuffer.h:47
Describe a rectangle's position and dimensions.
Definition geometry.h:247
int y
The vertical coordinate of the rectangle's top-left corner.
Definition geometry.h:279
unsigned int height
The distance between the top and bottom sides.
Definition geometry.h:281
RAII-style wrapper for file descriptors.
Definition shared_fd.h:17
Helper class to allocate an object in shareable memory.
Definition shared_mem_object.h:60
Generic signal and slot communication mechanism.
Definition signal.h:39
Describe a two-dimensional size.
Definition geometry.h:51
Class for gathering statistics on the CPU.
Definition swstats_cpu.h:36
const SharedFD & getStatsFD()
Get the file descriptor for the statistics.
Definition swstats_cpu.h:51
void processLine2(uint32_t frame, unsigned int y, const uint8_t *src[], unsigned int statsBufferIndex=0)
Process line 2 and 3.
Definition swstats_cpu.h:73
void finishFrame(uint32_t frame, uint32_t bufferId)
Finish statistics calculation for the current frame.
Definition swstats_cpu.cpp:353
void setWindow(const Rectangle &window)
Specify window coordinates over which to gather statistics.
Definition swstats_cpu.cpp:494
int configure(const StreamConfiguration &inputCfg, unsigned int statsBufferCount=1)
Configure the statistics object for the passed in input format.
Definition swstats_cpu.cpp:414
void processLine0(uint32_t frame, unsigned int y, const uint8_t *src[], unsigned int statsBufferIndex=0)
Process line 0.
Definition swstats_cpu.h:61
Signal< uint32_t, uint32_t > statsReady
Signals that the statistics are ready.
Definition swstats_cpu.h:85
bool isValid() const
Gets whether the statistics object is valid.
Definition swstats_cpu.h:49
void processFrame(uint32_t frame, uint32_t bufferId, FrameBuffer *input)
Calculate statistics for a frame in one go.
Definition swstats_cpu.cpp:540
static constexpr uint32_t kStatPerNumFrames
Run stats once every kStatPerNumFrames frames.
Definition swstats_cpu.h:47
const Size & patternSize()
Get the pattern size.
Definition swstats_cpu.h:53
void startFrame(uint32_t frame)
Reset state to start statistics gathering for a new frame.
Definition swstats_cpu.cpp:332
Data structures related to geometric objects.
Internal frame buffer handling support.
Top-level libcamera namespace.
Definition backtrace.h:17
Signal & slot implementation.
Configuration parameters for a stream.
Definition stream.h:40
Struct that holds the statistics for the Software ISP.
Definition swisp_stats.h:24