[2/7] ipa: libipa: camera_sensor_helper: Add OV32C4
diff mbox series

Message ID 20260826082328.24176-3-robertbozik@gmail.com
State Rejected
Headers show
Series
  • Software ISP: OV32C4 support, frame duration control, faster AGC with digital gain, temporal denoise
Related show

Commit Message

Róbert Božik Aug. 26, 2026, 8:23 a.m. UTC
Both numbers were measured on the sensor rather than taken from the
OmniVision helpers already present, because the obvious donor is wrong
for this part.

The analogue gain is linear in the register value, but unity is at
0x100, not at 0x80 as on ov13b10 and ov08x40 which use the same
register: below 0x100 the output stops tracking the value written at
all, and the chip itself powers up at 0x100. Using code/128 here would
make the AE loop believe it has twice the gain it actually applied.

The black level is 0x40 at 10 bits, measured with the sensor covered
across the whole gain range, where it stays within one LSB.

Signed-off-by: Robert Bozik <robertbozik@gmail.com>
---
 src/ipa/libipa/camera_sensor_helper.cpp | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

Patch
diff mbox series

diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp
index 82bf255d..6b746727 100644
--- a/src/ipa/libipa/camera_sensor_helper.cpp
+++ b/src/ipa/libipa/camera_sensor_helper.cpp
@@ -763,6 +763,23 @@  public:
 };
 REGISTER_CAMERA_SENSOR_HELPER("ov2740", CameraSensorHelperOv2740)
 
+class CameraSensorHelperOv32c4 : public CameraSensorHelper
+{
+public:
+	CameraSensorHelperOv32c4()
+	{
+		/*
+		 * Measured on the sensor: the black level is 0x40 at 10 bits,
+		 * and the gain is linear in the register value with unity at
+		 * 0x100, not at 0x80 as on other OmniVision sensors sharing
+		 * the same gain register.
+		 */
+		blackLevel_ = 4096;
+		gain_ = AnalogueGainLinear{ 1, 0, 0, 256 };
+	}
+};
+REGISTER_CAMERA_SENSOR_HELPER("ov32c4", CameraSensorHelperOv32c4)
+
 class CameraSensorHelperOv4689 : public CameraSensorHelper
 {
 public: