| | |
| | | /* |
| | | Simple DirectMedia Layer |
| | | Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org> |
| | | Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> |
| | | |
| | | This software is provided 'as-is', without any express or implied |
| | | warranty. In no event will the authors be held liable for any damages |
| | |
| | | } |
| | | return mode; |
| | | } |
| | | |
| | | #if SDL_HAVE_YUV |
| | | |
| | | static int GetYUVConversionType(int width, int height, YCbCrType *yuv_type) |
| | | { |
| | |
| | | return SDL_SetError("SDL_ConvertPixels_Planar2x2_to_Planar2x2: Unsupported YUV conversion: %s -> %s", SDL_GetPixelFormatName(src_format), SDL_GetPixelFormatName(dst_format)); |
| | | } |
| | | |
| | | #ifdef __SSE2__ |
| | | #define PACKED4_TO_PACKED4_ROW_SSE2(shuffle) \ |
| | | while (x >= 4) { \ |
| | | __m128i yuv = _mm_loadu_si128((__m128i*)srcYUV); \ |
| | |
| | | dstYUV += 16; \ |
| | | x -= 4; \ |
| | | } \ |
| | | |
| | | #endif |
| | | |
| | | static int |
| | | SDL_ConvertPixels_YUY2_to_UYVY(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch) |
| | |
| | | return 0; |
| | | } |
| | | |
| | | #endif /* SDL_HAVE_YUV */ |
| | | |
| | | int |
| | | SDL_ConvertPixels_YUV_to_YUV(int width, int height, |
| | | Uint32 src_format, const void *src, int src_pitch, |
| | | Uint32 dst_format, void *dst, int dst_pitch) |
| | | { |
| | | #if SDL_HAVE_YUV |
| | | if (src_format == dst_format) { |
| | | if (src == dst) { |
| | | /* Nothing to do */ |
| | |
| | | } else { |
| | | return SDL_SetError("SDL_ConvertPixels_YUV_to_YUV: Unsupported YUV conversion: %s -> %s", SDL_GetPixelFormatName(src_format), SDL_GetPixelFormatName(dst_format)); |
| | | } |
| | | #else |
| | | return SDL_SetError("SDL not built with YUV support"); |
| | | #endif |
| | | } |
| | | |
| | | /* vi: set ts=4 sw=4 expandtab: */ |