[PATCH v6 17/18] libcamera: software_isp: Apply black level compensation

Laurent Pinchart laurent.pinchart at ideasonboard.com
Sat Apr 20 12:42:47 CEST 2024


Hi Milan,

On Tue, Apr 16, 2024 at 05:31:38PM +0200, Milan Zamazal wrote:
> Laurent Pinchart <laurent.pinchart at ideasonboard.com> writes:
> 
> > As for other part of this series, I'm fine starting with this initial
> > implementation and improving it, but I think the black level should
> > eventually be moved before debayering, and ideally the colour gains as
> > well. I understand the need for optimizations to lower the CPU
> > consumption, but at the same time I don't feel comfortable building up
> > on top of an implementation that may work a bit more by chance than by
> > correctness, as that's not very maintainable.
> 
> Hi Laurent,
> 
> to make sure we understand each other correctly: Can we agree that "be moved
> before debayering" above means primarily separating the level adjustments
> computations from debayering code and building them (together with other stuff)
> on top of libipa/algorithm.h?  Rather than first applying the corrections on the
> data and only then perform debayering, which luxury we cannot afford, at least
> on CPU?  I.e. the first step could be something like
> https://gitlab.freedesktop.org/mzamazal/libcamera-softisp/-/commit/6180d853005bb956b3d2469576b139ff523b76ad ?

What I meant is subtracting the black level before applying the colour
gains and performing the CFA interpolation (a.k.a. debayering). I'm fine
with the black level subtraction and CFA interpolation being performed
in a single pass by a single function for performance reason, but the
order needs to be swapped.

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list