22#include "libcamera/internal/global_configuration.h"
23#include "libcamera/internal/shared_mem_object.h"
24#include "libcamera/internal/software_isp/swisp_stats.h"
31class MappedFrameBuffer;
32struct StreamConfiguration;
48 bool isValid()
const {
return sharedStats_.fd().isValid(); }
57 void finishFrame(uint32_t frame, uint32_t bufferId);
60 void processLine0(uint32_t frame,
unsigned int y,
const uint8_t *src[])
65 if ((y & ySkipMask_) || y <
static_cast<unsigned int>(window_.
y) ||
66 y >= (window_.
y + window_.
height))
69 (this->*stats0_)(src);
72 void processLine2(uint32_t frame,
unsigned int y,
const uint8_t *src[])
77 if ((y & ySkipMask_) || y <
static_cast<unsigned int>(window_.
y) ||
78 y >= (window_.
y + window_.
height))
81 (this->*stats2_)(src);
87 using statsProcessFn = void (
SwStatsCpu::*)(const uint8_t *src[]);
92 void statsBGGR8Line0(
const uint8_t *src[]);
94 void statsBGGR10Line0(
const uint8_t *src[]);
96 void statsBGGR12Line0(
const uint8_t *src[]);
98 void statsBGGR10PLine0(
const uint8_t *src[]);
99 void statsGBRG10PLine0(
const uint8_t *src[]);
103 processFrameFn processFrame_;
106 statsProcessFn stats0_;
107 statsProcessFn stats2_;
110 unsigned int ySkipMask_;
116 unsigned int xShift_;
117 unsigned int stride_;
Simple builtin benchmark.
Definition benchmark.h:21
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:35
const SharedFD & getStatsFD()
Get the file descriptor for the statistics.
Definition swstats_cpu.h:50
void processLine0(uint32_t frame, unsigned int y, const uint8_t *src[])
Process line 0.
Definition swstats_cpu.h:60
void processLine2(uint32_t frame, unsigned int y, const uint8_t *src[])
Process line 2 and 3.
Definition swstats_cpu.h:72
int configure(const StreamConfiguration &inputCfg)
Configure the statistics object for the passed in input format.
Definition swstats_cpu.cpp:395
void finishFrame(uint32_t frame, uint32_t bufferId)
Finish statistics calculation for the current frame.
Definition swstats_cpu.cpp:346
void setWindow(const Rectangle &window)
Specify window coordinates over which to gather statistics.
Definition swstats_cpu.cpp:474
Signal< uint32_t, uint32_t > statsReady
Signals that the statistics are ready.
Definition swstats_cpu.h:84
bool isValid() const
Gets whether the statistics object is valid.
Definition swstats_cpu.h:48
void processFrame(uint32_t frame, uint32_t bufferId, FrameBuffer *input)
Calculate statistics for a frame in one go.
Definition swstats_cpu.cpp:520
static constexpr uint32_t kStatPerNumFrames
Run stats once every kStatPerNumFrames frames.
Definition swstats_cpu.h:46
const Size & patternSize()
Get the pattern size.
Definition swstats_cpu.h:52
void startFrame(uint32_t frame)
Reset state to start statistics gathering for a new frame.
Definition swstats_cpu.cpp:327
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