On 13.07.2022 11:38, Marco Vianini wrote:
You can get a very big improvement of performances in the special (but very likely) case of:
"(dst_linesize == bytewidth && src_linesize == bytewidth)"
Isn't all that matters dst_linesize == src_linesize, and then you can
memcpy() the whole plane?
In this case in fact We can "Coalesce rows", that is using ONLY ONE MEMCPY,
instead of a smaller memcpy for every row (that is looping for height times).
Code:"static void image_copy_plane(uint8_t *dst, ptrdiff_t dst_linesize,
const uint8_t *src, ptrdiff_t src_linesize, ptrdiff_t
bytewidth, int height){ if (!dst || !src) return; av_assert0(abs(src_linesize) >=
bytewidth); av_assert0(abs(dst_linesize) >= bytewidth); // MY PATCH START // Coalesce
rows. if (dst_linesize == bytewidth && src_linesize == bytewidth) { bytewidth *=
height; height = 1; src_linesize = dst_linesize = 0; }// MY PATCH STOP
for (;height > 0; height--) { memcpy(dst, src, bytewidth); dst +=
dst_linesize; src += src_linesize; }}"
What do You think about?Thank You
Marco Vianini
That code is mangled by your mail client and practically unreadable.
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".