[vlc-commits] chroma: copy: add CopyPacked()
Thomas Guillem
git at videolan.org
Fri Mar 16 16:08:16 CET 2018
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Mar 16 15:22:26 2018 +0100| [10de9cab52679326c1c05244bdc04b529e392c43] | committer: Thomas Guillem
chroma: copy: add CopyPacked()
In order to use Uswc when copying packer pictures (RGB/YUYV).
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=10de9cab52679326c1c05244bdc04b529e392c43
---
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 1895218037..861f6543be 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 b2ced779c8..a58fbb0377 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