From 43657ef1f3aa85f7e5dbce57681181da4c049b96 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Tue, 21 Jul 2009 17:48:33 +0300 Subject: [PATCH] camerabin: small speedup in software zoom Force crop on even pixel position to avoid slowpath in crop & scale. --- gst/camerabin/gstcamerabin.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gst/camerabin/gstcamerabin.c b/gst/camerabin/gstcamerabin.c index 50f863d317..22a33477fd 100644 --- a/gst/camerabin/gstcamerabin.c +++ b/gst/camerabin/gstcamerabin.c @@ -1031,6 +1031,10 @@ gst_camerabin_set_element_zoom (GstCameraBin * camera, gint zoom) if (zoom != ZOOM_1X) { w2_crop = (camera->width - (camera->width * ZOOM_1X / zoom)) / 2; h2_crop = (camera->height - (camera->height * ZOOM_1X / zoom)) / 2; + + /* force number of pixels cropped from left to be even, to avoid slow code + * path on videoscale */ + w2_crop &= 0xFFFE; } pad_zoom_sink = gst_element_get_static_pad (camera->src_zoom_crop, "sink");