From 4b11862b140a196cd95f50265353bf3d5dd337ab Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Thu, 3 Jul 2014 13:08:30 +0200 Subject: [PATCH] Added 32-bit YUYV->UYVY --- configure.ac | 4 ++-- src/video_codec.c | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 4ac778547..961a8e4ff 100644 --- a/configure.ac +++ b/configure.ac @@ -202,9 +202,9 @@ then AC_MSG_ERROR([Your compiler does not accept C99.]) fi -AC_CHECK_SIZEOF([int *]) +AC_CHECK_SIZEOF([size_t]) -if test $ac_cv_sizeof_int_p -eq 8 +if test $ac_cv_sizeof_size_t -eq 8 then WORD_LEN=64 else diff --git a/src/video_codec.c b/src/video_codec.c index c2106e7b4..7e6cb35a0 100644 --- a/src/video_codec.c +++ b/src/video_codec.c @@ -507,6 +507,7 @@ void vc_copylinev210(unsigned char *dst, const unsigned char *src, int dst_len) */ void vc_copylineYUYV(unsigned char *dst, const unsigned char *src, int dst_len) { +#if WORD_LEN == 64 register uint32_t *d; register const uint32_t *s; const uint32_t * const end = (uint32_t *)(void *) dst + dst_len / 4; @@ -549,6 +550,20 @@ void vc_copylineYUYV(unsigned char *dst, const unsigned char *src, int dst_len) } } +#else + char u, y1, v, y2; + while (dst_len > 0) { + y1 = *src++; + u = *src++; + y2 = *src++; + v = *src++; + *dst++ = u; + *dst++ = y1; + *dst++ = v; + *dst++ = y2; + dst_len -= 4; + } +#endif } /**