annotate libswscale/rgb2rgb_template.c @ 29794:df1826dcdb2d

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