libcamera  v0.0.0+3695-a2c715d8
Supporting cameras in Linux since 2019
ipa_context.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 /*
3  * Copyright (C) 2021, Google Inc.
4  *
5  * ipa_context.h - IPU3 IPA Context
6  *
7  */
8 
9 #pragma once
10 
11 #include <array>
12 
13 #include <linux/intel-ipu3.h>
14 
15 #include <libcamera/base/utils.h>
16 
17 #include <libcamera/controls.h>
18 #include <libcamera/geometry.h>
19 
20 namespace libcamera {
21 
22 namespace ipa::ipu3 {
23 
24 /* Maximum number of frame contexts to be held */
25 static constexpr uint32_t kMaxFrameContexts = 16;
26 
28  struct {
29  ipu3_uapi_grid_config bdsGrid;
31  uint32_t stride;
32  } grid;
33 
34  struct {
35  ipu3_uapi_grid_config afGrid;
36  } af;
37 
38  struct {
43  } agc;
44 
45  struct {
46  int32_t defVBlank;
48  } sensor;
49 };
50 
52  struct {
53  uint32_t focus;
54  double maxVariance;
55  bool stable;
56  } af;
57 
58  struct {
59  uint32_t exposure;
60  double gain;
61  } agc;
62 
63  struct {
64  struct {
65  double red;
66  double green;
67  double blue;
68  } gains;
69 
70  double temperatureK;
71  } awb;
72 
73  struct {
74  double gamma;
75  struct ipu3_uapi_gamma_corr_lut gammaCorrection;
76  } toneMapping;
77 };
78 
81  IPAFrameContext(uint32_t id, const ControlList &reqControls);
82 
83  struct {
84  uint32_t exposure;
85  double gain;
86  } sensor;
87 
88  uint32_t frame;
90 };
91 
92 struct IPAContext {
95 
96  std::array<IPAFrameContext, kMaxFrameContexts> frameContexts;
97 };
98 
99 } /* namespace ipa::ipu3 */
100 
101 } /* namespace libcamera*/
utils::Duration lineDuration
Line duration in microseconds.
Definition: ipa_context.h:47
Global IPA context data shared between all algorithms.
Definition: ipa_context.h:92
double temperatureK
Estimated color temperature.
Definition: ipa_context.h:70
double red
White balance gain for R channel.
Definition: ipa_context.h:65
double gain
Analogue gain multiplier.
Definition: ipa_context.h:85
ipu3_uapi_grid_config afGrid
AF scene grid configuration.
Definition: ipa_context.h:35
ControlList frameControls
Controls sent in by the application while queuing the request.
Definition: ipa_context.h:89
Top-level libcamera namespace.
Definition: backtrace.h:17
struct libcamera::ipa::ipu3::IPASessionConfiguration::@6 agc
AGC parameters configuration of the IPA.
Size bdsOutputSize
BDS output size configured by the pipeline handler.
Definition: ipa_context.h:30
double maxAnalogueGain
Maximum analogue gain supported with the configured sensor.
Definition: ipa_context.h:42
IPAActiveState activeState
The current state of IPA algorithms.
Definition: ipa_context.h:94
Describe a two-dimensional size.
Definition: geometry.h:52
int32_t defVBlank
The default vblank value of the sensor.
Definition: ipa_context.h:46
std::array< IPAFrameContext, kMaxFrameContexts > frameContexts
Ring buffer of the IPAFrameContext(s)
Definition: ipa_context.h:96
Miscellaneous utility functions.
struct libcamera::ipa::ipu3::IPASessionConfiguration::@7 sensor
Sensor-specific configuration of the IPA.
struct libcamera::ipa::ipu3::IPASessionConfiguration::@4 grid
Grid configuration of the IPA.
utils::Duration minShutterSpeed
Minimum shutter speed supported with the configured sensor.
Definition: ipa_context.h:39
double gain
Analogue gain multiplier.
Definition: ipa_context.h:60
uint32_t stride
Number of cells on one line including the ImgU padding.
Definition: ipa_context.h:31
uint32_t exposure
Exposure time expressed as a number of lines.
Definition: ipa_context.h:84
Session configuration for the IPA module.
Definition: ipa_context.h:27
ipu3_uapi_grid_config bdsGrid
Bayer Down Scaler grid plane config used by the kernel.
Definition: ipa_context.h:29
bool stable
It is set to true, if the best focus is found.
Definition: ipa_context.h:55
IPASessionConfiguration configuration
The IPA session configuration, immutable during the session.
Definition: ipa_context.h:93
double blue
White balance gain for B channel.
Definition: ipa_context.h:67
Helper class from std::chrono::duration that represents a time duration in nanoseconds with double pr...
Definition: utils.h:323
uint32_t exposure
Exposure time expressed as a number of lines.
Definition: ipa_context.h:59
Context for a frame.
Definition: ipa_context.h:79
struct libcamera::ipa::ipu3::IPASessionConfiguration::@5 af
AF grid configuration of the IPA.
double green
White balance gain for G channel.
Definition: ipa_context.h:66
double gamma
Gamma value for the LUT.
Definition: ipa_context.h:74
Associate a list of ControlId with their values for an object.
Definition: controls.h:348
Framework to manage controls related to an object.
utils::Duration maxShutterSpeed
Maximum shutter speed supported with the configured sensor.
Definition: ipa_context.h:40
Data structures related to geometric objects.
double maxVariance
The maximum variance of the current image.
Definition: ipa_context.h:54
uint32_t focus
Current position of the lens.
Definition: ipa_context.h:53
double minAnalogueGain
Minimum analogue gain supported with the configured sensor.
Definition: ipa_context.h:41
uint32_t frame
The frame number.
Definition: ipa_context.h:88