mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
vp8dec: optimize vpx image to gstbuffer copy when strides match
Solving this FIXME. Copy the full plane when strides are the same
This commit is contained in:
parent
3270137702
commit
5c7c90ff2c
1 changed files with 12 additions and 6 deletions
|
@ -390,12 +390,18 @@ gst_vp8_dec_image_to_buffer (GstVP8Dec * dec, const vpx_image_t * img,
|
||||||
deststride = GST_VIDEO_FRAME_COMP_STRIDE (&frame, comp);
|
deststride = GST_VIDEO_FRAME_COMP_STRIDE (&frame, comp);
|
||||||
srcstride = img->stride[comp];
|
srcstride = img->stride[comp];
|
||||||
|
|
||||||
/* FIXME (Edward) : Do a plane memcpy is srcstride == deststride instead
|
if (srcstride == deststride) {
|
||||||
* of copying line by line */
|
GST_TRACE_OBJECT (dec, "Stride matches. Comp %d: %d, copying full plane",
|
||||||
for (line = 0; line < height; line++) {
|
comp, srcstride);
|
||||||
memcpy (dest, src, width);
|
memcpy (dest, src, srcstride * height);
|
||||||
dest += deststride;
|
} else {
|
||||||
src += srcstride;
|
GST_TRACE_OBJECT (dec, "Stride mismatch. Comp %d: %d != %d, copying "
|
||||||
|
"line by line.", comp, srcstride, deststride);
|
||||||
|
for (line = 0; line < height; line++) {
|
||||||
|
memcpy (dest, src, width);
|
||||||
|
dest += deststride;
|
||||||
|
src += srcstride;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue