ipa: rpi: agc: Clamp digital gain to avoid saturation issues#340
Closed
davidplowman wants to merge 1 commit into
Closed
ipa: rpi: agc: Clamp digital gain to avoid saturation issues#340davidplowman wants to merge 1 commit into
davidplowman wants to merge 1 commit into
Conversation
Digital gain is used to adjust overall image exposure when the target exposure cannot be achieved (for example, cannot go high enough). But when the target exposure is lower than we can achieve, the digital gain was being set to values less than unity, causing saturation problems. The fix is simply to clamp the digital gain at the bottom to 1.0, resulting in images that, while "too bright", saturate correctly. Fixes: 17f9912 ("ipa: rpi: agc: Calculate digital gain in process()") Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Alen Karnil <alen.karnil@ideasonboard.com> Tested-by: Alen Karnil <alen.karnil@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Collaborator
|
Looks reasonable. Should we merge? |
Collaborator
Author
|
I think so, it's in upstream libcamera already. Also perhaps this one, it's also been merged upstream? |
Collaborator
|
Perhaps I should merge the upstream tree in one-shot. Then we can close these. |
Collaborator
Author
|
Could do. We might also want to get Nick's fix, for the crash when |
Collaborator
|
I don't see a PR for that, but I can add it later. |
Collaborator
|
Just running through some tests now on https://github.com/raspberrypi/libcamera/tree/next_merge |
Collaborator
|
I've now merged upstream to next, which includes this change. |
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.
Digital gain is used to adjust overall image exposure when the target exposure cannot be achieved (for example, cannot go high enough). But when the target exposure is lower than we can achieve, the digital gain was being set to values less than unity, causing saturation problems.
The fix is simply to clamp the digital gain at the bottom to 1.0, resulting in images that, while "too bright", saturate correctly.
Fixes: 17f9912 ("ipa: rpi: agc: Calculate digital gain in process()")
Reviewed-by: Alen Karnil alen.karnil@ideasonboard.com
Tested-by: Alen Karnil alen.karnil@ideasonboard.com
Reviewed-by: Kieran Bingham kieran.bingham@ideasonboard.com