From 10de9cab52679326c1c05244bdc04b529e392c43 Mon Sep 17 00:00:00 2001 From: Thomas Guillem Date: Fri, 16 Mar 2018 15:22:26 +0100 Subject: [PATCH] chroma: copy: add CopyPacked() In order to use Uswc when copying packer pictures (RGB/YUYV). --- 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, -- 2.11.4.GIT