Lines 233-239
Link Here
|
233 |
#define YSCALEYUV2PACKEDX_END \ |
233 |
#define YSCALEYUV2PACKEDX_END \ |
234 |
:: "r" (&c->redDither), \ |
234 |
:: "r" (&c->redDither), \ |
235 |
"m" (dummy), "m" (dummy), "m" (dummy),\ |
235 |
"m" (dummy), "m" (dummy), "m" (dummy),\ |
236 |
"r" (dest), "m" (dstW) \ |
236 |
"r" (dest), "m" (dstW), \ |
|
|
237 |
"m" (b5Dither), "m" (g5Dither), \ |
238 |
"m" (r5Dither), "m" (bF8), "m" (bFC) \ |
237 |
: "%"REG_a, "%"REG_d, "%"REG_S \ |
239 |
: "%"REG_a, "%"REG_d, "%"REG_S \ |
238 |
); |
240 |
); |
239 |
|
241 |
|
Lines 687-696
Link Here
|
687 |
" jb 1b \n\t" |
689 |
" jb 1b \n\t" |
688 |
#define WRITEBGR32(dst, dstw, index) REAL_WRITEBGR32(dst, dstw, index) |
690 |
#define WRITEBGR32(dst, dstw, index) REAL_WRITEBGR32(dst, dstw, index) |
689 |
|
691 |
|
690 |
#define REAL_WRITEBGR16(dst, dstw, index) \ |
692 |
#define REAL_WRITEBGR16(dst, dstw, index, bf8, bfc) \ |
691 |
"pand "MANGLE(bF8)", %%mm2 \n\t" /* B */\ |
693 |
"pand "#bf8", %%mm2 \n\t" /* B */\ |
692 |
"pand "MANGLE(bFC)", %%mm4 \n\t" /* G */\ |
694 |
"pand "#bfc", %%mm4 \n\t" /* G */\ |
693 |
"pand "MANGLE(bF8)", %%mm5 \n\t" /* R */\ |
695 |
"pand "#bf8", %%mm5 \n\t" /* R */\ |
694 |
"psrlq $3, %%mm2 \n\t"\ |
696 |
"psrlq $3, %%mm2 \n\t"\ |
695 |
\ |
697 |
\ |
696 |
"movq %%mm2, %%mm1 \n\t"\ |
698 |
"movq %%mm2, %%mm1 \n\t"\ |
Lines 713-724
Link Here
|
713 |
"add $8, "#index" \n\t"\ |
715 |
"add $8, "#index" \n\t"\ |
714 |
"cmp "#dstw", "#index" \n\t"\ |
716 |
"cmp "#dstw", "#index" \n\t"\ |
715 |
" jb 1b \n\t" |
717 |
" jb 1b \n\t" |
716 |
#define WRITEBGR16(dst, dstw, index) REAL_WRITEBGR16(dst, dstw, index) |
718 |
#define WRITEBGR16(dst, dstw, index, bf8, bfc) REAL_WRITEBGR16(dst, dstw, index, bf8, bfc) |
717 |
|
719 |
|
718 |
#define REAL_WRITEBGR15(dst, dstw, index) \ |
720 |
#define REAL_WRITEBGR15(dst, dstw, index, bf8) \ |
719 |
"pand "MANGLE(bF8)", %%mm2 \n\t" /* B */\ |
721 |
"pand "#bf8", %%mm2 \n\t" /* B */\ |
720 |
"pand "MANGLE(bF8)", %%mm4 \n\t" /* G */\ |
722 |
"pand "#bf8", %%mm4 \n\t" /* G */\ |
721 |
"pand "MANGLE(bF8)", %%mm5 \n\t" /* R */\ |
723 |
"pand "#bf8", %%mm5 \n\t" /* R */\ |
722 |
"psrlq $3, %%mm2 \n\t"\ |
724 |
"psrlq $3, %%mm2 \n\t"\ |
723 |
"psrlq $1, %%mm5 \n\t"\ |
725 |
"psrlq $1, %%mm5 \n\t"\ |
724 |
\ |
726 |
\ |
Lines 742-750
Link Here
|
742 |
"add $8, "#index" \n\t"\ |
744 |
"add $8, "#index" \n\t"\ |
743 |
"cmp "#dstw", "#index" \n\t"\ |
745 |
"cmp "#dstw", "#index" \n\t"\ |
744 |
" jb 1b \n\t" |
746 |
" jb 1b \n\t" |
745 |
#define WRITEBGR15(dst, dstw, index) REAL_WRITEBGR15(dst, dstw, index) |
747 |
#define WRITEBGR15(dst, dstw, index, bf8) REAL_WRITEBGR15(dst, dstw, index, bf8) |
746 |
|
748 |
|
747 |
#define WRITEBGR24OLD(dst, dstw, index) \ |
749 |
#define WRITEBGR24OLD(dst, dstw, index, m24a, m24b, m24c) \ |
748 |
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */\ |
750 |
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */\ |
749 |
"movq %%mm2, %%mm1 \n\t" /* B */\ |
751 |
"movq %%mm2, %%mm1 \n\t" /* B */\ |
750 |
"movq %%mm5, %%mm6 \n\t" /* R */\ |
752 |
"movq %%mm5, %%mm6 \n\t" /* R */\ |
Lines 800-806
Link Here
|
800 |
"cmp "#dstw", "#index" \n\t"\ |
802 |
"cmp "#dstw", "#index" \n\t"\ |
801 |
" jb 1b \n\t" |
803 |
" jb 1b \n\t" |
802 |
|
804 |
|
803 |
#define WRITEBGR24MMX(dst, dstw, index) \ |
805 |
#define WRITEBGR24MMX(dst, dstw, index, m24a, m24b, m24c) \ |
804 |
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */\ |
806 |
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */\ |
805 |
"movq %%mm2, %%mm1 \n\t" /* B */\ |
807 |
"movq %%mm2, %%mm1 \n\t" /* B */\ |
806 |
"movq %%mm5, %%mm6 \n\t" /* R */\ |
808 |
"movq %%mm5, %%mm6 \n\t" /* R */\ |
Lines 853-862
Link Here
|
853 |
"cmp "#dstw", "#index" \n\t"\ |
855 |
"cmp "#dstw", "#index" \n\t"\ |
854 |
" jb 1b \n\t" |
856 |
" jb 1b \n\t" |
855 |
|
857 |
|
856 |
#define WRITEBGR24MMX2(dst, dstw, index) \ |
858 |
#define WRITEBGR24MMX2(dst, dstw, index, m24a, m24b, m24c) \ |
857 |
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */\ |
859 |
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */\ |
858 |
"movq "MANGLE(M24A)", %%mm0 \n\t"\ |
860 |
"movq "#m24a", %%mm0 \n\t"\ |
859 |
"movq "MANGLE(M24C)", %%mm7 \n\t"\ |
861 |
"movq "#m24c", %%mm7 \n\t"\ |
860 |
"pshufw $0x50, %%mm2, %%mm1 \n\t" /* B3 B2 B3 B2 B1 B0 B1 B0 */\ |
862 |
"pshufw $0x50, %%mm2, %%mm1 \n\t" /* B3 B2 B3 B2 B1 B0 B1 B0 */\ |
861 |
"pshufw $0x50, %%mm4, %%mm3 \n\t" /* G3 G2 G3 G2 G1 G0 G1 G0 */\ |
863 |
"pshufw $0x50, %%mm4, %%mm3 \n\t" /* G3 G2 G3 G2 G1 G0 G1 G0 */\ |
862 |
"pshufw $0x00, %%mm5, %%mm6 \n\t" /* R1 R0 R1 R0 R1 R0 R1 R0 */\ |
864 |
"pshufw $0x00, %%mm5, %%mm6 \n\t" /* R1 R0 R1 R0 R1 R0 R1 R0 */\ |
Lines 875-881
Link Here
|
875 |
"pshufw $0x55, %%mm4, %%mm3 \n\t" /* G4 G3 G4 G3 G4 G3 G4 G3 */\ |
877 |
"pshufw $0x55, %%mm4, %%mm3 \n\t" /* G4 G3 G4 G3 G4 G3 G4 G3 */\ |
876 |
"pshufw $0xA5, %%mm5, %%mm6 \n\t" /* R5 R4 R5 R4 R3 R2 R3 R2 */\ |
878 |
"pshufw $0xA5, %%mm5, %%mm6 \n\t" /* R5 R4 R5 R4 R3 R2 R3 R2 */\ |
877 |
\ |
879 |
\ |
878 |
"pand "MANGLE(M24B)", %%mm1 \n\t" /* B5 B4 B3 */\ |
880 |
"pand "#m24b", %%mm1 \n\t" /* B5 B4 B3 */\ |
879 |
"pand %%mm7, %%mm3 \n\t" /* G4 G3 */\ |
881 |
"pand %%mm7, %%mm3 \n\t" /* G4 G3 */\ |
880 |
"pand %%mm0, %%mm6 \n\t" /* R4 R3 R2 */\ |
882 |
"pand %%mm0, %%mm6 \n\t" /* R4 R3 R2 */\ |
881 |
\ |
883 |
\ |
Lines 889-895
Link Here
|
889 |
\ |
891 |
\ |
890 |
"pand %%mm7, %%mm1 \n\t" /* B7 B6 */\ |
892 |
"pand %%mm7, %%mm1 \n\t" /* B7 B6 */\ |
891 |
"pand %%mm0, %%mm3 \n\t" /* G7 G6 G5 */\ |
893 |
"pand %%mm0, %%mm3 \n\t" /* G7 G6 G5 */\ |
892 |
"pand "MANGLE(M24B)", %%mm6 \n\t" /* R7 R6 R5 */\ |
894 |
"pand "#m24b", %%mm6 \n\t" /* R7 R6 R5 */\ |
893 |
\ |
895 |
\ |
894 |
"por %%mm1, %%mm3 \n\t"\ |
896 |
"por %%mm1, %%mm3 \n\t"\ |
895 |
"por %%mm3, %%mm6 \n\t"\ |
897 |
"por %%mm3, %%mm6 \n\t"\ |
Lines 903-912
Link Here
|
903 |
|
905 |
|
904 |
#ifdef HAVE_MMX2 |
906 |
#ifdef HAVE_MMX2 |
905 |
#undef WRITEBGR24 |
907 |
#undef WRITEBGR24 |
906 |
#define WRITEBGR24(dst, dstw, index) WRITEBGR24MMX2(dst, dstw, index) |
908 |
#define WRITEBGR24(dst, dstw, index, m24a, m24b, m24c) WRITEBGR24MMX2(dst, dstw, index, m24a, m24b, m24c) |
907 |
#else |
909 |
#else |
908 |
#undef WRITEBGR24 |
910 |
#undef WRITEBGR24 |
909 |
#define WRITEBGR24(dst, dstw, index) WRITEBGR24MMX(dst, dstw, index) |
911 |
#define WRITEBGR24(dst, dstw, index, m24a, m24b, m24c) WRITEBGR24MMX(dst, dstw, index, m24a, m24b, m24c) |
910 |
#endif |
912 |
#endif |
911 |
|
913 |
|
912 |
#define REAL_WRITEYUY2(dst, dstw, index) \ |
914 |
#define REAL_WRITEYUY2(dst, dstw, index) \ |
Lines 1053-1064
static inline void RENAME(yuv2packedX)(S
Link Here
|
1053 |
YSCALEYUV2RGBX |
1055 |
YSCALEYUV2RGBX |
1054 |
"lea (%%"REG_a", %%"REG_a", 2), %%"REG_c"\n\t" //FIXME optimize |
1056 |
"lea (%%"REG_a", %%"REG_a", 2), %%"REG_c"\n\t" //FIXME optimize |
1055 |
"add %4, %%"REG_c" \n\t" |
1057 |
"add %4, %%"REG_c" \n\t" |
1056 |
WRITEBGR24(%%REGc, %5, %%REGa) |
1058 |
WRITEBGR24(%%REGc, %5, %%REGa, %6, %7, %8) |
1057 |
|
1059 |
|
1058 |
|
1060 |
|
1059 |
:: "r" (&c->redDither), |
1061 |
:: "r" (&c->redDither), |
1060 |
"m" (dummy), "m" (dummy), "m" (dummy), |
1062 |
"m" (dummy), "m" (dummy), "m" (dummy), |
1061 |
"r" (dest), "m" (dstW) |
1063 |
"r" (dest), "m" (dstW), "m" (M24A), "m" (M24B), "m" (M24C) |
1062 |
: "%"REG_a, "%"REG_c, "%"REG_d, "%"REG_S |
1064 |
: "%"REG_a, "%"REG_c, "%"REG_d, "%"REG_S |
1063 |
); |
1065 |
); |
1064 |
return; |
1066 |
return; |
Lines 1067-1078
static inline void RENAME(yuv2packedX)(S
Link Here
|
1067 |
YSCALEYUV2RGBX |
1069 |
YSCALEYUV2RGBX |
1068 |
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */ |
1070 |
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */ |
1069 |
#ifdef DITHER1XBPP |
1071 |
#ifdef DITHER1XBPP |
1070 |
"paddusb "MANGLE(b5Dither)", %%mm2\n\t" |
1072 |
"paddusb %6, %%mm2\n\t" |
1071 |
"paddusb "MANGLE(g5Dither)", %%mm4\n\t" |
1073 |
"paddusb %7, %%mm4\n\t" |
1072 |
"paddusb "MANGLE(r5Dither)", %%mm5\n\t" |
1074 |
"paddusb %8, %%mm5\n\t" |
1073 |
#endif |
1075 |
#endif |
1074 |
|
1076 |
|
1075 |
WRITEBGR15(%4, %5, %%REGa) |
1077 |
WRITEBGR15(%4, %5, %%REGa, %9) |
1076 |
YSCALEYUV2PACKEDX_END |
1078 |
YSCALEYUV2PACKEDX_END |
1077 |
return; |
1079 |
return; |
1078 |
case PIX_FMT_BGR565: |
1080 |
case PIX_FMT_BGR565: |
Lines 1080-1091
static inline void RENAME(yuv2packedX)(S
Link Here
|
1080 |
YSCALEYUV2RGBX |
1082 |
YSCALEYUV2RGBX |
1081 |
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */ |
1083 |
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */ |
1082 |
#ifdef DITHER1XBPP |
1084 |
#ifdef DITHER1XBPP |
1083 |
"paddusb "MANGLE(b5Dither)", %%mm2\n\t" |
1085 |
"paddusb %6, %%mm2\n\t" |
1084 |
"paddusb "MANGLE(g6Dither)", %%mm4\n\t" |
1086 |
"paddusb %7, %%mm4\n\t" |
1085 |
"paddusb "MANGLE(r5Dither)", %%mm5\n\t" |
1087 |
"paddusb %8, %%mm5\n\t" |
1086 |
#endif |
1088 |
#endif |
1087 |
|
1089 |
|
1088 |
WRITEBGR16(%4, %5, %%REGa) |
1090 |
WRITEBGR16(%4, %5, %%REGa, %9, %10) |
1089 |
YSCALEYUV2PACKEDX_END |
1091 |
YSCALEYUV2PACKEDX_END |
1090 |
return; |
1092 |
return; |
1091 |
case PIX_FMT_YUYV422: |
1093 |
case PIX_FMT_YUYV422: |
Lines 1114-1124
static inline void RENAME(yuv2packedX)(S
Link Here
|
1114 |
YSCALEYUV2RGBX |
1116 |
YSCALEYUV2RGBX |
1115 |
"lea (%%"REG_a", %%"REG_a", 2), %%"REG_c" \n\t" //FIXME optimize |
1117 |
"lea (%%"REG_a", %%"REG_a", 2), %%"REG_c" \n\t" //FIXME optimize |
1116 |
"add %4, %%"REG_c" \n\t" |
1118 |
"add %4, %%"REG_c" \n\t" |
1117 |
WRITEBGR24(%%REGc, %5, %%REGa) |
1119 |
WRITEBGR24(%%REGc, %5, %%REGa, %6, %7, %8) |
1118 |
|
1120 |
|
1119 |
:: "r" (&c->redDither), |
1121 |
:: "r" (&c->redDither), |
1120 |
"m" (dummy), "m" (dummy), "m" (dummy), |
1122 |
"m" (dummy), "m" (dummy), "m" (dummy), |
1121 |
"r" (dest), "m" (dstW) |
1123 |
"r" (dest), "m" (dstW), "m" (M24A), "m" (M24B), "m" (M24C) |
1122 |
: "%"REG_a, "%"REG_c, "%"REG_d, "%"REG_S |
1124 |
: "%"REG_a, "%"REG_c, "%"REG_d, "%"REG_S |
1123 |
); |
1125 |
); |
1124 |
return; |
1126 |
return; |
Lines 1127-1138
static inline void RENAME(yuv2packedX)(S
Link Here
|
1127 |
YSCALEYUV2RGBX |
1129 |
YSCALEYUV2RGBX |
1128 |
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */ |
1130 |
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */ |
1129 |
#ifdef DITHER1XBPP |
1131 |
#ifdef DITHER1XBPP |
1130 |
"paddusb "MANGLE(b5Dither)", %%mm2 \n\t" |
1132 |
"paddusb %6, %%mm2\n\t" |
1131 |
"paddusb "MANGLE(g5Dither)", %%mm4 \n\t" |
1133 |
"paddusb %7, %%mm4\n\t" |
1132 |
"paddusb "MANGLE(r5Dither)", %%mm5 \n\t" |
1134 |
"paddusb %8, %%mm5\n\t" |
1133 |
#endif |
1135 |
#endif |
1134 |
|
1136 |
|
1135 |
WRITEBGR15(%4, %5, %%REGa) |
1137 |
WRITEBGR15(%4, %5, %%REGa, %9) |
1136 |
YSCALEYUV2PACKEDX_END |
1138 |
YSCALEYUV2PACKEDX_END |
1137 |
return; |
1139 |
return; |
1138 |
case PIX_FMT_BGR565: |
1140 |
case PIX_FMT_BGR565: |
Lines 1140-1151
static inline void RENAME(yuv2packedX)(S
Link Here
|
1140 |
YSCALEYUV2RGBX |
1142 |
YSCALEYUV2RGBX |
1141 |
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */ |
1143 |
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */ |
1142 |
#ifdef DITHER1XBPP |
1144 |
#ifdef DITHER1XBPP |
1143 |
"paddusb "MANGLE(b5Dither)", %%mm2 \n\t" |
1145 |
"paddusb %6, %%mm2\n\t" |
1144 |
"paddusb "MANGLE(g6Dither)", %%mm4 \n\t" |
1146 |
"paddusb %7, %%mm4\n\t" |
1145 |
"paddusb "MANGLE(r5Dither)", %%mm5 \n\t" |
1147 |
"paddusb %8, %%mm5\n\t" |
1146 |
#endif |
1148 |
#endif |
1147 |
|
1149 |
|
1148 |
WRITEBGR16(%4, %5, %%REGa) |
1150 |
WRITEBGR16(%4, %5, %%REGa, %9, %10) |
1149 |
YSCALEYUV2PACKEDX_END |
1151 |
YSCALEYUV2PACKEDX_END |
1150 |
return; |
1152 |
return; |
1151 |
case PIX_FMT_YUYV422: |
1153 |
case PIX_FMT_YUYV422: |
Lines 1427-1437
FULL_YSCALEYUV2RGB
Link Here
|
1427 |
"mov %4, %%"REG_b" \n\t" |
1429 |
"mov %4, %%"REG_b" \n\t" |
1428 |
"push %%"REG_BP" \n\t" |
1430 |
"push %%"REG_BP" \n\t" |
1429 |
YSCALEYUV2RGB(%%REGBP, %5) |
1431 |
YSCALEYUV2RGB(%%REGBP, %5) |
1430 |
WRITEBGR24(%%REGb, 8280(%5), %%REGBP) |
1432 |
WRITEBGR24(%%REGb, 8280(%5), %%REGBP, %6, %7, %8) |
1431 |
"pop %%"REG_BP" \n\t" |
1433 |
"pop %%"REG_BP" \n\t" |
1432 |
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" |
1434 |
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" |
1433 |
:: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), |
1435 |
:: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), |
1434 |
"a" (&c->redDither) |
1436 |
"a" (&c->redDither), "m" (M24A), "m" (M24B), "m" (M24C) |
1435 |
); |
1437 |
); |
1436 |
return; |
1438 |
return; |
1437 |
case PIX_FMT_BGR555: |
1439 |
case PIX_FMT_BGR555: |
Lines 1442-1458
FULL_YSCALEYUV2RGB
Link Here
|
1442 |
YSCALEYUV2RGB(%%REGBP, %5) |
1444 |
YSCALEYUV2RGB(%%REGBP, %5) |
1443 |
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */ |
1445 |
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */ |
1444 |
#ifdef DITHER1XBPP |
1446 |
#ifdef DITHER1XBPP |
1445 |
"paddusb "MANGLE(b5Dither)", %%mm2 \n\t" |
1447 |
"paddusb %6, %%mm2 \n\t" |
1446 |
"paddusb "MANGLE(g5Dither)", %%mm4 \n\t" |
1448 |
"paddusb %7, %%mm4 \n\t" |
1447 |
"paddusb "MANGLE(r5Dither)", %%mm5 \n\t" |
1449 |
"paddusb %8, %%mm5 \n\t" |
1448 |
#endif |
1450 |
#endif |
1449 |
|
1451 |
|
1450 |
WRITEBGR15(%%REGb, 8280(%5), %%REGBP) |
1452 |
WRITEBGR15(%%REGb, 8280(%5), %%REGBP, %9) |
1451 |
"pop %%"REG_BP" \n\t" |
1453 |
"pop %%"REG_BP" \n\t" |
1452 |
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" |
1454 |
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" |
1453 |
|
1455 |
|
1454 |
:: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), |
1456 |
:: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), |
1455 |
"a" (&c->redDither) |
1457 |
"a" (&c->redDither), "m" (b5Dither), "m" (g6Dither), "m" (r5Dither), |
|
|
1458 |
"m" (bF8) |
1456 |
); |
1459 |
); |
1457 |
return; |
1460 |
return; |
1458 |
case PIX_FMT_BGR565: |
1461 |
case PIX_FMT_BGR565: |
Lines 1463-1478
FULL_YSCALEYUV2RGB
Link Here
|
1463 |
YSCALEYUV2RGB(%%REGBP, %5) |
1466 |
YSCALEYUV2RGB(%%REGBP, %5) |
1464 |
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */ |
1467 |
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */ |
1465 |
#ifdef DITHER1XBPP |
1468 |
#ifdef DITHER1XBPP |
1466 |
"paddusb "MANGLE(b5Dither)", %%mm2 \n\t" |
1469 |
"paddusb %6, %%mm2 \n\t" |
1467 |
"paddusb "MANGLE(g6Dither)", %%mm4 \n\t" |
1470 |
"paddusb %7, %%mm4 \n\t" |
1468 |
"paddusb "MANGLE(r5Dither)", %%mm5 \n\t" |
1471 |
"paddusb %8, %%mm5 \n\t" |
1469 |
#endif |
1472 |
#endif |
1470 |
|
1473 |
|
1471 |
WRITEBGR16(%%REGb, 8280(%5), %%REGBP) |
1474 |
WRITEBGR16(%%REGb, 8280(%5), %%REGBP, %9, %10) |
1472 |
"pop %%"REG_BP" \n\t" |
1475 |
"pop %%"REG_BP" \n\t" |
1473 |
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" |
1476 |
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" |
1474 |
:: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), |
1477 |
:: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), |
1475 |
"a" (&c->redDither) |
1478 |
"a" (&c->redDither), "m" (b5Dither), "m" (g6Dither), "m" (r5Dither), |
|
|
1479 |
"m" (bF8), "m" (bFC) |
1476 |
); |
1480 |
); |
1477 |
return; |
1481 |
return; |
1478 |
case PIX_FMT_YUYV422: |
1482 |
case PIX_FMT_YUYV422: |
Lines 1537-1548
static inline void RENAME(yuv2packed1)(S
Link Here
|
1537 |
"mov %4, %%"REG_b" \n\t" |
1541 |
"mov %4, %%"REG_b" \n\t" |
1538 |
"push %%"REG_BP" \n\t" |
1542 |
"push %%"REG_BP" \n\t" |
1539 |
YSCALEYUV2RGB1(%%REGBP, %5) |
1543 |
YSCALEYUV2RGB1(%%REGBP, %5) |
1540 |
WRITEBGR24(%%REGb, 8280(%5), %%REGBP) |
1544 |
WRITEBGR24(%%REGb, 8280(%5), %%REGBP, %6, %7, %8) |
1541 |
"pop %%"REG_BP" \n\t" |
1545 |
"pop %%"REG_BP" \n\t" |
1542 |
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" |
1546 |
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" |
1543 |
|
1547 |
|
1544 |
:: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), |
1548 |
:: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), |
1545 |
"a" (&c->redDither) |
1549 |
"a" (&c->redDither), "m" (M24A), "m" (M24B), "m" (M24C) |
1546 |
); |
1550 |
); |
1547 |
return; |
1551 |
return; |
1548 |
case PIX_FMT_BGR555: |
1552 |
case PIX_FMT_BGR555: |
Lines 1553-1568
static inline void RENAME(yuv2packed1)(S
Link Here
|
1553 |
YSCALEYUV2RGB1(%%REGBP, %5) |
1557 |
YSCALEYUV2RGB1(%%REGBP, %5) |
1554 |
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */ |
1558 |
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */ |
1555 |
#ifdef DITHER1XBPP |
1559 |
#ifdef DITHER1XBPP |
1556 |
"paddusb "MANGLE(b5Dither)", %%mm2 \n\t" |
1560 |
"paddusb %6, %%mm2 \n\t" |
1557 |
"paddusb "MANGLE(g5Dither)", %%mm4 \n\t" |
1561 |
"paddusb %7, %%mm4 \n\t" |
1558 |
"paddusb "MANGLE(r5Dither)", %%mm5 \n\t" |
1562 |
"paddusb %8, %%mm5 \n\t" |
1559 |
#endif |
1563 |
#endif |
1560 |
WRITEBGR15(%%REGb, 8280(%5), %%REGBP) |
1564 |
WRITEBGR15(%%REGb, 8280(%5), %%REGBP, %9) |
1561 |
"pop %%"REG_BP" \n\t" |
1565 |
"pop %%"REG_BP" \n\t" |
1562 |
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" |
1566 |
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" |
1563 |
|
1567 |
|
1564 |
:: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), |
1568 |
:: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), |
1565 |
"a" (&c->redDither) |
1569 |
"a" (&c->redDither), "m" (b5Dither), "m" (g6Dither), "m" (r5Dither), |
|
|
1570 |
"m" (bF8) |
1566 |
); |
1571 |
); |
1567 |
return; |
1572 |
return; |
1568 |
case PIX_FMT_BGR565: |
1573 |
case PIX_FMT_BGR565: |
Lines 1573-1589
static inline void RENAME(yuv2packed1)(S
Link Here
|
1573 |
YSCALEYUV2RGB1(%%REGBP, %5) |
1578 |
YSCALEYUV2RGB1(%%REGBP, %5) |
1574 |
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */ |
1579 |
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */ |
1575 |
#ifdef DITHER1XBPP |
1580 |
#ifdef DITHER1XBPP |
1576 |
"paddusb "MANGLE(b5Dither)", %%mm2 \n\t" |
1581 |
"paddusb %6, %%mm2 \n\t" |
1577 |
"paddusb "MANGLE(g6Dither)", %%mm4 \n\t" |
1582 |
"paddusb %7, %%mm4 \n\t" |
1578 |
"paddusb "MANGLE(r5Dither)", %%mm5 \n\t" |
1583 |
"paddusb %8, %%mm5 \n\t" |
1579 |
#endif |
1584 |
#endif |
1580 |
|
1585 |
|
1581 |
WRITEBGR16(%%REGb, 8280(%5), %%REGBP) |
1586 |
WRITEBGR16(%%REGb, 8280(%5), %%REGBP, %9, %10) |
1582 |
"pop %%"REG_BP" \n\t" |
1587 |
"pop %%"REG_BP" \n\t" |
1583 |
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" |
1588 |
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" |
1584 |
|
1589 |
|
1585 |
:: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), |
1590 |
:: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), |
1586 |
"a" (&c->redDither) |
1591 |
"a" (&c->redDither), "m" (b5Dither), "m" (g6Dither), "m" (r5Dither), |
|
|
1592 |
"m" (bF8), "m" (bFC) |
1587 |
); |
1593 |
); |
1588 |
return; |
1594 |
return; |
1589 |
case PIX_FMT_YUYV422: |
1595 |
case PIX_FMT_YUYV422: |
Lines 1626-1637
static inline void RENAME(yuv2packed1)(S
Link Here
|
1626 |
"mov %4, %%"REG_b" \n\t" |
1632 |
"mov %4, %%"REG_b" \n\t" |
1627 |
"push %%"REG_BP" \n\t" |
1633 |
"push %%"REG_BP" \n\t" |
1628 |
YSCALEYUV2RGB1b(%%REGBP, %5) |
1634 |
YSCALEYUV2RGB1b(%%REGBP, %5) |
1629 |
WRITEBGR24(%%REGb, 8280(%5), %%REGBP) |
1635 |
WRITEBGR24(%%REGb, 8280(%5), %%REGBP, %6, %7, %8) |
1630 |
"pop %%"REG_BP" \n\t" |
1636 |
"pop %%"REG_BP" \n\t" |
1631 |
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" |
1637 |
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" |
1632 |
|
1638 |
|
1633 |
:: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), |
1639 |
:: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), |
1634 |
"a" (&c->redDither) |
1640 |
"a" (&c->redDither), "m" (M24A), "m" (M24B), "m" (M24C) |
1635 |
); |
1641 |
); |
1636 |
return; |
1642 |
return; |
1637 |
case PIX_FMT_BGR555: |
1643 |
case PIX_FMT_BGR555: |
Lines 1642-1657
static inline void RENAME(yuv2packed1)(S
Link Here
|
1642 |
YSCALEYUV2RGB1b(%%REGBP, %5) |
1648 |
YSCALEYUV2RGB1b(%%REGBP, %5) |
1643 |
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */ |
1649 |
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */ |
1644 |
#ifdef DITHER1XBPP |
1650 |
#ifdef DITHER1XBPP |
1645 |
"paddusb "MANGLE(b5Dither)", %%mm2 \n\t" |
1651 |
"paddusb %6, %%mm2 \n\t" |
1646 |
"paddusb "MANGLE(g5Dither)", %%mm4 \n\t" |
1652 |
"paddusb %7, %%mm4 \n\t" |
1647 |
"paddusb "MANGLE(r5Dither)", %%mm5 \n\t" |
1653 |
"paddusb %8, %%mm5 \n\t" |
1648 |
#endif |
1654 |
#endif |
1649 |
WRITEBGR15(%%REGb, 8280(%5), %%REGBP) |
1655 |
WRITEBGR15(%%REGb, 8280(%5), %%REGBP, %9) |
1650 |
"pop %%"REG_BP" \n\t" |
1656 |
"pop %%"REG_BP" \n\t" |
1651 |
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" |
1657 |
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" |
1652 |
|
1658 |
|
1653 |
:: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), |
1659 |
:: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), |
1654 |
"a" (&c->redDither) |
1660 |
"a" (&c->redDither), "m" (b5Dither), "m" (g6Dither), "m" (r5Dither), |
|
|
1661 |
"m" (bF8) |
1655 |
); |
1662 |
); |
1656 |
return; |
1663 |
return; |
1657 |
case PIX_FMT_BGR565: |
1664 |
case PIX_FMT_BGR565: |
Lines 1662-1678
static inline void RENAME(yuv2packed1)(S
Link Here
|
1662 |
YSCALEYUV2RGB1b(%%REGBP, %5) |
1669 |
YSCALEYUV2RGB1b(%%REGBP, %5) |
1663 |
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */ |
1670 |
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */ |
1664 |
#ifdef DITHER1XBPP |
1671 |
#ifdef DITHER1XBPP |
1665 |
"paddusb "MANGLE(b5Dither)", %%mm2 \n\t" |
1672 |
"paddusb %6, %%mm2 \n\t" |
1666 |
"paddusb "MANGLE(g6Dither)", %%mm4 \n\t" |
1673 |
"paddusb %7, %%mm4 \n\t" |
1667 |
"paddusb "MANGLE(r5Dither)", %%mm5 \n\t" |
1674 |
"paddusb %8, %%mm5 \n\t" |
1668 |
#endif |
1675 |
#endif |
1669 |
|
1676 |
|
1670 |
WRITEBGR16(%%REGb, 8280(%5), %%REGBP) |
1677 |
WRITEBGR16(%%REGb, 8280(%5), %%REGBP, %9, %10) |
1671 |
"pop %%"REG_BP" \n\t" |
1678 |
"pop %%"REG_BP" \n\t" |
1672 |
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" |
1679 |
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" |
1673 |
|
1680 |
|
1674 |
:: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), |
1681 |
:: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), |
1675 |
"a" (&c->redDither) |
1682 |
"a" (&c->redDither), "m" (b5Dither), "m" (g6Dither), "m" (r5Dither), |
|
|
1683 |
"m" (bF8), "m" (bFC) |
1676 |
); |
1684 |
); |
1677 |
return; |
1685 |
return; |
1678 |
case PIX_FMT_YUYV422: |
1686 |
case PIX_FMT_YUYV422: |
Lines 1706-1712
static inline void RENAME(yuy2ToY)(uint8
Link Here
|
1706 |
{ |
1714 |
{ |
1707 |
#ifdef HAVE_MMX |
1715 |
#ifdef HAVE_MMX |
1708 |
asm volatile( |
1716 |
asm volatile( |
1709 |
"movq "MANGLE(bm01010101)", %%mm2 \n\t" |
1717 |
"movq %3, %%mm2 \n\t" |
1710 |
"mov %0, %%"REG_a" \n\t" |
1718 |
"mov %0, %%"REG_a" \n\t" |
1711 |
"1: \n\t" |
1719 |
"1: \n\t" |
1712 |
"movq (%1, %%"REG_a",2), %%mm0 \n\t" |
1720 |
"movq (%1, %%"REG_a",2), %%mm0 \n\t" |
Lines 1717-1723
static inline void RENAME(yuy2ToY)(uint8
Link Here
|
1717 |
"movq %%mm0, (%2, %%"REG_a") \n\t" |
1725 |
"movq %%mm0, (%2, %%"REG_a") \n\t" |
1718 |
"add $8, %%"REG_a" \n\t" |
1726 |
"add $8, %%"REG_a" \n\t" |
1719 |
" js 1b \n\t" |
1727 |
" js 1b \n\t" |
1720 |
: : "g" (-width), "r" (src+width*2), "r" (dst+width) |
1728 |
: : "g" (-width), "r" (src+width*2), "r" (dst+width), "m" (bm01010101) |
1721 |
: "%"REG_a |
1729 |
: "%"REG_a |
1722 |
); |
1730 |
); |
1723 |
#else |
1731 |
#else |
Lines 1731-1737
static inline void RENAME(yuy2ToUV)(uint
Link Here
|
1731 |
{ |
1739 |
{ |
1732 |
#ifdef HAVE_MMX |
1740 |
#ifdef HAVE_MMX |
1733 |
asm volatile( |
1741 |
asm volatile( |
1734 |
"movq "MANGLE(bm01010101)", %%mm4 \n\t" |
1742 |
"movq %4, %%mm4 \n\t" |
1735 |
"mov %0, %%"REG_a" \n\t" |
1743 |
"mov %0, %%"REG_a" \n\t" |
1736 |
"1: \n\t" |
1744 |
"1: \n\t" |
1737 |
"movq (%1, %%"REG_a",4), %%mm0 \n\t" |
1745 |
"movq (%1, %%"REG_a",4), %%mm0 \n\t" |
Lines 1748-1754
static inline void RENAME(yuy2ToUV)(uint
Link Here
|
1748 |
"movd %%mm1, (%2, %%"REG_a") \n\t" |
1756 |
"movd %%mm1, (%2, %%"REG_a") \n\t" |
1749 |
"add $4, %%"REG_a" \n\t" |
1757 |
"add $4, %%"REG_a" \n\t" |
1750 |
" js 1b \n\t" |
1758 |
" js 1b \n\t" |
1751 |
: : "g" (-width), "r" (src1+width*4), "r" (dstU+width), "r" (dstV+width) |
1759 |
: : "g" (-width), "r" (src1+width*4), "r" (dstU+width), "r" (dstV+width), "m" (bm01010101) |
1752 |
: "%"REG_a |
1760 |
: "%"REG_a |
1753 |
); |
1761 |
); |
1754 |
#else |
1762 |
#else |
Lines 1791-1797
static inline void RENAME(uyvyToUV)(uint
Link Here
|
1791 |
{ |
1799 |
{ |
1792 |
#ifdef HAVE_MMX |
1800 |
#ifdef HAVE_MMX |
1793 |
asm volatile( |
1801 |
asm volatile( |
1794 |
"movq "MANGLE(bm01010101)", %%mm4 \n\t" |
1802 |
"movq %4, %%mm4 \n\t" |
1795 |
"mov %0, %%"REG_a" \n\t" |
1803 |
"mov %0, %%"REG_a" \n\t" |
1796 |
"1: \n\t" |
1804 |
"1: \n\t" |
1797 |
"movq (%1, %%"REG_a",4), %%mm0 \n\t" |
1805 |
"movq (%1, %%"REG_a",4), %%mm0 \n\t" |
Lines 1808-1814
static inline void RENAME(uyvyToUV)(uint
Link Here
|
1808 |
"movd %%mm1, (%2, %%"REG_a") \n\t" |
1816 |
"movd %%mm1, (%2, %%"REG_a") \n\t" |
1809 |
"add $4, %%"REG_a" \n\t" |
1817 |
"add $4, %%"REG_a" \n\t" |
1810 |
" js 1b \n\t" |
1818 |
" js 1b \n\t" |
1811 |
: : "g" (-width), "r" (src1+width*4), "r" (dstU+width), "r" (dstV+width) |
1819 |
: : "g" (-width), "r" (src1+width*4), "r" (dstU+width), "r" (dstV+width), "m" (bm01010101) |
1812 |
: "%"REG_a |
1820 |
: "%"REG_a |
1813 |
); |
1821 |
); |
1814 |
#else |
1822 |
#else |
Lines 1859-1866
static inline void RENAME(bgr24ToY)(uint
Link Here
|
1859 |
#ifdef HAVE_MMX |
1867 |
#ifdef HAVE_MMX |
1860 |
asm volatile( |
1868 |
asm volatile( |
1861 |
"mov %2, %%"REG_a" \n\t" |
1869 |
"mov %2, %%"REG_a" \n\t" |
1862 |
"movq "MANGLE(bgr2YCoeff)", %%mm6 \n\t" |
1870 |
"movq %3, %%mm6 \n\t" |
1863 |
"movq "MANGLE(w1111)", %%mm5 \n\t" |
1871 |
"movq %4, %%mm5 \n\t" |
1864 |
"pxor %%mm7, %%mm7 \n\t" |
1872 |
"pxor %%mm7, %%mm7 \n\t" |
1865 |
"lea (%%"REG_a", %%"REG_a", 2), %%"REG_d" \n\t" |
1873 |
"lea (%%"REG_a", %%"REG_a", 2), %%"REG_d" \n\t" |
1866 |
ASMALIGN(4) |
1874 |
ASMALIGN(4) |
Lines 1918-1929
static inline void RENAME(bgr24ToY)(uint
Link Here
|
1918 |
"psraw $7, %%mm4 \n\t" |
1926 |
"psraw $7, %%mm4 \n\t" |
1919 |
|
1927 |
|
1920 |
"packuswb %%mm4, %%mm0 \n\t" |
1928 |
"packuswb %%mm4, %%mm0 \n\t" |
1921 |
"paddusb "MANGLE(bgr2YOffset)", %%mm0 \n\t" |
1929 |
"paddusb %5, %%mm0 \n\t" |
1922 |
|
1930 |
|
1923 |
"movq %%mm0, (%1, %%"REG_a") \n\t" |
1931 |
"movq %%mm0, (%1, %%"REG_a") \n\t" |
1924 |
"add $8, %%"REG_a" \n\t" |
1932 |
"add $8, %%"REG_a" \n\t" |
1925 |
" js 1b \n\t" |
1933 |
" js 1b \n\t" |
1926 |
: : "r" (src+width*3), "r" (dst+width), "g" (-width) |
1934 |
: : "r" (src+width*3), "r" (dst+width), "g" (-width), |
|
|
1935 |
"m" (bgr2YCoeff), "m" (w1111), "m" (bgr2YOffset) |
1927 |
: "%"REG_a, "%"REG_d |
1936 |
: "%"REG_a, "%"REG_d |
1928 |
); |
1937 |
); |
1929 |
#else |
1938 |
#else |
Lines 1944-1951
static inline void RENAME(bgr24ToUV)(uin
Link Here
|
1944 |
#ifdef HAVE_MMX |
1953 |
#ifdef HAVE_MMX |
1945 |
asm volatile( |
1954 |
asm volatile( |
1946 |
"mov %3, %%"REG_a" \n\t" |
1955 |
"mov %3, %%"REG_a" \n\t" |
1947 |
"movq "MANGLE(w1111)", %%mm5 \n\t" |
1956 |
"movq %4, %%mm5 \n\t" |
1948 |
"movq "MANGLE(bgr2UCoeff)", %%mm6 \n\t" |
1957 |
"movq %5, %%mm6 \n\t" |
1949 |
"pxor %%mm7, %%mm7 \n\t" |
1958 |
"pxor %%mm7, %%mm7 \n\t" |
1950 |
"lea (%%"REG_a", %%"REG_a", 2), %%"REG_d" \n\t" |
1959 |
"lea (%%"REG_a", %%"REG_a", 2), %%"REG_d" \n\t" |
1951 |
"add %%"REG_d", %%"REG_d" \n\t" |
1960 |
"add %%"REG_d", %%"REG_d" \n\t" |
Lines 1977-1984
static inline void RENAME(bgr24ToUV)(uin
Link Here
|
1977 |
"psrlw $1, %%mm0 \n\t" |
1986 |
"psrlw $1, %%mm0 \n\t" |
1978 |
"psrlw $1, %%mm2 \n\t" |
1987 |
"psrlw $1, %%mm2 \n\t" |
1979 |
#endif |
1988 |
#endif |
1980 |
"movq "MANGLE(bgr2VCoeff)", %%mm1 \n\t" |
1989 |
"movq %6, %%mm1 \n\t" |
1981 |
"movq "MANGLE(bgr2VCoeff)", %%mm3 \n\t" |
1990 |
"movq %6, %%mm3 \n\t" |
1982 |
|
1991 |
|
1983 |
"pmaddwd %%mm0, %%mm1 \n\t" |
1992 |
"pmaddwd %%mm0, %%mm1 \n\t" |
1984 |
"pmaddwd %%mm2, %%mm3 \n\t" |
1993 |
"pmaddwd %%mm2, %%mm3 \n\t" |
Lines 2019-2030
static inline void RENAME(bgr24ToUV)(uin
Link Here
|
2019 |
"punpcklbw %%mm7, %%mm5 \n\t" |
2028 |
"punpcklbw %%mm7, %%mm5 \n\t" |
2020 |
"punpcklbw %%mm7, %%mm2 \n\t" |
2029 |
"punpcklbw %%mm7, %%mm2 \n\t" |
2021 |
"paddw %%mm5, %%mm2 \n\t" |
2030 |
"paddw %%mm5, %%mm2 \n\t" |
2022 |
"movq "MANGLE(w1111)", %%mm5 \n\t" |
2031 |
"movq %4, %%mm5 \n\t" |
2023 |
"psrlw $2, %%mm4 \n\t" |
2032 |
"psrlw $2, %%mm4 \n\t" |
2024 |
"psrlw $2, %%mm2 \n\t" |
2033 |
"psrlw $2, %%mm2 \n\t" |
2025 |
#endif |
2034 |
#endif |
2026 |
"movq "MANGLE(bgr2VCoeff)", %%mm1 \n\t" |
2035 |
"movq %6, %%mm1 \n\t" |
2027 |
"movq "MANGLE(bgr2VCoeff)", %%mm3 \n\t" |
2036 |
"movq %6, %%mm3 \n\t" |
2028 |
|
2037 |
|
2029 |
"pmaddwd %%mm4, %%mm1 \n\t" |
2038 |
"pmaddwd %%mm4, %%mm1 \n\t" |
2030 |
"pmaddwd %%mm2, %%mm3 \n\t" |
2039 |
"pmaddwd %%mm2, %%mm3 \n\t" |
Lines 2048-2061
static inline void RENAME(bgr24ToUV)(uin
Link Here
|
2048 |
"punpckldq %%mm4, %%mm0 \n\t" |
2057 |
"punpckldq %%mm4, %%mm0 \n\t" |
2049 |
"punpckhdq %%mm4, %%mm1 \n\t" |
2058 |
"punpckhdq %%mm4, %%mm1 \n\t" |
2050 |
"packsswb %%mm1, %%mm0 \n\t" |
2059 |
"packsswb %%mm1, %%mm0 \n\t" |
2051 |
"paddb "MANGLE(bgr2UVOffset)", %%mm0 \n\t" |
2060 |
"paddb %7, %%mm0 \n\t" |
2052 |
|
2061 |
|
2053 |
"movd %%mm0, (%1, %%"REG_a") \n\t" |
2062 |
"movd %%mm0, (%1, %%"REG_a") \n\t" |
2054 |
"punpckhdq %%mm0, %%mm0 \n\t" |
2063 |
"punpckhdq %%mm0, %%mm0 \n\t" |
2055 |
"movd %%mm0, (%2, %%"REG_a") \n\t" |
2064 |
"movd %%mm0, (%2, %%"REG_a") \n\t" |
2056 |
"add $4, %%"REG_a" \n\t" |
2065 |
"add $4, %%"REG_a" \n\t" |
2057 |
" js 1b \n\t" |
2066 |
" js 1b \n\t" |
2058 |
: : "r" (src1+width*6), "r" (dstU+width), "r" (dstV+width), "g" (-width) |
2067 |
: : "r" (src1+width*6), "r" (dstU+width), "r" (dstV+width), "g" (-width), |
|
|
2068 |
"m" (w1111), "m" (bgr2UCoeff), "m" (bgr2VCoeff), "m" (bgr2UVOffset) |
2059 |
: "%"REG_a, "%"REG_d |
2069 |
: "%"REG_a, "%"REG_d |
2060 |
); |
2070 |
); |
2061 |
#else |
2071 |
#else |
Lines 2313-2319
static inline void RENAME(hScale)(int16_
Link Here
|
2313 |
"push %%"REG_b" \n\t" |
2323 |
"push %%"REG_b" \n\t" |
2314 |
#endif |
2324 |
#endif |
2315 |
"pxor %%mm7, %%mm7 \n\t" |
2325 |
"pxor %%mm7, %%mm7 \n\t" |
2316 |
"movq "MANGLE(w02)", %%mm6 \n\t" |
2326 |
"movq %5, %%mm6 \n\t" |
2317 |
"push %%"REG_BP" \n\t" // we use 7 regs here ... |
2327 |
"push %%"REG_BP" \n\t" // we use 7 regs here ... |
2318 |
"mov %%"REG_a", %%"REG_BP" \n\t" |
2328 |
"mov %%"REG_a", %%"REG_BP" \n\t" |
2319 |
ASMALIGN(4) |
2329 |
ASMALIGN(4) |
Lines 2342-2348
static inline void RENAME(hScale)(int16_
Link Here
|
2342 |
"pop %%"REG_b" \n\t" |
2352 |
"pop %%"REG_b" \n\t" |
2343 |
#endif |
2353 |
#endif |
2344 |
: "+a" (counter) |
2354 |
: "+a" (counter) |
2345 |
: "c" (filter), "d" (filterPos), "S" (src), "D" (dst) |
2355 |
: "c" (filter), "d" (filterPos), "S" (src), "D" (dst), "m" (w02) |
2346 |
#if !defined(PIC) |
2356 |
#if !defined(PIC) |
2347 |
: "%"REG_b |
2357 |
: "%"REG_b |
2348 |
#endif |
2358 |
#endif |
Lines 2359-2365
static inline void RENAME(hScale)(int16_
Link Here
|
2359 |
"push %%"REG_b" \n\t" |
2369 |
"push %%"REG_b" \n\t" |
2360 |
#endif |
2370 |
#endif |
2361 |
"pxor %%mm7, %%mm7 \n\t" |
2371 |
"pxor %%mm7, %%mm7 \n\t" |
2362 |
"movq "MANGLE(w02)", %%mm6 \n\t" |
2372 |
"movq %5, %%mm6 \n\t" |
2363 |
"push %%"REG_BP" \n\t" // we use 7 regs here ... |
2373 |
"push %%"REG_BP" \n\t" // we use 7 regs here ... |
2364 |
"mov %%"REG_a", %%"REG_BP" \n\t" |
2374 |
"mov %%"REG_a", %%"REG_BP" \n\t" |
2365 |
ASMALIGN(4) |
2375 |
ASMALIGN(4) |
Lines 2400-2406
static inline void RENAME(hScale)(int16_
Link Here
|
2400 |
"pop %%"REG_b" \n\t" |
2410 |
"pop %%"REG_b" \n\t" |
2401 |
#endif |
2411 |
#endif |
2402 |
: "+a" (counter) |
2412 |
: "+a" (counter) |
2403 |
: "c" (filter), "d" (filterPos), "S" (src), "D" (dst) |
2413 |
: "c" (filter), "d" (filterPos), "S" (src), "D" (dst), "m" (w02) |
2404 |
#if !defined(PIC) |
2414 |
#if !defined(PIC) |
2405 |
: "%"REG_b |
2415 |
: "%"REG_b |
2406 |
#endif |
2416 |
#endif |
Lines 2415-2421
static inline void RENAME(hScale)(int16_
Link Here
|
2415 |
dst-= counter/2; |
2425 |
dst-= counter/2; |
2416 |
asm volatile( |
2426 |
asm volatile( |
2417 |
"pxor %%mm7, %%mm7 \n\t" |
2427 |
"pxor %%mm7, %%mm7 \n\t" |
2418 |
"movq "MANGLE(w02)", %%mm6 \n\t" |
2428 |
"movq %7, %%mm6 \n\t" |
2419 |
ASMALIGN(4) |
2429 |
ASMALIGN(4) |
2420 |
"1: \n\t" |
2430 |
"1: \n\t" |
2421 |
"mov %2, %%"REG_c" \n\t" |
2431 |
"mov %2, %%"REG_c" \n\t" |
Lines 2452-2458
static inline void RENAME(hScale)(int16_
Link Here
|
2452 |
|
2462 |
|
2453 |
: "+r" (counter), "+r" (filter) |
2463 |
: "+r" (counter), "+r" (filter) |
2454 |
: "m" (filterPos), "m" (dst), "m"(offset), |
2464 |
: "m" (filterPos), "m" (dst), "m"(offset), |
2455 |
"m" (src), "r" (filterSize*2) |
2465 |
"m" (src), "r" (filterSize*2), "m"(w02) |
2456 |
: "%"REG_a, "%"REG_c, "%"REG_d |
2466 |
: "%"REG_a, "%"REG_c, "%"REG_d |
2457 |
); |
2467 |
); |
2458 |
} |
2468 |
} |