ipa: rpi: agc: Make the maximum digital gain configurable
The maximum allowed digital gain is hard-coded to 4. Make it a configurable parameter. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
committed by
Kieran Bingham
parent
42562d6d33
commit
25942b74e1
@@ -260,6 +260,8 @@ int AgcConfig::read(const libcamera::YamlObject ¶ms)
|
||||
|
||||
desaturate = params["desaturate"].get<int>(1);
|
||||
|
||||
maxDigitalGain = params["max_digital_gain"].get<double>(4.0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -508,7 +510,8 @@ void AgcChannel::prepare(Metadata *imageMetadata)
|
||||
* Never ask for a gain < 1.0, and also impose
|
||||
* some upper limit. Make it customisable?
|
||||
*/
|
||||
prepareStatus.digitalGain = std::max(1.0, std::min(digitalGain, 4.0));
|
||||
prepareStatus.digitalGain = std::max(1.0, std::min(digitalGain,
|
||||
config_.maxDigitalGain));
|
||||
LOG(RPiAgc, Debug) << "Actual exposure " << actualExposure;
|
||||
LOG(RPiAgc, Debug) << "Use digitalGain " << prepareStatus.digitalGain;
|
||||
LOG(RPiAgc, Debug) << "Effective exposure "
|
||||
|
||||
@@ -78,6 +78,7 @@ struct AgcConfig {
|
||||
double defaultAnalogueGain;
|
||||
double stableRegion;
|
||||
bool desaturate;
|
||||
double maxDigitalGain;
|
||||
};
|
||||
|
||||
class AgcChannel
|
||||
|
||||
Reference in New Issue
Block a user