[vlc-commits] chroma: copy: add CopyPacked()

Thomas Guillem git at videolan.org
Mon Mar 19 12:15:21 CET 2018


vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Mar 16 15:22:26 2018 +0100| [98131fb4f3b3f136f9d09fa1877b4632fc6f694c] | committer: Thomas Guillem

chroma: copy: add CopyPacked()

In order to use Uswc when copying packer pictures (RGB/YUYV).

(cherry picked from commit 10de9cab52679326c1c05244bdc04b529e392c43)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=98131fb4f3b3f136f9d09fa1877b4632fc6f694c
---

 modules/video_chroma/copy.c | 15 +++++++++++++++
 modules/video_chroma/copy.h |  5 +++++
 2 files changed, 20 insertions(+)

diff --git a/modules/video_chroma/copy.c b/modules/video_chroma/copy.c
index d6861812ba..72d99a5e03 100644
--- a/modules/video_chroma/copy.c
+++ b/modules/video_chroma/copy.c
@@ -637,6 +637,21 @@ static void CopyPlane(uint8_t *dst, size_t dst_pitch,
     }
 }
 
+void CopyPacked(picture_t *dst, const uint8_t *src, const size_t src_pitch,
+                unsigned height, const copy_cache_t *cache)
+{
+    assert(dst);
+    assert(src); assert(src_pitch);
+    assert(height);
+
+    if (vlc_CPU_SSE4_1())
+        SSE_CopyPlane(dst->p[0].p_pixels, dst->p[0].i_pitch, src, src_pitch,
+                      cache->buffer, cache->size, height, 0);
+    else
+        CopyPlane(dst->p[0].p_pixels, dst->p[0].i_pitch, src, src_pitch,
+                  height, 0);
+}
+
 void Copy420_SP_to_SP(picture_t *dst, const uint8_t *src[static 2],
                       const size_t src_pitch[static 2], unsigned height,
                       const copy_cache_t *cache)
diff --git a/modules/video_chroma/copy.h b/modules/video_chroma/copy.h
index 1efca78b36..6c438378ef 100644
--- a/modules/video_chroma/copy.h
+++ b/modules/video_chroma/copy.h
@@ -36,6 +36,11 @@ typedef struct {
 int  CopyInitCache(copy_cache_t *cache, unsigned width);
 void CopyCleanCache(copy_cache_t *cache);
 
+/* YUVY/RGB copies */
+void CopyPacked(picture_t *dst, const uint8_t *src,
+                const size_t src_pitch, unsigned height,
+                const copy_cache_t *cache);
+
 /* Copy planes from NV12/NV21 to NV12/NV21 */
 void Copy420_SP_to_SP(picture_t *dst, const uint8_t *src[static 2],
                       const size_t src_pitch[static 2], unsigned height,



More information about the vlc-commits mailing list