[PATCH] ipa: simple: Initialize ccmEnabled to false
Stanislaw Gruszka
stanislaw.gruszka at linux.intel.com
Tue Apr 1 12:45:07 CEST 2025
Hi Milan,
On Tue, Apr 01, 2025 at 12:17:56PM +0200, Milan Zamazal wrote:
> Hi Stanislaw,
>
> thank you for the patch.
>
> Stanislaw Gruszka <stanislaw.gruszka at linux.intel.com> writes:
>
> > ccmEnabled variable is not initialized by default, what result of
> > usage of CCM when the algorithm itself is not enabled and configured.
>
> Interesting, I thought the default boolean value in C++ is false.
> If true or not, it doesn't harm to set it explicitly.
I think class members are not initialized if not explicitly done so.
And can have random values unfortunately.
I can not really confirm the fix because, it happened randomly and very
seldom. But I initialized ccmEnabled to true and got the same effect
as when the bug happened: first collorfull images with only coutures
recognizable and then all black.
> > struct IPAContext {
> > IPAContext(unsigned int frameContextSize)
> > - : frameContexts(frameContextSize)
> > + : frameContexts(frameContextSize), ccmEnabled(false)
>
> Or setting it
>
> bool ccmEnabled = false;
>
> in IPAContext? Up to the maintainers, what they prefer.
>
> From my side, in either case:
>
> Reviewed-by: Milan Zamazal <mzamazal at redhat.com>
Thanks!
Regards
Stanislaw
More information about the libcamera-devel
mailing list