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,12 +383,17 @@ 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);
|
||||
|
||||
if (GST_VIDEO_INFO_PLANE_STRIDE (dinfo,
|
||||
plane) == GST_VIDEO_INFO_PLANE_STRIDE (sinfo, plane)) {
|
||||
memcpy (dp, sp, GST_VIDEO_INFO_PLANE_STRIDE (dinfo, plane) * h);
|
||||
} else {
|
||||
for (j = 0; j < h; j++) {
|
||||
memcpy (dp, sp, w);
|
||||
dp += ds;
|
||||
sp += ss;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue