[libcamera-devel] [PATCH 00/11] libcamera: introduce Software ISP and Software IPA

Hans de Goede hdegoede at redhat.com
Thu Dec 21 21:36:44 CET 2023


Hi Bryan,

On 12/15/23 15:37, Hans de Goede wrote:

<snip>

>>>> e3c2a5931dd825c58f626da8c12429b70d20219b (not really expecting a performance impact from this one but maybe)
>>
>>
>> Way brighter - too much IMO in comparsion to the previous, occupancy 100% fps 21.
> 
> Ok, so the CPU change here is weird. I know building with -O3 helps, but it looks
> like there is still more CPU load gain to have.
> 
> Can you try adding this change on top of SoftwareISP-v04 ? :
> 
> diff --git a/include/libcamera/internal/software_isp/debayer.h b/include/libcamera/internal/software_isp/debayer.h
> index 206bc2ac..e2a63f24 100644
> --- a/include/libcamera/internal/software_isp/debayer.h
> +++ b/include/libcamera/internal/software_isp/debayer.h
> @@ -77,10 +77,8 @@ public:
>  			return {};
>  		}
>  
> -		return SizeRange(Size(pattern_size.width, pattern_size.height),
> -				 Size((inputSize.width - 2 * pattern_size.width) & ~(pattern_size.width - 1),
> -				      (inputSize.height - 2 * pattern_size.height) & ~(pattern_size.height - 1)),
> -				 pattern_size.width, pattern_size.height);
> +		return SizeRange(Size((inputSize.width - 2 * pattern_size.width) & ~(pattern_size.width - 1),
> +				      (inputSize.height - 2 * pattern_size.height) & ~(pattern_size.height - 1)));
>  	}
>  
>  	Signal<FrameBuffer *> inputBufferReady;
> 
> That basically undoes e3c2a5931dd825c58f626da8c12429b70d20219b but then
> the SoftwareISP-v04 equivalent of it.

This question (the CPU increase you saw due to e3c2a5931dd825c58f626da8c12429b70d20219b
is still relevant and the above diff to just return a single fixed size
should still apply to SoftwareISP-v04-hans2 .

I know -O3 helps, but I'm still puzzled why the sizes() changed caused
a performance regression at all. So I wonder of if you undo the change
(diff above) we get even better performance with -O3.

Regards,

Hans





More information about the libcamera-devel mailing list