From 966dbdf236b6aa3a43348b6108bc1893849ef9b9 Mon Sep 17 00:00:00 2001 From: Martin Fleisz Date: Wed, 22 Feb 2017 10:21:01 +0100 Subject: [PATCH] primitives: Fix compilation with VS 2010 --- libfreerdp/primitives/prim_YUV_opt.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/libfreerdp/primitives/prim_YUV_opt.c b/libfreerdp/primitives/prim_YUV_opt.c index dafdae2ea..3438e9b39 100644 --- a/libfreerdp/primitives/prim_YUV_opt.c +++ b/libfreerdp/primitives/prim_YUV_opt.c @@ -361,6 +361,8 @@ static pstatus_t ssse3_YUV420ToRGB( static __m128i* ssse3_YUV444Pixel(__m128i* dst, __m128i Yraw, __m128i Uraw, __m128i Vraw, UINT8 pos) { + /* Visual Studio 2010 doesn't like _mm_set_epi32 in array initializer list */ +#if !defined(_MSC_VER) || (_MSC_VER > 1600) const __m128i mapY[] = { _mm_set_epi32(0x80800380, 0x80800280, 0x80800180, 0x80800080), @@ -381,6 +383,28 @@ static __m128i* ssse3_YUV444Pixel(__m128i* dst, __m128i Yraw, __m128i Uraw, __m1 _mm_set_epi32(0x80800380, 0x80800280, 0x80800180, 0x80800080), _mm_set_epi32(0x80808003, 0x80808002, 0x80808001, 0x80808000) }; +#else + const __m128i mapY[] = + { + { 0x80, 0x80, 0x03, 0x80, 0x80, 0x80, 0x02, 0x80, 0x80, 0x80, 0x01, 0x80, 0x80, 0x80, 0x00, 0x80}, + { 0x80, 0x80, 0x07, 0x80, 0x80, 0x80, 0x06, 0x80, 0x80, 0x80, 0x05, 0x80, 0x80, 0x80, 0x04, 0x80}, + { 0x80, 0x80, 0x0B, 0x80, 0x80, 0x80, 0x0A, 0x80, 0x80, 0x80, 0x09, 0x80, 0x80, 0x80, 0x08, 0x80}, + { 0x80, 0x80, 0x0F, 0x80, 0x80, 0x80, 0x0E, 0x80, 0x80, 0x80, 0x0D, 0x80, 0x80, 0x80, 0x0C, 0x80} + }; + const __m128i mapUV[] = + { + { 0x80, 0x03, 0x80, 0x02, 0x80, 0x01, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, + { 0x80, 0x07, 0x80, 0x06, 0x80, 0x05, 0x80, 0x04, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, + { 0x80, 0x0B, 0x80, 0x0A, 0x80, 0x09, 0x80, 0x08, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, + { 0x80, 0x0F, 0x80, 0x0E, 0x80, 0x0D, 0x80, 0x0C, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80} + }; + const __m128i mask[] = + { + { 0x80, 0x03, 0x80, 0x80, 0x80, 0x02, 0x80, 0x80, 0x80, 0x01, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80}, + { 0x80, 0x80, 0x03, 0x80, 0x80, 0x80, 0x02, 0x80, 0x80, 0x80, 0x01, 0x80, 0x80, 0x80, 0x00, 0x80}, + { 0x80, 0x80, 0x80, 0x03, 0x80, 0x80, 0x80, 0x02, 0x80, 0x80, 0x80, 0x01, 0x80, 0x80, 0x80, 0x00} + }; +#endif const __m128i c128 = _mm_set1_epi16(128); __m128i BGRX = _mm_set_epi32(0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000); {