summaryrefslogtreecommitdiff
path: root/src/ipa/libipa/camera_sensor_helper.h
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-02-24 19:01:38 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-04-01 14:29:25 +0300
commit8ad9249fb09d598cb24bae85101526fa822270ff (patch)
tree3d5f587bd2cc61ab76989efdbc0ecd471d3b09f3 /src/ipa/libipa/camera_sensor_helper.h
parenta9d43c4710ba0db092c2abbf7d3423f4ac58352a (diff)
libipa: camera_sensor_helper: Implement exponential gain model
The CameraSensorHelper specifies two gain models, linear and exponential. They are modelled after the MIPI CCS specification. Only the linear model has been implemented, the exponential model was left for later. We now need to support sensors that configure their gain in a hardware register with a value expressed in dB. This has similarities with the MIPI CCS exponential gain model, but is only has an exponential factor, while CCS also allows sensors to support a configurable linear factor. The full CCS exponential model needs two values (for the linear and exponential factors) to express a gain, while IPAs use a single linear gain value internally. However, the exponential gain model example in the CCS specification has a fixed linear factor, which may indicate that it could be common for sensors that implement the exponential gain model to only use the exponential factor. For this reason, implement the exponential gain model with a fixed linear factor, but with a sensor-specific coefficient for the exponential factor that allows expressing the gain in dB (or other logarithmical units) instead of limiting it to powers of 2 as in the MIPI CCS specification. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Diffstat (limited to 'src/ipa/libipa/camera_sensor_helper.h')
-rw-r--r--src/ipa/libipa/camera_sensor_helper.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ipa/libipa/camera_sensor_helper.h b/src/ipa/libipa/camera_sensor_helper.h
index 6b96520b..7351fc7c 100644
--- a/src/ipa/libipa/camera_sensor_helper.h
+++ b/src/ipa/libipa/camera_sensor_helper.h
@@ -41,8 +41,14 @@ protected:
int16_t c1;
};
+ struct AnalogueGainExpConstants {
+ double a;
+ double m;
+ };
+
union AnalogueGainConstants {
AnalogueGainLinearConstants linear;
+ AnalogueGainExpConstants exp;
};
AnalogueGainType gainType_;