annotate libswscale/rgb2rgb_template.c @ 27404:778fac8c186f

Add separate variables for CFLAGS that are specific to internal libraries and only add them to CFLAGS when compiling objects from those libraries.
author diego
date Thu, 07 Aug 2008 21:46:06 +0000
parents 65b8334df960
children e05965c550fc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1 /*
27158
65b8334df960 spelling/grammar/wording overhaul
diego
parents: 26925
diff changeset
2 * software RGB to RGB converter
65b8334df960 spelling/grammar/wording overhaul
diego
parents: 26925
diff changeset
3 * pluralize by software PAL8 to RGB converter
65b8334df960 spelling/grammar/wording overhaul
diego
parents: 26925
diff changeset
4 * software YUV to YUV converter
65b8334df960 spelling/grammar/wording overhaul
diego
parents: 26925
diff changeset
5 * software YUV to RGB converter
65b8334df960 spelling/grammar/wording overhaul
diego
parents: 26925
diff changeset
6 * Written by Nick Kurshev.
65b8334df960 spelling/grammar/wording overhaul
diego
parents: 26925
diff changeset
7 * palette & YUV & runtime CPU stuff by Michael (michaelni@gmx.at)
65b8334df960 spelling/grammar/wording overhaul
diego
parents: 26925
diff changeset
8 * lot of big-endian byte order fixes by Alex Beregszaszi
19703
ad7f49a1ba95 Add official GPL header to make license explicit as discussed on ffmpeg-devel.
diego
parents: 19396
diff changeset
9 *
20094
aca9e9783f67 Change license headers to say 'FFmpeg' instead of 'this program'.
diego
parents: 19703
diff changeset
10 * This file is part of FFmpeg.
aca9e9783f67 Change license headers to say 'FFmpeg' instead of 'this program'.
diego
parents: 19703
diff changeset
11 *
aca9e9783f67 Change license headers to say 'FFmpeg' instead of 'this program'.
diego
parents: 19703
diff changeset
12 * FFmpeg is free software; you can redistribute it and/or modify
19703
ad7f49a1ba95 Add official GPL header to make license explicit as discussed on ffmpeg-devel.
diego
parents: 19396
diff changeset
13 * it under the terms of the GNU General Public License as published by
ad7f49a1ba95 Add official GPL header to make license explicit as discussed on ffmpeg-devel.
diego
parents: 19396
diff changeset
14 * the Free Software Foundation; either version 2 of the License, or
ad7f49a1ba95 Add official GPL header to make license explicit as discussed on ffmpeg-devel.
diego
parents: 19396
diff changeset
15 * (at your option) any later version.
ad7f49a1ba95 Add official GPL header to make license explicit as discussed on ffmpeg-devel.
diego
parents: 19396
diff changeset
16 *
20094
aca9e9783f67 Change license headers to say 'FFmpeg' instead of 'this program'.
diego
parents: 19703
diff changeset
17 * FFmpeg is distributed in the hope that it will be useful,
19703
ad7f49a1ba95 Add official GPL header to make license explicit as discussed on ffmpeg-devel.
diego
parents: 19396
diff changeset
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ad7f49a1ba95 Add official GPL header to make license explicit as discussed on ffmpeg-devel.
diego
parents: 19396
diff changeset
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ad7f49a1ba95 Add official GPL header to make license explicit as discussed on ffmpeg-devel.
diego
parents: 19396
diff changeset
20 * GNU General Public License for more details.
ad7f49a1ba95 Add official GPL header to make license explicit as discussed on ffmpeg-devel.
diego
parents: 19396
diff changeset
21 *
ad7f49a1ba95 Add official GPL header to make license explicit as discussed on ffmpeg-devel.
diego
parents: 19396
diff changeset
22 * You should have received a copy of the GNU General Public License
20094
aca9e9783f67 Change license headers to say 'FFmpeg' instead of 'this program'.
diego
parents: 19703
diff changeset
23 * along with FFmpeg; if not, write to the Free Software
23702
5159b5f8784e license header consistency cosmetics
diego
parents: 23536
diff changeset
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23129
9528d1ebe68f cosmetics: Remove trailing whitespace.
diego
parents: 23004
diff changeset
25 *
27158
65b8334df960 spelling/grammar/wording overhaul
diego
parents: 26925
diff changeset
26 * The C code (not assembly, MMX, ...) of this file can be used
25109
a362a3b42e24 comment spelling/grammar fixes
diego
parents: 23702
diff changeset
27 * under the LGPL license.
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
28 */
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
29
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
30 #include <stddef.h>
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
31 #include <inttypes.h> /* for __WORDSIZE */
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
32
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
33 #ifndef __WORDSIZE
25109
a362a3b42e24 comment spelling/grammar fixes
diego
parents: 23702
diff changeset
34 // #warning You have a misconfigured system and will probably lose performance!
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
35 #define __WORDSIZE MP_WORDSIZE
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
36 #endif
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
37
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
38 #undef PREFETCH
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
39 #undef MOVNTQ
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
40 #undef EMMS
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
41 #undef SFENCE
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
42 #undef MMREG_SIZE
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
43 #undef PREFETCHW
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
44 #undef PAVGB
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
45
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
46 #ifdef HAVE_SSE2
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
47 #define MMREG_SIZE 16
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
48 #else
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
49 #define MMREG_SIZE 8
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
50 #endif
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
51
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
52 #ifdef HAVE_3DNOW
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
53 #define PREFETCH "prefetch"
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
54 #define PREFETCHW "prefetchw"
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
55 #define PAVGB "pavgusb"
25749
8d082a234a6d Remove non cosmetic spaces inside parentheses.
benoit
parents: 25109
diff changeset
56 #elif defined (HAVE_MMX2)
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
57 #define PREFETCH "prefetchnta"
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
58 #define PREFETCHW "prefetcht0"
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
59 #define PAVGB "pavgb"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
60 #else
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
61 #ifdef __APPLE__
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
62 #define PREFETCH "#"
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
63 #define PREFETCHW "#"
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
64 #else
20724
b8fe18a742ce Fix MacIntel build: "/nop" is illegal on Apple's older version of GAS
gpoirier
parents: 20094
diff changeset
65 #define PREFETCH " # nop"
b8fe18a742ce Fix MacIntel build: "/nop" is illegal on Apple's older version of GAS
gpoirier
parents: 20094
diff changeset
66 #define PREFETCHW " # nop"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
67 #endif
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
68 #endif
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
69
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
70 #ifdef HAVE_3DNOW
25109
a362a3b42e24 comment spelling/grammar fixes
diego
parents: 23702
diff changeset
71 /* On K6 femms is faster than emms. On K7 femms is directly mapped on emms. */
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
72 #define EMMS "femms"
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
73 #else
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
74 #define EMMS "emms"
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
75 #endif
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
76
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
77 #ifdef HAVE_MMX2
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
78 #define MOVNTQ "movntq"
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
79 #define SFENCE "sfence"
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
80 #else
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
81 #define MOVNTQ "movq"
20724
b8fe18a742ce Fix MacIntel build: "/nop" is illegal on Apple's older version of GAS
gpoirier
parents: 20094
diff changeset
82 #define SFENCE " # nop"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
83 #endif
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
84
25750
06bf0eb70a55 Cosmetics: whitespaces
benoit
parents: 25749
diff changeset
85 static inline void RENAME(rgb24to32)(const uint8_t *src, uint8_t *dst, long src_size)
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
86 {
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
87 uint8_t *dest = dst;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
88 const uint8_t *s = src;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
89 const uint8_t *end;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
90 #ifdef HAVE_MMX
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
91 const uint8_t *mm_end;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
92 #endif
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
93 end = s + src_size;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
94 #ifdef HAVE_MMX
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
95 asm volatile(PREFETCH" %0"::"m"(*s):"memory");
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
96 mm_end = end - 23;
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
97 asm volatile("movq %0, %%mm7"::"m"(mask32):"memory");
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
98 while (s < mm_end)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
99 {
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
100 asm volatile(
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
101 PREFETCH" 32%1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
102 "movd %1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
103 "punpckldq 3%1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
104 "movd 6%1, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
105 "punpckldq 9%1, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
106 "movd 12%1, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
107 "punpckldq 15%1, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
108 "movd 18%1, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
109 "punpckldq 21%1, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
110 "pand %%mm7, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
111 "pand %%mm7, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
112 "pand %%mm7, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
113 "pand %%mm7, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
114 MOVNTQ" %%mm0, %0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
115 MOVNTQ" %%mm1, 8%0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
116 MOVNTQ" %%mm2, 16%0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
117 MOVNTQ" %%mm3, 24%0"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
118 :"=m"(*dest)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
119 :"m"(*s)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
120 :"memory");
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
121 dest += 32;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
122 s += 24;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
123 }
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
124 asm volatile(SFENCE:::"memory");
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
125 asm volatile(EMMS:::"memory");
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
126 #endif
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
127 while (s < end)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
128 {
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
129 #ifdef WORDS_BIGENDIAN
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
130 /* RGB24 (= R,G,B) -> RGB32 (= A,B,G,R) */
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
131 *dest++ = 0;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
132 *dest++ = s[2];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
133 *dest++ = s[1];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
134 *dest++ = s[0];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
135 s+=3;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
136 #else
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
137 *dest++ = *s++;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
138 *dest++ = *s++;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
139 *dest++ = *s++;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
140 *dest++ = 0;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
141 #endif
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
142 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
143 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
144
25750
06bf0eb70a55 Cosmetics: whitespaces
benoit
parents: 25749
diff changeset
145 static inline void RENAME(rgb32to24)(const uint8_t *src, uint8_t *dst, long src_size)
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
146 {
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
147 uint8_t *dest = dst;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
148 const uint8_t *s = src;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
149 const uint8_t *end;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
150 #ifdef HAVE_MMX
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
151 const uint8_t *mm_end;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
152 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
153 end = s + src_size;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
154 #ifdef HAVE_MMX
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
155 asm volatile(PREFETCH" %0"::"m"(*s):"memory");
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
156 mm_end = end - 31;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
157 while (s < mm_end)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
158 {
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
159 asm volatile(
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
160 PREFETCH" 32%1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
161 "movq %1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
162 "movq 8%1, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
163 "movq 16%1, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
164 "movq 24%1, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
165 "movq %%mm0, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
166 "movq %%mm1, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
167 "movq %%mm4, %%mm6 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
168 "movq %%mm5, %%mm7 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
169 "psrlq $8, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
170 "psrlq $8, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
171 "psrlq $8, %%mm6 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
172 "psrlq $8, %%mm7 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
173 "pand %2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
174 "pand %2, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
175 "pand %2, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
176 "pand %2, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
177 "pand %3, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
178 "pand %3, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
179 "pand %3, %%mm6 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
180 "pand %3, %%mm7 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
181 "por %%mm2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
182 "por %%mm3, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
183 "por %%mm6, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
184 "por %%mm7, %%mm5 \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
185
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
186 "movq %%mm1, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
187 "movq %%mm4, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
188 "psllq $48, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
189 "psllq $32, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
190 "pand %4, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
191 "pand %5, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
192 "por %%mm2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
193 "psrlq $16, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
194 "psrlq $32, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
195 "psllq $16, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
196 "por %%mm3, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
197 "pand %6, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
198 "por %%mm5, %%mm4 \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
199
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
200 MOVNTQ" %%mm0, %0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
201 MOVNTQ" %%mm1, 8%0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
202 MOVNTQ" %%mm4, 16%0"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
203 :"=m"(*dest)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
204 :"m"(*s),"m"(mask24l),
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
205 "m"(mask24h),"m"(mask24hh),"m"(mask24hhh),"m"(mask24hhhh)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
206 :"memory");
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
207 dest += 24;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
208 s += 32;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
209 }
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
210 asm volatile(SFENCE:::"memory");
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
211 asm volatile(EMMS:::"memory");
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
212 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
213 while (s < end)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
214 {
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
215 #ifdef WORDS_BIGENDIAN
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
216 /* RGB32 (= A,B,G,R) -> RGB24 (= R,G,B) */
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
217 s++;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
218 dest[2] = *s++;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
219 dest[1] = *s++;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
220 dest[0] = *s++;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
221 dest += 3;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
222 #else
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
223 *dest++ = *s++;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
224 *dest++ = *s++;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
225 *dest++ = *s++;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
226 s++;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
227 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
228 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
229 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
230
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
231 /*
27158
65b8334df960 spelling/grammar/wording overhaul
diego
parents: 26925
diff changeset
232 original by Strepto/Astral
65b8334df960 spelling/grammar/wording overhaul
diego
parents: 26925
diff changeset
233 ported to gcc & bugfixed: A'rpi
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
234 MMX2, 3DNOW optimization by Nick Kurshev
27158
65b8334df960 spelling/grammar/wording overhaul
diego
parents: 26925
diff changeset
235 32-bit C version, and and&add trick by Michael Niedermayer
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
236 */
25750
06bf0eb70a55 Cosmetics: whitespaces
benoit
parents: 25749
diff changeset
237 static inline void RENAME(rgb15to16)(const uint8_t *src, uint8_t *dst, long src_size)
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
238 {
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
239 register const uint8_t* s=src;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
240 register uint8_t* d=dst;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
241 register const uint8_t *end;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
242 const uint8_t *mm_end;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
243 end = s + src_size;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
244 #ifdef HAVE_MMX
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
245 asm volatile(PREFETCH" %0"::"m"(*s));
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
246 asm volatile("movq %0, %%mm4"::"m"(mask15s));
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
247 mm_end = end - 15;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
248 while (s<mm_end)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
249 {
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
250 asm volatile(
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
251 PREFETCH" 32%1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
252 "movq %1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
253 "movq 8%1, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
254 "movq %%mm0, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
255 "movq %%mm2, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
256 "pand %%mm4, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
257 "pand %%mm4, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
258 "paddw %%mm1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
259 "paddw %%mm3, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
260 MOVNTQ" %%mm0, %0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
261 MOVNTQ" %%mm2, 8%0"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
262 :"=m"(*d)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
263 :"m"(*s)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
264 );
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
265 d+=16;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
266 s+=16;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
267 }
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
268 asm volatile(SFENCE:::"memory");
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
269 asm volatile(EMMS:::"memory");
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
270 #endif
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
271 mm_end = end - 3;
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
272 while (s < mm_end)
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
273 {
26910
da8e02081774 add const, suppress warnings
bcoudurier
parents: 26909
diff changeset
274 register unsigned x= *((const uint32_t *)s);
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
275 *((uint32_t *)d) = (x&0x7FFF7FFF) + (x&0x7FE07FE0);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
276 d+=4;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
277 s+=4;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
278 }
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
279 if (s < end)
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
280 {
26910
da8e02081774 add const, suppress warnings
bcoudurier
parents: 26909
diff changeset
281 register unsigned short x= *((const uint16_t *)s);
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
282 *((uint16_t *)d) = (x&0x7FFF) + (x&0x7FE0);
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
283 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
284 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
285
25750
06bf0eb70a55 Cosmetics: whitespaces
benoit
parents: 25749
diff changeset
286 static inline void RENAME(rgb16to15)(const uint8_t *src, uint8_t *dst, long src_size)
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
287 {
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
288 register const uint8_t* s=src;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
289 register uint8_t* d=dst;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
290 register const uint8_t *end;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
291 const uint8_t *mm_end;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
292 end = s + src_size;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
293 #ifdef HAVE_MMX
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
294 asm volatile(PREFETCH" %0"::"m"(*s));
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
295 asm volatile("movq %0, %%mm7"::"m"(mask15rg));
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
296 asm volatile("movq %0, %%mm6"::"m"(mask15b));
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
297 mm_end = end - 15;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
298 while (s<mm_end)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
299 {
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
300 asm volatile(
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
301 PREFETCH" 32%1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
302 "movq %1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
303 "movq 8%1, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
304 "movq %%mm0, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
305 "movq %%mm2, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
306 "psrlq $1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
307 "psrlq $1, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
308 "pand %%mm7, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
309 "pand %%mm7, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
310 "pand %%mm6, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
311 "pand %%mm6, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
312 "por %%mm1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
313 "por %%mm3, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
314 MOVNTQ" %%mm0, %0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
315 MOVNTQ" %%mm2, 8%0"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
316 :"=m"(*d)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
317 :"m"(*s)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
318 );
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
319 d+=16;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
320 s+=16;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
321 }
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
322 asm volatile(SFENCE:::"memory");
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
323 asm volatile(EMMS:::"memory");
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
324 #endif
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
325 mm_end = end - 3;
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
326 while (s < mm_end)
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
327 {
26925
3f6d2ca29727 restore needed cast to correct type with const
bcoudurier
parents: 26910
diff changeset
328 register uint32_t x= *((const uint32_t*)s);
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
329 *((uint32_t *)d) = ((x>>1)&0x7FE07FE0) | (x&0x001F001F);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
330 s+=4;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
331 d+=4;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
332 }
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
333 if (s < end)
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
334 {
26925
3f6d2ca29727 restore needed cast to correct type with const
bcoudurier
parents: 26910
diff changeset
335 register uint16_t x= *((const uint16_t*)s);
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
336 *((uint16_t *)d) = ((x>>1)&0x7FE0) | (x&0x001F);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
337 s+=2;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
338 d+=2;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
339 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
340 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
341
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
342 static inline void RENAME(rgb32to16)(const uint8_t *src, uint8_t *dst, long src_size)
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
343 {
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
344 const uint8_t *s = src;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
345 const uint8_t *end;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
346 #ifdef HAVE_MMX
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
347 const uint8_t *mm_end;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
348 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
349 uint16_t *d = (uint16_t *)dst;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
350 end = s + src_size;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
351 #ifdef HAVE_MMX
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
352 mm_end = end - 15;
25109
a362a3b42e24 comment spelling/grammar fixes
diego
parents: 23702
diff changeset
353 #if 1 //is faster only if multiplies are reasonably fast (FIXME figure out on which CPUs this is faster, on Athlon it is slightly faster)
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
354 asm volatile(
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
355 "movq %3, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
356 "movq %4, %%mm6 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
357 "movq %5, %%mm7 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
358 "jmp 2f \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
359 ASMALIGN(4)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
360 "1: \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
361 PREFETCH" 32(%1) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
362 "movd (%1), %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
363 "movd 4(%1), %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
364 "punpckldq 8(%1), %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
365 "punpckldq 12(%1), %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
366 "movq %%mm0, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
367 "movq %%mm3, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
368 "pand %%mm6, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
369 "pand %%mm6, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
370 "pmaddwd %%mm7, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
371 "pmaddwd %%mm7, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
372 "pand %%mm5, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
373 "pand %%mm5, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
374 "por %%mm1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
375 "por %%mm4, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
376 "psrld $5, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
377 "pslld $11, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
378 "por %%mm3, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
379 MOVNTQ" %%mm0, (%0) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
380 "add $16, %1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
381 "add $8, %0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
382 "2: \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
383 "cmp %2, %1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
384 " jb 1b \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
385 : "+r" (d), "+r"(s)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
386 : "r" (mm_end), "m" (mask3216g), "m" (mask3216br), "m" (mul3216)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
387 );
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
388 #else
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
389 asm volatile(PREFETCH" %0"::"m"(*src):"memory");
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
390 asm volatile(
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
391 "movq %0, %%mm7 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
392 "movq %1, %%mm6 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
393 ::"m"(red_16mask),"m"(green_16mask));
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
394 while (s < mm_end)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
395 {
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
396 asm volatile(
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
397 PREFETCH" 32%1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
398 "movd %1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
399 "movd 4%1, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
400 "punpckldq 8%1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
401 "punpckldq 12%1, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
402 "movq %%mm0, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
403 "movq %%mm0, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
404 "movq %%mm3, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
405 "movq %%mm3, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
406 "psrlq $3, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
407 "psrlq $3, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
408 "pand %2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
409 "pand %2, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
410 "psrlq $5, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
411 "psrlq $5, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
412 "pand %%mm6, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
413 "pand %%mm6, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
414 "psrlq $8, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
415 "psrlq $8, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
416 "pand %%mm7, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
417 "pand %%mm7, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
418 "por %%mm1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
419 "por %%mm4, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
420 "por %%mm2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
421 "por %%mm5, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
422 "psllq $16, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
423 "por %%mm3, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
424 MOVNTQ" %%mm0, %0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
425 :"=m"(*d):"m"(*s),"m"(blue_16mask):"memory");
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
426 d += 4;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
427 s += 16;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
428 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
429 #endif
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
430 asm volatile(SFENCE:::"memory");
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
431 asm volatile(EMMS:::"memory");
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
432 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
433 while (s < end)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
434 {
26910
da8e02081774 add const, suppress warnings
bcoudurier
parents: 26909
diff changeset
435 register int rgb = *(const uint32_t*)s; s += 4;
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
436 *d++ = ((rgb&0xFF)>>3) + ((rgb&0xFC00)>>5) + ((rgb&0xF80000)>>8);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
437 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
438 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
439
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
440 static inline void RENAME(rgb32tobgr16)(const uint8_t *src, uint8_t *dst, long src_size)
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
441 {
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
442 const uint8_t *s = src;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
443 const uint8_t *end;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
444 #ifdef HAVE_MMX
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
445 const uint8_t *mm_end;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
446 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
447 uint16_t *d = (uint16_t *)dst;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
448 end = s + src_size;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
449 #ifdef HAVE_MMX
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
450 asm volatile(PREFETCH" %0"::"m"(*src):"memory");
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
451 asm volatile(
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
452 "movq %0, %%mm7 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
453 "movq %1, %%mm6 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
454 ::"m"(red_16mask),"m"(green_16mask));
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
455 mm_end = end - 15;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
456 while (s < mm_end)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
457 {
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
458 asm volatile(
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
459 PREFETCH" 32%1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
460 "movd %1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
461 "movd 4%1, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
462 "punpckldq 8%1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
463 "punpckldq 12%1, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
464 "movq %%mm0, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
465 "movq %%mm0, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
466 "movq %%mm3, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
467 "movq %%mm3, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
468 "psllq $8, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
469 "psllq $8, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
470 "pand %%mm7, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
471 "pand %%mm7, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
472 "psrlq $5, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
473 "psrlq $5, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
474 "pand %%mm6, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
475 "pand %%mm6, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
476 "psrlq $19, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
477 "psrlq $19, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
478 "pand %2, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
479 "pand %2, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
480 "por %%mm1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
481 "por %%mm4, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
482 "por %%mm2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
483 "por %%mm5, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
484 "psllq $16, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
485 "por %%mm3, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
486 MOVNTQ" %%mm0, %0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
487 :"=m"(*d):"m"(*s),"m"(blue_16mask):"memory");
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
488 d += 4;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
489 s += 16;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
490 }
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
491 asm volatile(SFENCE:::"memory");
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
492 asm volatile(EMMS:::"memory");
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
493 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
494 while (s < end)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
495 {
26910
da8e02081774 add const, suppress warnings
bcoudurier
parents: 26909
diff changeset
496 register int rgb = *(const uint32_t*)s; s += 4;
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
497 *d++ = ((rgb&0xF8)<<8) + ((rgb&0xFC00)>>5) + ((rgb&0xF80000)>>19);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
498 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
499 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
500
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
501 static inline void RENAME(rgb32to15)(const uint8_t *src, uint8_t *dst, long src_size)
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
502 {
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
503 const uint8_t *s = src;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
504 const uint8_t *end;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
505 #ifdef HAVE_MMX
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
506 const uint8_t *mm_end;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
507 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
508 uint16_t *d = (uint16_t *)dst;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
509 end = s + src_size;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
510 #ifdef HAVE_MMX
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
511 mm_end = end - 15;
25109
a362a3b42e24 comment spelling/grammar fixes
diego
parents: 23702
diff changeset
512 #if 1 //is faster only if multiplies are reasonably fast (FIXME figure out on which CPUs this is faster, on Athlon it is slightly faster)
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
513 asm volatile(
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
514 "movq %3, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
515 "movq %4, %%mm6 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
516 "movq %5, %%mm7 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
517 "jmp 2f \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
518 ASMALIGN(4)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
519 "1: \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
520 PREFETCH" 32(%1) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
521 "movd (%1), %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
522 "movd 4(%1), %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
523 "punpckldq 8(%1), %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
524 "punpckldq 12(%1), %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
525 "movq %%mm0, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
526 "movq %%mm3, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
527 "pand %%mm6, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
528 "pand %%mm6, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
529 "pmaddwd %%mm7, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
530 "pmaddwd %%mm7, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
531 "pand %%mm5, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
532 "pand %%mm5, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
533 "por %%mm1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
534 "por %%mm4, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
535 "psrld $6, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
536 "pslld $10, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
537 "por %%mm3, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
538 MOVNTQ" %%mm0, (%0) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
539 "add $16, %1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
540 "add $8, %0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
541 "2: \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
542 "cmp %2, %1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
543 " jb 1b \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
544 : "+r" (d), "+r"(s)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
545 : "r" (mm_end), "m" (mask3215g), "m" (mask3216br), "m" (mul3215)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
546 );
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
547 #else
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
548 asm volatile(PREFETCH" %0"::"m"(*src):"memory");
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
549 asm volatile(
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
550 "movq %0, %%mm7 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
551 "movq %1, %%mm6 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
552 ::"m"(red_15mask),"m"(green_15mask));
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
553 while (s < mm_end)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
554 {
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
555 asm volatile(
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
556 PREFETCH" 32%1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
557 "movd %1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
558 "movd 4%1, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
559 "punpckldq 8%1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
560 "punpckldq 12%1, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
561 "movq %%mm0, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
562 "movq %%mm0, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
563 "movq %%mm3, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
564 "movq %%mm3, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
565 "psrlq $3, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
566 "psrlq $3, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
567 "pand %2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
568 "pand %2, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
569 "psrlq $6, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
570 "psrlq $6, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
571 "pand %%mm6, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
572 "pand %%mm6, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
573 "psrlq $9, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
574 "psrlq $9, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
575 "pand %%mm7, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
576 "pand %%mm7, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
577 "por %%mm1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
578 "por %%mm4, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
579 "por %%mm2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
580 "por %%mm5, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
581 "psllq $16, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
582 "por %%mm3, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
583 MOVNTQ" %%mm0, %0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
584 :"=m"(*d):"m"(*s),"m"(blue_15mask):"memory");
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
585 d += 4;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
586 s += 16;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
587 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
588 #endif
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
589 asm volatile(SFENCE:::"memory");
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
590 asm volatile(EMMS:::"memory");
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
591 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
592 while (s < end)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
593 {
26910
da8e02081774 add const, suppress warnings
bcoudurier
parents: 26909
diff changeset
594 register int rgb = *(const uint32_t*)s; s += 4;
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
595 *d++ = ((rgb&0xFF)>>3) + ((rgb&0xF800)>>6) + ((rgb&0xF80000)>>9);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
596 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
597 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
598
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
599 static inline void RENAME(rgb32tobgr15)(const uint8_t *src, uint8_t *dst, long src_size)
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
600 {
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
601 const uint8_t *s = src;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
602 const uint8_t *end;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
603 #ifdef HAVE_MMX
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
604 const uint8_t *mm_end;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
605 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
606 uint16_t *d = (uint16_t *)dst;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
607 end = s + src_size;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
608 #ifdef HAVE_MMX
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
609 asm volatile(PREFETCH" %0"::"m"(*src):"memory");
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
610 asm volatile(
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
611 "movq %0, %%mm7 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
612 "movq %1, %%mm6 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
613 ::"m"(red_15mask),"m"(green_15mask));
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
614 mm_end = end - 15;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
615 while (s < mm_end)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
616 {
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
617 asm volatile(
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
618 PREFETCH" 32%1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
619 "movd %1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
620 "movd 4%1, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
621 "punpckldq 8%1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
622 "punpckldq 12%1, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
623 "movq %%mm0, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
624 "movq %%mm0, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
625 "movq %%mm3, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
626 "movq %%mm3, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
627 "psllq $7, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
628 "psllq $7, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
629 "pand %%mm7, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
630 "pand %%mm7, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
631 "psrlq $6, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
632 "psrlq $6, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
633 "pand %%mm6, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
634 "pand %%mm6, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
635 "psrlq $19, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
636 "psrlq $19, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
637 "pand %2, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
638 "pand %2, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
639 "por %%mm1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
640 "por %%mm4, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
641 "por %%mm2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
642 "por %%mm5, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
643 "psllq $16, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
644 "por %%mm3, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
645 MOVNTQ" %%mm0, %0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
646 :"=m"(*d):"m"(*s),"m"(blue_15mask):"memory");
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
647 d += 4;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
648 s += 16;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
649 }
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
650 asm volatile(SFENCE:::"memory");
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
651 asm volatile(EMMS:::"memory");
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
652 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
653 while (s < end)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
654 {
26910
da8e02081774 add const, suppress warnings
bcoudurier
parents: 26909
diff changeset
655 register int rgb = *(const uint32_t*)s; s += 4;
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
656 *d++ = ((rgb&0xF8)<<7) + ((rgb&0xF800)>>6) + ((rgb&0xF80000)>>19);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
657 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
658 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
659
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
660 static inline void RENAME(rgb24to16)(const uint8_t *src, uint8_t *dst, long src_size)
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
661 {
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
662 const uint8_t *s = src;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
663 const uint8_t *end;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
664 #ifdef HAVE_MMX
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
665 const uint8_t *mm_end;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
666 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
667 uint16_t *d = (uint16_t *)dst;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
668 end = s + src_size;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
669 #ifdef HAVE_MMX
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
670 asm volatile(PREFETCH" %0"::"m"(*src):"memory");
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
671 asm volatile(
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
672 "movq %0, %%mm7 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
673 "movq %1, %%mm6 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
674 ::"m"(red_16mask),"m"(green_16mask));
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
675 mm_end = end - 11;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
676 while (s < mm_end)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
677 {
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
678 asm volatile(
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
679 PREFETCH" 32%1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
680 "movd %1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
681 "movd 3%1, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
682 "punpckldq 6%1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
683 "punpckldq 9%1, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
684 "movq %%mm0, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
685 "movq %%mm0, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
686 "movq %%mm3, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
687 "movq %%mm3, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
688 "psrlq $3, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
689 "psrlq $3, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
690 "pand %2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
691 "pand %2, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
692 "psrlq $5, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
693 "psrlq $5, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
694 "pand %%mm6, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
695 "pand %%mm6, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
696 "psrlq $8, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
697 "psrlq $8, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
698 "pand %%mm7, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
699 "pand %%mm7, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
700 "por %%mm1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
701 "por %%mm4, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
702 "por %%mm2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
703 "por %%mm5, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
704 "psllq $16, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
705 "por %%mm3, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
706 MOVNTQ" %%mm0, %0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
707 :"=m"(*d):"m"(*s),"m"(blue_16mask):"memory");
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
708 d += 4;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
709 s += 12;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
710 }
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
711 asm volatile(SFENCE:::"memory");
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
712 asm volatile(EMMS:::"memory");
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
713 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
714 while (s < end)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
715 {
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
716 const int b = *s++;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
717 const int g = *s++;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
718 const int r = *s++;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
719 *d++ = (b>>3) | ((g&0xFC)<<3) | ((r&0xF8)<<8);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
720 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
721 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
722
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
723 static inline void RENAME(rgb24tobgr16)(const uint8_t *src, uint8_t *dst, long src_size)
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
724 {
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
725 const uint8_t *s = src;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
726 const uint8_t *end;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
727 #ifdef HAVE_MMX
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
728 const uint8_t *mm_end;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
729 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
730 uint16_t *d = (uint16_t *)dst;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
731 end = s + src_size;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
732 #ifdef HAVE_MMX
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
733 asm volatile(PREFETCH" %0"::"m"(*src):"memory");
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
734 asm volatile(
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
735 "movq %0, %%mm7 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
736 "movq %1, %%mm6 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
737 ::"m"(red_16mask),"m"(green_16mask));
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
738 mm_end = end - 15;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
739 while (s < mm_end)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
740 {
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
741 asm volatile(
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
742 PREFETCH" 32%1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
743 "movd %1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
744 "movd 3%1, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
745 "punpckldq 6%1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
746 "punpckldq 9%1, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
747 "movq %%mm0, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
748 "movq %%mm0, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
749 "movq %%mm3, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
750 "movq %%mm3, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
751 "psllq $8, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
752 "psllq $8, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
753 "pand %%mm7, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
754 "pand %%mm7, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
755 "psrlq $5, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
756 "psrlq $5, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
757 "pand %%mm6, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
758 "pand %%mm6, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
759 "psrlq $19, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
760 "psrlq $19, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
761 "pand %2, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
762 "pand %2, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
763 "por %%mm1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
764 "por %%mm4, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
765 "por %%mm2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
766 "por %%mm5, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
767 "psllq $16, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
768 "por %%mm3, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
769 MOVNTQ" %%mm0, %0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
770 :"=m"(*d):"m"(*s),"m"(blue_16mask):"memory");
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
771 d += 4;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
772 s += 12;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
773 }
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
774 asm volatile(SFENCE:::"memory");
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
775 asm volatile(EMMS:::"memory");
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
776 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
777 while (s < end)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
778 {
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
779 const int r = *s++;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
780 const int g = *s++;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
781 const int b = *s++;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
782 *d++ = (b>>3) | ((g&0xFC)<<3) | ((r&0xF8)<<8);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
783 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
784 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
785
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
786 static inline void RENAME(rgb24to15)(const uint8_t *src, uint8_t *dst, long src_size)
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
787 {
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
788 const uint8_t *s = src;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
789 const uint8_t *end;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
790 #ifdef HAVE_MMX
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
791 const uint8_t *mm_end;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
792 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
793 uint16_t *d = (uint16_t *)dst;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
794 end = s + src_size;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
795 #ifdef HAVE_MMX
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
796 asm volatile(PREFETCH" %0"::"m"(*src):"memory");
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
797 asm volatile(
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
798 "movq %0, %%mm7 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
799 "movq %1, %%mm6 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
800 ::"m"(red_15mask),"m"(green_15mask));
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
801 mm_end = end - 11;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
802 while (s < mm_end)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
803 {
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
804 asm volatile(
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
805 PREFETCH" 32%1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
806 "movd %1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
807 "movd 3%1, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
808 "punpckldq 6%1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
809 "punpckldq 9%1, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
810 "movq %%mm0, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
811 "movq %%mm0, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
812 "movq %%mm3, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
813 "movq %%mm3, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
814 "psrlq $3, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
815 "psrlq $3, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
816 "pand %2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
817 "pand %2, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
818 "psrlq $6, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
819 "psrlq $6, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
820 "pand %%mm6, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
821 "pand %%mm6, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
822 "psrlq $9, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
823 "psrlq $9, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
824 "pand %%mm7, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
825 "pand %%mm7, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
826 "por %%mm1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
827 "por %%mm4, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
828 "por %%mm2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
829 "por %%mm5, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
830 "psllq $16, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
831 "por %%mm3, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
832 MOVNTQ" %%mm0, %0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
833 :"=m"(*d):"m"(*s),"m"(blue_15mask):"memory");
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
834 d += 4;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
835 s += 12;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
836 }
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
837 asm volatile(SFENCE:::"memory");
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
838 asm volatile(EMMS:::"memory");
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
839 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
840 while (s < end)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
841 {
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
842 const int b = *s++;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
843 const int g = *s++;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
844 const int r = *s++;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
845 *d++ = (b>>3) | ((g&0xF8)<<2) | ((r&0xF8)<<7);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
846 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
847 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
848
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
849 static inline void RENAME(rgb24tobgr15)(const uint8_t *src, uint8_t *dst, long src_size)
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
850 {
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
851 const uint8_t *s = src;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
852 const uint8_t *end;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
853 #ifdef HAVE_MMX
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
854 const uint8_t *mm_end;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
855 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
856 uint16_t *d = (uint16_t *)dst;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
857 end = s + src_size;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
858 #ifdef HAVE_MMX
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
859 asm volatile(PREFETCH" %0"::"m"(*src):"memory");
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
860 asm volatile(
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
861 "movq %0, %%mm7 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
862 "movq %1, %%mm6 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
863 ::"m"(red_15mask),"m"(green_15mask));
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
864 mm_end = end - 15;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
865 while (s < mm_end)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
866 {
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
867 asm volatile(
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
868 PREFETCH" 32%1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
869 "movd %1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
870 "movd 3%1, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
871 "punpckldq 6%1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
872 "punpckldq 9%1, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
873 "movq %%mm0, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
874 "movq %%mm0, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
875 "movq %%mm3, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
876 "movq %%mm3, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
877 "psllq $7, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
878 "psllq $7, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
879 "pand %%mm7, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
880 "pand %%mm7, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
881 "psrlq $6, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
882 "psrlq $6, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
883 "pand %%mm6, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
884 "pand %%mm6, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
885 "psrlq $19, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
886 "psrlq $19, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
887 "pand %2, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
888 "pand %2, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
889 "por %%mm1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
890 "por %%mm4, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
891 "por %%mm2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
892 "por %%mm5, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
893 "psllq $16, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
894 "por %%mm3, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
895 MOVNTQ" %%mm0, %0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
896 :"=m"(*d):"m"(*s),"m"(blue_15mask):"memory");
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
897 d += 4;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
898 s += 12;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
899 }
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
900 asm volatile(SFENCE:::"memory");
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
901 asm volatile(EMMS:::"memory");
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
902 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
903 while (s < end)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
904 {
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
905 const int r = *s++;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
906 const int g = *s++;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
907 const int b = *s++;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
908 *d++ = (b>>3) | ((g&0xF8)<<2) | ((r&0xF8)<<7);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
909 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
910 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
911
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
912 /*
25109
a362a3b42e24 comment spelling/grammar fixes
diego
parents: 23702
diff changeset
913 I use less accurate approximation here by simply left-shifting the input
a362a3b42e24 comment spelling/grammar fixes
diego
parents: 23702
diff changeset
914 value and filling the low order bits with zeroes. This method improves PNG
a362a3b42e24 comment spelling/grammar fixes
diego
parents: 23702
diff changeset
915 compression but this scheme cannot reproduce white exactly, since it does
a362a3b42e24 comment spelling/grammar fixes
diego
parents: 23702
diff changeset
916 not generate an all-ones maximum value; the net effect is to darken the
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
917 image slightly.
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
918
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
919 The better method should be "left bit replication":
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
920
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
921 4 3 2 1 0
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
922 ---------
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
923 1 1 0 1 1
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
924
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
925 7 6 5 4 3 2 1 0
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
926 ----------------
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
927 1 1 0 1 1 1 1 0
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
928 |=======| |===|
27158
65b8334df960 spelling/grammar/wording overhaul
diego
parents: 26925
diff changeset
929 | leftmost bits repeated to fill open bits
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
930 |
27158
65b8334df960 spelling/grammar/wording overhaul
diego
parents: 26925
diff changeset
931 original bits
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
932 */
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
933 static inline void RENAME(rgb15to24)(const uint8_t *src, uint8_t *dst, long src_size)
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
934 {
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
935 const uint16_t *end;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
936 #ifdef HAVE_MMX
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
937 const uint16_t *mm_end;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
938 #endif
26909
b7eeb3590bc9 remove useless casts
bcoudurier
parents: 26059
diff changeset
939 uint8_t *d = dst;
26910
da8e02081774 add const, suppress warnings
bcoudurier
parents: 26909
diff changeset
940 const uint16_t *s = (const uint16_t*)src;
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
941 end = s + src_size/2;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
942 #ifdef HAVE_MMX
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
943 asm volatile(PREFETCH" %0"::"m"(*s):"memory");
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
944 mm_end = end - 7;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
945 while (s < mm_end)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
946 {
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
947 asm volatile(
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
948 PREFETCH" 32%1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
949 "movq %1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
950 "movq %1, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
951 "movq %1, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
952 "pand %2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
953 "pand %3, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
954 "pand %4, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
955 "psllq $3, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
956 "psrlq $2, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
957 "psrlq $7, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
958 "movq %%mm0, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
959 "movq %%mm1, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
960 "movq %%mm2, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
961 "punpcklwd %5, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
962 "punpcklwd %5, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
963 "punpcklwd %5, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
964 "punpckhwd %5, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
965 "punpckhwd %5, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
966 "punpckhwd %5, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
967 "psllq $8, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
968 "psllq $16, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
969 "por %%mm1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
970 "por %%mm2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
971 "psllq $8, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
972 "psllq $16, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
973 "por %%mm4, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
974 "por %%mm5, %%mm3 \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
975
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
976 "movq %%mm0, %%mm6 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
977 "movq %%mm3, %%mm7 \n\t"
23129
9528d1ebe68f cosmetics: Remove trailing whitespace.
diego
parents: 23004
diff changeset
978
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
979 "movq 8%1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
980 "movq 8%1, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
981 "movq 8%1, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
982 "pand %2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
983 "pand %3, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
984 "pand %4, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
985 "psllq $3, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
986 "psrlq $2, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
987 "psrlq $7, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
988 "movq %%mm0, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
989 "movq %%mm1, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
990 "movq %%mm2, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
991 "punpcklwd %5, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
992 "punpcklwd %5, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
993 "punpcklwd %5, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
994 "punpckhwd %5, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
995 "punpckhwd %5, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
996 "punpckhwd %5, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
997 "psllq $8, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
998 "psllq $16, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
999 "por %%mm1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1000 "por %%mm2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1001 "psllq $8, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1002 "psllq $16, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1003 "por %%mm4, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1004 "por %%mm5, %%mm3 \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1005
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1006 :"=m"(*d)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1007 :"m"(*s),"m"(mask15b),"m"(mask15g),"m"(mask15r), "m"(mmx_null)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1008 :"memory");
27158
65b8334df960 spelling/grammar/wording overhaul
diego
parents: 26925
diff changeset
1009 /* borrowed 32 to 24 */
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
1010 asm volatile(
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1011 "movq %%mm0, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1012 "movq %%mm3, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1013 "movq %%mm6, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1014 "movq %%mm7, %%mm1 \n\t"
23129
9528d1ebe68f cosmetics: Remove trailing whitespace.
diego
parents: 23004
diff changeset
1015
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1016 "movq %%mm4, %%mm6 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1017 "movq %%mm5, %%mm7 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1018 "movq %%mm0, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1019 "movq %%mm1, %%mm3 \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1020
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1021 "psrlq $8, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1022 "psrlq $8, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1023 "psrlq $8, %%mm6 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1024 "psrlq $8, %%mm7 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1025 "pand %2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1026 "pand %2, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1027 "pand %2, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1028 "pand %2, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1029 "pand %3, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1030 "pand %3, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1031 "pand %3, %%mm6 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1032 "pand %3, %%mm7 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1033 "por %%mm2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1034 "por %%mm3, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1035 "por %%mm6, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1036 "por %%mm7, %%mm5 \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1037
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1038 "movq %%mm1, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1039 "movq %%mm4, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1040 "psllq $48, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1041 "psllq $32, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1042 "pand %4, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1043 "pand %5, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1044 "por %%mm2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1045 "psrlq $16, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1046 "psrlq $32, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1047 "psllq $16, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1048 "por %%mm3, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1049 "pand %6, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1050 "por %%mm5, %%mm4 \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1051
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1052 MOVNTQ" %%mm0, %0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1053 MOVNTQ" %%mm1, 8%0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1054 MOVNTQ" %%mm4, 16%0"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1055
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1056 :"=m"(*d)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1057 :"m"(*s),"m"(mask24l),"m"(mask24h),"m"(mask24hh),"m"(mask24hhh),"m"(mask24hhhh)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1058 :"memory");
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1059 d += 24;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1060 s += 8;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1061 }
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
1062 asm volatile(SFENCE:::"memory");
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
1063 asm volatile(EMMS:::"memory");
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1064 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1065 while (s < end)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1066 {
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1067 register uint16_t bgr;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1068 bgr = *s++;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1069 *d++ = (bgr&0x1F)<<3;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1070 *d++ = (bgr&0x3E0)>>2;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1071 *d++ = (bgr&0x7C00)>>7;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1072 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1073 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1074
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1075 static inline void RENAME(rgb16to24)(const uint8_t *src, uint8_t *dst, long src_size)
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1076 {
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1077 const uint16_t *end;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1078 #ifdef HAVE_MMX
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1079 const uint16_t *mm_end;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1080 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1081 uint8_t *d = (uint8_t *)dst;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1082 const uint16_t *s = (const uint16_t *)src;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1083 end = s + src_size/2;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1084 #ifdef HAVE_MMX
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
1085 asm volatile(PREFETCH" %0"::"m"(*s):"memory");
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1086 mm_end = end - 7;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1087 while (s < mm_end)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1088 {
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
1089 asm volatile(
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1090 PREFETCH" 32%1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1091 "movq %1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1092 "movq %1, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1093 "movq %1, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1094 "pand %2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1095 "pand %3, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1096 "pand %4, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1097 "psllq $3, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1098 "psrlq $3, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1099 "psrlq $8, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1100 "movq %%mm0, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1101 "movq %%mm1, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1102 "movq %%mm2, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1103 "punpcklwd %5, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1104 "punpcklwd %5, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1105 "punpcklwd %5, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1106 "punpckhwd %5, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1107 "punpckhwd %5, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1108 "punpckhwd %5, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1109 "psllq $8, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1110 "psllq $16, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1111 "por %%mm1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1112 "por %%mm2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1113 "psllq $8, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1114 "psllq $16, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1115 "por %%mm4, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1116 "por %%mm5, %%mm3 \n\t"
23129
9528d1ebe68f cosmetics: Remove trailing whitespace.
diego
parents: 23004
diff changeset
1117
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1118 "movq %%mm0, %%mm6 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1119 "movq %%mm3, %%mm7 \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1120
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1121 "movq 8%1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1122 "movq 8%1, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1123 "movq 8%1, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1124 "pand %2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1125 "pand %3, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1126 "pand %4, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1127 "psllq $3, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1128 "psrlq $3, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1129 "psrlq $8, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1130 "movq %%mm0, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1131 "movq %%mm1, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1132 "movq %%mm2, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1133 "punpcklwd %5, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1134 "punpcklwd %5, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1135 "punpcklwd %5, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1136 "punpckhwd %5, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1137 "punpckhwd %5, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1138 "punpckhwd %5, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1139 "psllq $8, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1140 "psllq $16, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1141 "por %%mm1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1142 "por %%mm2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1143 "psllq $8, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1144 "psllq $16, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1145 "por %%mm4, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1146 "por %%mm5, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1147 :"=m"(*d)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1148 :"m"(*s),"m"(mask16b),"m"(mask16g),"m"(mask16r),"m"(mmx_null)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1149 :"memory");
27158
65b8334df960 spelling/grammar/wording overhaul
diego
parents: 26925
diff changeset
1150 /* borrowed 32 to 24 */
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
1151 asm volatile(
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1152 "movq %%mm0, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1153 "movq %%mm3, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1154 "movq %%mm6, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1155 "movq %%mm7, %%mm1 \n\t"
23129
9528d1ebe68f cosmetics: Remove trailing whitespace.
diego
parents: 23004
diff changeset
1156
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1157 "movq %%mm4, %%mm6 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1158 "movq %%mm5, %%mm7 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1159 "movq %%mm0, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1160 "movq %%mm1, %%mm3 \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1161
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1162 "psrlq $8, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1163 "psrlq $8, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1164 "psrlq $8, %%mm6 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1165 "psrlq $8, %%mm7 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1166 "pand %2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1167 "pand %2, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1168 "pand %2, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1169 "pand %2, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1170 "pand %3, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1171 "pand %3, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1172 "pand %3, %%mm6 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1173 "pand %3, %%mm7 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1174 "por %%mm2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1175 "por %%mm3, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1176 "por %%mm6, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1177 "por %%mm7, %%mm5 \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1178
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1179 "movq %%mm1, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1180 "movq %%mm4, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1181 "psllq $48, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1182 "psllq $32, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1183 "pand %4, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1184 "pand %5, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1185 "por %%mm2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1186 "psrlq $16, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1187 "psrlq $32, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1188 "psllq $16, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1189 "por %%mm3, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1190 "pand %6, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1191 "por %%mm5, %%mm4 \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1192
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1193 MOVNTQ" %%mm0, %0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1194 MOVNTQ" %%mm1, 8%0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1195 MOVNTQ" %%mm4, 16%0"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1196
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1197 :"=m"(*d)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1198 :"m"(*s),"m"(mask24l),"m"(mask24h),"m"(mask24hh),"m"(mask24hhh),"m"(mask24hhhh)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1199 :"memory");
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1200 d += 24;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1201 s += 8;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1202 }
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
1203 asm volatile(SFENCE:::"memory");
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
1204 asm volatile(EMMS:::"memory");
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1205 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1206 while (s < end)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1207 {
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1208 register uint16_t bgr;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1209 bgr = *s++;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1210 *d++ = (bgr&0x1F)<<3;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1211 *d++ = (bgr&0x7E0)>>3;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1212 *d++ = (bgr&0xF800)>>8;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1213 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1214 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1215
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1216 static inline void RENAME(rgb15to32)(const uint8_t *src, uint8_t *dst, long src_size)
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1217 {
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1218 const uint16_t *end;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1219 #ifdef HAVE_MMX
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1220 const uint16_t *mm_end;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1221 #endif
26909
b7eeb3590bc9 remove useless casts
bcoudurier
parents: 26059
diff changeset
1222 uint8_t *d = dst;
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1223 const uint16_t *s = (const uint16_t *)src;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1224 end = s + src_size/2;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1225 #ifdef HAVE_MMX
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
1226 asm volatile(PREFETCH" %0"::"m"(*s):"memory");
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
1227 asm volatile("pxor %%mm7,%%mm7 \n\t":::"memory");
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1228 mm_end = end - 3;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1229 while (s < mm_end)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1230 {
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
1231 asm volatile(
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1232 PREFETCH" 32%1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1233 "movq %1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1234 "movq %1, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1235 "movq %1, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1236 "pand %2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1237 "pand %3, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1238 "pand %4, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1239 "psllq $3, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1240 "psrlq $2, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1241 "psrlq $7, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1242 "movq %%mm0, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1243 "movq %%mm1, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1244 "movq %%mm2, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1245 "punpcklwd %%mm7, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1246 "punpcklwd %%mm7, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1247 "punpcklwd %%mm7, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1248 "punpckhwd %%mm7, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1249 "punpckhwd %%mm7, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1250 "punpckhwd %%mm7, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1251 "psllq $8, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1252 "psllq $16, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1253 "por %%mm1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1254 "por %%mm2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1255 "psllq $8, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1256 "psllq $16, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1257 "por %%mm4, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1258 "por %%mm5, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1259 MOVNTQ" %%mm0, %0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1260 MOVNTQ" %%mm3, 8%0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1261 :"=m"(*d)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1262 :"m"(*s),"m"(mask15b),"m"(mask15g),"m"(mask15r)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1263 :"memory");
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1264 d += 16;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1265 s += 4;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1266 }
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
1267 asm volatile(SFENCE:::"memory");
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
1268 asm volatile(EMMS:::"memory");
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1269 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1270 while (s < end)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1271 {
25109
a362a3b42e24 comment spelling/grammar fixes
diego
parents: 23702
diff changeset
1272 #if 0 //slightly slower on Athlon
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1273 int bgr= *s++;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1274 *((uint32_t*)d)++ = ((bgr&0x1F)<<3) + ((bgr&0x3E0)<<6) + ((bgr&0x7C00)<<9);
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1275 #else
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1276 register uint16_t bgr;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1277 bgr = *s++;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1278 #ifdef WORDS_BIGENDIAN
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1279 *d++ = 0;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1280 *d++ = (bgr&0x7C00)>>7;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1281 *d++ = (bgr&0x3E0)>>2;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1282 *d++ = (bgr&0x1F)<<3;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1283 #else
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1284 *d++ = (bgr&0x1F)<<3;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1285 *d++ = (bgr&0x3E0)>>2;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1286 *d++ = (bgr&0x7C00)>>7;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1287 *d++ = 0;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1288 #endif
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1289
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1290 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1291 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1292 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1293
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1294 static inline void RENAME(rgb16to32)(const uint8_t *src, uint8_t *dst, long src_size)
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1295 {
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1296 const uint16_t *end;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1297 #ifdef HAVE_MMX
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1298 const uint16_t *mm_end;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1299 #endif
26909
b7eeb3590bc9 remove useless casts
bcoudurier
parents: 26059
diff changeset
1300 uint8_t *d = dst;
26910
da8e02081774 add const, suppress warnings
bcoudurier
parents: 26909
diff changeset
1301 const uint16_t *s = (const uint16_t*)src;
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1302 end = s + src_size/2;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1303 #ifdef HAVE_MMX
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
1304 asm volatile(PREFETCH" %0"::"m"(*s):"memory");
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
1305 asm volatile("pxor %%mm7,%%mm7 \n\t":::"memory");
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1306 mm_end = end - 3;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1307 while (s < mm_end)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1308 {
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
1309 asm volatile(
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1310 PREFETCH" 32%1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1311 "movq %1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1312 "movq %1, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1313 "movq %1, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1314 "pand %2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1315 "pand %3, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1316 "pand %4, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1317 "psllq $3, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1318 "psrlq $3, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1319 "psrlq $8, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1320 "movq %%mm0, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1321 "movq %%mm1, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1322 "movq %%mm2, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1323 "punpcklwd %%mm7, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1324 "punpcklwd %%mm7, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1325 "punpcklwd %%mm7, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1326 "punpckhwd %%mm7, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1327 "punpckhwd %%mm7, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1328 "punpckhwd %%mm7, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1329 "psllq $8, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1330 "psllq $16, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1331 "por %%mm1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1332 "por %%mm2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1333 "psllq $8, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1334 "psllq $16, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1335 "por %%mm4, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1336 "por %%mm5, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1337 MOVNTQ" %%mm0, %0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1338 MOVNTQ" %%mm3, 8%0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1339 :"=m"(*d)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1340 :"m"(*s),"m"(mask16b),"m"(mask16g),"m"(mask16r)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1341 :"memory");
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1342 d += 16;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1343 s += 4;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1344 }
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
1345 asm volatile(SFENCE:::"memory");
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
1346 asm volatile(EMMS:::"memory");
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1347 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1348 while (s < end)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1349 {
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1350 register uint16_t bgr;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1351 bgr = *s++;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1352 #ifdef WORDS_BIGENDIAN
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1353 *d++ = 0;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1354 *d++ = (bgr&0xF800)>>8;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1355 *d++ = (bgr&0x7E0)>>3;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1356 *d++ = (bgr&0x1F)<<3;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1357 #else
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1358 *d++ = (bgr&0x1F)<<3;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1359 *d++ = (bgr&0x7E0)>>3;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1360 *d++ = (bgr&0xF800)>>8;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1361 *d++ = 0;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1362 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1363 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1364 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1365
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1366 static inline void RENAME(rgb32tobgr32)(const uint8_t *src, uint8_t *dst, long src_size)
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1367 {
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1368 long idx = 15 - src_size;
26910
da8e02081774 add const, suppress warnings
bcoudurier
parents: 26909
diff changeset
1369 const uint8_t *s = src-idx;
da8e02081774 add const, suppress warnings
bcoudurier
parents: 26909
diff changeset
1370 uint8_t *d = dst-idx;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1371 #ifdef HAVE_MMX
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
1372 asm volatile(
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1373 "test %0, %0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1374 "jns 2f \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1375 PREFETCH" (%1, %0) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1376 "movq %3, %%mm7 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1377 "pxor %4, %%mm7 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1378 "movq %%mm7, %%mm6 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1379 "pxor %5, %%mm7 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1380 ASMALIGN(4)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1381 "1: \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1382 PREFETCH" 32(%1, %0) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1383 "movq (%1, %0), %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1384 "movq 8(%1, %0), %%mm1 \n\t"
22991
59671a52cc82 New implementation of rgb32tobgr32
ivo
parents: 22960
diff changeset
1385 # ifdef HAVE_MMX2
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1386 "pshufw $177, %%mm0, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1387 "pshufw $177, %%mm1, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1388 "pand %%mm7, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1389 "pand %%mm6, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1390 "pand %%mm7, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1391 "pand %%mm6, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1392 "por %%mm3, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1393 "por %%mm5, %%mm1 \n\t"
22991
59671a52cc82 New implementation of rgb32tobgr32
ivo
parents: 22960
diff changeset
1394 # else
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1395 "movq %%mm0, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1396 "movq %%mm1, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1397 "pand %%mm7, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1398 "pand %%mm6, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1399 "pand %%mm7, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1400 "pand %%mm6, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1401 "movq %%mm2, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1402 "movq %%mm4, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1403 "pslld $16, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1404 "psrld $16, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1405 "pslld $16, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1406 "psrld $16, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1407 "por %%mm2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1408 "por %%mm4, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1409 "por %%mm3, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1410 "por %%mm5, %%mm1 \n\t"
22991
59671a52cc82 New implementation of rgb32tobgr32
ivo
parents: 22960
diff changeset
1411 # endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1412 MOVNTQ" %%mm0, (%2, %0) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1413 MOVNTQ" %%mm1, 8(%2, %0) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1414 "add $16, %0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1415 "js 1b \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1416 SFENCE" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1417 EMMS" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1418 "2: \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1419 : "+&r"(idx)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1420 : "r" (s), "r" (d), "m" (mask32b), "m" (mask32r), "m" (mmx_one)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1421 : "memory");
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1422 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1423 for (; idx<15; idx+=4) {
26910
da8e02081774 add const, suppress warnings
bcoudurier
parents: 26909
diff changeset
1424 register int v = *(const uint32_t *)&s[idx], g = v & 0xff00ff00;
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1425 v &= 0xff00ff;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1426 *(uint32_t *)&d[idx] = (v>>16) + g + (v<<16);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1427 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1428 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1429
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1430 static inline void RENAME(rgb24tobgr24)(const uint8_t *src, uint8_t *dst, long src_size)
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1431 {
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1432 unsigned i;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1433 #ifdef HAVE_MMX
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1434 long mmx_size= 23 - src_size;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1435 asm volatile (
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1436 "test %%"REG_a", %%"REG_a" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1437 "jns 2f \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1438 "movq "MANGLE(mask24r)", %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1439 "movq "MANGLE(mask24g)", %%mm6 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1440 "movq "MANGLE(mask24b)", %%mm7 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1441 ASMALIGN(4)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1442 "1: \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1443 PREFETCH" 32(%1, %%"REG_a") \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1444 "movq (%1, %%"REG_a"), %%mm0 \n\t" // BGR BGR BG
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1445 "movq (%1, %%"REG_a"), %%mm1 \n\t" // BGR BGR BG
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1446 "movq 2(%1, %%"REG_a"), %%mm2 \n\t" // R BGR BGR B
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1447 "psllq $16, %%mm0 \n\t" // 00 BGR BGR
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1448 "pand %%mm5, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1449 "pand %%mm6, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1450 "pand %%mm7, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1451 "por %%mm0, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1452 "por %%mm2, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1453 "movq 6(%1, %%"REG_a"), %%mm0 \n\t" // BGR BGR BG
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1454 MOVNTQ" %%mm1, (%2, %%"REG_a") \n\t" // RGB RGB RG
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1455 "movq 8(%1, %%"REG_a"), %%mm1 \n\t" // R BGR BGR B
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1456 "movq 10(%1, %%"REG_a"), %%mm2 \n\t" // GR BGR BGR
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1457 "pand %%mm7, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1458 "pand %%mm5, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1459 "pand %%mm6, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1460 "por %%mm0, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1461 "por %%mm2, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1462 "movq 14(%1, %%"REG_a"), %%mm0 \n\t" // R BGR BGR B
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1463 MOVNTQ" %%mm1, 8(%2, %%"REG_a") \n\t" // B RGB RGB R
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1464 "movq 16(%1, %%"REG_a"), %%mm1 \n\t" // GR BGR BGR
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1465 "movq 18(%1, %%"REG_a"), %%mm2 \n\t" // BGR BGR BG
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1466 "pand %%mm6, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1467 "pand %%mm7, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1468 "pand %%mm5, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1469 "por %%mm0, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1470 "por %%mm2, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1471 MOVNTQ" %%mm1, 16(%2, %%"REG_a") \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1472 "add $24, %%"REG_a" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1473 " js 1b \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1474 "2: \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1475 : "+a" (mmx_size)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1476 : "r" (src-mmx_size), "r"(dst-mmx_size)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1477 );
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1478
26059
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
1479 asm volatile(SFENCE:::"memory");
ba2efd11abf9 __asm __volatile -> asm volatile part 3
reimar
parents: 25882
diff changeset
1480 asm volatile(EMMS:::"memory");
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1481
27158
65b8334df960 spelling/grammar/wording overhaul
diego
parents: 26925
diff changeset
1482 if (mmx_size==23) return; //finished, was multiple of 8
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1483
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1484 src+= src_size;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1485 dst+= src_size;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1486 src_size= 23-mmx_size;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1487 src-= src_size;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1488 dst-= src_size;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1489 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1490 for (i=0; i<src_size; i+=3)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1491 {
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1492 register uint8_t x;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1493 x = src[i + 2];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1494 dst[i + 1] = src[i + 1];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1495 dst[i + 2] = src[i + 0];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1496 dst[i + 0] = x;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1497 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1498 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1499
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1500 static inline void RENAME(yuvPlanartoyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1501 long width, long height,
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1502 long lumStride, long chromStride, long dstStride, long vertLumPerChroma)
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1503 {
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1504 long y;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1505 const long chromWidth= width>>1;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1506 for (y=0; y<height; y++)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1507 {
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1508 #ifdef HAVE_MMX
25109
a362a3b42e24 comment spelling/grammar fixes
diego
parents: 23702
diff changeset
1509 //FIXME handle 2 lines at once (fewer prefetches, reuse some chroma, but very likely memory-limited anyway)
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1510 asm volatile(
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1511 "xor %%"REG_a", %%"REG_a" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1512 ASMALIGN(4)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1513 "1: \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1514 PREFETCH" 32(%1, %%"REG_a", 2) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1515 PREFETCH" 32(%2, %%"REG_a") \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1516 PREFETCH" 32(%3, %%"REG_a") \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1517 "movq (%2, %%"REG_a"), %%mm0 \n\t" // U(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1518 "movq %%mm0, %%mm2 \n\t" // U(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1519 "movq (%3, %%"REG_a"), %%mm1 \n\t" // V(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1520 "punpcklbw %%mm1, %%mm0 \n\t" // UVUV UVUV(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1521 "punpckhbw %%mm1, %%mm2 \n\t" // UVUV UVUV(8)
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1522
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1523 "movq (%1, %%"REG_a",2), %%mm3 \n\t" // Y(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1524 "movq 8(%1, %%"REG_a",2), %%mm5 \n\t" // Y(8)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1525 "movq %%mm3, %%mm4 \n\t" // Y(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1526 "movq %%mm5, %%mm6 \n\t" // Y(8)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1527 "punpcklbw %%mm0, %%mm3 \n\t" // YUYV YUYV(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1528 "punpckhbw %%mm0, %%mm4 \n\t" // YUYV YUYV(4)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1529 "punpcklbw %%mm2, %%mm5 \n\t" // YUYV YUYV(8)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1530 "punpckhbw %%mm2, %%mm6 \n\t" // YUYV YUYV(12)
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1531
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1532 MOVNTQ" %%mm3, (%0, %%"REG_a", 4) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1533 MOVNTQ" %%mm4, 8(%0, %%"REG_a", 4) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1534 MOVNTQ" %%mm5, 16(%0, %%"REG_a", 4) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1535 MOVNTQ" %%mm6, 24(%0, %%"REG_a", 4) \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1536
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1537 "add $8, %%"REG_a" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1538 "cmp %4, %%"REG_a" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1539 " jb 1b \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1540 ::"r"(dst), "r"(ysrc), "r"(usrc), "r"(vsrc), "g" (chromWidth)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1541 : "%"REG_a
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1542 );
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1543 #else
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1544
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1545 #if defined ARCH_ALPHA && defined HAVE_MVI
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1546 #define pl2yuy2(n) \
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1547 y1 = yc[n]; \
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1548 y2 = yc2[n]; \
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1549 u = uc[n]; \
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1550 v = vc[n]; \
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1551 asm("unpkbw %1, %0" : "=r"(y1) : "r"(y1)); \
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1552 asm("unpkbw %1, %0" : "=r"(y2) : "r"(y2)); \
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1553 asm("unpkbl %1, %0" : "=r"(u) : "r"(u)); \
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1554 asm("unpkbl %1, %0" : "=r"(v) : "r"(v)); \
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1555 yuv1 = (u << 8) + (v << 24); \
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1556 yuv2 = yuv1 + y2; \
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1557 yuv1 += y1; \
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1558 qdst[n] = yuv1; \
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1559 qdst2[n] = yuv2;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1560
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1561 int i;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1562 uint64_t *qdst = (uint64_t *) dst;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1563 uint64_t *qdst2 = (uint64_t *) (dst + dstStride);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1564 const uint32_t *yc = (uint32_t *) ysrc;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1565 const uint32_t *yc2 = (uint32_t *) (ysrc + lumStride);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1566 const uint16_t *uc = (uint16_t*) usrc, *vc = (uint16_t*) vsrc;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1567 for (i = 0; i < chromWidth; i += 8){
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1568 uint64_t y1, y2, yuv1, yuv2;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1569 uint64_t u, v;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1570 /* Prefetch */
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1571 asm("ldq $31,64(%0)" :: "r"(yc));
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1572 asm("ldq $31,64(%0)" :: "r"(yc2));
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1573 asm("ldq $31,64(%0)" :: "r"(uc));
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1574 asm("ldq $31,64(%0)" :: "r"(vc));
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1575
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1576 pl2yuy2(0);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1577 pl2yuy2(1);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1578 pl2yuy2(2);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1579 pl2yuy2(3);
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1580
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1581 yc += 4;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1582 yc2 += 4;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1583 uc += 4;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1584 vc += 4;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1585 qdst += 4;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1586 qdst2 += 4;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1587 }
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1588 y++;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1589 ysrc += lumStride;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1590 dst += dstStride;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1591
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1592 #elif __WORDSIZE >= 64
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1593 int i;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1594 uint64_t *ldst = (uint64_t *) dst;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1595 const uint8_t *yc = ysrc, *uc = usrc, *vc = vsrc;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1596 for (i = 0; i < chromWidth; i += 2){
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1597 uint64_t k, l;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1598 k = yc[0] + (uc[0] << 8) +
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1599 (yc[1] << 16) + (vc[0] << 24);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1600 l = yc[2] + (uc[1] << 8) +
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1601 (yc[3] << 16) + (vc[1] << 24);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1602 *ldst++ = k + (l << 32);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1603 yc += 4;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1604 uc += 2;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1605 vc += 2;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1606 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1607
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1608 #else
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1609 int i, *idst = (int32_t *) dst;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1610 const uint8_t *yc = ysrc, *uc = usrc, *vc = vsrc;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1611 for (i = 0; i < chromWidth; i++){
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1612 #ifdef WORDS_BIGENDIAN
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1613 *idst++ = (yc[0] << 24)+ (uc[0] << 16) +
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1614 (yc[1] << 8) + (vc[0] << 0);
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1615 #else
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1616 *idst++ = yc[0] + (uc[0] << 8) +
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1617 (yc[1] << 16) + (vc[0] << 24);
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1618 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1619 yc += 2;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1620 uc++;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1621 vc++;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1622 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1623 #endif
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1624 #endif
25751
147deb141e07 Remove some useless parentheses.
benoit
parents: 25750
diff changeset
1625 if ((y&(vertLumPerChroma-1)) == vertLumPerChroma-1)
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1626 {
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1627 usrc += chromStride;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1628 vsrc += chromStride;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1629 }
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1630 ysrc += lumStride;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1631 dst += dstStride;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1632 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1633 #ifdef HAVE_MMX
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1634 asm( EMMS" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1635 SFENCE" \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1636 :::"memory");
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1637 #endif
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1638 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1639
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1640 /**
27158
65b8334df960 spelling/grammar/wording overhaul
diego
parents: 26925
diff changeset
1641 * Height should be a multiple of 2 and width should be a multiple of 16.
65b8334df960 spelling/grammar/wording overhaul
diego
parents: 26925
diff changeset
1642 * (If this is a problem for anyone then tell me, and I will fix it.)
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1643 */
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1644 static inline void RENAME(yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1645 long width, long height,
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1646 long lumStride, long chromStride, long dstStride)
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1647 {
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1648 //FIXME interpolate chroma
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1649 RENAME(yuvPlanartoyuy2)(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride, 2);
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1650 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1651
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1652 static inline void RENAME(yuvPlanartouyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1653 long width, long height,
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1654 long lumStride, long chromStride, long dstStride, long vertLumPerChroma)
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1655 {
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1656 long y;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1657 const long chromWidth= width>>1;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1658 for (y=0; y<height; y++)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1659 {
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1660 #ifdef HAVE_MMX
25109
a362a3b42e24 comment spelling/grammar fixes
diego
parents: 23702
diff changeset
1661 //FIXME handle 2 lines at once (fewer prefetches, reuse some chroma, but very likely memory-limited anyway)
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1662 asm volatile(
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1663 "xor %%"REG_a", %%"REG_a" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1664 ASMALIGN(4)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1665 "1: \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1666 PREFETCH" 32(%1, %%"REG_a", 2) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1667 PREFETCH" 32(%2, %%"REG_a") \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1668 PREFETCH" 32(%3, %%"REG_a") \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1669 "movq (%2, %%"REG_a"), %%mm0 \n\t" // U(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1670 "movq %%mm0, %%mm2 \n\t" // U(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1671 "movq (%3, %%"REG_a"), %%mm1 \n\t" // V(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1672 "punpcklbw %%mm1, %%mm0 \n\t" // UVUV UVUV(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1673 "punpckhbw %%mm1, %%mm2 \n\t" // UVUV UVUV(8)
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1674
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1675 "movq (%1, %%"REG_a",2), %%mm3 \n\t" // Y(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1676 "movq 8(%1, %%"REG_a",2), %%mm5 \n\t" // Y(8)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1677 "movq %%mm0, %%mm4 \n\t" // Y(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1678 "movq %%mm2, %%mm6 \n\t" // Y(8)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1679 "punpcklbw %%mm3, %%mm0 \n\t" // YUYV YUYV(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1680 "punpckhbw %%mm3, %%mm4 \n\t" // YUYV YUYV(4)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1681 "punpcklbw %%mm5, %%mm2 \n\t" // YUYV YUYV(8)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1682 "punpckhbw %%mm5, %%mm6 \n\t" // YUYV YUYV(12)
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1683
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1684 MOVNTQ" %%mm0, (%0, %%"REG_a", 4) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1685 MOVNTQ" %%mm4, 8(%0, %%"REG_a", 4) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1686 MOVNTQ" %%mm2, 16(%0, %%"REG_a", 4) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1687 MOVNTQ" %%mm6, 24(%0, %%"REG_a", 4) \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1688
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1689 "add $8, %%"REG_a" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1690 "cmp %4, %%"REG_a" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1691 " jb 1b \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1692 ::"r"(dst), "r"(ysrc), "r"(usrc), "r"(vsrc), "g" (chromWidth)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1693 : "%"REG_a
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1694 );
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1695 #else
25109
a362a3b42e24 comment spelling/grammar fixes
diego
parents: 23702
diff changeset
1696 //FIXME adapt the Alpha ASM code from yv12->yuy2
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1697
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1698 #if __WORDSIZE >= 64
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1699 int i;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1700 uint64_t *ldst = (uint64_t *) dst;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1701 const uint8_t *yc = ysrc, *uc = usrc, *vc = vsrc;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1702 for (i = 0; i < chromWidth; i += 2){
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1703 uint64_t k, l;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1704 k = uc[0] + (yc[0] << 8) +
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1705 (vc[0] << 16) + (yc[1] << 24);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1706 l = uc[1] + (yc[2] << 8) +
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1707 (vc[1] << 16) + (yc[3] << 24);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1708 *ldst++ = k + (l << 32);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1709 yc += 4;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1710 uc += 2;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1711 vc += 2;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1712 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1713
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1714 #else
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1715 int i, *idst = (int32_t *) dst;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1716 const uint8_t *yc = ysrc, *uc = usrc, *vc = vsrc;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1717 for (i = 0; i < chromWidth; i++){
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1718 #ifdef WORDS_BIGENDIAN
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1719 *idst++ = (uc[0] << 24)+ (yc[0] << 16) +
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1720 (vc[0] << 8) + (yc[1] << 0);
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1721 #else
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1722 *idst++ = uc[0] + (yc[0] << 8) +
27158
65b8334df960 spelling/grammar/wording overhaul
diego
parents: 26925
diff changeset
1723 (vc[0] << 16) + (yc[1] << 24);
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1724 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1725 yc += 2;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1726 uc++;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1727 vc++;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1728 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1729 #endif
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1730 #endif
25751
147deb141e07 Remove some useless parentheses.
benoit
parents: 25750
diff changeset
1731 if ((y&(vertLumPerChroma-1)) == vertLumPerChroma-1)
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1732 {
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1733 usrc += chromStride;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1734 vsrc += chromStride;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1735 }
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1736 ysrc += lumStride;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1737 dst += dstStride;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1738 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1739 #ifdef HAVE_MMX
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1740 asm( EMMS" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1741 SFENCE" \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1742 :::"memory");
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1743 #endif
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1744 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1745
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1746 /**
27158
65b8334df960 spelling/grammar/wording overhaul
diego
parents: 26925
diff changeset
1747 * Height should be a multiple of 2 and width should be a multiple of 16
65b8334df960 spelling/grammar/wording overhaul
diego
parents: 26925
diff changeset
1748 * (If this is a problem for anyone then tell me, and I will fix it.)
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1749 */
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1750 static inline void RENAME(yv12touyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1751 long width, long height,
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1752 long lumStride, long chromStride, long dstStride)
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1753 {
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1754 //FIXME interpolate chroma
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1755 RENAME(yuvPlanartouyvy)(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride, 2);
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1756 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1757
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1758 /**
25109
a362a3b42e24 comment spelling/grammar fixes
diego
parents: 23702
diff changeset
1759 * Width should be a multiple of 16.
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1760 */
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1761 static inline void RENAME(yuv422ptoyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1762 long width, long height,
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1763 long lumStride, long chromStride, long dstStride)
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1764 {
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1765 RENAME(yuvPlanartoyuy2)(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride, 1);
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1766 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1767
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1768 /**
27158
65b8334df960 spelling/grammar/wording overhaul
diego
parents: 26925
diff changeset
1769 * Height should be a multiple of 2 and width should be a multiple of 16.
65b8334df960 spelling/grammar/wording overhaul
diego
parents: 26925
diff changeset
1770 * (If this is a problem for anyone then tell me, and I will fix it.)
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1771 */
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1772 static inline void RENAME(yuy2toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1773 long width, long height,
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1774 long lumStride, long chromStride, long srcStride)
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1775 {
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1776 long y;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1777 const long chromWidth= width>>1;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1778 for (y=0; y<height; y+=2)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1779 {
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1780 #ifdef HAVE_MMX
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1781 asm volatile(
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1782 "xor %%"REG_a", %%"REG_a" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1783 "pcmpeqw %%mm7, %%mm7 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1784 "psrlw $8, %%mm7 \n\t" // FF,00,FF,00...
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1785 ASMALIGN(4)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1786 "1: \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1787 PREFETCH" 64(%0, %%"REG_a", 4) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1788 "movq (%0, %%"REG_a", 4), %%mm0 \n\t" // YUYV YUYV(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1789 "movq 8(%0, %%"REG_a", 4), %%mm1 \n\t" // YUYV YUYV(4)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1790 "movq %%mm0, %%mm2 \n\t" // YUYV YUYV(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1791 "movq %%mm1, %%mm3 \n\t" // YUYV YUYV(4)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1792 "psrlw $8, %%mm0 \n\t" // U0V0 U0V0(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1793 "psrlw $8, %%mm1 \n\t" // U0V0 U0V0(4)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1794 "pand %%mm7, %%mm2 \n\t" // Y0Y0 Y0Y0(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1795 "pand %%mm7, %%mm3 \n\t" // Y0Y0 Y0Y0(4)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1796 "packuswb %%mm1, %%mm0 \n\t" // UVUV UVUV(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1797 "packuswb %%mm3, %%mm2 \n\t" // YYYY YYYY(0)
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1798
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1799 MOVNTQ" %%mm2, (%1, %%"REG_a", 2) \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1800
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1801 "movq 16(%0, %%"REG_a", 4), %%mm1 \n\t" // YUYV YUYV(8)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1802 "movq 24(%0, %%"REG_a", 4), %%mm2 \n\t" // YUYV YUYV(12)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1803 "movq %%mm1, %%mm3 \n\t" // YUYV YUYV(8)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1804 "movq %%mm2, %%mm4 \n\t" // YUYV YUYV(12)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1805 "psrlw $8, %%mm1 \n\t" // U0V0 U0V0(8)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1806 "psrlw $8, %%mm2 \n\t" // U0V0 U0V0(12)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1807 "pand %%mm7, %%mm3 \n\t" // Y0Y0 Y0Y0(8)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1808 "pand %%mm7, %%mm4 \n\t" // Y0Y0 Y0Y0(12)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1809 "packuswb %%mm2, %%mm1 \n\t" // UVUV UVUV(8)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1810 "packuswb %%mm4, %%mm3 \n\t" // YYYY YYYY(8)
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1811
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1812 MOVNTQ" %%mm3, 8(%1, %%"REG_a", 2) \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1813
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1814 "movq %%mm0, %%mm2 \n\t" // UVUV UVUV(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1815 "movq %%mm1, %%mm3 \n\t" // UVUV UVUV(8)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1816 "psrlw $8, %%mm0 \n\t" // V0V0 V0V0(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1817 "psrlw $8, %%mm1 \n\t" // V0V0 V0V0(8)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1818 "pand %%mm7, %%mm2 \n\t" // U0U0 U0U0(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1819 "pand %%mm7, %%mm3 \n\t" // U0U0 U0U0(8)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1820 "packuswb %%mm1, %%mm0 \n\t" // VVVV VVVV(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1821 "packuswb %%mm3, %%mm2 \n\t" // UUUU UUUU(0)
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1822
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1823 MOVNTQ" %%mm0, (%3, %%"REG_a") \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1824 MOVNTQ" %%mm2, (%2, %%"REG_a") \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1825
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1826 "add $8, %%"REG_a" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1827 "cmp %4, %%"REG_a" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1828 " jb 1b \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1829 ::"r"(src), "r"(ydst), "r"(udst), "r"(vdst), "g" (chromWidth)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1830 : "memory", "%"REG_a
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1831 );
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1832
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1833 ydst += lumStride;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1834 src += srcStride;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1835
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1836 asm volatile(
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1837 "xor %%"REG_a", %%"REG_a" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1838 ASMALIGN(4)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1839 "1: \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1840 PREFETCH" 64(%0, %%"REG_a", 4) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1841 "movq (%0, %%"REG_a", 4), %%mm0 \n\t" // YUYV YUYV(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1842 "movq 8(%0, %%"REG_a", 4), %%mm1 \n\t" // YUYV YUYV(4)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1843 "movq 16(%0, %%"REG_a", 4), %%mm2 \n\t" // YUYV YUYV(8)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1844 "movq 24(%0, %%"REG_a", 4), %%mm3 \n\t" // YUYV YUYV(12)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1845 "pand %%mm7, %%mm0 \n\t" // Y0Y0 Y0Y0(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1846 "pand %%mm7, %%mm1 \n\t" // Y0Y0 Y0Y0(4)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1847 "pand %%mm7, %%mm2 \n\t" // Y0Y0 Y0Y0(8)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1848 "pand %%mm7, %%mm3 \n\t" // Y0Y0 Y0Y0(12)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1849 "packuswb %%mm1, %%mm0 \n\t" // YYYY YYYY(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1850 "packuswb %%mm3, %%mm2 \n\t" // YYYY YYYY(8)
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1851
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1852 MOVNTQ" %%mm0, (%1, %%"REG_a", 2) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1853 MOVNTQ" %%mm2, 8(%1, %%"REG_a", 2) \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1854
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1855 "add $8, %%"REG_a" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1856 "cmp %4, %%"REG_a" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1857 " jb 1b \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1858
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1859 ::"r"(src), "r"(ydst), "r"(udst), "r"(vdst), "g" (chromWidth)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1860 : "memory", "%"REG_a
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1861 );
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1862 #else
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1863 long i;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1864 for (i=0; i<chromWidth; i++)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1865 {
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1866 ydst[2*i+0] = src[4*i+0];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1867 udst[i] = src[4*i+1];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1868 ydst[2*i+1] = src[4*i+2];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1869 vdst[i] = src[4*i+3];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1870 }
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1871 ydst += lumStride;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1872 src += srcStride;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1873
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1874 for (i=0; i<chromWidth; i++)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1875 {
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1876 ydst[2*i+0] = src[4*i+0];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1877 ydst[2*i+1] = src[4*i+2];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1878 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1879 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1880 udst += chromStride;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1881 vdst += chromStride;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1882 ydst += lumStride;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1883 src += srcStride;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1884 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1885 #ifdef HAVE_MMX
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1886 asm volatile( EMMS" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1887 SFENCE" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1888 :::"memory");
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1889 #endif
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1890 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1891
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1892 static inline void RENAME(yvu9toyv12)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc,
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1893 uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1894 long width, long height, long lumStride, long chromStride)
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1895 {
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1896 /* Y Plane */
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1897 memcpy(ydst, ysrc, width*height);
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1898
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1899 /* XXX: implement upscaling for U,V */
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1900 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1901
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1902 static inline void RENAME(planar2x)(const uint8_t *src, uint8_t *dst, long srcWidth, long srcHeight, long srcStride, long dstStride)
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1903 {
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1904 long x,y;
23129
9528d1ebe68f cosmetics: Remove trailing whitespace.
diego
parents: 23004
diff changeset
1905
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1906 dst[0]= src[0];
23129
9528d1ebe68f cosmetics: Remove trailing whitespace.
diego
parents: 23004
diff changeset
1907
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1908 // first line
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1909 for (x=0; x<srcWidth-1; x++){
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1910 dst[2*x+1]= (3*src[x] + src[x+1])>>2;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1911 dst[2*x+2]= ( src[x] + 3*src[x+1])>>2;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1912 }
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1913 dst[2*srcWidth-1]= src[srcWidth-1];
23129
9528d1ebe68f cosmetics: Remove trailing whitespace.
diego
parents: 23004
diff changeset
1914
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1915 dst+= dstStride;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1916
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1917 for (y=1; y<srcHeight; y++){
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1918 #if defined (HAVE_MMX2) || defined (HAVE_3DNOW)
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1919 const long mmxSize= srcWidth&~15;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1920 asm volatile(
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1921 "mov %4, %%"REG_a" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1922 "1: \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1923 "movq (%0, %%"REG_a"), %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1924 "movq (%1, %%"REG_a"), %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1925 "movq 1(%0, %%"REG_a"), %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1926 "movq 1(%1, %%"REG_a"), %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1927 "movq -1(%0, %%"REG_a"), %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1928 "movq -1(%1, %%"REG_a"), %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1929 PAVGB" %%mm0, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1930 PAVGB" %%mm0, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1931 PAVGB" %%mm0, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1932 PAVGB" %%mm0, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1933 PAVGB" %%mm1, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1934 PAVGB" %%mm1, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1935 PAVGB" %%mm1, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1936 PAVGB" %%mm1, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1937 "movq %%mm5, %%mm7 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1938 "movq %%mm4, %%mm6 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1939 "punpcklbw %%mm3, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1940 "punpckhbw %%mm3, %%mm7 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1941 "punpcklbw %%mm2, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1942 "punpckhbw %%mm2, %%mm6 \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1943 #if 1
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1944 MOVNTQ" %%mm5, (%2, %%"REG_a", 2) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1945 MOVNTQ" %%mm7, 8(%2, %%"REG_a", 2) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1946 MOVNTQ" %%mm4, (%3, %%"REG_a", 2) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1947 MOVNTQ" %%mm6, 8(%3, %%"REG_a", 2) \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1948 #else
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1949 "movq %%mm5, (%2, %%"REG_a", 2) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1950 "movq %%mm7, 8(%2, %%"REG_a", 2) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1951 "movq %%mm4, (%3, %%"REG_a", 2) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1952 "movq %%mm6, 8(%3, %%"REG_a", 2) \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1953 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1954 "add $8, %%"REG_a" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1955 " js 1b \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1956 :: "r" (src + mmxSize ), "r" (src + srcStride + mmxSize ),
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1957 "r" (dst + mmxSize*2), "r" (dst + dstStride + mmxSize*2),
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1958 "g" (-mmxSize)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1959 : "%"REG_a
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1960
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1961 );
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1962 #else
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1963 const long mmxSize=1;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1964 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1965 dst[0 ]= (3*src[0] + src[srcStride])>>2;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1966 dst[dstStride]= ( src[0] + 3*src[srcStride])>>2;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1967
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1968 for (x=mmxSize-1; x<srcWidth-1; x++){
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1969 dst[2*x +1]= (3*src[x+0] + src[x+srcStride+1])>>2;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1970 dst[2*x+dstStride+2]= ( src[x+0] + 3*src[x+srcStride+1])>>2;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1971 dst[2*x+dstStride+1]= ( src[x+1] + 3*src[x+srcStride ])>>2;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1972 dst[2*x +2]= (3*src[x+1] + src[x+srcStride ])>>2;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1973 }
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1974 dst[srcWidth*2 -1 ]= (3*src[srcWidth-1] + src[srcWidth-1 + srcStride])>>2;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1975 dst[srcWidth*2 -1 + dstStride]= ( src[srcWidth-1] + 3*src[srcWidth-1 + srcStride])>>2;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1976
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1977 dst+=dstStride*2;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1978 src+=srcStride;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1979 }
23129
9528d1ebe68f cosmetics: Remove trailing whitespace.
diego
parents: 23004
diff changeset
1980
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1981 // last line
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1982 #if 1
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1983 dst[0]= src[0];
23129
9528d1ebe68f cosmetics: Remove trailing whitespace.
diego
parents: 23004
diff changeset
1984
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1985 for (x=0; x<srcWidth-1; x++){
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1986 dst[2*x+1]= (3*src[x] + src[x+1])>>2;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1987 dst[2*x+2]= ( src[x] + 3*src[x+1])>>2;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1988 }
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1989 dst[2*srcWidth-1]= src[srcWidth-1];
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1990 #else
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1991 for (x=0; x<srcWidth; x++){
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1992 dst[2*x+0]=
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1993 dst[2*x+1]= src[x];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1994 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1995 #endif
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1996
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
1997 #ifdef HAVE_MMX
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1998 asm volatile( EMMS" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
1999 SFENCE" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2000 :::"memory");
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2001 #endif
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2002 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2003
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2004 /**
27158
65b8334df960 spelling/grammar/wording overhaul
diego
parents: 26925
diff changeset
2005 * Height should be a multiple of 2 and width should be a multiple of 16.
65b8334df960 spelling/grammar/wording overhaul
diego
parents: 26925
diff changeset
2006 * (If this is a problem for anyone then tell me, and I will fix it.)
65b8334df960 spelling/grammar/wording overhaul
diego
parents: 26925
diff changeset
2007 * Chrominance data is only taken from every second line, others are ignored.
25109
a362a3b42e24 comment spelling/grammar fixes
diego
parents: 23702
diff changeset
2008 * FIXME: Write HQ version.
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2009 */
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2010 static inline void RENAME(uyvytoyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2011 long width, long height,
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2012 long lumStride, long chromStride, long srcStride)
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2013 {
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2014 long y;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2015 const long chromWidth= width>>1;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2016 for (y=0; y<height; y+=2)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2017 {
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2018 #ifdef HAVE_MMX
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2019 asm volatile(
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2020 "xorl %%eax, %%eax \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2021 "pcmpeqw %%mm7, %%mm7 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2022 "psrlw $8, %%mm7 \n\t" // FF,00,FF,00...
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2023 ASMALIGN(4)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2024 "1: \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2025 PREFETCH" 64(%0, %%eax, 4) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2026 "movq (%0, %%eax, 4), %%mm0 \n\t" // UYVY UYVY(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2027 "movq 8(%0, %%eax, 4), %%mm1 \n\t" // UYVY UYVY(4)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2028 "movq %%mm0, %%mm2 \n\t" // UYVY UYVY(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2029 "movq %%mm1, %%mm3 \n\t" // UYVY UYVY(4)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2030 "pand %%mm7, %%mm0 \n\t" // U0V0 U0V0(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2031 "pand %%mm7, %%mm1 \n\t" // U0V0 U0V0(4)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2032 "psrlw $8, %%mm2 \n\t" // Y0Y0 Y0Y0(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2033 "psrlw $8, %%mm3 \n\t" // Y0Y0 Y0Y0(4)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2034 "packuswb %%mm1, %%mm0 \n\t" // UVUV UVUV(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2035 "packuswb %%mm3, %%mm2 \n\t" // YYYY YYYY(0)
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2036
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2037 MOVNTQ" %%mm2, (%1, %%eax, 2) \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2038
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2039 "movq 16(%0, %%eax, 4), %%mm1 \n\t" // UYVY UYVY(8)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2040 "movq 24(%0, %%eax, 4), %%mm2 \n\t" // UYVY UYVY(12)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2041 "movq %%mm1, %%mm3 \n\t" // UYVY UYVY(8)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2042 "movq %%mm2, %%mm4 \n\t" // UYVY UYVY(12)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2043 "pand %%mm7, %%mm1 \n\t" // U0V0 U0V0(8)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2044 "pand %%mm7, %%mm2 \n\t" // U0V0 U0V0(12)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2045 "psrlw $8, %%mm3 \n\t" // Y0Y0 Y0Y0(8)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2046 "psrlw $8, %%mm4 \n\t" // Y0Y0 Y0Y0(12)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2047 "packuswb %%mm2, %%mm1 \n\t" // UVUV UVUV(8)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2048 "packuswb %%mm4, %%mm3 \n\t" // YYYY YYYY(8)
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2049
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2050 MOVNTQ" %%mm3, 8(%1, %%eax, 2) \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2051
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2052 "movq %%mm0, %%mm2 \n\t" // UVUV UVUV(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2053 "movq %%mm1, %%mm3 \n\t" // UVUV UVUV(8)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2054 "psrlw $8, %%mm0 \n\t" // V0V0 V0V0(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2055 "psrlw $8, %%mm1 \n\t" // V0V0 V0V0(8)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2056 "pand %%mm7, %%mm2 \n\t" // U0U0 U0U0(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2057 "pand %%mm7, %%mm3 \n\t" // U0U0 U0U0(8)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2058 "packuswb %%mm1, %%mm0 \n\t" // VVVV VVVV(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2059 "packuswb %%mm3, %%mm2 \n\t" // UUUU UUUU(0)
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2060
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2061 MOVNTQ" %%mm0, (%3, %%eax) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2062 MOVNTQ" %%mm2, (%2, %%eax) \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2063
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2064 "addl $8, %%eax \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2065 "cmpl %4, %%eax \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2066 " jb 1b \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2067 ::"r"(src), "r"(ydst), "r"(udst), "r"(vdst), "g" (chromWidth)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2068 : "memory", "%eax"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2069 );
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2070
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2071 ydst += lumStride;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2072 src += srcStride;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2073
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2074 asm volatile(
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2075 "xorl %%eax, %%eax \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2076 ASMALIGN(4)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2077 "1: \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2078 PREFETCH" 64(%0, %%eax, 4) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2079 "movq (%0, %%eax, 4), %%mm0 \n\t" // YUYV YUYV(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2080 "movq 8(%0, %%eax, 4), %%mm1 \n\t" // YUYV YUYV(4)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2081 "movq 16(%0, %%eax, 4), %%mm2 \n\t" // YUYV YUYV(8)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2082 "movq 24(%0, %%eax, 4), %%mm3 \n\t" // YUYV YUYV(12)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2083 "psrlw $8, %%mm0 \n\t" // Y0Y0 Y0Y0(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2084 "psrlw $8, %%mm1 \n\t" // Y0Y0 Y0Y0(4)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2085 "psrlw $8, %%mm2 \n\t" // Y0Y0 Y0Y0(8)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2086 "psrlw $8, %%mm3 \n\t" // Y0Y0 Y0Y0(12)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2087 "packuswb %%mm1, %%mm0 \n\t" // YYYY YYYY(0)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2088 "packuswb %%mm3, %%mm2 \n\t" // YYYY YYYY(8)
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2089
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2090 MOVNTQ" %%mm0, (%1, %%eax, 2) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2091 MOVNTQ" %%mm2, 8(%1, %%eax, 2) \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2092
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2093 "addl $8, %%eax \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2094 "cmpl %4, %%eax \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2095 " jb 1b \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2096
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2097 ::"r"(src), "r"(ydst), "r"(udst), "r"(vdst), "g" (chromWidth)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2098 : "memory", "%eax"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2099 );
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2100 #else
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2101 long i;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2102 for (i=0; i<chromWidth; i++)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2103 {
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2104 udst[i] = src[4*i+0];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2105 ydst[2*i+0] = src[4*i+1];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2106 vdst[i] = src[4*i+2];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2107 ydst[2*i+1] = src[4*i+3];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2108 }
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2109 ydst += lumStride;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2110 src += srcStride;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2111
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2112 for (i=0; i<chromWidth; i++)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2113 {
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2114 ydst[2*i+0] = src[4*i+1];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2115 ydst[2*i+1] = src[4*i+3];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2116 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2117 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2118 udst += chromStride;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2119 vdst += chromStride;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2120 ydst += lumStride;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2121 src += srcStride;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2122 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2123 #ifdef HAVE_MMX
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2124 asm volatile( EMMS" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2125 SFENCE" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2126 :::"memory");
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2127 #endif
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2128 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2129
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2130 /**
27158
65b8334df960 spelling/grammar/wording overhaul
diego
parents: 26925
diff changeset
2131 * Height should be a multiple of 2 and width should be a multiple of 2.
65b8334df960 spelling/grammar/wording overhaul
diego
parents: 26925
diff changeset
2132 * (If this is a problem for anyone then tell me, and I will fix it.)
65b8334df960 spelling/grammar/wording overhaul
diego
parents: 26925
diff changeset
2133 * Chrominance data is only taken from every second line,
25109
a362a3b42e24 comment spelling/grammar fixes
diego
parents: 23702
diff changeset
2134 * others are ignored in the C version.
a362a3b42e24 comment spelling/grammar fixes
diego
parents: 23702
diff changeset
2135 * FIXME: Write HQ version.
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2136 */
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2137 static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2138 long width, long height,
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2139 long lumStride, long chromStride, long srcStride)
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2140 {
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2141 long y;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2142 const long chromWidth= width>>1;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2143 #ifdef HAVE_MMX
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2144 for (y=0; y<height-2; y+=2)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2145 {
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2146 long i;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2147 for (i=0; i<2; i++)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2148 {
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2149 asm volatile(
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2150 "mov %2, %%"REG_a" \n\t"
25882
2ad528dd42a0 Make some assembler constants global instead of declaring them multiple times.
reimar
parents: 25751
diff changeset
2151 "movq "MANGLE(ff_bgr2YCoeff)", %%mm6 \n\t"
2ad528dd42a0 Make some assembler constants global instead of declaring them multiple times.
reimar
parents: 25751
diff changeset
2152 "movq "MANGLE(ff_w1111)", %%mm5 \n\t"
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2153 "pxor %%mm7, %%mm7 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2154 "lea (%%"REG_a", %%"REG_a", 2), %%"REG_d" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2155 ASMALIGN(4)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2156 "1: \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2157 PREFETCH" 64(%0, %%"REG_d") \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2158 "movd (%0, %%"REG_d"), %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2159 "movd 3(%0, %%"REG_d"), %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2160 "punpcklbw %%mm7, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2161 "punpcklbw %%mm7, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2162 "movd 6(%0, %%"REG_d"), %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2163 "movd 9(%0, %%"REG_d"), %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2164 "punpcklbw %%mm7, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2165 "punpcklbw %%mm7, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2166 "pmaddwd %%mm6, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2167 "pmaddwd %%mm6, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2168 "pmaddwd %%mm6, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2169 "pmaddwd %%mm6, %%mm3 \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2170 #ifndef FAST_BGR2YV12
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2171 "psrad $8, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2172 "psrad $8, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2173 "psrad $8, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2174 "psrad $8, %%mm3 \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2175 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2176 "packssdw %%mm1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2177 "packssdw %%mm3, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2178 "pmaddwd %%mm5, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2179 "pmaddwd %%mm5, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2180 "packssdw %%mm2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2181 "psraw $7, %%mm0 \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2182
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2183 "movd 12(%0, %%"REG_d"), %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2184 "movd 15(%0, %%"REG_d"), %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2185 "punpcklbw %%mm7, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2186 "punpcklbw %%mm7, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2187 "movd 18(%0, %%"REG_d"), %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2188 "movd 21(%0, %%"REG_d"), %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2189 "punpcklbw %%mm7, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2190 "punpcklbw %%mm7, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2191 "pmaddwd %%mm6, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2192 "pmaddwd %%mm6, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2193 "pmaddwd %%mm6, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2194 "pmaddwd %%mm6, %%mm3 \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2195 #ifndef FAST_BGR2YV12
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2196 "psrad $8, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2197 "psrad $8, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2198 "psrad $8, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2199 "psrad $8, %%mm3 \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2200 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2201 "packssdw %%mm1, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2202 "packssdw %%mm3, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2203 "pmaddwd %%mm5, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2204 "pmaddwd %%mm5, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2205 "add $24, %%"REG_d" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2206 "packssdw %%mm2, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2207 "psraw $7, %%mm4 \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2208
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2209 "packuswb %%mm4, %%mm0 \n\t"
25882
2ad528dd42a0 Make some assembler constants global instead of declaring them multiple times.
reimar
parents: 25751
diff changeset
2210 "paddusb "MANGLE(ff_bgr2YOffset)", %%mm0 \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2211
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2212 MOVNTQ" %%mm0, (%1, %%"REG_a") \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2213 "add $8, %%"REG_a" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2214 " js 1b \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2215 : : "r" (src+width*3), "r" (ydst+width), "g" (-width)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2216 : "%"REG_a, "%"REG_d
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2217 );
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2218 ydst += lumStride;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2219 src += srcStride;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2220 }
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2221 src -= srcStride*2;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2222 asm volatile(
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2223 "mov %4, %%"REG_a" \n\t"
25882
2ad528dd42a0 Make some assembler constants global instead of declaring them multiple times.
reimar
parents: 25751
diff changeset
2224 "movq "MANGLE(ff_w1111)", %%mm5 \n\t"
2ad528dd42a0 Make some assembler constants global instead of declaring them multiple times.
reimar
parents: 25751
diff changeset
2225 "movq "MANGLE(ff_bgr2UCoeff)", %%mm6 \n\t"
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2226 "pxor %%mm7, %%mm7 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2227 "lea (%%"REG_a", %%"REG_a", 2), %%"REG_d" \n\t"
23156
f9a8f92087ef cosmetics: Fix stray wrongly indented line.
diego
parents: 23140
diff changeset
2228 "add %%"REG_d", %%"REG_d" \n\t"
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2229 ASMALIGN(4)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2230 "1: \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2231 PREFETCH" 64(%0, %%"REG_d") \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2232 PREFETCH" 64(%1, %%"REG_d") \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2233 #if defined (HAVE_MMX2) || defined (HAVE_3DNOW)
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2234 "movq (%0, %%"REG_d"), %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2235 "movq (%1, %%"REG_d"), %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2236 "movq 6(%0, %%"REG_d"), %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2237 "movq 6(%1, %%"REG_d"), %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2238 PAVGB" %%mm1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2239 PAVGB" %%mm3, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2240 "movq %%mm0, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2241 "movq %%mm2, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2242 "psrlq $24, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2243 "psrlq $24, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2244 PAVGB" %%mm1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2245 PAVGB" %%mm3, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2246 "punpcklbw %%mm7, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2247 "punpcklbw %%mm7, %%mm2 \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2248 #else
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2249 "movd (%0, %%"REG_d"), %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2250 "movd (%1, %%"REG_d"), %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2251 "movd 3(%0, %%"REG_d"), %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2252 "movd 3(%1, %%"REG_d"), %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2253 "punpcklbw %%mm7, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2254 "punpcklbw %%mm7, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2255 "punpcklbw %%mm7, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2256 "punpcklbw %%mm7, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2257 "paddw %%mm1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2258 "paddw %%mm3, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2259 "paddw %%mm2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2260 "movd 6(%0, %%"REG_d"), %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2261 "movd 6(%1, %%"REG_d"), %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2262 "movd 9(%0, %%"REG_d"), %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2263 "movd 9(%1, %%"REG_d"), %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2264 "punpcklbw %%mm7, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2265 "punpcklbw %%mm7, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2266 "punpcklbw %%mm7, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2267 "punpcklbw %%mm7, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2268 "paddw %%mm1, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2269 "paddw %%mm3, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2270 "paddw %%mm4, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2271 "psrlw $2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2272 "psrlw $2, %%mm2 \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2273 #endif
25882
2ad528dd42a0 Make some assembler constants global instead of declaring them multiple times.
reimar
parents: 25751
diff changeset
2274 "movq "MANGLE(ff_bgr2VCoeff)", %%mm1 \n\t"
2ad528dd42a0 Make some assembler constants global instead of declaring them multiple times.
reimar
parents: 25751
diff changeset
2275 "movq "MANGLE(ff_bgr2VCoeff)", %%mm3 \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2276
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2277 "pmaddwd %%mm0, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2278 "pmaddwd %%mm2, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2279 "pmaddwd %%mm6, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2280 "pmaddwd %%mm6, %%mm2 \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2281 #ifndef FAST_BGR2YV12
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2282 "psrad $8, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2283 "psrad $8, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2284 "psrad $8, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2285 "psrad $8, %%mm3 \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2286 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2287 "packssdw %%mm2, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2288 "packssdw %%mm3, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2289 "pmaddwd %%mm5, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2290 "pmaddwd %%mm5, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2291 "packssdw %%mm1, %%mm0 \n\t" // V1 V0 U1 U0
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2292 "psraw $7, %%mm0 \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2293
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2294 #if defined (HAVE_MMX2) || defined (HAVE_3DNOW)
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2295 "movq 12(%0, %%"REG_d"), %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2296 "movq 12(%1, %%"REG_d"), %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2297 "movq 18(%0, %%"REG_d"), %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2298 "movq 18(%1, %%"REG_d"), %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2299 PAVGB" %%mm1, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2300 PAVGB" %%mm3, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2301 "movq %%mm4, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2302 "movq %%mm2, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2303 "psrlq $24, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2304 "psrlq $24, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2305 PAVGB" %%mm1, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2306 PAVGB" %%mm3, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2307 "punpcklbw %%mm7, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2308 "punpcklbw %%mm7, %%mm2 \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2309 #else
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2310 "movd 12(%0, %%"REG_d"), %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2311 "movd 12(%1, %%"REG_d"), %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2312 "movd 15(%0, %%"REG_d"), %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2313 "movd 15(%1, %%"REG_d"), %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2314 "punpcklbw %%mm7, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2315 "punpcklbw %%mm7, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2316 "punpcklbw %%mm7, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2317 "punpcklbw %%mm7, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2318 "paddw %%mm1, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2319 "paddw %%mm3, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2320 "paddw %%mm2, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2321 "movd 18(%0, %%"REG_d"), %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2322 "movd 18(%1, %%"REG_d"), %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2323 "movd 21(%0, %%"REG_d"), %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2324 "movd 21(%1, %%"REG_d"), %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2325 "punpcklbw %%mm7, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2326 "punpcklbw %%mm7, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2327 "punpcklbw %%mm7, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2328 "punpcklbw %%mm7, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2329 "paddw %%mm1, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2330 "paddw %%mm3, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2331 "paddw %%mm5, %%mm2 \n\t"
25882
2ad528dd42a0 Make some assembler constants global instead of declaring them multiple times.
reimar
parents: 25751
diff changeset
2332 "movq "MANGLE(ff_w1111)", %%mm5 \n\t"
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2333 "psrlw $2, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2334 "psrlw $2, %%mm2 \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2335 #endif
25882
2ad528dd42a0 Make some assembler constants global instead of declaring them multiple times.
reimar
parents: 25751
diff changeset
2336 "movq "MANGLE(ff_bgr2VCoeff)", %%mm1 \n\t"
2ad528dd42a0 Make some assembler constants global instead of declaring them multiple times.
reimar
parents: 25751
diff changeset
2337 "movq "MANGLE(ff_bgr2VCoeff)", %%mm3 \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2338
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2339 "pmaddwd %%mm4, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2340 "pmaddwd %%mm2, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2341 "pmaddwd %%mm6, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2342 "pmaddwd %%mm6, %%mm2 \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2343 #ifndef FAST_BGR2YV12
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2344 "psrad $8, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2345 "psrad $8, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2346 "psrad $8, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2347 "psrad $8, %%mm3 \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2348 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2349 "packssdw %%mm2, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2350 "packssdw %%mm3, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2351 "pmaddwd %%mm5, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2352 "pmaddwd %%mm5, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2353 "add $24, %%"REG_d" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2354 "packssdw %%mm1, %%mm4 \n\t" // V3 V2 U3 U2
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2355 "psraw $7, %%mm4 \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2356
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2357 "movq %%mm0, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2358 "punpckldq %%mm4, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2359 "punpckhdq %%mm4, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2360 "packsswb %%mm1, %%mm0 \n\t"
25882
2ad528dd42a0 Make some assembler constants global instead of declaring them multiple times.
reimar
parents: 25751
diff changeset
2361 "paddb "MANGLE(ff_bgr2UVOffset)", %%mm0 \n\t"
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2362 "movd %%mm0, (%2, %%"REG_a") \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2363 "punpckhdq %%mm0, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2364 "movd %%mm0, (%3, %%"REG_a") \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2365 "add $4, %%"REG_a" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2366 " js 1b \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2367 : : "r" (src+chromWidth*6), "r" (src+srcStride+chromWidth*6), "r" (udst+chromWidth), "r" (vdst+chromWidth), "g" (-chromWidth)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2368 : "%"REG_a, "%"REG_d
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2369 );
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2370
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2371 udst += chromStride;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2372 vdst += chromStride;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2373 src += srcStride*2;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2374 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2375
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2376 asm volatile( EMMS" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2377 SFENCE" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2378 :::"memory");
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2379 #else
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2380 y=0;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2381 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2382 for (; y<height; y+=2)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2383 {
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2384 long i;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2385 for (i=0; i<chromWidth; i++)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2386 {
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2387 unsigned int b = src[6*i+0];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2388 unsigned int g = src[6*i+1];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2389 unsigned int r = src[6*i+2];
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2390
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2391 unsigned int Y = ((RY*r + GY*g + BY*b)>>RGB2YUV_SHIFT) + 16;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2392 unsigned int V = ((RV*r + GV*g + BV*b)>>RGB2YUV_SHIFT) + 128;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2393 unsigned int U = ((RU*r + GU*g + BU*b)>>RGB2YUV_SHIFT) + 128;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2394
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2395 udst[i] = U;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2396 vdst[i] = V;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2397 ydst[2*i] = Y;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2398
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2399 b = src[6*i+3];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2400 g = src[6*i+4];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2401 r = src[6*i+5];
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2402
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2403 Y = ((RY*r + GY*g + BY*b)>>RGB2YUV_SHIFT) + 16;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2404 ydst[2*i+1] = Y;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2405 }
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2406 ydst += lumStride;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2407 src += srcStride;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2408
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2409 for (i=0; i<chromWidth; i++)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2410 {
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2411 unsigned int b = src[6*i+0];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2412 unsigned int g = src[6*i+1];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2413 unsigned int r = src[6*i+2];
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2414
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2415 unsigned int Y = ((RY*r + GY*g + BY*b)>>RGB2YUV_SHIFT) + 16;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2416
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2417 ydst[2*i] = Y;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2418
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2419 b = src[6*i+3];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2420 g = src[6*i+4];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2421 r = src[6*i+5];
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2422
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2423 Y = ((RY*r + GY*g + BY*b)>>RGB2YUV_SHIFT) + 16;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2424 ydst[2*i+1] = Y;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2425 }
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2426 udst += chromStride;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2427 vdst += chromStride;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2428 ydst += lumStride;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2429 src += srcStride;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2430 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2431 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2432
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2433 void RENAME(interleaveBytes)(uint8_t *src1, uint8_t *src2, uint8_t *dest,
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2434 long width, long height, long src1Stride,
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2435 long src2Stride, long dstStride){
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2436 long h;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2437
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2438 for (h=0; h < height; h++)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2439 {
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2440 long w;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2441
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2442 #ifdef HAVE_MMX
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2443 #ifdef HAVE_SSE2
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2444 asm(
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2445 "xor %%"REG_a", %%"REG_a" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2446 "1: \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2447 PREFETCH" 64(%1, %%"REG_a") \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2448 PREFETCH" 64(%2, %%"REG_a") \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2449 "movdqa (%1, %%"REG_a"), %%xmm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2450 "movdqa (%1, %%"REG_a"), %%xmm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2451 "movdqa (%2, %%"REG_a"), %%xmm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2452 "punpcklbw %%xmm2, %%xmm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2453 "punpckhbw %%xmm2, %%xmm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2454 "movntdq %%xmm0, (%0, %%"REG_a", 2) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2455 "movntdq %%xmm1, 16(%0, %%"REG_a", 2) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2456 "add $16, %%"REG_a" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2457 "cmp %3, %%"REG_a" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2458 " jb 1b \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2459 ::"r"(dest), "r"(src1), "r"(src2), "r" (width-15)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2460 : "memory", "%"REG_a""
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2461 );
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2462 #else
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2463 asm(
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2464 "xor %%"REG_a", %%"REG_a" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2465 "1: \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2466 PREFETCH" 64(%1, %%"REG_a") \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2467 PREFETCH" 64(%2, %%"REG_a") \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2468 "movq (%1, %%"REG_a"), %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2469 "movq 8(%1, %%"REG_a"), %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2470 "movq %%mm0, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2471 "movq %%mm2, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2472 "movq (%2, %%"REG_a"), %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2473 "movq 8(%2, %%"REG_a"), %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2474 "punpcklbw %%mm4, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2475 "punpckhbw %%mm4, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2476 "punpcklbw %%mm5, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2477 "punpckhbw %%mm5, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2478 MOVNTQ" %%mm0, (%0, %%"REG_a", 2) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2479 MOVNTQ" %%mm1, 8(%0, %%"REG_a", 2) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2480 MOVNTQ" %%mm2, 16(%0, %%"REG_a", 2) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2481 MOVNTQ" %%mm3, 24(%0, %%"REG_a", 2) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2482 "add $16, %%"REG_a" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2483 "cmp %3, %%"REG_a" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2484 " jb 1b \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2485 ::"r"(dest), "r"(src1), "r"(src2), "r" (width-15)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2486 : "memory", "%"REG_a
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2487 );
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2488 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2489 for (w= (width&(~15)); w < width; w++)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2490 {
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2491 dest[2*w+0] = src1[w];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2492 dest[2*w+1] = src2[w];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2493 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2494 #else
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2495 for (w=0; w < width; w++)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2496 {
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2497 dest[2*w+0] = src1[w];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2498 dest[2*w+1] = src2[w];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2499 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2500 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2501 dest += dstStride;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2502 src1 += src1Stride;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2503 src2 += src2Stride;
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2504 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2505 #ifdef HAVE_MMX
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2506 asm(
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2507 EMMS" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2508 SFENCE" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2509 ::: "memory"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2510 );
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2511 #endif
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2512 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2513
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2514 static inline void RENAME(vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2,
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2515 uint8_t *dst1, uint8_t *dst2,
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2516 long width, long height,
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2517 long srcStride1, long srcStride2,
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2518 long dstStride1, long dstStride2)
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2519 {
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2520 long y,x,w,h;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2521 w=width/2; h=height/2;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2522 #ifdef HAVE_MMX
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2523 asm volatile(
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2524 PREFETCH" %0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2525 PREFETCH" %1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2526 ::"m"(*(src1+srcStride1)),"m"(*(src2+srcStride2)):"memory");
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2527 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2528 for (y=0;y<h;y++){
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2529 const uint8_t* s1=src1+srcStride1*(y>>1);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2530 uint8_t* d=dst1+dstStride1*y;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2531 x=0;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2532 #ifdef HAVE_MMX
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2533 for (;x<w-31;x+=32)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2534 {
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2535 asm volatile(
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2536 PREFETCH" 32%1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2537 "movq %1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2538 "movq 8%1, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2539 "movq 16%1, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2540 "movq 24%1, %%mm6 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2541 "movq %%mm0, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2542 "movq %%mm2, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2543 "movq %%mm4, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2544 "movq %%mm6, %%mm7 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2545 "punpcklbw %%mm0, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2546 "punpckhbw %%mm1, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2547 "punpcklbw %%mm2, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2548 "punpckhbw %%mm3, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2549 "punpcklbw %%mm4, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2550 "punpckhbw %%mm5, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2551 "punpcklbw %%mm6, %%mm6 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2552 "punpckhbw %%mm7, %%mm7 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2553 MOVNTQ" %%mm0, %0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2554 MOVNTQ" %%mm1, 8%0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2555 MOVNTQ" %%mm2, 16%0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2556 MOVNTQ" %%mm3, 24%0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2557 MOVNTQ" %%mm4, 32%0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2558 MOVNTQ" %%mm5, 40%0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2559 MOVNTQ" %%mm6, 48%0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2560 MOVNTQ" %%mm7, 56%0"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2561 :"=m"(d[2*x])
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2562 :"m"(s1[x])
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2563 :"memory");
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2564 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2565 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2566 for (;x<w;x++) d[2*x]=d[2*x+1]=s1[x];
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2567 }
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2568 for (y=0;y<h;y++){
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2569 const uint8_t* s2=src2+srcStride2*(y>>1);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2570 uint8_t* d=dst2+dstStride2*y;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2571 x=0;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2572 #ifdef HAVE_MMX
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2573 for (;x<w-31;x+=32)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2574 {
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2575 asm volatile(
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2576 PREFETCH" 32%1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2577 "movq %1, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2578 "movq 8%1, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2579 "movq 16%1, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2580 "movq 24%1, %%mm6 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2581 "movq %%mm0, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2582 "movq %%mm2, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2583 "movq %%mm4, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2584 "movq %%mm6, %%mm7 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2585 "punpcklbw %%mm0, %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2586 "punpckhbw %%mm1, %%mm1 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2587 "punpcklbw %%mm2, %%mm2 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2588 "punpckhbw %%mm3, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2589 "punpcklbw %%mm4, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2590 "punpckhbw %%mm5, %%mm5 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2591 "punpcklbw %%mm6, %%mm6 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2592 "punpckhbw %%mm7, %%mm7 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2593 MOVNTQ" %%mm0, %0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2594 MOVNTQ" %%mm1, 8%0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2595 MOVNTQ" %%mm2, 16%0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2596 MOVNTQ" %%mm3, 24%0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2597 MOVNTQ" %%mm4, 32%0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2598 MOVNTQ" %%mm5, 40%0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2599 MOVNTQ" %%mm6, 48%0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2600 MOVNTQ" %%mm7, 56%0"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2601 :"=m"(d[2*x])
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2602 :"m"(s2[x])
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2603 :"memory");
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2604 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2605 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2606 for (;x<w;x++) d[2*x]=d[2*x+1]=s2[x];
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2607 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2608 #ifdef HAVE_MMX
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2609 asm(
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2610 EMMS" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2611 SFENCE" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2612 ::: "memory"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2613 );
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2614 #endif
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2615 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2616
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2617 static inline void RENAME(yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2, const uint8_t *src3,
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2618 uint8_t *dst,
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2619 long width, long height,
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2620 long srcStride1, long srcStride2,
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2621 long srcStride3, long dstStride)
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2622 {
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2623 long y,x,w,h;
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2624 w=width/2; h=height;
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2625 for (y=0;y<h;y++){
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2626 const uint8_t* yp=src1+srcStride1*y;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2627 const uint8_t* up=src2+srcStride2*(y>>2);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2628 const uint8_t* vp=src3+srcStride3*(y>>2);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2629 uint8_t* d=dst+dstStride*y;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2630 x=0;
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2631 #ifdef HAVE_MMX
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2632 for (;x<w-7;x+=8)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2633 {
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2634 asm volatile(
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2635 PREFETCH" 32(%1, %0) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2636 PREFETCH" 32(%2, %0) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2637 PREFETCH" 32(%3, %0) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2638 "movq (%1, %0, 4), %%mm0 \n\t" /* Y0Y1Y2Y3Y4Y5Y6Y7 */
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2639 "movq (%2, %0), %%mm1 \n\t" /* U0U1U2U3U4U5U6U7 */
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2640 "movq (%3, %0), %%mm2 \n\t" /* V0V1V2V3V4V5V6V7 */
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2641 "movq %%mm0, %%mm3 \n\t" /* Y0Y1Y2Y3Y4Y5Y6Y7 */
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2642 "movq %%mm1, %%mm4 \n\t" /* U0U1U2U3U4U5U6U7 */
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2643 "movq %%mm2, %%mm5 \n\t" /* V0V1V2V3V4V5V6V7 */
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2644 "punpcklbw %%mm1, %%mm1 \n\t" /* U0U0 U1U1 U2U2 U3U3 */
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2645 "punpcklbw %%mm2, %%mm2 \n\t" /* V0V0 V1V1 V2V2 V3V3 */
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2646 "punpckhbw %%mm4, %%mm4 \n\t" /* U4U4 U5U5 U6U6 U7U7 */
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2647 "punpckhbw %%mm5, %%mm5 \n\t" /* V4V4 V5V5 V6V6 V7V7 */
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2648
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2649 "movq %%mm1, %%mm6 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2650 "punpcklbw %%mm2, %%mm1 \n\t" /* U0V0 U0V0 U1V1 U1V1*/
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2651 "punpcklbw %%mm1, %%mm0 \n\t" /* Y0U0 Y1V0 Y2U0 Y3V0*/
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2652 "punpckhbw %%mm1, %%mm3 \n\t" /* Y4U1 Y5V1 Y6U1 Y7V1*/
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2653 MOVNTQ" %%mm0, (%4, %0, 8) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2654 MOVNTQ" %%mm3, 8(%4, %0, 8) \n\t"
23129
9528d1ebe68f cosmetics: Remove trailing whitespace.
diego
parents: 23004
diff changeset
2655
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2656 "punpckhbw %%mm2, %%mm6 \n\t" /* U2V2 U2V2 U3V3 U3V3*/
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2657 "movq 8(%1, %0, 4), %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2658 "movq %%mm0, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2659 "punpcklbw %%mm6, %%mm0 \n\t" /* Y U2 Y V2 Y U2 Y V2*/
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2660 "punpckhbw %%mm6, %%mm3 \n\t" /* Y U3 Y V3 Y U3 Y V3*/
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2661 MOVNTQ" %%mm0, 16(%4, %0, 8) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2662 MOVNTQ" %%mm3, 24(%4, %0, 8) \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2663
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2664 "movq %%mm4, %%mm6 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2665 "movq 16(%1, %0, 4), %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2666 "movq %%mm0, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2667 "punpcklbw %%mm5, %%mm4 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2668 "punpcklbw %%mm4, %%mm0 \n\t" /* Y U4 Y V4 Y U4 Y V4*/
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2669 "punpckhbw %%mm4, %%mm3 \n\t" /* Y U5 Y V5 Y U5 Y V5*/
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2670 MOVNTQ" %%mm0, 32(%4, %0, 8) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2671 MOVNTQ" %%mm3, 40(%4, %0, 8) \n\t"
23129
9528d1ebe68f cosmetics: Remove trailing whitespace.
diego
parents: 23004
diff changeset
2672
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2673 "punpckhbw %%mm5, %%mm6 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2674 "movq 24(%1, %0, 4), %%mm0 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2675 "movq %%mm0, %%mm3 \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2676 "punpcklbw %%mm6, %%mm0 \n\t" /* Y U6 Y V6 Y U6 Y V6*/
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2677 "punpckhbw %%mm6, %%mm3 \n\t" /* Y U7 Y V7 Y U7 Y V7*/
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2678 MOVNTQ" %%mm0, 48(%4, %0, 8) \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2679 MOVNTQ" %%mm3, 56(%4, %0, 8) \n\t"
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2680
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2681 : "+r" (x)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2682 : "r"(yp), "r" (up), "r"(vp), "r"(d)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2683 :"memory");
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2684 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2685 #endif
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2686 for (; x<w; x++)
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2687 {
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2688 const long x2 = x<<2;
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2689 d[8*x+0] = yp[x2];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2690 d[8*x+1] = up[x];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2691 d[8*x+2] = yp[x2+1];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2692 d[8*x+3] = vp[x];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2693 d[8*x+4] = yp[x2+2];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2694 d[8*x+5] = up[x];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2695 d[8*x+6] = yp[x2+3];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2696 d[8*x+7] = vp[x];
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2697 }
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2698 }
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2699 #ifdef HAVE_MMX
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2700 asm(
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2701 EMMS" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2702 SFENCE" \n\t"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2703 ::: "memory"
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2704 );
18861
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2705 #endif
8579acff875e Move postproc ---> libswscale
lucabe
parents:
diff changeset
2706 }
22960
2d1ad4285df4 Remove code duplication in sws_rgb2rgb_init.
ivo
parents: 21029
diff changeset
2707
2d1ad4285df4 Remove code duplication in sws_rgb2rgb_init.
ivo
parents: 21029
diff changeset
2708 static inline void RENAME(rgb2rgb_init)(void){
23140
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2709 rgb15to16 = RENAME(rgb15to16);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2710 rgb15to24 = RENAME(rgb15to24);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2711 rgb15to32 = RENAME(rgb15to32);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2712 rgb16to24 = RENAME(rgb16to24);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2713 rgb16to32 = RENAME(rgb16to32);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2714 rgb16to15 = RENAME(rgb16to15);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2715 rgb24to16 = RENAME(rgb24to16);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2716 rgb24to15 = RENAME(rgb24to15);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2717 rgb24to32 = RENAME(rgb24to32);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2718 rgb32to16 = RENAME(rgb32to16);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2719 rgb32to15 = RENAME(rgb32to15);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2720 rgb32to24 = RENAME(rgb32to24);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2721 rgb24tobgr15 = RENAME(rgb24tobgr15);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2722 rgb24tobgr16 = RENAME(rgb24tobgr16);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2723 rgb24tobgr24 = RENAME(rgb24tobgr24);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2724 rgb32tobgr32 = RENAME(rgb32tobgr32);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2725 rgb32tobgr16 = RENAME(rgb32tobgr16);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2726 rgb32tobgr15 = RENAME(rgb32tobgr15);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2727 yv12toyuy2 = RENAME(yv12toyuy2);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2728 yv12touyvy = RENAME(yv12touyvy);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2729 yuv422ptoyuy2 = RENAME(yuv422ptoyuy2);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2730 yuy2toyv12 = RENAME(yuy2toyv12);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2731 // uyvytoyv12 = RENAME(uyvytoyv12);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2732 // yvu9toyv12 = RENAME(yvu9toyv12);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2733 planar2x = RENAME(planar2x);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2734 rgb24toyv12 = RENAME(rgb24toyv12);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2735 interleaveBytes = RENAME(interleaveBytes);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2736 vu9_to_vu12 = RENAME(vu9_to_vu12);
4d3870361b73 cosmetics attack, part I: Remove all tabs and prettyprint/reindent the code.
diego
parents: 23139
diff changeset
2737 yvu9_to_yuy2 = RENAME(yvu9_to_yuy2);
22960
2d1ad4285df4 Remove code duplication in sws_rgb2rgb_init.
ivo
parents: 21029
diff changeset
2738 }