summaryrefslogtreecommitdiff
path: root/src/ipa/rkisp1/ipa_context.h
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-09-08 00:39:53 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-09-28 05:41:14 +0300
commit128f22bce55ba2baea082010bceaffdba23f3f0d (patch)
treefbbc378e5d2d15a3994785c0a124878c52f8f5f8 /src/ipa/rkisp1/ipa_context.h
parent310b7a6a306bb981be7c3fca18e5d53c02eac78b (diff)
ipa: rkisp1: awb: Store per-frame information in frame context
Rework the algorithm's usage of the active state and frame context to store data in the right place. The active state stores two distinct categories of information: - The consolidated value of all algorithm controls. Requests passed to the queueRequest() function store values for controls that the application wants to modify for that particular frame, and the queueRequest() function updates the active state with those values. The active state thus contains a consolidated view of the value of all controls handled by the algorithm. - The value of parameters computed by the algorithm when running in auto mode. Algorithms running in auto mode compute new parameters every time statistics buffers are received (either synchronously, or possibly in a background thread). The latest computed value of those parameters is stored in the active state in the process() function. The frame context also stores two categories of information: - The value of the controls to be applied to the frame. These values are typically set in the queueRequest() function, from the consolidated control values stored in the active state. The frame context thus stores values for all controls related to the algorithm, not limited to the controls specified in the corresponding request, but consolidated from all requests that have been queued so far. For controls that can be specified manually or computed by the algorithm depending on the operation mode (such as the colour gains), the control value will be stored in the frame context in queueRequest() only when operating in manual mode. When operating in auto mode, the values are computed by the algorithm and stored in the frame context in prepare(), just before being stored in the ISP parameters buffer. The queueRequest() function can also store ancillary data in the frame context, such as flags to indicate if (and what) control values have changed compared to the previous request. - Status information computed by the algorithm for a frame. For instance, the colour temperature estimated by the algorithm from ISP statistics calculated on a frame is stored in the frame context for that frame in the process() function. The active state and frame context thus both contain identical members for most control values, but store values that have a different meaning. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/ipa/rkisp1/ipa_context.h')
-rw-r--r--src/ipa/rkisp1/ipa_context.h25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h
index 3fbd6b18..5494a68f 100644
--- a/src/ipa/rkisp1/ipa_context.h
+++ b/src/ipa/rkisp1/ipa_context.h
@@ -56,12 +56,18 @@ struct IPAActiveState {
struct {
struct {
- double red;
- double green;
- double blue;
+ struct {
+ double red;
+ double green;
+ double blue;
+ } manual;
+ struct {
+ double red;
+ double green;
+ double blue;
+ } automatic;
} gains;
- double temperatureK;
bool autoEnabled;
} awb;
@@ -91,6 +97,17 @@ struct IPAFrameContext : public FrameContext {
} agc;
struct {
+ struct {
+ double red;
+ double green;
+ double blue;
+ } gains;
+
+ double temperatureK;
+ bool autoEnabled;
+ } awb;
+
+ struct {
uint32_t exposure;
double gain;
} sensor;