[libcamera-devel] swisp performance notes was Re: [RFC] Add 8-bit bayer support.

Hans de Goede hdegoede at redhat.com
Fri Dec 15 15:15:42 CET 2023


Hi,

On 12/14/23 22:44, Pavel Machek wrote:
> Hi!
> 
> So... For some reason latest version uses full sensor resolution. That
> gave me 0.1 fps.

That is weird, in recent versions I changed the sizes()
method defined in:

include/libcamera/internal/software_isp/debayer.h

to return an actual SizeRange from for normal debayering
2x2 - (width-4)x(height-4).

Since we can fill a smaller output buffer using cropping,
so this replaces the old sizes function which returned
a SizeRange of:

(width-4)x(height-4) - (width-4)x(height-4)

Does your sensor driver support multiple resolutions /
cropping at the sensor level ?

I wonder if advertising cropping in the software-isp
is causing the simple-pipeline to pick a different
sensor resolution.

You could try undoing the sizes change:

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;

Regards,

Hans



More information about the libcamera-devel mailing list