mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
mpeg2dec: Copy planes in one go when possible
This commit is contained in:
parent
425e6e395f
commit
4a4d652dd4
1 changed files with 14 additions and 4 deletions
|
@ -357,12 +357,22 @@ gst_mpeg2dec_crop_buffer (GstMpeg2dec * dec, GstBuffer ** buf)
|
|||
gst_video_format_get_component_height (dec->format, c, dec->height);
|
||||
c_width = gst_video_format_get_component_width (dec->format, c, dec->width);
|
||||
|
||||
GST_DEBUG ("stride_in:%d _out:%d c_width:%d c_height:%d",
|
||||
stride_in, stride_out, c_width, c_height);
|
||||
|
||||
if (stride_in == stride_out && stride_in == c_width) {
|
||||
/* FAST PATH */
|
||||
memcpy (dest, src, c_height * stride_out);
|
||||
dest += stride_out * c_height;
|
||||
src += stride_out * c_height;
|
||||
} else {
|
||||
for (line = 0; line < c_height; line++) {
|
||||
memcpy (dest, src, c_width);
|
||||
dest += stride_out;
|
||||
src += stride_in;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gst_buffer_set_caps (outbuf, GST_PAD_CAPS (dec->srcpad));
|
||||
gst_buffer_copy_metadata (outbuf, inbuf,
|
||||
|
|
Loading…
Reference in a new issue