camerabin: small speedup in software zoom

Force crop on even pixel position to avoid slowpath in crop & scale.
This commit is contained in:
Stefan Kost 2009-07-21 17:48:33 +03:00
parent b3753116d2
commit 43657ef1f3

View file

@ -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");