| | |
| | | #include "SDL_endian.h" |
| | | #include "SDL_video.h" |
| | | #include "SDL_pixels_c.h" |
| | | #include "SDL_yuv_c.h" |
| | | |
| | | #include "yuv2rgb/yuv_rgb.h" |
| | | |
| | |
| | | } |
| | | |
| | | static int GetYUVPlanes(int width, int height, Uint32 format, const void *yuv, int yuv_pitch, |
| | | const Uint8 **y, const Uint8 **u, const Uint8 **v, Uint32 *y_stride, Uint32 *uv_stride) |
| | | const Uint8 **y, const Uint8 **u, const Uint8 **v, Uint32 *y_stride, Uint32 *uv_stride) |
| | | { |
| | | const Uint8 *planes[3] = { NULL, NULL, NULL }; |
| | | int pitches[3] = { 0, 0, 0 }; |
| | | const Uint8 *planes[3] = { NULL, NULL, NULL }; |
| | | int pitches[3] = { 0, 0, 0 }; |
| | | |
| | | switch (format) { |
| | | case SDL_PIXELFORMAT_YV12: |
| | |
| | | |
| | | static SDL_bool yuv_rgb_sse( |
| | | Uint32 src_format, Uint32 dst_format, |
| | | Uint32 width, Uint32 height, |
| | | const Uint8 *y, const Uint8 *u, const Uint8 *v, Uint32 y_stride, Uint32 uv_stride, |
| | | Uint8 *rgb, Uint32 rgb_stride, |
| | | YCbCrType yuv_type) |
| | | Uint32 width, Uint32 height, |
| | | const Uint8 *y, const Uint8 *u, const Uint8 *v, Uint32 y_stride, Uint32 uv_stride, |
| | | Uint8 *rgb, Uint32 rgb_stride, |
| | | YCbCrType yuv_type) |
| | | { |
| | | #ifdef __SSE2__ |
| | | if (!SDL_HasSSE2()) { |
| | |
| | | |
| | | static SDL_bool yuv_rgb_std( |
| | | Uint32 src_format, Uint32 dst_format, |
| | | Uint32 width, Uint32 height, |
| | | const Uint8 *y, const Uint8 *u, const Uint8 *v, Uint32 y_stride, Uint32 uv_stride, |
| | | Uint8 *rgb, Uint32 rgb_stride, |
| | | YCbCrType yuv_type) |
| | | Uint32 width, Uint32 height, |
| | | const Uint8 *y, const Uint8 *u, const Uint8 *v, Uint32 y_stride, Uint32 uv_stride, |
| | | Uint8 *rgb, Uint32 rgb_stride, |
| | | YCbCrType yuv_type) |
| | | { |
| | | if (src_format == SDL_PIXELFORMAT_YV12 || |
| | | src_format == SDL_PIXELFORMAT_IYUV) { |
| | |
| | | Uint32 src_format, const void *src, int src_pitch, |
| | | Uint32 dst_format, void *dst, int dst_pitch) |
| | | { |
| | | const Uint8 *y = NULL; |
| | | const Uint8 *y = NULL; |
| | | const Uint8 *u = NULL; |
| | | const Uint8 *v = NULL; |
| | | Uint32 y_stride = 0; |
| | |
| | | Uint32 y_stride, uv_stride, y_skip, uv_skip; |
| | | |
| | | GetYUVPlanes(width, height, dst_format, dst, dst_pitch, |
| | | (const Uint8 **)&plane_y, (const Uint8 **)&plane_u, (const Uint8 **)&plane_v, |
| | | (const Uint8 **)&plane_y, (const Uint8 **)&plane_u, (const Uint8 **)&plane_v, |
| | | &y_stride, &uv_stride); |
| | | plane_interleaved_uv = (plane_y + height * y_stride); |
| | | y_skip = (y_stride - width); |