21 #include "../SDL_internal.h" 30 #define SDL_YUV_SD_THRESHOLD 576 96 int pitches[3] = { 0, 0, 0 };
101 pitches[0] = yuv_pitch;
102 pitches[1] = (pitches[0] + 1) / 2;
103 pitches[2] = (pitches[0] + 1) / 2;
104 planes[0] = (
const Uint8 *)yuv;
105 planes[1] = planes[0] + pitches[0] *
height;
106 planes[2] = planes[1] + pitches[1] * ((height + 1) / 2);
111 pitches[0] = yuv_pitch;
112 planes[0] = (
const Uint8 *)yuv;
116 pitches[0] = yuv_pitch;
117 pitches[1] = 2 * ((pitches[0] + 1) / 2);
118 planes[0] = (
const Uint8 *)yuv;
119 planes[1] = planes[0] + pitches[0] *
height;
128 *y_stride = pitches[0];
131 *uv_stride = pitches[1];
135 *y_stride = pitches[0];
138 *uv_stride = pitches[1];
142 *y_stride = pitches[0];
145 *uv_stride = pitches[0];
149 *y_stride = pitches[0];
152 *uv_stride = pitches[0];
156 *y_stride = pitches[0];
159 *uv_stride = pitches[0];
163 *y_stride = pitches[0];
166 *uv_stride = pitches[1];
170 *y_stride = pitches[0];
173 *uv_stride = pitches[1];
197 switch (dst_format) {
199 yuv420_rgb565_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
202 yuv420_rgb24_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
206 yuv420_rgba_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
210 yuv420_bgra_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
214 yuv420_argb_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
218 yuv420_abgr_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
229 switch (dst_format) {
231 yuv422_rgb565_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
234 yuv422_rgb24_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
238 yuv422_rgba_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
242 yuv422_bgra_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
246 yuv422_argb_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
250 yuv422_abgr_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
260 switch (dst_format) {
262 yuvnv12_rgb565_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
265 yuvnv12_rgb24_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
269 yuvnv12_rgba_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
273 yuvnv12_bgra_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
277 yuvnv12_argb_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
281 yuvnv12_abgr_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
305 switch (dst_format) {
307 yuv420_rgb24_msa(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
311 yuv420_rgba_msa(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
315 yuv420_bgra_msa(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
319 yuv420_argb_msa(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
323 yuv420_abgr_msa(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
340 #ifdef __loongarch_sx 347 switch (dst_format) {
349 yuv420_rgb24_lsx(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
353 yuv420_rgba_lsx(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
357 yuv420_bgra_lsx(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
361 yuv420_argb_lsx(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
365 yuv420_abgr_lsx(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
385 switch (dst_format) {
387 yuv420_rgb565_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
390 yuv420_rgb24_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
394 yuv420_rgba_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
398 yuv420_bgra_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
402 yuv420_argb_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
406 yuv420_abgr_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
417 switch (dst_format) {
419 yuv422_rgb565_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
422 yuv422_rgb24_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
426 yuv422_rgba_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
430 yuv422_bgra_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
434 yuv422_argb_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
438 yuv422_abgr_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
448 switch (dst_format) {
450 yuvnv12_rgb565_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
453 yuvnv12_rgb24_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
457 yuvnv12_rgba_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
461 yuvnv12_bgra_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
465 yuvnv12_argb_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
469 yuvnv12_abgr_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
480 Uint32 src_format,
const void *
src,
int src_pitch,
481 Uint32 dst_format,
void *
dst,
int dst_pitch)
490 if (
GetYUVPlanes(width, height, src_format, src, src_pitch, &y, &u, &v, &y_stride, &uv_stride) < 0) {
498 if (
yuv_rgb_sse(src_format, dst_format, width, height, y, u, v, y_stride, uv_stride, (
Uint8*)dst, dst_pitch, yuv_type)) {
502 if (
yuv_rgb_msa(src_format, dst_format, width, height, y, u, v, y_stride, uv_stride, (
Uint8*)dst, dst_pitch, yuv_type)) {
506 if (
yuv_rgb_lsx(src_format, dst_format, width, height, y, u, v, y_stride, uv_stride, (
Uint8*)dst, dst_pitch, yuv_type)) {
510 if (
yuv_rgb_std(src_format, dst_format, width, height, y, u, v, y_stride, uv_stride, (
Uint8*)dst, dst_pitch, yuv_type)) {
518 int tmp_pitch = (width *
sizeof(
Uint32));
552 const int src_pitch_x_2 = src_pitch * 2;
553 const int height_half = height / 2;
554 const int height_remainder = (height & 0x1);
555 const int width_half = width / 2;
556 const int width_remainder = (width & 0x1);
559 static struct RGB2YUVFactors RGB2YUVFactorTables[SDL_YUV_CONVERSION_BT709 + 1] =
564 { 0.2990f, 0.5870f, 0.1140f },
565 { -0.1687f, -0.3313f, 0.5000f },
566 { 0.5000f, -0.4187f, -0.0813f },
571 { 0.2568f, 0.5041f, 0.0979f },
572 { -0.1482f, -0.2910f, 0.4392f },
573 { 0.4392f, -0.3678f, -0.0714f },
578 { 0.1826f, 0.6142f, 0.0620f },
579 {-0.1006f, -0.3386f, 0.4392f },
580 { 0.4392f, -0.3989f, -0.0403f },
585 #define MAKE_Y(r, g, b) (Uint8)((int)(cvt->y[0] * (r) + cvt->y[1] * (g) + cvt->y[2] * (b) + 0.5f) + cvt->y_offset) 586 #define MAKE_U(r, g, b) (Uint8)((int)(cvt->u[0] * (r) + cvt->u[1] * (g) + cvt->u[2] * (b) + 0.5f) + 128) 587 #define MAKE_V(r, g, b) (Uint8)((int)(cvt->v[0] * (r) + cvt->v[1] * (g) + cvt->v[2] * (b) + 0.5f) + 128) 589 #define READ_2x2_PIXELS \ 590 const Uint32 p1 = ((const Uint32 *)curr_row)[2 * i]; \ 591 const Uint32 p2 = ((const Uint32 *)curr_row)[2 * i + 1]; \ 592 const Uint32 p3 = ((const Uint32 *)next_row)[2 * i]; \ 593 const Uint32 p4 = ((const Uint32 *)next_row)[2 * i + 1]; \ 594 const Uint32 r = ((p1 & 0x00ff0000) + (p2 & 0x00ff0000) + (p3 & 0x00ff0000) + (p4 & 0x00ff0000)) >> 18; \ 595 const Uint32 g = ((p1 & 0x0000ff00) + (p2 & 0x0000ff00) + (p3 & 0x0000ff00) + (p4 & 0x0000ff00)) >> 10; \ 596 const Uint32 b = ((p1 & 0x000000ff) + (p2 & 0x000000ff) + (p3 & 0x000000ff) + (p4 & 0x000000ff)) >> 2; \ 598 #define READ_2x1_PIXELS \ 599 const Uint32 p1 = ((const Uint32 *)curr_row)[2 * i]; \ 600 const Uint32 p2 = ((const Uint32 *)next_row)[2 * i]; \ 601 const Uint32 r = ((p1 & 0x00ff0000) + (p2 & 0x00ff0000)) >> 17; \ 602 const Uint32 g = ((p1 & 0x0000ff00) + (p2 & 0x0000ff00)) >> 9; \ 603 const Uint32 b = ((p1 & 0x000000ff) + (p2 & 0x000000ff)) >> 1; \ 605 #define READ_1x2_PIXELS \ 606 const Uint32 p1 = ((const Uint32 *)curr_row)[2 * i]; \ 607 const Uint32 p2 = ((const Uint32 *)curr_row)[2 * i + 1]; \ 608 const Uint32 r = ((p1 & 0x00ff0000) + (p2 & 0x00ff0000)) >> 17; \ 609 const Uint32 g = ((p1 & 0x0000ff00) + (p2 & 0x0000ff00)) >> 9; \ 610 const Uint32 b = ((p1 & 0x000000ff) + (p2 & 0x000000ff)) >> 1; \ 612 #define READ_1x1_PIXEL \ 613 const Uint32 p = ((const Uint32 *)curr_row)[2 * i]; \ 614 const Uint32 r = (p & 0x00ff0000) >> 16; \ 615 const Uint32 g = (p & 0x0000ff00) >> 8; \ 616 const Uint32 b = (p & 0x000000ff); \ 618 #define READ_TWO_RGB_PIXELS \ 619 const Uint32 p = ((const Uint32 *)curr_row)[2 * i]; \ 620 const Uint32 r = (p & 0x00ff0000) >> 16; \ 621 const Uint32 g = (p & 0x0000ff00) >> 8; \ 622 const Uint32 b = (p & 0x000000ff); \ 623 const Uint32 p1 = ((const Uint32 *)curr_row)[2 * i + 1]; \ 624 const Uint32 r1 = (p1 & 0x00ff0000) >> 16; \ 625 const Uint32 g1 = (p1 & 0x0000ff00) >> 8; \ 626 const Uint32 b1 = (p1 & 0x000000ff); \ 627 const Uint32 R = (r + r1)/2; \ 628 const Uint32 G = (g + g1)/2; \ 629 const Uint32 B = (b + b1)/2; \ 631 #define READ_ONE_RGB_PIXEL READ_1x1_PIXEL 640 const Uint8 *curr_row, *next_row;
645 Uint8 *plane_interleaved_uv;
646 Uint32 y_stride, uv_stride, y_skip, uv_skip;
649 (
const Uint8 **)&plane_y, (
const Uint8 **)&plane_u, (
const Uint8 **)&plane_v,
650 &y_stride, &uv_stride);
651 plane_interleaved_uv = (plane_y + height * y_stride);
652 y_skip = (y_stride -
width);
654 curr_row = (
const Uint8*)src;
657 for (j = 0; j <
height; j++) {
658 for (i = 0; i <
width; i++) {
660 const Uint32 r = (p1 & 0x00ff0000) >> 16;
661 const Uint32 g = (p1 & 0x0000ff00) >> 8;
662 const Uint32 b = (p1 & 0x000000ff);
663 *plane_y++ =
MAKE_Y(r, g, b);
666 curr_row += src_pitch;
669 curr_row = (
const Uint8*)src;
670 next_row = (
const Uint8*)src;
671 next_row += src_pitch;
676 uv_skip = (uv_stride - (width + 1)/2);
677 for (j = 0; j < height_half; j++) {
678 for (i = 0; i < width_half; i++) {
683 if (width_remainder) {
690 curr_row += src_pitch_x_2;
691 next_row += src_pitch_x_2;
693 if (height_remainder) {
694 for (i = 0; i < width_half; i++) {
699 if (width_remainder) {
710 uv_skip = (uv_stride - ((width + 1)/2)*2);
711 for (j = 0; j < height_half; j++) {
712 for (i = 0; i < width_half; i++) {
714 *plane_interleaved_uv++ =
MAKE_U(
r,
g,
b);
715 *plane_interleaved_uv++ =
MAKE_V(
r,
g,
b);
717 if (width_remainder) {
719 *plane_interleaved_uv++ =
MAKE_U(
r,
g,
b);
720 *plane_interleaved_uv++ =
MAKE_V(
r,
g,
b);
722 plane_interleaved_uv += uv_skip;
723 curr_row += src_pitch_x_2;
724 next_row += src_pitch_x_2;
726 if (height_remainder) {
727 for (i = 0; i < width_half; i++) {
729 *plane_interleaved_uv++ =
MAKE_U(
r,
g,
b);
730 *plane_interleaved_uv++ =
MAKE_V(
r,
g,
b);
732 if (width_remainder) {
734 *plane_interleaved_uv++ =
MAKE_U(
r,
g,
b);
735 *plane_interleaved_uv++ =
MAKE_V(
r,
g,
b);
741 uv_skip = (uv_stride - ((width + 1)/2)*2);
742 for (j = 0; j < height_half; j++) {
743 for (i = 0; i < width_half; i++) {
745 *plane_interleaved_uv++ =
MAKE_V(
r,
g,
b);
746 *plane_interleaved_uv++ =
MAKE_U(
r,
g,
b);
748 if (width_remainder) {
750 *plane_interleaved_uv++ =
MAKE_V(
r,
g,
b);
751 *plane_interleaved_uv++ =
MAKE_U(
r,
g,
b);
753 plane_interleaved_uv += uv_skip;
754 curr_row += src_pitch_x_2;
755 next_row += src_pitch_x_2;
757 if (height_remainder) {
758 for (i = 0; i < width_half; i++) {
760 *plane_interleaved_uv++ =
MAKE_V(
r,
g,
b);
761 *plane_interleaved_uv++ =
MAKE_U(
r,
g,
b);
763 if (width_remainder) {
765 *plane_interleaved_uv++ =
MAKE_V(
r,
g,
b);
766 *plane_interleaved_uv++ =
MAKE_U(
r,
g,
b);
779 const int row_size = (4 * ((width + 1) / 2));
782 if (dst_pitch < row_size) {
783 return SDL_SetError(
"Destination pitch is too small, expected at least %d\n", row_size);
785 plane_skip = (dst_pitch - row_size);
790 for (j = 0; j <
height; j++) {
791 for (i = 0; i < width_half; i++) {
796 *plane++ =
MAKE_Y(r1, g1, b1);
799 if (width_remainder) {
808 curr_row += src_pitch;
813 for (j = 0; j <
height; j++) {
814 for (i = 0; i < width_half; i++) {
820 *plane++ =
MAKE_Y(r1, g1, b1);
822 if (width_remainder) {
831 curr_row += src_pitch;
836 for (j = 0; j <
height; j++) {
837 for (i = 0; i < width_half; i++) {
842 *plane++ =
MAKE_Y(r1, g1, b1);
845 if (width_remainder) {
854 curr_row += src_pitch;
866 #undef READ_2x2_PIXELS 867 #undef READ_2x1_PIXELS 868 #undef READ_1x2_PIXELS 869 #undef READ_1x1_PIXEL 870 #undef READ_TWO_RGB_PIXELS 871 #undef READ_ONE_RGB_PIXEL 877 Uint32 src_format,
const void *
src,
int src_pitch,
878 Uint32 dst_format,
void *
dst,
int dst_pitch)
890 if (
GetYUVPlanes(width, height, dst_format, dst, dst_pitch, (
const Uint8 **)&y, (
const Uint8 **)&u, (
const Uint8 **)&v, &y_stride, &uv_stride) < 0) {
898 rgb24_yuv420_std(width, height, src, src_pitch, y, u, v, y_stride, uv_stride, yuv_type);
912 int tmp_pitch = (width *
sizeof(
Uint32));
935 const void *
src,
int src_pitch,
void *
dst,
int dst_pitch)
941 for (i = height; i--;) {
943 src = (
const Uint8*)src + src_pitch;
944 dst = (
Uint8*)dst + dst_pitch;
949 width = (width + 1) / 2;
950 height = (height + 1) / 2;
951 src_pitch = (src_pitch + 1) / 2;
952 dst_pitch = (dst_pitch + 1) / 2;
953 for (i = height * 2; i--;) {
955 src = (
const Uint8*)src + src_pitch;
956 dst = (
Uint8*)dst + dst_pitch;
960 height = (height + 1) / 2;
961 width = ((width + 1) / 2)*2;
962 src_pitch = ((src_pitch + 1) / 2)*2;
963 dst_pitch = ((dst_pitch + 1) / 2)*2;
964 for (i = height; i--;) {
966 src = (
const Uint8*)src + src_pitch;
967 dst = (
Uint8*)dst + dst_pitch;
975 width = 4 * ((width + 1) / 2);
976 for (i = height; i--;) {
978 src = (
const Uint8*)src + src_pitch;
979 dst = (
Uint8*)dst + dst_pitch;
991 const int UVwidth = (width + 1)/2;
992 const int UVheight = (height + 1)/2;
995 src = (
const Uint8 *)src + height * src_pitch;
996 dst = (
Uint8 *)dst + height * dst_pitch;
999 int UVpitch = (dst_pitch + 1)/2;
1002 Uint8 *row2 = (
Uint8 *)dst + UVheight * UVpitch;
1009 for (y = 0; y < UVheight; ++
y) {
1020 int srcUVPitch = ((src_pitch + 1)/2);
1021 int dstUVPitch = ((dst_pitch + 1)/2);
1024 srcUV = (
const Uint8 *)src;
1025 dstUV = (
Uint8 *)dst + UVheight * dstUVPitch;
1026 for (y = 0; y < UVheight; ++
y) {
1028 srcUV += srcUVPitch;
1029 dstUV += dstUVPitch;
1033 dstUV = (
Uint8 *)dst;
1034 for (y = 0; y < UVheight; ++
y) {
1036 srcUV += srcUVPitch;
1037 dstUV += dstUVPitch;
1047 const int UVwidth = (width + 1)/2;
1048 const int UVheight = (height + 1)/2;
1049 const int srcUVPitch = ((src_pitch + 1)/2);
1050 const int srcUVPitchLeft = srcUVPitch - UVwidth;
1051 const int dstUVPitch = ((dst_pitch + 1)/2)*2;
1052 const int dstUVPitchLeft = dstUVPitch - UVwidth*2;
1053 const Uint8 *src1, *src2;
1061 src = (
const Uint8 *)src + height * src_pitch;
1062 dst = (
Uint8 *)dst + height * dst_pitch;
1075 src2 = (
const Uint8 *)src;
1076 src1 = src2 + UVheight * srcUVPitch;
1078 src1 = (
const Uint8 *)src;
1079 src2 = src1 + UVheight * srcUVPitch;
1081 dstUV = (
Uint8 *)dst;
1089 __m128i
u = _mm_loadu_si128((__m128i *)src1);
1090 __m128i
v = _mm_loadu_si128((__m128i *)src2);
1091 __m128i uv1 = _mm_unpacklo_epi8(u, v);
1092 __m128i uv2 = _mm_unpackhi_epi8(u, v);
1093 _mm_storeu_si128((__m128i*)dstUV, uv1);
1094 _mm_storeu_si128((__m128i*)(dstUV + 16), uv2);
1106 src1 += srcUVPitchLeft;
1107 src2 += srcUVPitchLeft;
1108 dstUV += dstUVPitchLeft;
1121 const int UVwidth = (width + 1)/2;
1122 const int UVheight = (height + 1)/2;
1123 const int srcUVPitch = ((src_pitch + 1)/2)*2;
1124 const int srcUVPitchLeft = srcUVPitch - UVwidth*2;
1125 const int dstUVPitch = ((dst_pitch + 1)/2);
1126 const int dstUVPitchLeft = dstUVPitch - UVwidth;
1135 src = (
const Uint8 *)src + height * src_pitch;
1136 dst = (
Uint8 *)dst + height * dst_pitch;
1149 dst2 = (
Uint8 *)dst;
1150 dst1 = dst2 + UVheight * dstUVPitch;
1152 dst1 = (
Uint8 *)dst;
1153 dst2 = dst1 + UVheight * dstUVPitch;
1155 srcUV = (
const Uint8 *)src;
1162 __m128i
mask = _mm_set1_epi16(0x00FF);
1164 __m128i uv1 = _mm_loadu_si128((__m128i*)srcUV);
1165 __m128i uv2 = _mm_loadu_si128((__m128i*)(srcUV+16));
1166 __m128i
u1 = _mm_and_si128(uv1, mask);
1167 __m128i
u2 = _mm_and_si128(uv2, mask);
1168 __m128i
u = _mm_packus_epi16(u1, u2);
1169 __m128i
v1 = _mm_srli_epi16(uv1, 8);
1170 __m128i
v2 = _mm_srli_epi16(uv2, 8);
1171 __m128i
v = _mm_packus_epi16(v1, v2);
1172 _mm_storeu_si128((__m128i*)dst1, u);
1173 _mm_storeu_si128((__m128i*)dst2, v);
1185 srcUV += srcUVPitchLeft;
1186 dst1 += dstUVPitchLeft;
1187 dst2 += dstUVPitchLeft;
1200 const int UVwidth = (width + 1)/2;
1201 const int UVheight = (height + 1)/2;
1202 const int srcUVPitch = ((src_pitch + 1)/2)*2;
1203 const int srcUVPitchLeft = (srcUVPitch - UVwidth*2)/
sizeof(
Uint16);
1204 const int dstUVPitch = ((dst_pitch + 1)/2)*2;
1205 const int dstUVPitchLeft = (dstUVPitch - UVwidth*2)/
sizeof(
Uint16);
1213 src = (
const Uint8 *)src + height * src_pitch;
1214 dst = (
Uint8 *)dst + height * dst_pitch;
1216 srcUV = (
const Uint16 *)src;
1224 __m128i uv = _mm_loadu_si128((__m128i*)srcUV);
1225 __m128i
v = _mm_slli_epi16(uv, 8);
1226 __m128i
u = _mm_srli_epi16(uv, 8);
1227 __m128i vu = _mm_or_si128(v, u);
1228 _mm_storeu_si128((__m128i*)dstUV, vu);
1238 srcUV += srcUVPitchLeft;
1239 dstUV += dstUVPitchLeft;
1246 Uint32 src_format,
const void *
src,
int src_pitch,
1247 Uint32 dst_format,
void *
dst,
int dst_pitch)
1254 for (i = height; i--; ) {
1261 switch (src_format) {
1263 switch (dst_format) {
1275 switch (dst_format) {
1287 switch (dst_format) {
1299 switch (dst_format) {
1316 #define PACKED4_TO_PACKED4_ROW_SSE2(shuffle) \ 1318 __m128i yuv = _mm_loadu_si128((__m128i*)srcYUV); \ 1319 __m128i lo = _mm_unpacklo_epi8(yuv, _mm_setzero_si128()); \ 1320 __m128i hi = _mm_unpackhi_epi8(yuv, _mm_setzero_si128()); \ 1321 lo = _mm_shufflelo_epi16(lo, shuffle); \ 1322 lo = _mm_shufflehi_epi16(lo, shuffle); \ 1323 hi = _mm_shufflelo_epi16(hi, shuffle); \ 1324 hi = _mm_shufflehi_epi16(hi, shuffle); \ 1325 yuv = _mm_packus_epi16(lo, hi); \ 1326 _mm_storeu_si128((__m128i*)dstYUV, yuv); \ 1336 const int YUVwidth = (width + 1)/2;
1337 const int srcYUVPitchLeft = (src_pitch - YUVwidth*4);
1338 const int dstYUVPitchLeft = (dst_pitch - YUVwidth*4);
1368 srcYUV += srcYUVPitchLeft;
1369 dstYUV += dstYUVPitchLeft;
1378 const int YUVwidth = (width + 1)/2;
1379 const int srcYUVPitchLeft = (src_pitch - YUVwidth*4);
1380 const int dstYUVPitchLeft = (dst_pitch - YUVwidth*4);
1410 srcYUV += srcYUVPitchLeft;
1411 dstYUV += dstYUVPitchLeft;
1420 const int YUVwidth = (width + 1)/2;
1421 const int srcYUVPitchLeft = (src_pitch - YUVwidth*4);
1422 const int dstYUVPitchLeft = (dst_pitch - YUVwidth*4);
1452 srcYUV += srcYUVPitchLeft;
1453 dstYUV += dstYUVPitchLeft;
1462 const int YUVwidth = (width + 1)/2;
1463 const int srcYUVPitchLeft = (src_pitch - YUVwidth*4);
1464 const int dstYUVPitchLeft = (dst_pitch - YUVwidth*4);
1494 srcYUV += srcYUVPitchLeft;
1495 dstYUV += dstYUVPitchLeft;
1504 const int YUVwidth = (width + 1)/2;
1505 const int srcYUVPitchLeft = (src_pitch - YUVwidth*4);
1506 const int dstYUVPitchLeft = (dst_pitch - YUVwidth*4);
1536 srcYUV += srcYUVPitchLeft;
1537 dstYUV += dstYUVPitchLeft;
1546 const int YUVwidth = (width + 1)/2;
1547 const int srcYUVPitchLeft = (src_pitch - YUVwidth*4);
1548 const int dstYUVPitchLeft = (dst_pitch - YUVwidth*4);
1578 srcYUV += srcYUVPitchLeft;
1579 dstYUV += dstYUVPitchLeft;
1586 Uint32 src_format,
const void *
src,
int src_pitch,
1587 Uint32 dst_format,
void *
dst,
int dst_pitch)
1589 switch (src_format) {
1591 switch (dst_format) {
1601 switch (dst_format) {
1611 switch (dst_format) {
1628 Uint32 src_format,
const void *
src,
int src_pitch,
1629 Uint32 dst_format,
void *
dst,
int dst_pitch)
1633 Uint32 srcY_pitch, srcUV_pitch;
1634 Uint32 srcY_pitch_left, srcUV_pitch_left, srcUV_pixel_stride;
1635 Uint8 *
dstY1, *dstY2, *dstU1, *dstU2, *dstV1, *dstV2;
1636 Uint32 dstY_pitch, dstUV_pitch;
1640 return SDL_SetError(
"Can't change YUV plane types in-place");
1643 if (
GetYUVPlanes(width, height, src_format, src, src_pitch,
1644 &srcY1, &srcU, &srcV, &srcY_pitch, &srcUV_pitch) < 0) {
1647 srcY2 = srcY1 + srcY_pitch;
1648 srcY_pitch_left = (srcY_pitch -
width);
1651 srcUV_pixel_stride = 2;
1652 srcUV_pitch_left = (srcUV_pitch - 2*((width + 1)/2));
1654 srcUV_pixel_stride = 1;
1655 srcUV_pitch_left = (srcUV_pitch - ((width + 1)/2));
1658 if (
GetYUVPlanes(width, height, dst_format, dst, dst_pitch,
1660 &dstY_pitch, &dstUV_pitch) < 0) {
1663 dstY2 = dstY1 + dstY_pitch;
1664 dstU2 = dstU1 + dstUV_pitch;
1665 dstV2 = dstV1 + dstUV_pitch;
1666 dst_pitch_left = (dstY_pitch - 4*((width + 1)/2));
1669 for (y = 0; y < (height - 1); y += 2) {
1670 for (x = 0; x < (width - 1); x += 2) {
1687 srcU += srcUV_pixel_stride;
1688 srcV += srcUV_pixel_stride;
1696 if (x == (width - 1)) {
1713 srcU += srcUV_pixel_stride;
1714 srcV += srcUV_pixel_stride;
1721 srcY1 += srcY_pitch_left + srcY_pitch;
1722 srcY2 += srcY_pitch_left + srcY_pitch;
1723 srcU += srcUV_pitch_left;
1724 srcV += srcUV_pitch_left;
1725 dstY1 += dst_pitch_left + dstY_pitch;
1726 dstY2 += dst_pitch_left + dstY_pitch;
1727 dstU1 += dst_pitch_left + dstUV_pitch;
1728 dstU2 += dst_pitch_left + dstUV_pitch;
1729 dstV1 += dst_pitch_left + dstUV_pitch;
1730 dstV2 += dst_pitch_left + dstUV_pitch;
1734 if (y == (height - 1)) {
1735 for (x = 0; x < (width - 1); x += 2) {
1744 srcU += srcUV_pixel_stride;
1745 srcV += srcUV_pixel_stride;
1751 if (x == (width - 1)) {
1760 srcU += srcUV_pixel_stride;
1761 srcV += srcUV_pixel_stride;
1771 Uint32 src_format,
const void *
src,
int src_pitch,
1772 Uint32 dst_format,
void *
dst,
int dst_pitch)
1775 const Uint8 *
srcY1, *srcY2, *srcU1, *srcU2, *srcV1, *srcV2;
1776 Uint32 srcY_pitch, srcUV_pitch;
1779 Uint32 dstY_pitch, dstUV_pitch;
1780 Uint32 dstY_pitch_left, dstUV_pitch_left, dstUV_pixel_stride;
1783 return SDL_SetError(
"Can't change YUV plane types in-place");
1786 if (
GetYUVPlanes(width, height, src_format, src, src_pitch,
1787 &srcY1, &srcU1, &srcV1, &srcY_pitch, &srcUV_pitch) < 0) {
1790 srcY2 = srcY1 + srcY_pitch;
1791 srcU2 = srcU1 + srcUV_pitch;
1792 srcV2 = srcV1 + srcUV_pitch;
1793 src_pitch_left = (srcY_pitch - 4*((width + 1)/2));
1795 if (
GetYUVPlanes(width, height, dst_format, dst, dst_pitch,
1797 &dstY_pitch, &dstUV_pitch) < 0) {
1800 dstY2 = dstY1 + dstY_pitch;
1801 dstY_pitch_left = (dstY_pitch -
width);
1804 dstUV_pixel_stride = 2;
1805 dstUV_pitch_left = (dstUV_pitch - 2*((width + 1)/2));
1807 dstUV_pixel_stride = 1;
1808 dstUV_pitch_left = (dstUV_pitch - ((width + 1)/2));
1812 for (y = 0; y < (height - 1); y += 2) {
1813 for (x = 0; x < (width - 1); x += 2) {
1833 dstU += dstUV_pixel_stride;
1834 dstV += dstUV_pixel_stride;
1838 if (x == (width - 1)) {
1858 dstU += dstUV_pixel_stride;
1859 dstV += dstUV_pixel_stride;
1862 srcY1 += src_pitch_left + srcY_pitch;
1863 srcY2 += src_pitch_left + srcY_pitch;
1864 srcU1 += src_pitch_left + srcUV_pitch;
1865 srcU2 += src_pitch_left + srcUV_pitch;
1866 srcV1 += src_pitch_left + srcUV_pitch;
1867 srcV2 += src_pitch_left + srcUV_pitch;
1868 dstY1 += dstY_pitch_left + dstY_pitch;
1869 dstY2 += dstY_pitch_left + dstY_pitch;
1870 dstU += dstUV_pitch_left;
1871 dstV += dstUV_pitch_left;
1875 if (y == (height - 1)) {
1876 for (x = 0; x < (width - 1); x += 2) {
1887 dstU += dstUV_pixel_stride;
1888 dstV += dstUV_pixel_stride;
1892 if (x == (width - 1)) {
1903 Uint32 src_format,
const void *
src,
int src_pitch,
1904 Uint32 dst_format,
void *
dst,
int dst_pitch)
1906 if (src_format == dst_format) {
void SDL_SetYUVConversionMode(SDL_YUV_CONVERSION_MODE mode)
Set the YUV conversion mode.
void yuv420_rgb565_sseu(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
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)
void yuvnv12_rgb565_std(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
void yuv422_rgb565_sseu(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
GLdouble GLdouble GLdouble r
void yuv420_bgra_lsx(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *v, const uint8_t *u, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
void yuv422_rgb24_std(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
SDL_YUV_CONVERSION_MODE SDL_GetYUVConversionModeForResolution(int width, int height)
Get the YUV conversion mode, returning the correct mode for the resolution when the current conversio...
static int SDL_ConvertPixels_YUY2_to_YVYU(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch)
static int SDL_ConvertPixels_Planar2x2_to_Packed4(int width, int height, Uint32 src_format, const void *src, int src_pitch, Uint32 dst_format, void *dst, int dst_pitch)
static int SDL_ConvertPixels_SwapNV(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch)
static SDL_bool IsPacked4Format(Uint32 format)
static int SDL_ConvertPixels_Packed4_to_Planar2x2(int width, int height, Uint32 src_format, const void *src, int src_pitch, Uint32 dst_format, void *dst, int dst_pitch)
GLint GLint GLint GLint GLint x
GLenum GLint GLint GLint GLint GLuint GLenum GLint GLint GLint dstY
static int SDL_ConvertPixels_YUY2_to_UYVY(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch)
void yuv420_abgr_lsx(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *v, const uint8_t *u, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
void yuv420_rgb24_sseu(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
static int SDL_ConvertPixels_SplitNV_to_UVPlanes(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch, SDL_bool reverseUV)
void yuvnv12_bgra_sseu(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
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)
void yuv420_argb_sseu(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
void yuv422_abgr_std(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
void rgb24_yuv420_std(uint32_t width, uint32_t height, const uint8_t *RGB, uint32_t RGB_stride, uint8_t *Y, uint8_t *U, uint8_t *V, uint32_t Y_stride, uint32_t UV_stride, YCbCrType yuv_type)
void yuv420_rgba_sseu(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
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)
void yuv420_rgb24_msa(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
void yuvnv12_abgr_sseu(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
static SDL_bool yuv_rgb_msa(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)
void yuv422_argb_sseu(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
int SDL_ConvertPixels_YUV_to_RGB(int width, int height, Uint32 src_format, const void *src, int src_pitch, Uint32 dst_format, void *dst, int dst_pitch)
GLint GLint GLsizei width
void yuv422_rgb24_sseu(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
static int SDL_ConvertPixels_YVYU_to_YUY2(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch)
GLenum GLint GLint GLint srcY
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
void yuvnv12_rgba_sseu(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
#define PACKED4_TO_PACKED4_ROW_SSE2(shuffle)
GLfloat GLfloat GLfloat v2
static int SDL_ConvertPixels_ARGB8888_to_YUV(int width, int height, const void *src, int src_pitch, Uint32 dst_format, void *dst, int dst_pitch)
void yuv420_rgba_lsx(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *v, const uint8_t *u, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
void yuv422_argb_std(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
void yuv420_rgba_std(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
void yuv420_abgr_msa(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
static int SDL_ConvertPixels_SwapUVPlanes(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch)
void yuv420_rgb24_lsx(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
void yuvnv12_argb_std(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
static SDL_bool yuv_rgb_lsx(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)
void yuv422_rgb565_std(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
static int GetYUVConversionType(int width, int height, YCbCrType *yuv_type)
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int int in j)
void yuv420_abgr_std(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
SDL_FORCE_INLINE Uint16 SDL_Swap16(Uint16 x)
void yuv420_bgra_msa(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
SDL_bool SDL_HasLSX(void)
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)
void yuvnv12_rgb24_std(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
void yuv420_abgr_sseu(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
static SDL_bool IsPlanar2x2Format(Uint32 format)
void yuv420_rgb24_std(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
GLint GLint GLint GLint GLint GLint y
#define READ_TWO_RGB_PIXELS
void yuv420_argb_std(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
void yuv422_rgba_sseu(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
void yuvnv12_bgra_std(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
static SDL_YUV_CONVERSION_MODE SDL_YUV_ConversionMode
static int SDL_ConvertPixels_UYVY_to_YUY2(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch)
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
void yuvnv12_argb_sseu(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
#define SDL_OutOfMemory()
#define READ_ONE_RGB_PIXEL
void yuv420_bgra_std(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
void yuvnv12_rgb565_sseu(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
void yuv420_argb_msa(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
void yuv422_bgra_sseu(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
GLint GLint GLsizei GLsizei height
#define SDL_YUV_SD_THRESHOLD
static int SDL_ConvertPixels_Packed4_to_Packed4(int width, int height, Uint32 src_format, const void *src, int src_pitch, Uint32 dst_format, void *dst, int dst_pitch)
void yuvnv12_abgr_std(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
static int SDL_ConvertPixels_UYVY_to_YVYU(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch)
void yuv420_bgra_sseu(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
void yuv422_rgba_std(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
SDL_YUV_CONVERSION_MODE
The formula used for converting between YUV and RGB.
static int SDL_ConvertPixels_PackUVPlanes_to_NV(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch, SDL_bool reverseUV)
void yuv420_rgb565_std(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
#define SDL_ConvertPixels
void yuv422_abgr_sseu(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
void yuv420_argb_lsx(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *v, const uint8_t *u, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
void yuv420_rgba_msa(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
static int SDL_ConvertPixels_YVYU_to_UYVY(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch)
int SDL_ConvertPixels_RGB_to_YUV(int width, int height, Uint32 src_format, const void *src, int src_pitch, Uint32 dst_format, void *dst, int dst_pitch)
static int SDL_ConvertPixels_Planar2x2_to_Planar2x2(int width, int height, Uint32 src_format, const void *src, int src_pitch, Uint32 dst_format, void *dst, int dst_pitch)
SDL_YUV_CONVERSION_MODE SDL_GetYUVConversionMode()
Get the YUV conversion mode.
void yuvnv12_rgba_std(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
GLboolean GLboolean GLboolean b
void yuvnv12_rgb24_sseu(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
static int SDL_ConvertPixels_YUV_to_YUV_Copy(int width, int height, Uint32 format, const void *src, int src_pitch, void *dst, int dst_pitch)
void yuv422_bgra_std(uint32_t width, uint32_t height, const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, uint8_t *rgb, uint32_t rgb_stride, YCbCrType yuv_type)
GLint GLint GLint GLint GLint GLint GLint dstY1
#define SDL_GetPixelFormatName