From 69a41c602cee91e39420f1765e433ff13399e882 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 19 May 2020 13:41:14 +0200 Subject: [PATCH] Lavd: added conversion RG48->RGB Just to have complete transformation matrix to RGB. --- src/video_codec.c | 11 +++++++++++ src/video_codec.h | 1 + src/video_decompress/libavcodec.c | 1 + 3 files changed, 13 insertions(+) diff --git a/src/video_codec.c b/src/video_codec.c index e06220449..bd8e3c605 100644 --- a/src/video_codec.c +++ b/src/video_codec.c @@ -1950,6 +1950,17 @@ void vc_copylineRG48toR12L(unsigned char * __restrict dst, const unsigned char * } } +void vc_copylineRG48toRGB(unsigned char * __restrict dst, const unsigned char * __restrict src, int dst_len, int rshift, + int gshift, int bshift) +{ + OPTIMIZED_FOR (int x = 0; x <= dst_len - 4; x += 4) { + *dst++ = src[1]; + *dst++ = src[3]; + *dst++ = src[5]; + src += 6; + } +} + void vc_copylineRG48toRGBA(unsigned char * __restrict dst, const unsigned char * __restrict src, int dst_len, int rshift, int gshift, int bshift) { diff --git a/src/video_codec.h b/src/video_codec.h index b8953625a..249c45589 100644 --- a/src/video_codec.h +++ b/src/video_codec.h @@ -124,6 +124,7 @@ decoder_func_t vc_copylineRGBtoR12L; decoder_func_t vc_copylineR12LtoRG48; decoder_func_t vc_copylineR12LtoRGB; decoder_func_t vc_copylineRG48toR12L; +decoder_func_t vc_copylineRG48toRGB; decoder_func_t vc_copylineRG48toRGBA; decoder_func_t vc_copylineUYVYtoRGB; decoder_func_t vc_copylineUYVYtoRGBA; diff --git a/src/video_decompress/libavcodec.c b/src/video_decompress/libavcodec.c index c676c8583..50a046d8b 100644 --- a/src/video_decompress/libavcodec.c +++ b/src/video_decompress/libavcodec.c @@ -754,6 +754,7 @@ static const struct decode_from_to dec_template[] = { { VIDEO_CODEC_NONE, R12L, R12L, 500 }, { VIDEO_CODEC_NONE, R12L, RGB, 500 }, { VIDEO_CODEC_NONE, R12L, RGBA, 500 }, + { VIDEO_CODEC_NONE, RG48, RGB, 500 }, { VIDEO_CODEC_NONE, RG48, RGBA, 500 }, { VIDEO_CODEC_NONE, RG48, R12L, 500 }, { VIDEO_CODEC_NONE, UYVY, RGB, 800 },