[libcamera-devel] statistics cleanup was Re: ... libcamera: ipa: Soft IPA: add a Soft IPA implementation

Pavel Machek pavel at ucw.cz
Wed Dec 13 14:01:05 CET 2023


Hi!

> >> ATM the statistics and debayer classes are mostly ready,
> >> but I need to merge this with Andrey's v2 RFC and
> >> then produce a clean new series from this
> >> (assuming people like the approach).
> > 
> > Could I get you to apply this?
> 
> I can give it a try and assuming it does not cause
> a performance regression I would be happy to
> squash this in.
> 
> Which brings the question of crediting the change,
> I can add a:
> 
> Suggested-by: Pavel Machek <pavel at ucw.cz>

This one will be fine.

> but then I'm going to need a Signed-off-by from you
> (just reply here with it).

Signed-off-by: Pavel Machek <pavel at ucw.cz>

> Either way let me know which way you want to be credited?
> 
> The same question (how to credit) you also applies to
> the suggested debayering changes ?

Suggested-by will be fine... and

Signed-off-by: Pavel Machek <pavel at ucw.cz>

for that as well.

> BTW did you see that I added a x_shift_ variable
> to both the swstats and the debayer_cpu classes?
> 
> This allows shifting the input data start one
> pixel to the right, changing e.g. RGGB to GRBG
> so that we need less debayer functions.
> 
> Unfortunately this trick will not work for
> 10bpp packed formats because there we have:
> MSB MSB MSB MSB LSBS in memory so we cannot
> just shift things by skipping the first column
> because then we end up with:
> MSB MSB MSB LSBS MSB instead, which breaks
> the debayer / stats functions expectations.

Aha, neat trick I did not notice. I'll take a look. At some point, I
guess we'll need better abstractions that separate getting bayer data
(there are at least 8, 10, 10p, 12 variants -- and some people will
want to use the low bits) and actual debayer algorithm (you have
bi-linear, but there's also nearest point, and there are also higher
quality variants).

But, this all can wait.

I believe first step is getting your series merged. Adding 8bpp to
that should be easy after it is in, and makes pinephone useful. (And
likely helps to others).

Then... I guess doing debayer+downscale for preview makes sense. Doing
it in one step should save significant CPU. But then "what to do with
rgb stream for video recording" is a good question. May need better
quality than we have (use full 10 bits, lens shading compensation),
and is still performance sensitive, and maybe clipping to odd
resolution as we currently do will be a problem there.

Best regards,
								Pavel
-- 
People of Russia, stop Putin before his war on Ukraine escalates.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://lists.libcamera.org/pipermail/libcamera-devel/attachments/20231213/898c471c/attachment.sig>


More information about the libcamera-devel mailing list