[libcamera-devel] softISP for libcamera

Pavel Machek pavel at ucw.cz
Tue Dec 5 22:49:25 CET 2023


Hi!

> > (I'd really like ability to collect statistics without doing the
> > debayering,
> 
> That is actually already a part of my refactoring, the stats
> collection is now done separately (on a line by line basis
> to keep the input data hot in the cache for debayering.

#define SWISP_LINARO_START_LINE_STATS()                 \
        uint8_t r, g1, g2, b;                           \

...

void SwIspLinaro::IspWorker::statsBGGR10PLine0(const uint8_t *src0)
void SwIspLinaro::IspWorker::statsGBRG10PLine0(const uint8_t *src0)

...

This is quite evil code. Could we have struct for statistics and
inline functions instead?

There must be a better way then this.

What about

void inline statsBayer10PLine0(const uint8_t *src0, int bayer_type)

... have a switch for BGGR/GBRG, ... variants passed as bayer_type. Then

void SwIspLinaro::IspWorker::statsBGGR10PLine0(const uint8_t *src0)
{
    statsBayer10PLine0(src0, 0);
}

and rely on optimizer doing the right thing? Having 4 copies is
... not fun. Especially because I'll need to do one more copy for 8
bit support...

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/20231205/ba3b8261/attachment.sig>


More information about the libcamera-devel mailing list