Mercurial > mplayer.hg
comparison libswscale/rgb2rgb_template.c @ 23129:9528d1ebe68f
cosmetics: Remove trailing whitespace.
author | diego |
---|---|
date | Thu, 26 Apr 2007 23:07:11 +0000 |
parents | beb4ac492c5e |
children | 10425310d2da |
comparison
equal
deleted
inserted
replaced
23128:0c4b9bc10494 | 23129:9528d1ebe68f |
---|---|
21 * GNU General Public License for more details. | 21 * GNU General Public License for more details. |
22 * | 22 * |
23 * You should have received a copy of the GNU General Public License | 23 * You should have received a copy of the GNU General Public License |
24 * along with FFmpeg; if not, write to the Free Software | 24 * along with FFmpeg; if not, write to the Free Software |
25 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | 25 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
26 * | 26 * |
27 * the C code (not assembly, mmx, ...) of this file can be used | 27 * the C code (not assembly, mmx, ...) of this file can be used |
28 * under the LGPL license too | 28 * under the LGPL license too |
29 */ | 29 */ |
30 | 30 |
31 #include <stddef.h> | 31 #include <stddef.h> |
370 "pand %%mm6, %%mm3 \n\t" | 370 "pand %%mm6, %%mm3 \n\t" |
371 "pmaddwd %%mm7, %%mm0 \n\t" | 371 "pmaddwd %%mm7, %%mm0 \n\t" |
372 "pmaddwd %%mm7, %%mm3 \n\t" | 372 "pmaddwd %%mm7, %%mm3 \n\t" |
373 "pand %%mm5, %%mm1 \n\t" | 373 "pand %%mm5, %%mm1 \n\t" |
374 "pand %%mm5, %%mm4 \n\t" | 374 "pand %%mm5, %%mm4 \n\t" |
375 "por %%mm1, %%mm0 \n\t" | 375 "por %%mm1, %%mm0 \n\t" |
376 "por %%mm4, %%mm3 \n\t" | 376 "por %%mm4, %%mm3 \n\t" |
377 "psrld $5, %%mm0 \n\t" | 377 "psrld $5, %%mm0 \n\t" |
378 "pslld $11, %%mm3 \n\t" | 378 "pslld $11, %%mm3 \n\t" |
379 "por %%mm3, %%mm0 \n\t" | 379 "por %%mm3, %%mm0 \n\t" |
380 MOVNTQ" %%mm0, (%0) \n\t" | 380 MOVNTQ" %%mm0, (%0) \n\t" |
529 "pand %%mm6, %%mm3 \n\t" | 529 "pand %%mm6, %%mm3 \n\t" |
530 "pmaddwd %%mm7, %%mm0 \n\t" | 530 "pmaddwd %%mm7, %%mm0 \n\t" |
531 "pmaddwd %%mm7, %%mm3 \n\t" | 531 "pmaddwd %%mm7, %%mm3 \n\t" |
532 "pand %%mm5, %%mm1 \n\t" | 532 "pand %%mm5, %%mm1 \n\t" |
533 "pand %%mm5, %%mm4 \n\t" | 533 "pand %%mm5, %%mm4 \n\t" |
534 "por %%mm1, %%mm0 \n\t" | 534 "por %%mm1, %%mm0 \n\t" |
535 "por %%mm4, %%mm3 \n\t" | 535 "por %%mm4, %%mm3 \n\t" |
536 "psrld $6, %%mm0 \n\t" | 536 "psrld $6, %%mm0 \n\t" |
537 "pslld $10, %%mm3 \n\t" | 537 "pslld $10, %%mm3 \n\t" |
538 "por %%mm3, %%mm0 \n\t" | 538 "por %%mm3, %%mm0 \n\t" |
539 MOVNTQ" %%mm0, (%0) \n\t" | 539 MOVNTQ" %%mm0, (%0) \n\t" |
976 "por %%mm4, %%mm3\n\t" | 976 "por %%mm4, %%mm3\n\t" |
977 "por %%mm5, %%mm3\n\t" | 977 "por %%mm5, %%mm3\n\t" |
978 | 978 |
979 "movq %%mm0, %%mm6\n\t" | 979 "movq %%mm0, %%mm6\n\t" |
980 "movq %%mm3, %%mm7\n\t" | 980 "movq %%mm3, %%mm7\n\t" |
981 | 981 |
982 "movq 8%1, %%mm0\n\t" | 982 "movq 8%1, %%mm0\n\t" |
983 "movq 8%1, %%mm1\n\t" | 983 "movq 8%1, %%mm1\n\t" |
984 "movq 8%1, %%mm2\n\t" | 984 "movq 8%1, %%mm2\n\t" |
985 "pand %2, %%mm0\n\t" | 985 "pand %2, %%mm0\n\t" |
986 "pand %3, %%mm1\n\t" | 986 "pand %3, %%mm1\n\t" |
1013 __asm __volatile( | 1013 __asm __volatile( |
1014 "movq %%mm0, %%mm4\n\t" | 1014 "movq %%mm0, %%mm4\n\t" |
1015 "movq %%mm3, %%mm5\n\t" | 1015 "movq %%mm3, %%mm5\n\t" |
1016 "movq %%mm6, %%mm0\n\t" | 1016 "movq %%mm6, %%mm0\n\t" |
1017 "movq %%mm7, %%mm1\n\t" | 1017 "movq %%mm7, %%mm1\n\t" |
1018 | 1018 |
1019 "movq %%mm4, %%mm6\n\t" | 1019 "movq %%mm4, %%mm6\n\t" |
1020 "movq %%mm5, %%mm7\n\t" | 1020 "movq %%mm5, %%mm7\n\t" |
1021 "movq %%mm0, %%mm2\n\t" | 1021 "movq %%mm0, %%mm2\n\t" |
1022 "movq %%mm1, %%mm3\n\t" | 1022 "movq %%mm1, %%mm3\n\t" |
1023 | 1023 |
1115 "por %%mm2, %%mm0\n\t" | 1115 "por %%mm2, %%mm0\n\t" |
1116 "psllq $8, %%mm4\n\t" | 1116 "psllq $8, %%mm4\n\t" |
1117 "psllq $16, %%mm5\n\t" | 1117 "psllq $16, %%mm5\n\t" |
1118 "por %%mm4, %%mm3\n\t" | 1118 "por %%mm4, %%mm3\n\t" |
1119 "por %%mm5, %%mm3\n\t" | 1119 "por %%mm5, %%mm3\n\t" |
1120 | 1120 |
1121 "movq %%mm0, %%mm6\n\t" | 1121 "movq %%mm0, %%mm6\n\t" |
1122 "movq %%mm3, %%mm7\n\t" | 1122 "movq %%mm3, %%mm7\n\t" |
1123 | 1123 |
1124 "movq 8%1, %%mm0\n\t" | 1124 "movq 8%1, %%mm0\n\t" |
1125 "movq 8%1, %%mm1\n\t" | 1125 "movq 8%1, %%mm1\n\t" |
1146 "psllq $8, %%mm4\n\t" | 1146 "psllq $8, %%mm4\n\t" |
1147 "psllq $16, %%mm5\n\t" | 1147 "psllq $16, %%mm5\n\t" |
1148 "por %%mm4, %%mm3\n\t" | 1148 "por %%mm4, %%mm3\n\t" |
1149 "por %%mm5, %%mm3\n\t" | 1149 "por %%mm5, %%mm3\n\t" |
1150 :"=m"(*d) | 1150 :"=m"(*d) |
1151 :"m"(*s),"m"(mask16b),"m"(mask16g),"m"(mask16r),"m"(mmx_null) | 1151 :"m"(*s),"m"(mask16b),"m"(mask16g),"m"(mask16r),"m"(mmx_null) |
1152 :"memory"); | 1152 :"memory"); |
1153 /* Borrowed 32 to 24 */ | 1153 /* Borrowed 32 to 24 */ |
1154 __asm __volatile( | 1154 __asm __volatile( |
1155 "movq %%mm0, %%mm4\n\t" | 1155 "movq %%mm0, %%mm4\n\t" |
1156 "movq %%mm3, %%mm5\n\t" | 1156 "movq %%mm3, %%mm5\n\t" |
1157 "movq %%mm6, %%mm0\n\t" | 1157 "movq %%mm6, %%mm0\n\t" |
1158 "movq %%mm7, %%mm1\n\t" | 1158 "movq %%mm7, %%mm1\n\t" |
1159 | 1159 |
1160 "movq %%mm4, %%mm6\n\t" | 1160 "movq %%mm4, %%mm6\n\t" |
1161 "movq %%mm5, %%mm7\n\t" | 1161 "movq %%mm5, %%mm7\n\t" |
1162 "movq %%mm0, %%mm2\n\t" | 1162 "movq %%mm0, %%mm2\n\t" |
1163 "movq %%mm1, %%mm3\n\t" | 1163 "movq %%mm1, %%mm3\n\t" |
1164 | 1164 |
1449 "psllq $16, %%mm0 \n\t" // 00 BGR BGR | 1449 "psllq $16, %%mm0 \n\t" // 00 BGR BGR |
1450 "pand %%mm5, %%mm0 \n\t" | 1450 "pand %%mm5, %%mm0 \n\t" |
1451 "pand %%mm6, %%mm1 \n\t" | 1451 "pand %%mm6, %%mm1 \n\t" |
1452 "pand %%mm7, %%mm2 \n\t" | 1452 "pand %%mm7, %%mm2 \n\t" |
1453 "por %%mm0, %%mm1 \n\t" | 1453 "por %%mm0, %%mm1 \n\t" |
1454 "por %%mm2, %%mm1 \n\t" | 1454 "por %%mm2, %%mm1 \n\t" |
1455 "movq 6(%1, %%"REG_a"), %%mm0 \n\t" // BGR BGR BG | 1455 "movq 6(%1, %%"REG_a"), %%mm0 \n\t" // BGR BGR BG |
1456 MOVNTQ" %%mm1, (%2, %%"REG_a")\n\t" // RGB RGB RG | 1456 MOVNTQ" %%mm1, (%2, %%"REG_a")\n\t" // RGB RGB RG |
1457 "movq 8(%1, %%"REG_a"), %%mm1 \n\t" // R BGR BGR B | 1457 "movq 8(%1, %%"REG_a"), %%mm1 \n\t" // R BGR BGR B |
1458 "movq 10(%1, %%"REG_a"), %%mm2 \n\t" // GR BGR BGR | 1458 "movq 10(%1, %%"REG_a"), %%mm2 \n\t" // GR BGR BGR |
1459 "pand %%mm7, %%mm0 \n\t" | 1459 "pand %%mm7, %%mm0 \n\t" |
1460 "pand %%mm5, %%mm1 \n\t" | 1460 "pand %%mm5, %%mm1 \n\t" |
1461 "pand %%mm6, %%mm2 \n\t" | 1461 "pand %%mm6, %%mm2 \n\t" |
1462 "por %%mm0, %%mm1 \n\t" | 1462 "por %%mm0, %%mm1 \n\t" |
1463 "por %%mm2, %%mm1 \n\t" | 1463 "por %%mm2, %%mm1 \n\t" |
1464 "movq 14(%1, %%"REG_a"), %%mm0 \n\t" // R BGR BGR B | 1464 "movq 14(%1, %%"REG_a"), %%mm0 \n\t" // R BGR BGR B |
1465 MOVNTQ" %%mm1, 8(%2, %%"REG_a")\n\t" // B RGB RGB R | 1465 MOVNTQ" %%mm1, 8(%2, %%"REG_a")\n\t" // B RGB RGB R |
1466 "movq 16(%1, %%"REG_a"), %%mm1 \n\t" // GR BGR BGR | 1466 "movq 16(%1, %%"REG_a"), %%mm1 \n\t" // GR BGR BGR |
1467 "movq 18(%1, %%"REG_a"), %%mm2 \n\t" // BGR BGR BG | 1467 "movq 18(%1, %%"REG_a"), %%mm2 \n\t" // BGR BGR BG |
1468 "pand %%mm6, %%mm0 \n\t" | 1468 "pand %%mm6, %%mm0 \n\t" |
1469 "pand %%mm7, %%mm1 \n\t" | 1469 "pand %%mm7, %%mm1 \n\t" |
1470 "pand %%mm5, %%mm2 \n\t" | 1470 "pand %%mm5, %%mm2 \n\t" |
1471 "por %%mm0, %%mm1 \n\t" | 1471 "por %%mm0, %%mm1 \n\t" |
1472 "por %%mm2, %%mm1 \n\t" | 1472 "por %%mm2, %%mm1 \n\t" |
1473 MOVNTQ" %%mm1, 16(%2, %%"REG_a")\n\t" | 1473 MOVNTQ" %%mm1, 16(%2, %%"REG_a")\n\t" |
1474 "add $24, %%"REG_a" \n\t" | 1474 "add $24, %%"REG_a" \n\t" |
1475 " js 1b \n\t" | 1475 " js 1b \n\t" |
1476 "2: \n\t" | 1476 "2: \n\t" |
1477 : "+a" (mmx_size) | 1477 : "+a" (mmx_size) |
1906 } | 1906 } |
1907 | 1907 |
1908 static inline void RENAME(planar2x)(const uint8_t *src, uint8_t *dst, long srcWidth, long srcHeight, long srcStride, long dstStride) | 1908 static inline void RENAME(planar2x)(const uint8_t *src, uint8_t *dst, long srcWidth, long srcHeight, long srcStride, long dstStride) |
1909 { | 1909 { |
1910 long x,y; | 1910 long x,y; |
1911 | 1911 |
1912 dst[0]= src[0]; | 1912 dst[0]= src[0]; |
1913 | 1913 |
1914 // first line | 1914 // first line |
1915 for(x=0; x<srcWidth-1; x++){ | 1915 for(x=0; x<srcWidth-1; x++){ |
1916 dst[2*x+1]= (3*src[x] + src[x+1])>>2; | 1916 dst[2*x+1]= (3*src[x] + src[x+1])>>2; |
1917 dst[2*x+2]= ( src[x] + 3*src[x+1])>>2; | 1917 dst[2*x+2]= ( src[x] + 3*src[x+1])>>2; |
1918 } | 1918 } |
1919 dst[2*srcWidth-1]= src[srcWidth-1]; | 1919 dst[2*srcWidth-1]= src[srcWidth-1]; |
1920 | 1920 |
1921 dst+= dstStride; | 1921 dst+= dstStride; |
1922 | 1922 |
1923 for(y=1; y<srcHeight; y++){ | 1923 for(y=1; y<srcHeight; y++){ |
1924 #if defined (HAVE_MMX2) || defined (HAVE_3DNOW) | 1924 #if defined (HAVE_MMX2) || defined (HAVE_3DNOW) |
1925 const long mmxSize= srcWidth&~15; | 1925 const long mmxSize= srcWidth&~15; |
1981 dst[srcWidth*2 -1 + dstStride]= ( src[srcWidth-1] + 3*src[srcWidth-1 + srcStride])>>2; | 1981 dst[srcWidth*2 -1 + dstStride]= ( src[srcWidth-1] + 3*src[srcWidth-1 + srcStride])>>2; |
1982 | 1982 |
1983 dst+=dstStride*2; | 1983 dst+=dstStride*2; |
1984 src+=srcStride; | 1984 src+=srcStride; |
1985 } | 1985 } |
1986 | 1986 |
1987 // last line | 1987 // last line |
1988 #if 1 | 1988 #if 1 |
1989 dst[0]= src[0]; | 1989 dst[0]= src[0]; |
1990 | 1990 |
1991 for(x=0; x<srcWidth-1; x++){ | 1991 for(x=0; x<srcWidth-1; x++){ |
1992 dst[2*x+1]= (3*src[x] + src[x+1])>>2; | 1992 dst[2*x+1]= (3*src[x] + src[x+1])>>2; |
1993 dst[2*x+2]= ( src[x] + 3*src[x+1])>>2; | 1993 dst[2*x+2]= ( src[x] + 3*src[x+1])>>2; |
1994 } | 1994 } |
1995 dst[2*srcWidth-1]= src[srcWidth-1]; | 1995 dst[2*srcWidth-1]= src[srcWidth-1]; |
2655 "punpcklbw %%mm2, %%mm1\n\t" /* U0V0 U0V0 U1V1 U1V1*/ | 2655 "punpcklbw %%mm2, %%mm1\n\t" /* U0V0 U0V0 U1V1 U1V1*/ |
2656 "punpcklbw %%mm1, %%mm0\n\t" /* Y0U0 Y1V0 Y2U0 Y3V0*/ | 2656 "punpcklbw %%mm1, %%mm0\n\t" /* Y0U0 Y1V0 Y2U0 Y3V0*/ |
2657 "punpckhbw %%mm1, %%mm3\n\t" /* Y4U1 Y5V1 Y6U1 Y7V1*/ | 2657 "punpckhbw %%mm1, %%mm3\n\t" /* Y4U1 Y5V1 Y6U1 Y7V1*/ |
2658 MOVNTQ" %%mm0, (%4, %0, 8)\n\t" | 2658 MOVNTQ" %%mm0, (%4, %0, 8)\n\t" |
2659 MOVNTQ" %%mm3, 8(%4, %0, 8)\n\t" | 2659 MOVNTQ" %%mm3, 8(%4, %0, 8)\n\t" |
2660 | 2660 |
2661 "punpckhbw %%mm2, %%mm6\n\t" /* U2V2 U2V2 U3V3 U3V3*/ | 2661 "punpckhbw %%mm2, %%mm6\n\t" /* U2V2 U2V2 U3V3 U3V3*/ |
2662 "movq 8(%1, %0, 4), %%mm0\n\t" | 2662 "movq 8(%1, %0, 4), %%mm0\n\t" |
2663 "movq %%mm0, %%mm3\n\t" | 2663 "movq %%mm0, %%mm3\n\t" |
2664 "punpcklbw %%mm6, %%mm0\n\t" /* Y U2 Y V2 Y U2 Y V2*/ | 2664 "punpcklbw %%mm6, %%mm0\n\t" /* Y U2 Y V2 Y U2 Y V2*/ |
2665 "punpckhbw %%mm6, %%mm3\n\t" /* Y U3 Y V3 Y U3 Y V3*/ | 2665 "punpckhbw %%mm6, %%mm3\n\t" /* Y U3 Y V3 Y U3 Y V3*/ |
2672 "punpcklbw %%mm5, %%mm4\n\t" | 2672 "punpcklbw %%mm5, %%mm4\n\t" |
2673 "punpcklbw %%mm4, %%mm0\n\t" /* Y U4 Y V4 Y U4 Y V4*/ | 2673 "punpcklbw %%mm4, %%mm0\n\t" /* Y U4 Y V4 Y U4 Y V4*/ |
2674 "punpckhbw %%mm4, %%mm3\n\t" /* Y U5 Y V5 Y U5 Y V5*/ | 2674 "punpckhbw %%mm4, %%mm3\n\t" /* Y U5 Y V5 Y U5 Y V5*/ |
2675 MOVNTQ" %%mm0, 32(%4, %0, 8)\n\t" | 2675 MOVNTQ" %%mm0, 32(%4, %0, 8)\n\t" |
2676 MOVNTQ" %%mm3, 40(%4, %0, 8)\n\t" | 2676 MOVNTQ" %%mm3, 40(%4, %0, 8)\n\t" |
2677 | 2677 |
2678 "punpckhbw %%mm5, %%mm6\n\t" | 2678 "punpckhbw %%mm5, %%mm6\n\t" |
2679 "movq 24(%1, %0, 4), %%mm0\n\t" | 2679 "movq 24(%1, %0, 4), %%mm0\n\t" |
2680 "movq %%mm0, %%mm3\n\t" | 2680 "movq %%mm0, %%mm3\n\t" |
2681 "punpcklbw %%mm6, %%mm0\n\t" /* Y U6 Y V6 Y U6 Y V6*/ | 2681 "punpcklbw %%mm6, %%mm0\n\t" /* Y U6 Y V6 Y U6 Y V6*/ |
2682 "punpckhbw %%mm6, %%mm3\n\t" /* Y U7 Y V7 Y U7 Y V7*/ | 2682 "punpckhbw %%mm6, %%mm3\n\t" /* Y U7 Y V7 Y U7 Y V7*/ |