diff mbox series

[FFmpeg-devel,2/2] hwcontext_vulkan: use GPU memcpy when copying to system RAM

Message ID Mgjfn7h--3-2@lynne.ee
State New
Headers show
Series [FFmpeg-devel,1/2] imgutils: expose av_image_copy_plane_uc_from() | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Lynne Aug. 10, 2021, 10:50 a.m. UTC
This should speed it up significantly on systems where it matters.

Patch attached.
Subject: [PATCH 2/2] hwcontext_vulkan: use GPU memcpy when copying to system
 RAM

This should speed it up significantly on systems where it matters.
---
 libavutil/hwcontext_vulkan.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index b7da6a7e32..92b2c236c8 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -3424,7 +3424,7 @@  static int vulkan_transfer_data(AVHWFramesContext *hwfc, const AVFrame *vkf,
     }
 
     if (!from) {
-        /* Map, copy image to buffer, unmap */
+        /* Map, copy image from buffer, unmap */
         if ((err = map_buffers(dev_ctx, bufs, tmp.data, planes, 0)))
             goto end;
 
@@ -3434,10 +3434,10 @@  static int vulkan_transfer_data(AVHWFramesContext *hwfc, const AVFrame *vkf,
 
             get_plane_wh(&p_w, &p_h, swf->format, swf->width, swf->height, i);
 
-            av_image_copy_plane(tmp.data[i], tmp.linesize[i],
-                                (const uint8_t *)swf->data[i], swf->linesize[i],
-                                FFMIN(tmp.linesize[i], FFABS(swf->linesize[i])),
-                                p_h);
+            av_image_copy_plane_uc_from(tmp.data[i], tmp.linesize[i],
+                                        (const uint8_t *)swf->data[i], swf->linesize[i],
+                                        FFMIN(tmp.linesize[i], FFABS(swf->linesize[i])),
+                                        p_h);
         }
 
         if ((err = unmap_buffers(dev_ctx, bufs, planes, 1)))