Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ipa/rpi/controller/rpi/agc_channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -941,8 +941,8 @@ void AgcChannel::divideUpExposure()
/* Finally work out the digital gain that we will need. */
filtered_.totalExposureNoDG = analogueGain * exposureTime;
double digitalGain = filtered_.totalExposure / filtered_.totalExposureNoDG;
/* Limit dg by what is allowed. */
digitalGain = std::min(digitalGain, config_.maxDigitalGain);
/* Limit dg by what is allowed (and to 1.0 to avoid saturation issues). */
digitalGain = std::clamp(digitalGain, 1.0, config_.maxDigitalGain);
/* Update total exposure, in case the dg went down. */
filtered_.totalExposure = filtered_.totalExposureNoDG * digitalGain;

Expand Down