mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 11:11:08 +00:00
video-format: reduce the number of memcpy if possible
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7694>
This commit is contained in:
parent
b3245eb7bd
commit
fe61bc3cee
1 changed files with 9 additions and 4 deletions
|
@ -383,10 +383,15 @@ gst_video_frame_copy_plane (GstVideoFrame * dest, const GstVideoFrame * src,
|
||||||
|
|
||||||
GST_CAT_DEBUG (CAT_PERFORMANCE, "copy plane %d, w:%d h:%d ", plane, w, h);
|
GST_CAT_DEBUG (CAT_PERFORMANCE, "copy plane %d, w:%d h:%d ", plane, w, h);
|
||||||
|
|
||||||
for (j = 0; j < h; j++) {
|
if (GST_VIDEO_INFO_PLANE_STRIDE (dinfo,
|
||||||
memcpy (dp, sp, w);
|
plane) == GST_VIDEO_INFO_PLANE_STRIDE (sinfo, plane)) {
|
||||||
dp += ds;
|
memcpy (dp, sp, GST_VIDEO_INFO_PLANE_STRIDE (dinfo, plane) * h);
|
||||||
sp += ss;
|
} else {
|
||||||
|
for (j = 0; j < h; j++) {
|
||||||
|
memcpy (dp, sp, w);
|
||||||
|
dp += ds;
|
||||||
|
sp += ss;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue