Repository navigation
superpix_sp2305: analog gain to 31.9x, and the module maker's colour defaults - #262
Merged
Merged
Conversation
…defaults
The analog gain is a 9-bit code in sixteenths: the low byte in P1:0x24
and bit 8 in bit 0 of P1:0x38. The driver wrote only 0x24 and stopped at
15.5x, half of what the sensor has. 0x38 now rides in the per-frame
register list ahead of the trigger, and the again table runs on to
511/16 = 31.94x.
Measured on an hi3516ev300 + SP2305 module in RAW at a fixed exposure:
0x24 0x10 -> 0x20 -> 0x40 -> 0x80 signal x2.05, x2.00, x1.95
0x38 bit 0 set under 0x24 = 0x10 x17.1 (code 0x110), pedestal unchanged
AE in a dark room again 32704, 0x38 = 1, ISO 13673
(the maker's camera: 13379)
The black pedestal holds at 65-67 DN in all four channels at 31.9x, so
the 0x100 black level stays right; nothing clips at zero.
The white-balance curve, colour matrices and saturation table are now
the ones the module maker's library carries for this board. Its curve
places lights on the colour-temperature scale an IQ profile's matrices
are written against, and on one camera and profile, beside the maker's
camera as the control, it left the chart's greys about twice as close
to neutral as the chart fit from #248 under a 3000 K lamp (0.16 -> 0.08,
max-min over mean) and a 3000 K + 6000 K mix (0.56 -> 0.32), and the
same under 6000 K (0.41 -> 0.45). Swapping this library for the maker's
on the same camera, at the same moment, moves those numbers by no more
than run-to-run scatter.
Left as they were: the 24 MHz timing, the 0x40 black-level target the
init writes to P1:0xF0-0xF3, and the 0x100 the ISP subtracts. The
maker's library drops that target, so its pedestal is near zero and the
sensor clips its own noise there.
widgetii
marked this pull request as ready for review
October 14, 2026 06:30
Contributor
|
/review |
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can switch off images and animations for a plain-text comment |
widgetii
added a commit
to OpenIPC/firmware
that referenced
this pull request
Oct 14, 2026
widgetii
added a commit
to OpenIPC/firmware
that referenced
this pull request
Oct 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The SP2305/OV2735 driver for hi3516ev200/ev300 now does what the module maker's library does in the places an IQ profile depends on, while keeping its own timing and black level.
Analog gain: 15.5x → 31.9x
The analog gain is a 9-bit code in sixteenths. The low byte goes in P1:0x24 and bit 8 in bit 0 of P1:0x38. The driver wrote only 0x24.
Measured in RAW on an hi3516ev300 + SP2305 at a fixed exposure:
White balance, colour matrices and saturation: the maker's
These now match the maker's library for this board. The IQ profile's matrices are written against this curve's colour-temperature scale.
Grey neutrality on one camera and profile, with the maker's camera beside it as the control (max−min over mean of the chart's greys, lower is better):
Swapping this library for the maker's on the same camera at the same moment moves these numbers by no more than run-to-run scatter. That is why I'm calling it functionally equivalent.
Not changed
The maker's library drops that target. Its pedestal sits near zero and the sensor clips its own noise there, so a profile tuned on that library needs a different black level. That doesn't apply to this one.
The firmware IQ profile that goes with this follows in OpenIPC/firmware.