aboutsummaryrefslogtreecommitdiffstats
path: root/libswscale/input.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2014-04-07 17:19:53 +0200
committerVittorio Giovara <vittorio.giovara@gmail.com>2014-04-07 23:50:34 +0200
commit92b099daf4b8ef93513e38b43899cb8458a2fde3 (patch)
treec710f34a51faafc685be8cfd123540defd913d47 /libswscale/input.c
parent8b17243d1742279bcb2368f8d325ea71e66736c8 (diff)
downloadffmpeg-92b099daf4b8ef93513e38b43899cb8458a2fde3.tar.gz
swscale: support converting YVYU422 pixel format
Diffstat (limited to 'libswscale/input.c')
-rw-r--r--libswscale/input.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libswscale/input.c b/libswscale/input.c
index 2e8d43f446..c1cfd7cf7d 100644
--- a/libswscale/input.c
+++ b/libswscale/input.c
@@ -385,6 +385,17 @@ static void yuy2ToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1,
assert(src1 == src2);
}
+static void yvy2ToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1,
+ const uint8_t *src2, int width, uint32_t *unused)
+{
+ int i;
+ for (i = 0; i < width; i++) {
+ dstV[i] = src1[4 * i + 1];
+ dstU[i] = src1[4 * i + 3];
+ }
+ assert(src1 == src2);
+}
+
static void bswap16Y_c(uint8_t *_dst, const uint8_t *_src, int width,
uint32_t *unused)
{
@@ -677,6 +688,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
case AV_PIX_FMT_YUYV422:
c->chrToYV12 = yuy2ToUV_c;
break;
+ case AV_PIX_FMT_YVYU422:
+ c->chrToYV12 = yvy2ToUV_c;
+ break;
case AV_PIX_FMT_UYVY422:
c->chrToYV12 = uyvyToUV_c;
break;
@@ -974,6 +988,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
break;
#endif
case AV_PIX_FMT_YUYV422:
+ case AV_PIX_FMT_YVYU422:
case AV_PIX_FMT_Y400A:
c->lumToYV12 = yuy2ToY_c;
break;