Loading...
Searching...
No Matches
ipa_context.h
Go to the documentation of this file.
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
* Copyright (C) 2021, Google Inc.
*
* IPU3 IPA Context
*
*/
#pragma once
#include <linux/intel-ipu3.h>
#include <libcamera/base/utils.h>
#include <libcamera/controls.h>
#include <libcamera/geometry.h>
#include <libipa/fc_queue.h>
namespace libcamera {
namespace ipa::ipu3 {
struct IPASessionConfiguration {
struct {
ipu3_uapi_grid_config bdsGrid;
Size bdsOutputSize;
uint32_t stride;
} grid;
struct {
ipu3_uapi_grid_config afGrid;
} af;
struct {
utils::Duration minExposureTime;
utils::Duration maxExposureTime;
double minAnalogueGain;
double maxAnalogueGain;
} agc;
struct {
int32_t defVBlank;
utils::Duration lineDuration;
Size size;
} sensor;
};
struct IPAActiveState {
struct {
uint32_t focus;
double maxVariance;
bool stable;
} af;
struct {
uint32_t exposure;
double gain;
uint32_t constraintMode;
uint32_t exposureMode;
} agc;
struct {
struct {
double red;
double green;
double blue;
} gains;
double temperatureK;
} awb;
struct {
double gamma;
struct ipu3_uapi_gamma_corr_lut gammaCorrection;
} toneMapping;
};
struct IPAFrameContext : public FrameContext {
struct {
uint32_t exposure;
double gain;
} sensor;
};
struct IPAContext {
IPAContext(unsigned int frameContextSize)
: frameContexts(frameContextSize)
{
}
IPASessionConfiguration configuration;
IPAActiveState activeState;
FCQueue<IPAFrameContext> frameContexts;
ControlInfoMap::Map ctrlMap;
};
} /* namespace ipa::ipu3 */
} /* namespace libcamera*/
libcamera::ControlInfoMap::Map
std::unordered_map< const ControlId *, ControlInfo > Map
The base std::unsorted_map<> container.
Definition controls.h:367
libcamera::Size
Describe a two-dimensional size.
Definition geometry.h:51
libcamera::ipa::FCQueue
A support class for managing FrameContext instances in IPA modules.
Definition fc_queue.h:33
libcamera::utils::Duration
Helper class from std::chrono::duration that represents a time duration in nanoseconds with double pr...
Definition utils.h:322
controls.h
Framework to manage controls related to an object.
fc_queue.h
Queue of per-frame contexts.
geometry.h
Data structures related to geometric objects.
libcamera
Top-level libcamera namespace.
Definition backtrace.h:17
libcamera::ipa::FrameContext
Context for a frame.
Definition fc_queue.h:24
libcamera::ipa::ipu3::IPAActiveState
The active state of the IPA algorithms.
Definition ipa_context.h:49
libcamera::ipa::ipu3::IPAActiveState::gamma
double gamma
Gamma value for the LUT.
Definition ipa_context.h:74
libcamera::ipa::ipu3::IPAActiveState::exposure
uint32_t exposure
Exposure time expressed as a number of lines.
Definition ipa_context.h:57
libcamera::ipa::ipu3::IPAActiveState::blue
double blue
White balance gain for B channel.
Definition ipa_context.h:67
libcamera::ipa::ipu3::IPAActiveState::green
double green
White balance gain for G channel.
Definition ipa_context.h:66
libcamera::ipa::ipu3::IPAActiveState::gain
double gain
Analogue gain multiplier.
Definition ipa_context.h:58
libcamera::ipa::ipu3::IPAActiveState::agc
struct libcamera::ipa::ipu3::IPAActiveState::@213365101006337121240370031272077062224235355025 agc
Context for the Automatic Gain Control algorithm.
libcamera::ipa::ipu3::IPAActiveState::stable
bool stable
It is set to true, if the best focus is found.
Definition ipa_context.h:53
libcamera::ipa::ipu3::IPAActiveState::toneMapping
struct libcamera::ipa::ipu3::IPAActiveState::@074301367332221224366323347260343256075341055067 toneMapping
Context for ToneMapping and Gamma control.
libcamera::ipa::ipu3::IPAActiveState::red
double red
White balance gain for R channel.
Definition ipa_context.h:65
libcamera::ipa::ipu3::IPAActiveState::gains
struct libcamera::ipa::ipu3::IPAActiveState::@051374147247113050363206126116016245340200121213::@104324143206056240300277312255303030207353205200 gains
White balance gains.
libcamera::ipa::ipu3::IPAActiveState::gammaCorrection
struct ipu3_uapi_gamma_corr_lut gammaCorrection
Per-pixel tone mapping implemented as a LUT.
Definition ipa_context.h:75
libcamera::ipa::ipu3::IPAActiveState::focus
uint32_t focus
Current position of the lens.
Definition ipa_context.h:51
libcamera::ipa::ipu3::IPAActiveState::maxVariance
double maxVariance
The maximum variance of the current image.
Definition ipa_context.h:52
libcamera::ipa::ipu3::IPAActiveState::temperatureK
double temperatureK
Estimated color temperature.
Definition ipa_context.h:70
libcamera::ipa::ipu3::IPAActiveState::awb
struct libcamera::ipa::ipu3::IPAActiveState::@051374147247113050363206126116016245340200121213 awb
Context for the Automatic White Balance algorithm.
libcamera::ipa::ipu3::IPAActiveState::af
struct libcamera::ipa::ipu3::IPAActiveState::@071262103123273134035360040264157341021041311001 af
Context for the Automatic Focus algorithm.
libcamera::ipa::ipu3::IPAContext::configuration
IPASessionConfiguration configuration
The IPA session configuration, immutable during the session.
Definition ipa_context.h:92
libcamera::ipa::ipu3::IPAContext::frameContexts
FCQueue< IPAFrameContext > frameContexts
Ring buffer of the IPAFrameContext(s).
Definition ipa_context.h:95
libcamera::ipa::ipu3::IPAContext::IPAContext
IPAContext(unsigned int frameContextSize)
Initialize the instance with the given number of frame contexts.
Definition ipa_context.h:87
libcamera::ipa::ipu3::IPAContext::ctrlMap
ControlInfoMap::Map ctrlMap
A ControlInfoMap::Map of controls populated by the algorithms.
Definition ipa_context.h:97
libcamera::ipa::ipu3::IPAContext::activeState
IPAActiveState activeState
The current state of IPA algorithms.
Definition ipa_context.h:93
libcamera::ipa::ipu3::IPAFrameContext
IPU3-specific FrameContext.
Definition ipa_context.h:79
libcamera::ipa::ipu3::IPAFrameContext::sensor
struct libcamera::ipa::ipu3::IPAFrameContext::@153316034052110176217141150134324150265214072044 sensor
Effective sensor values that were applied for the frame.
libcamera::ipa::ipu3::IPAFrameContext::gain
double gain
Analogue gain multiplier.
Definition ipa_context.h:82
libcamera::ipa::ipu3::IPAFrameContext::exposure
uint32_t exposure
Exposure time expressed as a number of lines.
Definition ipa_context.h:81
libcamera::ipa::ipu3::IPASessionConfiguration
Session configuration for the IPA module.
Definition ipa_context.h:24
libcamera::ipa::ipu3::IPASessionConfiguration::bdsGrid
ipu3_uapi_grid_config bdsGrid
Bayer Down Scaler grid plane config used by the kernel.
Definition ipa_context.h:26
libcamera::ipa::ipu3::IPASessionConfiguration::sensor
struct libcamera::ipa::ipu3::IPASessionConfiguration::@000270162205233312240267154160141120017226164101 sensor
Sensor-specific configuration of the IPA.
libcamera::ipa::ipu3::IPASessionConfiguration::afGrid
ipu3_uapi_grid_config afGrid
AF scene grid configuration.
Definition ipa_context.h:32
libcamera::ipa::ipu3::IPASessionConfiguration::minAnalogueGain
double minAnalogueGain
Minimum analogue gain supported with the configured sensor.
Definition ipa_context.h:38
libcamera::ipa::ipu3::IPASessionConfiguration::lineDuration
utils::Duration lineDuration
Line duration in microseconds.
Definition ipa_context.h:44
libcamera::ipa::ipu3::IPASessionConfiguration::size
Size size
Sensor output resolution.
Definition ipa_context.h:45
libcamera::ipa::ipu3::IPASessionConfiguration::minExposureTime
utils::Duration minExposureTime
Minimum exposure time supported with the configured sensor.
Definition ipa_context.h:36
libcamera::ipa::ipu3::IPASessionConfiguration::bdsOutputSize
Size bdsOutputSize
BDS output size configured by the pipeline handler.
Definition ipa_context.h:27
libcamera::ipa::ipu3::IPASessionConfiguration::af
struct libcamera::ipa::ipu3::IPASessionConfiguration::@134111133116024143261334214133061373076336176224 af
AF grid configuration of the IPA.
libcamera::ipa::ipu3::IPASessionConfiguration::maxExposureTime
utils::Duration maxExposureTime
Maximum exposure time supported with the configured sensor.
Definition ipa_context.h:37
libcamera::ipa::ipu3::IPASessionConfiguration::grid
struct libcamera::ipa::ipu3::IPASessionConfiguration::@120042124303245340150020112133163112264141374071 grid
Grid configuration of the IPA.
libcamera::ipa::ipu3::IPASessionConfiguration::defVBlank
int32_t defVBlank
The default vblank value of the sensor.
Definition ipa_context.h:43
libcamera::ipa::ipu3::IPASessionConfiguration::maxAnalogueGain
double maxAnalogueGain
Maximum analogue gain supported with the configured sensor.
Definition ipa_context.h:39
libcamera::ipa::ipu3::IPASessionConfiguration::agc
struct libcamera::ipa::ipu3::IPASessionConfiguration::@247016210333232265124136337006233133064156163334 agc
AGC parameters configuration of the IPA.
libcamera::ipa::ipu3::IPASessionConfiguration::stride
uint32_t stride
Number of cells on one line including the ImgU padding.
Definition ipa_context.h:28
utils.h
Miscellaneous utility functions.