Mercurial > libavcodec.hg
annotate i386/dsputil_mmx.c @ 3839:c5ec6d7710ba libavcodec
Original Commit: r36 | ods15 | 2006-09-23 08:43:09 +0300 (Sat, 23 Sep 2006) | 2 lines
starting point for packet encode, writing floor
author | ods15 |
---|---|
date | Mon, 02 Oct 2006 05:56:18 +0000 |
parents | 6a40092eb9e6 |
children | d13da74a26f5 |
rev | line source |
---|---|
0 | 1 /* |
2 * MMX optimized DSP utils | |
429 | 3 * Copyright (c) 2000, 2001 Fabrice Bellard. |
1739
07a484280a82
copyright year update of the files i touched and remembered, things look annoyingly unmaintained otherwise
michael
parents:
1729
diff
changeset
|
4 * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at> |
0 | 5 * |
429 | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Lesser General Public | |
8 * License as published by the Free Software Foundation; either | |
9 * version 2 of the License, or (at your option) any later version. | |
0 | 10 * |
429 | 11 * This library is distributed in the hope that it will be useful, |
0 | 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
429 | 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 * Lesser General Public License for more details. | |
0 | 15 * |
429 | 16 * You should have received a copy of the GNU Lesser General Public |
17 * License along with this library; if not, write to the Free Software | |
3036
0b546eab515d
Update licensing information: The FSF changed postal address.
diego
parents:
2979
diff
changeset
|
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
0 | 19 * |
20 * MMX optimization by Nick Kurshev <nickols_k@mail.ru> | |
21 */ | |
22 | |
23 #include "../dsputil.h" | |
1092 | 24 #include "../simple_idct.h" |
2067 | 25 #include "../mpegvideo.h" |
3398
e0927bc44a10
Move REG_* macros from libavcodec/i386/mmx.h to libavutil/x86_cpu.h
lucabe
parents:
3250
diff
changeset
|
26 #include "x86_cpu.h" |
1984
ef919e9ef73e
separate out put_signed_pixels_clamped() into its own function and
melanson
parents:
1977
diff
changeset
|
27 #include "mmx.h" |
0 | 28 |
1729 | 29 //#undef NDEBUG |
30 //#include <assert.h> | |
31 | |
2868 | 32 extern void ff_idct_xvid_mmx(short *block); |
33 extern void ff_idct_xvid_mmx2(short *block); | |
1647 | 34 |
5 | 35 int mm_flags; /* multimedia extension flags */ |
936 | 36 |
0 | 37 /* pixel operations */ |
1845
3054613980a8
attribute used patch by (mitya at school dot ioffe dot ru (Dmitry Baryshkov))
michael
parents:
1784
diff
changeset
|
38 static const uint64_t mm_bone attribute_used __attribute__ ((aligned(8))) = 0x0101010101010101ULL; |
3054613980a8
attribute used patch by (mitya at school dot ioffe dot ru (Dmitry Baryshkov))
michael
parents:
1784
diff
changeset
|
39 static const uint64_t mm_wone attribute_used __attribute__ ((aligned(8))) = 0x0001000100010001ULL; |
3054613980a8
attribute used patch by (mitya at school dot ioffe dot ru (Dmitry Baryshkov))
michael
parents:
1784
diff
changeset
|
40 static const uint64_t mm_wtwo attribute_used __attribute__ ((aligned(8))) = 0x0002000200020002ULL; |
0 | 41 |
3557
8e13ec0f8aa3
change vorbis_inverse_coupling_sse2() so it works on sse1 cpus
michael
parents:
3541
diff
changeset
|
42 static const uint64_t ff_pdw_80000000[2] attribute_used __attribute__ ((aligned(16))) = |
8e13ec0f8aa3
change vorbis_inverse_coupling_sse2() so it works on sse1 cpus
michael
parents:
3541
diff
changeset
|
43 {0x8000000080000000ULL, 0x8000000080000000ULL}; |
8e13ec0f8aa3
change vorbis_inverse_coupling_sse2() so it works on sse1 cpus
michael
parents:
3541
diff
changeset
|
44 |
1845
3054613980a8
attribute used patch by (mitya at school dot ioffe dot ru (Dmitry Baryshkov))
michael
parents:
1784
diff
changeset
|
45 static const uint64_t ff_pw_20 attribute_used __attribute__ ((aligned(8))) = 0x0014001400140014ULL; |
3054613980a8
attribute used patch by (mitya at school dot ioffe dot ru (Dmitry Baryshkov))
michael
parents:
1784
diff
changeset
|
46 static const uint64_t ff_pw_3 attribute_used __attribute__ ((aligned(8))) = 0x0003000300030003ULL; |
2633 | 47 static const uint64_t ff_pw_4 attribute_used __attribute__ ((aligned(8))) = 0x0004000400040004ULL; |
2209 | 48 static const uint64_t ff_pw_5 attribute_used __attribute__ ((aligned(8))) = 0x0005000500050005ULL; |
2922
d772011258ec
faster h264_chroma_mc8_mmx, added h264_chroma_mc4_mmx.
lorenm
parents:
2902
diff
changeset
|
49 static const uint64_t ff_pw_8 attribute_used __attribute__ ((aligned(8))) = 0x0008000800080008ULL; |
1845
3054613980a8
attribute used patch by (mitya at school dot ioffe dot ru (Dmitry Baryshkov))
michael
parents:
1784
diff
changeset
|
50 static const uint64_t ff_pw_16 attribute_used __attribute__ ((aligned(8))) = 0x0010001000100010ULL; |
2209 | 51 static const uint64_t ff_pw_32 attribute_used __attribute__ ((aligned(8))) = 0x0020002000200020ULL; |
2754 | 52 static const uint64_t ff_pw_64 attribute_used __attribute__ ((aligned(8))) = 0x0040004000400040ULL; |
1845
3054613980a8
attribute used patch by (mitya at school dot ioffe dot ru (Dmitry Baryshkov))
michael
parents:
1784
diff
changeset
|
53 static const uint64_t ff_pw_15 attribute_used __attribute__ ((aligned(8))) = 0x000F000F000F000FULL; |
954 | 54 |
3645
47821be55b6c
mmx implementation of deblocking strength decision.
lorenm
parents:
3576
diff
changeset
|
55 static const uint64_t ff_pb_1 attribute_used __attribute__ ((aligned(8))) = 0x0101010101010101ULL; |
47821be55b6c
mmx implementation of deblocking strength decision.
lorenm
parents:
3576
diff
changeset
|
56 static const uint64_t ff_pb_3 attribute_used __attribute__ ((aligned(8))) = 0x0303030303030303ULL; |
47821be55b6c
mmx implementation of deblocking strength decision.
lorenm
parents:
3576
diff
changeset
|
57 static const uint64_t ff_pb_7 attribute_used __attribute__ ((aligned(8))) = 0x0707070707070707ULL; |
2707
360024d31dab
H.264 deblocking optimizations (mmx for chroma_bS4 case, convert existing cases to 8-bit math)
lorenm
parents:
2696
diff
changeset
|
58 static const uint64_t ff_pb_3F attribute_used __attribute__ ((aligned(8))) = 0x3F3F3F3F3F3F3F3FULL; |
1845
3054613980a8
attribute used patch by (mitya at school dot ioffe dot ru (Dmitry Baryshkov))
michael
parents:
1784
diff
changeset
|
59 static const uint64_t ff_pb_FC attribute_used __attribute__ ((aligned(8))) = 0xFCFCFCFCFCFCFCFCULL; |
1647 | 60 |
3576
f7125bf10892
Support for MacIntel, last part: balign directives
gpoirier
parents:
3574
diff
changeset
|
61 #define JUMPALIGN() __asm __volatile (ASMALIGN(3)::) |
247
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
62 #define MOVQ_ZERO(regd) __asm __volatile ("pxor %%" #regd ", %%" #regd ::) |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
63 |
448 | 64 #define MOVQ_WONE(regd) \ |
65 __asm __volatile ( \ | |
66 "pcmpeqd %%" #regd ", %%" #regd " \n\t" \ | |
67 "psrlw $15, %%" #regd ::) | |
68 | |
69 #define MOVQ_BFE(regd) \ | |
70 __asm __volatile ( \ | |
71 "pcmpeqd %%" #regd ", %%" #regd " \n\t"\ | |
72 "paddb %%" #regd ", %%" #regd " \n\t" ::) | |
73 | |
247
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
74 #ifndef PIC |
448 | 75 #define MOVQ_BONE(regd) __asm __volatile ("movq %0, %%" #regd " \n\t" ::"m"(mm_bone)) |
247
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
76 #define MOVQ_WTWO(regd) __asm __volatile ("movq %0, %%" #regd " \n\t" ::"m"(mm_wtwo)) |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
77 #else |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
78 // for shared library it's better to use this way for accessing constants |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
79 // pcmpeqd -> -1 |
448 | 80 #define MOVQ_BONE(regd) \ |
247
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
81 __asm __volatile ( \ |
448 | 82 "pcmpeqd %%" #regd ", %%" #regd " \n\t" \ |
83 "psrlw $15, %%" #regd " \n\t" \ | |
84 "packuswb %%" #regd ", %%" #regd " \n\t" ::) | |
247
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
85 |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
86 #define MOVQ_WTWO(regd) \ |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
87 __asm __volatile ( \ |
448 | 88 "pcmpeqd %%" #regd ", %%" #regd " \n\t" \ |
89 "psrlw $15, %%" #regd " \n\t" \ | |
90 "psllw $1, %%" #regd " \n\t"::) | |
387 | 91 |
247
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
92 #endif |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
93 |
448 | 94 // using regr as temporary and for the output result |
444
a5edef76dac6
* new mmx code - based upon http://aggregate.org/MAGIC
kabi
parents:
438
diff
changeset
|
95 // first argument is unmodifed and second is trashed |
471 | 96 // regfe is supposed to contain 0xfefefefefefefefe |
97 #define PAVGB_MMX_NO_RND(rega, regb, regr, regfe) \ | |
2979 | 98 "movq " #rega ", " #regr " \n\t"\ |
99 "pand " #regb ", " #regr " \n\t"\ | |
100 "pxor " #rega ", " #regb " \n\t"\ | |
101 "pand " #regfe "," #regb " \n\t"\ | |
102 "psrlq $1, " #regb " \n\t"\ | |
103 "paddb " #regb ", " #regr " \n\t" | |
444
a5edef76dac6
* new mmx code - based upon http://aggregate.org/MAGIC
kabi
parents:
438
diff
changeset
|
104 |
471 | 105 #define PAVGB_MMX(rega, regb, regr, regfe) \ |
2979 | 106 "movq " #rega ", " #regr " \n\t"\ |
107 "por " #regb ", " #regr " \n\t"\ | |
108 "pxor " #rega ", " #regb " \n\t"\ | |
109 "pand " #regfe "," #regb " \n\t"\ | |
110 "psrlq $1, " #regb " \n\t"\ | |
111 "psubb " #regb ", " #regr " \n\t" | |
445
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
112 |
471 | 113 // mm6 is supposed to contain 0xfefefefefefefefe |
446
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
114 #define PAVGBP_MMX_NO_RND(rega, regb, regr, regc, regd, regp) \ |
2979 | 115 "movq " #rega ", " #regr " \n\t"\ |
116 "movq " #regc ", " #regp " \n\t"\ | |
117 "pand " #regb ", " #regr " \n\t"\ | |
118 "pand " #regd ", " #regp " \n\t"\ | |
119 "pxor " #rega ", " #regb " \n\t"\ | |
120 "pxor " #regc ", " #regd " \n\t"\ | |
121 "pand %%mm6, " #regb " \n\t"\ | |
122 "pand %%mm6, " #regd " \n\t"\ | |
123 "psrlq $1, " #regb " \n\t"\ | |
124 "psrlq $1, " #regd " \n\t"\ | |
125 "paddb " #regb ", " #regr " \n\t"\ | |
126 "paddb " #regd ", " #regp " \n\t" | |
446
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
127 |
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
128 #define PAVGBP_MMX(rega, regb, regr, regc, regd, regp) \ |
2979 | 129 "movq " #rega ", " #regr " \n\t"\ |
130 "movq " #regc ", " #regp " \n\t"\ | |
131 "por " #regb ", " #regr " \n\t"\ | |
132 "por " #regd ", " #regp " \n\t"\ | |
133 "pxor " #rega ", " #regb " \n\t"\ | |
134 "pxor " #regc ", " #regd " \n\t"\ | |
135 "pand %%mm6, " #regb " \n\t"\ | |
136 "pand %%mm6, " #regd " \n\t"\ | |
137 "psrlq $1, " #regd " \n\t"\ | |
138 "psrlq $1, " #regb " \n\t"\ | |
139 "psubb " #regb ", " #regr " \n\t"\ | |
140 "psubb " #regd ", " #regp " \n\t" | |
446
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
141 |
445
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
142 /***********************************/ |
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
143 /* MMX no rounding */ |
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
144 #define DEF(x, y) x ## _no_rnd_ ## y ##_mmx |
448 | 145 #define SET_RND MOVQ_WONE |
2979 | 146 #define PAVGBP(a, b, c, d, e, f) PAVGBP_MMX_NO_RND(a, b, c, d, e, f) |
147 #define PAVGB(a, b, c, e) PAVGB_MMX_NO_RND(a, b, c, e) | |
445
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
148 |
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
149 #include "dsputil_mmx_rnd.h" |
444
a5edef76dac6
* new mmx code - based upon http://aggregate.org/MAGIC
kabi
parents:
438
diff
changeset
|
150 |
445
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
151 #undef DEF |
448 | 152 #undef SET_RND |
446
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
153 #undef PAVGBP |
471 | 154 #undef PAVGB |
445
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
155 /***********************************/ |
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
156 /* MMX rounding */ |
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
157 |
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
158 #define DEF(x, y) x ## _ ## y ##_mmx |
448 | 159 #define SET_RND MOVQ_WTWO |
2979 | 160 #define PAVGBP(a, b, c, d, e, f) PAVGBP_MMX(a, b, c, d, e, f) |
161 #define PAVGB(a, b, c, e) PAVGB_MMX(a, b, c, e) | |
445
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
162 |
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
163 #include "dsputil_mmx_rnd.h" |
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
164 |
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
165 #undef DEF |
448 | 166 #undef SET_RND |
446
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
167 #undef PAVGBP |
471 | 168 #undef PAVGB |
387 | 169 |
0 | 170 /***********************************/ |
171 /* 3Dnow specific */ | |
172 | |
173 #define DEF(x) x ## _3dnow | |
174 /* for Athlons PAVGUSB is prefered */ | |
175 #define PAVGB "pavgusb" | |
176 | |
177 #include "dsputil_mmx_avg.h" | |
178 | |
179 #undef DEF | |
180 #undef PAVGB | |
181 | |
182 /***********************************/ | |
183 /* MMX2 specific */ | |
184 | |
386 | 185 #define DEF(x) x ## _mmx2 |
0 | 186 |
187 /* Introduced only in MMX2 set */ | |
188 #define PAVGB "pavgb" | |
189 | |
190 #include "dsputil_mmx_avg.h" | |
191 | |
192 #undef DEF | |
193 #undef PAVGB | |
194 | |
3416 | 195 #define SBUTTERFLY(a,b,t,n)\ |
196 "movq " #a ", " #t " \n\t" /* abcd */\ | |
197 "punpckl" #n " " #b ", " #a " \n\t" /* aebf */\ | |
198 "punpckh" #n " " #b ", " #t " \n\t" /* cgdh */\ | |
199 | |
0 | 200 /***********************************/ |
201 /* standard MMX */ | |
202 | |
1530
3b31998fe22f
disable encoders where appropriate (patch courtesy of BERO
melanson
parents:
1527
diff
changeset
|
203 #ifdef CONFIG_ENCODERS |
1064 | 204 static void get_pixels_mmx(DCTELEM *block, const uint8_t *pixels, int line_size) |
0 | 205 { |
386 | 206 asm volatile( |
2979 | 207 "mov $-128, %%"REG_a" \n\t" |
208 "pxor %%mm7, %%mm7 \n\t" | |
3576
f7125bf10892
Support for MacIntel, last part: balign directives
gpoirier
parents:
3574
diff
changeset
|
209 ASMALIGN(4) |
2979 | 210 "1: \n\t" |
211 "movq (%0), %%mm0 \n\t" | |
212 "movq (%0, %2), %%mm2 \n\t" | |
213 "movq %%mm0, %%mm1 \n\t" | |
214 "movq %%mm2, %%mm3 \n\t" | |
215 "punpcklbw %%mm7, %%mm0 \n\t" | |
216 "punpckhbw %%mm7, %%mm1 \n\t" | |
217 "punpcklbw %%mm7, %%mm2 \n\t" | |
218 "punpckhbw %%mm7, %%mm3 \n\t" | |
219 "movq %%mm0, (%1, %%"REG_a") \n\t" | |
220 "movq %%mm1, 8(%1, %%"REG_a") \n\t" | |
221 "movq %%mm2, 16(%1, %%"REG_a") \n\t" | |
222 "movq %%mm3, 24(%1, %%"REG_a") \n\t" | |
223 "add %3, %0 \n\t" | |
224 "add $32, %%"REG_a" \n\t" | |
225 "js 1b \n\t" | |
386 | 226 : "+r" (pixels) |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
227 : "r" (block+64), "r" ((long)line_size), "r" ((long)line_size*2) |
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
228 : "%"REG_a |
386 | 229 ); |
0 | 230 } |
231 | |
1064 | 232 static inline void diff_pixels_mmx(DCTELEM *block, const uint8_t *s1, const uint8_t *s2, int stride) |
324 | 233 { |
234 asm volatile( | |
2979 | 235 "pxor %%mm7, %%mm7 \n\t" |
236 "mov $-128, %%"REG_a" \n\t" | |
3576
f7125bf10892
Support for MacIntel, last part: balign directives
gpoirier
parents:
3574
diff
changeset
|
237 ASMALIGN(4) |
2979 | 238 "1: \n\t" |
239 "movq (%0), %%mm0 \n\t" | |
240 "movq (%1), %%mm2 \n\t" | |
241 "movq %%mm0, %%mm1 \n\t" | |
242 "movq %%mm2, %%mm3 \n\t" | |
243 "punpcklbw %%mm7, %%mm0 \n\t" | |
244 "punpckhbw %%mm7, %%mm1 \n\t" | |
245 "punpcklbw %%mm7, %%mm2 \n\t" | |
246 "punpckhbw %%mm7, %%mm3 \n\t" | |
247 "psubw %%mm2, %%mm0 \n\t" | |
248 "psubw %%mm3, %%mm1 \n\t" | |
249 "movq %%mm0, (%2, %%"REG_a") \n\t" | |
250 "movq %%mm1, 8(%2, %%"REG_a") \n\t" | |
251 "add %3, %0 \n\t" | |
252 "add %3, %1 \n\t" | |
253 "add $16, %%"REG_a" \n\t" | |
254 "jnz 1b \n\t" | |
324 | 255 : "+r" (s1), "+r" (s2) |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
256 : "r" (block+64), "r" ((long)stride) |
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
257 : "%"REG_a |
324 | 258 ); |
259 } | |
1530
3b31998fe22f
disable encoders where appropriate (patch courtesy of BERO
melanson
parents:
1527
diff
changeset
|
260 #endif //CONFIG_ENCODERS |
324 | 261 |
1064 | 262 void put_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size) |
0 | 263 { |
264 const DCTELEM *p; | |
1064 | 265 uint8_t *pix; |
0 | 266 |
267 /* read the pixels */ | |
268 p = block; | |
269 pix = pixels; | |
247
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
270 /* unrolled loop */ |
2979 | 271 __asm __volatile( |
272 "movq %3, %%mm0 \n\t" | |
273 "movq 8%3, %%mm1 \n\t" | |
274 "movq 16%3, %%mm2 \n\t" | |
275 "movq 24%3, %%mm3 \n\t" | |
276 "movq 32%3, %%mm4 \n\t" | |
277 "movq 40%3, %%mm5 \n\t" | |
278 "movq 48%3, %%mm6 \n\t" | |
279 "movq 56%3, %%mm7 \n\t" | |
280 "packuswb %%mm1, %%mm0 \n\t" | |
281 "packuswb %%mm3, %%mm2 \n\t" | |
282 "packuswb %%mm5, %%mm4 \n\t" | |
283 "packuswb %%mm7, %%mm6 \n\t" | |
284 "movq %%mm0, (%0) \n\t" | |
285 "movq %%mm2, (%0, %1) \n\t" | |
286 "movq %%mm4, (%0, %1, 2) \n\t" | |
287 "movq %%mm6, (%0, %2) \n\t" | |
288 ::"r" (pix), "r" ((long)line_size), "r" ((long)line_size*3), "m"(*p) | |
289 :"memory"); | |
0 | 290 pix += line_size*4; |
291 p += 32; | |
247
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
292 |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
293 // if here would be an exact copy of the code above |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
294 // compiler would generate some very strange code |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
295 // thus using "r" |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
296 __asm __volatile( |
2979 | 297 "movq (%3), %%mm0 \n\t" |
298 "movq 8(%3), %%mm1 \n\t" | |
299 "movq 16(%3), %%mm2 \n\t" | |
300 "movq 24(%3), %%mm3 \n\t" | |
301 "movq 32(%3), %%mm4 \n\t" | |
302 "movq 40(%3), %%mm5 \n\t" | |
303 "movq 48(%3), %%mm6 \n\t" | |
304 "movq 56(%3), %%mm7 \n\t" | |
305 "packuswb %%mm1, %%mm0 \n\t" | |
306 "packuswb %%mm3, %%mm2 \n\t" | |
307 "packuswb %%mm5, %%mm4 \n\t" | |
308 "packuswb %%mm7, %%mm6 \n\t" | |
309 "movq %%mm0, (%0) \n\t" | |
310 "movq %%mm2, (%0, %1) \n\t" | |
311 "movq %%mm4, (%0, %1, 2) \n\t" | |
312 "movq %%mm6, (%0, %2) \n\t" | |
313 ::"r" (pix), "r" ((long)line_size), "r" ((long)line_size*3), "r"(p) | |
314 :"memory"); | |
0 | 315 } |
316 | |
3089 | 317 static DECLARE_ALIGNED_8(const unsigned char, vector128[8]) = |
1985
b2bc62fdecc0
move the 0x80 vector outside of the function, thus saving the compiler
melanson
parents:
1984
diff
changeset
|
318 { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }; |
b2bc62fdecc0
move the 0x80 vector outside of the function, thus saving the compiler
melanson
parents:
1984
diff
changeset
|
319 |
1984
ef919e9ef73e
separate out put_signed_pixels_clamped() into its own function and
melanson
parents:
1977
diff
changeset
|
320 void put_signed_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size) |
ef919e9ef73e
separate out put_signed_pixels_clamped() into its own function and
melanson
parents:
1977
diff
changeset
|
321 { |
ef919e9ef73e
separate out put_signed_pixels_clamped() into its own function and
melanson
parents:
1977
diff
changeset
|
322 int i; |
ef919e9ef73e
separate out put_signed_pixels_clamped() into its own function and
melanson
parents:
1977
diff
changeset
|
323 |
ef919e9ef73e
separate out put_signed_pixels_clamped() into its own function and
melanson
parents:
1977
diff
changeset
|
324 movq_m2r(*vector128, mm1); |
ef919e9ef73e
separate out put_signed_pixels_clamped() into its own function and
melanson
parents:
1977
diff
changeset
|
325 for (i = 0; i < 8; i++) { |
ef919e9ef73e
separate out put_signed_pixels_clamped() into its own function and
melanson
parents:
1977
diff
changeset
|
326 movq_m2r(*(block), mm0); |
ef919e9ef73e
separate out put_signed_pixels_clamped() into its own function and
melanson
parents:
1977
diff
changeset
|
327 packsswb_m2r(*(block + 4), mm0); |
ef919e9ef73e
separate out put_signed_pixels_clamped() into its own function and
melanson
parents:
1977
diff
changeset
|
328 block += 8; |
ef919e9ef73e
separate out put_signed_pixels_clamped() into its own function and
melanson
parents:
1977
diff
changeset
|
329 paddb_r2r(mm1, mm0); |
ef919e9ef73e
separate out put_signed_pixels_clamped() into its own function and
melanson
parents:
1977
diff
changeset
|
330 movq_r2m(mm0, *pixels); |
ef919e9ef73e
separate out put_signed_pixels_clamped() into its own function and
melanson
parents:
1977
diff
changeset
|
331 pixels += line_size; |
ef919e9ef73e
separate out put_signed_pixels_clamped() into its own function and
melanson
parents:
1977
diff
changeset
|
332 } |
ef919e9ef73e
separate out put_signed_pixels_clamped() into its own function and
melanson
parents:
1977
diff
changeset
|
333 } |
ef919e9ef73e
separate out put_signed_pixels_clamped() into its own function and
melanson
parents:
1977
diff
changeset
|
334 |
1064 | 335 void add_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size) |
0 | 336 { |
337 const DCTELEM *p; | |
1064 | 338 uint8_t *pix; |
0 | 339 int i; |
340 | |
341 /* read the pixels */ | |
342 p = block; | |
343 pix = pixels; | |
247
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
344 MOVQ_ZERO(mm7); |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
345 i = 4; |
342
8635a7036395
* fixes problem with -funroll-loops and buggy gcc compiler
kabi
parents:
324
diff
changeset
|
346 do { |
2979 | 347 __asm __volatile( |
348 "movq (%2), %%mm0 \n\t" | |
349 "movq 8(%2), %%mm1 \n\t" | |
350 "movq 16(%2), %%mm2 \n\t" | |
351 "movq 24(%2), %%mm3 \n\t" | |
352 "movq %0, %%mm4 \n\t" | |
353 "movq %1, %%mm6 \n\t" | |
354 "movq %%mm4, %%mm5 \n\t" | |
355 "punpcklbw %%mm7, %%mm4 \n\t" | |
356 "punpckhbw %%mm7, %%mm5 \n\t" | |
357 "paddsw %%mm4, %%mm0 \n\t" | |
358 "paddsw %%mm5, %%mm1 \n\t" | |
359 "movq %%mm6, %%mm5 \n\t" | |
360 "punpcklbw %%mm7, %%mm6 \n\t" | |
361 "punpckhbw %%mm7, %%mm5 \n\t" | |
362 "paddsw %%mm6, %%mm2 \n\t" | |
363 "paddsw %%mm5, %%mm3 \n\t" | |
364 "packuswb %%mm1, %%mm0 \n\t" | |
365 "packuswb %%mm3, %%mm2 \n\t" | |
366 "movq %%mm0, %0 \n\t" | |
367 "movq %%mm2, %1 \n\t" | |
368 :"+m"(*pix), "+m"(*(pix+line_size)) | |
369 :"r"(p) | |
370 :"memory"); | |
0 | 371 pix += line_size*2; |
372 p += 16; | |
342
8635a7036395
* fixes problem with -funroll-loops and buggy gcc compiler
kabi
parents:
324
diff
changeset
|
373 } while (--i); |
0 | 374 } |
375 | |
2209 | 376 static void put_pixels4_mmx(uint8_t *block, const uint8_t *pixels, int line_size, int h) |
377 { | |
378 __asm __volatile( | |
2979 | 379 "lea (%3, %3), %%"REG_a" \n\t" |
3576
f7125bf10892
Support for MacIntel, last part: balign directives
gpoirier
parents:
3574
diff
changeset
|
380 ASMALIGN(3) |
2979 | 381 "1: \n\t" |
382 "movd (%1), %%mm0 \n\t" | |
383 "movd (%1, %3), %%mm1 \n\t" | |
384 "movd %%mm0, (%2) \n\t" | |
385 "movd %%mm1, (%2, %3) \n\t" | |
386 "add %%"REG_a", %1 \n\t" | |
387 "add %%"REG_a", %2 \n\t" | |
388 "movd (%1), %%mm0 \n\t" | |
389 "movd (%1, %3), %%mm1 \n\t" | |
390 "movd %%mm0, (%2) \n\t" | |
391 "movd %%mm1, (%2, %3) \n\t" | |
392 "add %%"REG_a", %1 \n\t" | |
393 "add %%"REG_a", %2 \n\t" | |
394 "subl $4, %0 \n\t" | |
395 "jnz 1b \n\t" | |
396 : "+g"(h), "+r" (pixels), "+r" (block) | |
397 : "r"((long)line_size) | |
398 : "%"REG_a, "memory" | |
399 ); | |
2209 | 400 } |
401 | |
1064 | 402 static void put_pixels8_mmx(uint8_t *block, const uint8_t *pixels, int line_size, int h) |
0 | 403 { |
471 | 404 __asm __volatile( |
2979 | 405 "lea (%3, %3), %%"REG_a" \n\t" |
3576
f7125bf10892
Support for MacIntel, last part: balign directives
gpoirier
parents:
3574
diff
changeset
|
406 ASMALIGN(3) |
2979 | 407 "1: \n\t" |
408 "movq (%1), %%mm0 \n\t" | |
409 "movq (%1, %3), %%mm1 \n\t" | |
410 "movq %%mm0, (%2) \n\t" | |
411 "movq %%mm1, (%2, %3) \n\t" | |
412 "add %%"REG_a", %1 \n\t" | |
413 "add %%"REG_a", %2 \n\t" | |
414 "movq (%1), %%mm0 \n\t" | |
415 "movq (%1, %3), %%mm1 \n\t" | |
416 "movq %%mm0, (%2) \n\t" | |
417 "movq %%mm1, (%2, %3) \n\t" | |
418 "add %%"REG_a", %1 \n\t" | |
419 "add %%"REG_a", %2 \n\t" | |
420 "subl $4, %0 \n\t" | |
421 "jnz 1b \n\t" | |
422 : "+g"(h), "+r" (pixels), "+r" (block) | |
423 : "r"((long)line_size) | |
424 : "%"REG_a, "memory" | |
425 ); | |
0 | 426 } |
427 | |
1064 | 428 static void put_pixels16_mmx(uint8_t *block, const uint8_t *pixels, int line_size, int h) |
651 | 429 { |
430 __asm __volatile( | |
2979 | 431 "lea (%3, %3), %%"REG_a" \n\t" |
3576
f7125bf10892
Support for MacIntel, last part: balign directives
gpoirier
parents:
3574
diff
changeset
|
432 ASMALIGN(3) |
2979 | 433 "1: \n\t" |
434 "movq (%1), %%mm0 \n\t" | |
435 "movq 8(%1), %%mm4 \n\t" | |
436 "movq (%1, %3), %%mm1 \n\t" | |
437 "movq 8(%1, %3), %%mm5 \n\t" | |
438 "movq %%mm0, (%2) \n\t" | |
439 "movq %%mm4, 8(%2) \n\t" | |
440 "movq %%mm1, (%2, %3) \n\t" | |
441 "movq %%mm5, 8(%2, %3) \n\t" | |
442 "add %%"REG_a", %1 \n\t" | |
443 "add %%"REG_a", %2 \n\t" | |
444 "movq (%1), %%mm0 \n\t" | |
445 "movq 8(%1), %%mm4 \n\t" | |
446 "movq (%1, %3), %%mm1 \n\t" | |
447 "movq 8(%1, %3), %%mm5 \n\t" | |
448 "movq %%mm0, (%2) \n\t" | |
449 "movq %%mm4, 8(%2) \n\t" | |
450 "movq %%mm1, (%2, %3) \n\t" | |
451 "movq %%mm5, 8(%2, %3) \n\t" | |
452 "add %%"REG_a", %1 \n\t" | |
453 "add %%"REG_a", %2 \n\t" | |
454 "subl $4, %0 \n\t" | |
455 "jnz 1b \n\t" | |
456 : "+g"(h), "+r" (pixels), "+r" (block) | |
457 : "r"((long)line_size) | |
458 : "%"REG_a, "memory" | |
459 ); | |
651 | 460 } |
461 | |
296 | 462 static void clear_blocks_mmx(DCTELEM *blocks) |
463 { | |
471 | 464 __asm __volatile( |
2979 | 465 "pxor %%mm7, %%mm7 \n\t" |
466 "mov $-128*6, %%"REG_a" \n\t" | |
467 "1: \n\t" | |
468 "movq %%mm7, (%0, %%"REG_a") \n\t" | |
469 "movq %%mm7, 8(%0, %%"REG_a") \n\t" | |
470 "movq %%mm7, 16(%0, %%"REG_a") \n\t" | |
471 "movq %%mm7, 24(%0, %%"REG_a") \n\t" | |
472 "add $32, %%"REG_a" \n\t" | |
473 " js 1b \n\t" | |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
474 : : "r" (((uint8_t *)blocks)+128*6) |
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
475 : "%"REG_a |
296 | 476 ); |
477 } | |
478 | |
1530
3b31998fe22f
disable encoders where appropriate (patch courtesy of BERO
melanson
parents:
1527
diff
changeset
|
479 #ifdef CONFIG_ENCODERS |
1064 | 480 static int pix_sum16_mmx(uint8_t * pix, int line_size){ |
688 | 481 const int h=16; |
482 int sum; | |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
483 long index= -line_size*h; |
688 | 484 |
485 __asm __volatile( | |
2979 | 486 "pxor %%mm7, %%mm7 \n\t" |
487 "pxor %%mm6, %%mm6 \n\t" | |
488 "1: \n\t" | |
489 "movq (%2, %1), %%mm0 \n\t" | |
490 "movq (%2, %1), %%mm1 \n\t" | |
491 "movq 8(%2, %1), %%mm2 \n\t" | |
492 "movq 8(%2, %1), %%mm3 \n\t" | |
493 "punpcklbw %%mm7, %%mm0 \n\t" | |
494 "punpckhbw %%mm7, %%mm1 \n\t" | |
495 "punpcklbw %%mm7, %%mm2 \n\t" | |
496 "punpckhbw %%mm7, %%mm3 \n\t" | |
497 "paddw %%mm0, %%mm1 \n\t" | |
498 "paddw %%mm2, %%mm3 \n\t" | |
499 "paddw %%mm1, %%mm3 \n\t" | |
500 "paddw %%mm3, %%mm6 \n\t" | |
501 "add %3, %1 \n\t" | |
502 " js 1b \n\t" | |
503 "movq %%mm6, %%mm5 \n\t" | |
504 "psrlq $32, %%mm6 \n\t" | |
505 "paddw %%mm5, %%mm6 \n\t" | |
506 "movq %%mm6, %%mm5 \n\t" | |
507 "psrlq $16, %%mm6 \n\t" | |
508 "paddw %%mm5, %%mm6 \n\t" | |
509 "movd %%mm6, %0 \n\t" | |
510 "andl $0xFFFF, %0 \n\t" | |
688 | 511 : "=&r" (sum), "+r" (index) |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
512 : "r" (pix - index), "r" ((long)line_size) |
688 | 513 ); |
514 | |
515 return sum; | |
516 } | |
1530
3b31998fe22f
disable encoders where appropriate (patch courtesy of BERO
melanson
parents:
1527
diff
changeset
|
517 #endif //CONFIG_ENCODERS |
688 | 518 |
866 | 519 static void add_bytes_mmx(uint8_t *dst, uint8_t *src, int w){ |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
520 long i=0; |
866 | 521 asm volatile( |
2979 | 522 "1: \n\t" |
523 "movq (%1, %0), %%mm0 \n\t" | |
524 "movq (%2, %0), %%mm1 \n\t" | |
525 "paddb %%mm0, %%mm1 \n\t" | |
526 "movq %%mm1, (%2, %0) \n\t" | |
527 "movq 8(%1, %0), %%mm0 \n\t" | |
528 "movq 8(%2, %0), %%mm1 \n\t" | |
529 "paddb %%mm0, %%mm1 \n\t" | |
530 "movq %%mm1, 8(%2, %0) \n\t" | |
531 "add $16, %0 \n\t" | |
532 "cmp %3, %0 \n\t" | |
533 " jb 1b \n\t" | |
866 | 534 : "+r" (i) |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
535 : "r"(src), "r"(dst), "r"((long)w-15) |
866 | 536 ); |
537 for(; i<w; i++) | |
538 dst[i+0] += src[i+0]; | |
539 } | |
540 | |
1648 | 541 #define H263_LOOP_FILTER \ |
2979 | 542 "pxor %%mm7, %%mm7 \n\t"\ |
543 "movq %0, %%mm0 \n\t"\ | |
544 "movq %0, %%mm1 \n\t"\ | |
545 "movq %3, %%mm2 \n\t"\ | |
546 "movq %3, %%mm3 \n\t"\ | |
547 "punpcklbw %%mm7, %%mm0 \n\t"\ | |
548 "punpckhbw %%mm7, %%mm1 \n\t"\ | |
549 "punpcklbw %%mm7, %%mm2 \n\t"\ | |
550 "punpckhbw %%mm7, %%mm3 \n\t"\ | |
551 "psubw %%mm2, %%mm0 \n\t"\ | |
552 "psubw %%mm3, %%mm1 \n\t"\ | |
553 "movq %1, %%mm2 \n\t"\ | |
554 "movq %1, %%mm3 \n\t"\ | |
555 "movq %2, %%mm4 \n\t"\ | |
556 "movq %2, %%mm5 \n\t"\ | |
557 "punpcklbw %%mm7, %%mm2 \n\t"\ | |
558 "punpckhbw %%mm7, %%mm3 \n\t"\ | |
559 "punpcklbw %%mm7, %%mm4 \n\t"\ | |
560 "punpckhbw %%mm7, %%mm5 \n\t"\ | |
561 "psubw %%mm2, %%mm4 \n\t"\ | |
562 "psubw %%mm3, %%mm5 \n\t"\ | |
563 "psllw $2, %%mm4 \n\t"\ | |
564 "psllw $2, %%mm5 \n\t"\ | |
565 "paddw %%mm0, %%mm4 \n\t"\ | |
566 "paddw %%mm1, %%mm5 \n\t"\ | |
567 "pxor %%mm6, %%mm6 \n\t"\ | |
568 "pcmpgtw %%mm4, %%mm6 \n\t"\ | |
569 "pcmpgtw %%mm5, %%mm7 \n\t"\ | |
570 "pxor %%mm6, %%mm4 \n\t"\ | |
571 "pxor %%mm7, %%mm5 \n\t"\ | |
572 "psubw %%mm6, %%mm4 \n\t"\ | |
573 "psubw %%mm7, %%mm5 \n\t"\ | |
574 "psrlw $3, %%mm4 \n\t"\ | |
575 "psrlw $3, %%mm5 \n\t"\ | |
576 "packuswb %%mm5, %%mm4 \n\t"\ | |
577 "packsswb %%mm7, %%mm6 \n\t"\ | |
578 "pxor %%mm7, %%mm7 \n\t"\ | |
579 "movd %4, %%mm2 \n\t"\ | |
580 "punpcklbw %%mm2, %%mm2 \n\t"\ | |
581 "punpcklbw %%mm2, %%mm2 \n\t"\ | |
582 "punpcklbw %%mm2, %%mm2 \n\t"\ | |
583 "psubusb %%mm4, %%mm2 \n\t"\ | |
584 "movq %%mm2, %%mm3 \n\t"\ | |
585 "psubusb %%mm4, %%mm3 \n\t"\ | |
586 "psubb %%mm3, %%mm2 \n\t"\ | |
587 "movq %1, %%mm3 \n\t"\ | |
588 "movq %2, %%mm4 \n\t"\ | |
589 "pxor %%mm6, %%mm3 \n\t"\ | |
590 "pxor %%mm6, %%mm4 \n\t"\ | |
591 "paddusb %%mm2, %%mm3 \n\t"\ | |
592 "psubusb %%mm2, %%mm4 \n\t"\ | |
593 "pxor %%mm6, %%mm3 \n\t"\ | |
594 "pxor %%mm6, %%mm4 \n\t"\ | |
595 "paddusb %%mm2, %%mm2 \n\t"\ | |
596 "packsswb %%mm1, %%mm0 \n\t"\ | |
597 "pcmpgtb %%mm0, %%mm7 \n\t"\ | |
598 "pxor %%mm7, %%mm0 \n\t"\ | |
599 "psubb %%mm7, %%mm0 \n\t"\ | |
600 "movq %%mm0, %%mm1 \n\t"\ | |
601 "psubusb %%mm2, %%mm0 \n\t"\ | |
602 "psubb %%mm0, %%mm1 \n\t"\ | |
603 "pand %5, %%mm1 \n\t"\ | |
604 "psrlw $2, %%mm1 \n\t"\ | |
605 "pxor %%mm7, %%mm1 \n\t"\ | |
606 "psubb %%mm7, %%mm1 \n\t"\ | |
607 "movq %0, %%mm5 \n\t"\ | |
608 "movq %3, %%mm6 \n\t"\ | |
609 "psubb %%mm1, %%mm5 \n\t"\ | |
610 "paddb %%mm1, %%mm6 \n\t" | |
1648 | 611 |
1647 | 612 static void h263_v_loop_filter_mmx(uint8_t *src, int stride, int qscale){ |
613 const int strength= ff_h263_loop_filter_strength[qscale]; | |
614 | |
615 asm volatile( | |
2967 | 616 |
1648 | 617 H263_LOOP_FILTER |
2967 | 618 |
2979 | 619 "movq %%mm3, %1 \n\t" |
620 "movq %%mm4, %2 \n\t" | |
621 "movq %%mm5, %0 \n\t" | |
622 "movq %%mm6, %3 \n\t" | |
1647 | 623 : "+m" (*(uint64_t*)(src - 2*stride)), |
624 "+m" (*(uint64_t*)(src - 1*stride)), | |
625 "+m" (*(uint64_t*)(src + 0*stride)), | |
626 "+m" (*(uint64_t*)(src + 1*stride)) | |
627 : "g" (2*strength), "m"(ff_pb_FC) | |
628 ); | |
629 } | |
630 | |
1648 | 631 static inline void transpose4x4(uint8_t *dst, uint8_t *src, int dst_stride, int src_stride){ |
632 asm volatile( //FIXME could save 1 instruction if done as 8x4 ... | |
2979 | 633 "movd %4, %%mm0 \n\t" |
634 "movd %5, %%mm1 \n\t" | |
635 "movd %6, %%mm2 \n\t" | |
636 "movd %7, %%mm3 \n\t" | |
637 "punpcklbw %%mm1, %%mm0 \n\t" | |
638 "punpcklbw %%mm3, %%mm2 \n\t" | |
639 "movq %%mm0, %%mm1 \n\t" | |
640 "punpcklwd %%mm2, %%mm0 \n\t" | |
641 "punpckhwd %%mm2, %%mm1 \n\t" | |
642 "movd %%mm0, %0 \n\t" | |
643 "punpckhdq %%mm0, %%mm0 \n\t" | |
644 "movd %%mm0, %1 \n\t" | |
645 "movd %%mm1, %2 \n\t" | |
646 "punpckhdq %%mm1, %%mm1 \n\t" | |
647 "movd %%mm1, %3 \n\t" | |
2967 | 648 |
1648 | 649 : "=m" (*(uint32_t*)(dst + 0*dst_stride)), |
650 "=m" (*(uint32_t*)(dst + 1*dst_stride)), | |
651 "=m" (*(uint32_t*)(dst + 2*dst_stride)), | |
652 "=m" (*(uint32_t*)(dst + 3*dst_stride)) | |
653 : "m" (*(uint32_t*)(src + 0*src_stride)), | |
654 "m" (*(uint32_t*)(src + 1*src_stride)), | |
655 "m" (*(uint32_t*)(src + 2*src_stride)), | |
656 "m" (*(uint32_t*)(src + 3*src_stride)) | |
657 ); | |
658 } | |
659 | |
660 static void h263_h_loop_filter_mmx(uint8_t *src, int stride, int qscale){ | |
661 const int strength= ff_h263_loop_filter_strength[qscale]; | |
662 uint64_t temp[4] __attribute__ ((aligned(8))); | |
663 uint8_t *btemp= (uint8_t*)temp; | |
2967 | 664 |
1648 | 665 src -= 2; |
666 | |
667 transpose4x4(btemp , src , 8, stride); | |
668 transpose4x4(btemp+4, src + 4*stride, 8, stride); | |
669 asm volatile( | |
670 H263_LOOP_FILTER // 5 3 4 6 | |
2967 | 671 |
1648 | 672 : "+m" (temp[0]), |
673 "+m" (temp[1]), | |
674 "+m" (temp[2]), | |
675 "+m" (temp[3]) | |
676 : "g" (2*strength), "m"(ff_pb_FC) | |
677 ); | |
678 | |
679 asm volatile( | |
2979 | 680 "movq %%mm5, %%mm1 \n\t" |
681 "movq %%mm4, %%mm0 \n\t" | |
682 "punpcklbw %%mm3, %%mm5 \n\t" | |
683 "punpcklbw %%mm6, %%mm4 \n\t" | |
684 "punpckhbw %%mm3, %%mm1 \n\t" | |
685 "punpckhbw %%mm6, %%mm0 \n\t" | |
686 "movq %%mm5, %%mm3 \n\t" | |
687 "movq %%mm1, %%mm6 \n\t" | |
688 "punpcklwd %%mm4, %%mm5 \n\t" | |
689 "punpcklwd %%mm0, %%mm1 \n\t" | |
690 "punpckhwd %%mm4, %%mm3 \n\t" | |
691 "punpckhwd %%mm0, %%mm6 \n\t" | |
692 "movd %%mm5, (%0) \n\t" | |
693 "punpckhdq %%mm5, %%mm5 \n\t" | |
694 "movd %%mm5, (%0,%2) \n\t" | |
695 "movd %%mm3, (%0,%2,2) \n\t" | |
696 "punpckhdq %%mm3, %%mm3 \n\t" | |
697 "movd %%mm3, (%0,%3) \n\t" | |
698 "movd %%mm1, (%1) \n\t" | |
699 "punpckhdq %%mm1, %%mm1 \n\t" | |
700 "movd %%mm1, (%1,%2) \n\t" | |
701 "movd %%mm6, (%1,%2,2) \n\t" | |
702 "punpckhdq %%mm6, %%mm6 \n\t" | |
703 "movd %%mm6, (%1,%3) \n\t" | |
2505
86e2b1424801
optimization and gcc 4.0 bug workaround patch by (Martin Drab >drab kepler.fjfi.cvut cz<)
michael
parents:
2293
diff
changeset
|
704 :: "r" (src), |
86e2b1424801
optimization and gcc 4.0 bug workaround patch by (Martin Drab >drab kepler.fjfi.cvut cz<)
michael
parents:
2293
diff
changeset
|
705 "r" (src + 4*stride), |
86e2b1424801
optimization and gcc 4.0 bug workaround patch by (Martin Drab >drab kepler.fjfi.cvut cz<)
michael
parents:
2293
diff
changeset
|
706 "r" ((long) stride ), |
86e2b1424801
optimization and gcc 4.0 bug workaround patch by (Martin Drab >drab kepler.fjfi.cvut cz<)
michael
parents:
2293
diff
changeset
|
707 "r" ((long)(3*stride)) |
1648 | 708 ); |
709 } | |
710 | |
1530
3b31998fe22f
disable encoders where appropriate (patch courtesy of BERO
melanson
parents:
1527
diff
changeset
|
711 #ifdef CONFIG_ENCODERS |
997
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
712 static int pix_norm1_mmx(uint8_t *pix, int line_size) { |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
713 int tmp; |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
714 asm volatile ( |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
715 "movl $16,%%ecx\n" |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
716 "pxor %%mm0,%%mm0\n" |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
717 "pxor %%mm7,%%mm7\n" |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
718 "1:\n" |
2979 | 719 "movq (%0),%%mm2\n" /* mm2 = pix[0-7] */ |
720 "movq 8(%0),%%mm3\n" /* mm3 = pix[8-15] */ | |
997
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
721 |
2979 | 722 "movq %%mm2,%%mm1\n" /* mm1 = mm2 = pix[0-7] */ |
997
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
723 |
2979 | 724 "punpckhbw %%mm0,%%mm1\n" /* mm1 = [pix4-7] */ |
725 "punpcklbw %%mm0,%%mm2\n" /* mm2 = [pix0-3] */ | |
997
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
726 |
2979 | 727 "movq %%mm3,%%mm4\n" /* mm4 = mm3 = pix[8-15] */ |
728 "punpckhbw %%mm0,%%mm3\n" /* mm3 = [pix12-15] */ | |
729 "punpcklbw %%mm0,%%mm4\n" /* mm4 = [pix8-11] */ | |
997
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
730 |
2979 | 731 "pmaddwd %%mm1,%%mm1\n" /* mm1 = (pix0^2+pix1^2,pix2^2+pix3^2) */ |
732 "pmaddwd %%mm2,%%mm2\n" /* mm2 = (pix4^2+pix5^2,pix6^2+pix7^2) */ | |
997
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
733 |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
734 "pmaddwd %%mm3,%%mm3\n" |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
735 "pmaddwd %%mm4,%%mm4\n" |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
736 |
2979 | 737 "paddd %%mm1,%%mm2\n" /* mm2 = (pix0^2+pix1^2+pix4^2+pix5^2, |
738 pix2^2+pix3^2+pix6^2+pix7^2) */ | |
997
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
739 "paddd %%mm3,%%mm4\n" |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
740 "paddd %%mm2,%%mm7\n" |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
741 |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
742 "add %2, %0\n" |
997
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
743 "paddd %%mm4,%%mm7\n" |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
744 "dec %%ecx\n" |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
745 "jnz 1b\n" |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
746 |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
747 "movq %%mm7,%%mm1\n" |
2979 | 748 "psrlq $32, %%mm7\n" /* shift hi dword to lo */ |
997
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
749 "paddd %%mm7,%%mm1\n" |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
750 "movd %%mm1,%1\n" |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
751 : "+r" (pix), "=r"(tmp) : "r" ((long)line_size) : "%ecx" ); |
997
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
752 return tmp; |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
753 } |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
754 |
2067 | 755 static int sse8_mmx(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h) { |
756 int tmp; | |
757 asm volatile ( | |
758 "movl %4,%%ecx\n" | |
2899
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
759 "shr $1,%%ecx\n" |
2979 | 760 "pxor %%mm0,%%mm0\n" /* mm0 = 0 */ |
761 "pxor %%mm7,%%mm7\n" /* mm7 holds the sum */ | |
2067 | 762 "1:\n" |
2979 | 763 "movq (%0),%%mm1\n" /* mm1 = pix1[0][0-7] */ |
764 "movq (%1),%%mm2\n" /* mm2 = pix2[0][0-7] */ | |
765 "movq (%0,%3),%%mm3\n" /* mm3 = pix1[1][0-7] */ | |
766 "movq (%1,%3),%%mm4\n" /* mm4 = pix2[1][0-7] */ | |
2067 | 767 |
2899
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
768 /* todo: mm1-mm2, mm3-mm4 */ |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
769 /* algo: substract mm1 from mm2 with saturation and vice versa */ |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
770 /* OR the results to get absolute difference */ |
2067 | 771 "movq %%mm1,%%mm5\n" |
2899
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
772 "movq %%mm3,%%mm6\n" |
2067 | 773 "psubusb %%mm2,%%mm1\n" |
2899
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
774 "psubusb %%mm4,%%mm3\n" |
2067 | 775 "psubusb %%mm5,%%mm2\n" |
2899
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
776 "psubusb %%mm6,%%mm4\n" |
2067 | 777 |
778 "por %%mm1,%%mm2\n" | |
2899
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
779 "por %%mm3,%%mm4\n" |
2067 | 780 |
2899
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
781 /* now convert to 16-bit vectors so we can square them */ |
2067 | 782 "movq %%mm2,%%mm1\n" |
2899
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
783 "movq %%mm4,%%mm3\n" |
2067 | 784 |
785 "punpckhbw %%mm0,%%mm2\n" | |
2899
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
786 "punpckhbw %%mm0,%%mm4\n" |
2979 | 787 "punpcklbw %%mm0,%%mm1\n" /* mm1 now spread over (mm1,mm2) */ |
788 "punpcklbw %%mm0,%%mm3\n" /* mm4 now spread over (mm3,mm4) */ | |
2067 | 789 |
790 "pmaddwd %%mm2,%%mm2\n" | |
2899
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
791 "pmaddwd %%mm4,%%mm4\n" |
2067 | 792 "pmaddwd %%mm1,%%mm1\n" |
2899
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
793 "pmaddwd %%mm3,%%mm3\n" |
2067 | 794 |
2979 | 795 "lea (%0,%3,2), %0\n" /* pix1 += 2*line_size */ |
796 "lea (%1,%3,2), %1\n" /* pix2 += 2*line_size */ | |
2067 | 797 |
798 "paddd %%mm2,%%mm1\n" | |
2899
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
799 "paddd %%mm4,%%mm3\n" |
2067 | 800 "paddd %%mm1,%%mm7\n" |
2899
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
801 "paddd %%mm3,%%mm7\n" |
2067 | 802 |
803 "decl %%ecx\n" | |
804 "jnz 1b\n" | |
805 | |
806 "movq %%mm7,%%mm1\n" | |
2979 | 807 "psrlq $32, %%mm7\n" /* shift hi dword to lo */ |
2067 | 808 "paddd %%mm7,%%mm1\n" |
809 "movd %%mm1,%2\n" | |
2967 | 810 : "+r" (pix1), "+r" (pix2), "=r"(tmp) |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
811 : "r" ((long)line_size) , "m" (h) |
2067 | 812 : "%ecx"); |
813 return tmp; | |
814 } | |
815 | |
1708 | 816 static int sse16_mmx(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h) { |
997
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
817 int tmp; |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
818 asm volatile ( |
1708 | 819 "movl %4,%%ecx\n" |
2979 | 820 "pxor %%mm0,%%mm0\n" /* mm0 = 0 */ |
821 "pxor %%mm7,%%mm7\n" /* mm7 holds the sum */ | |
997
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
822 "1:\n" |
2979 | 823 "movq (%0),%%mm1\n" /* mm1 = pix1[0-7] */ |
824 "movq (%1),%%mm2\n" /* mm2 = pix2[0-7] */ | |
825 "movq 8(%0),%%mm3\n" /* mm3 = pix1[8-15] */ | |
826 "movq 8(%1),%%mm4\n" /* mm4 = pix2[8-15] */ | |
997
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
827 |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
828 /* todo: mm1-mm2, mm3-mm4 */ |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
829 /* algo: substract mm1 from mm2 with saturation and vice versa */ |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
830 /* OR the results to get absolute difference */ |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
831 "movq %%mm1,%%mm5\n" |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
832 "movq %%mm3,%%mm6\n" |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
833 "psubusb %%mm2,%%mm1\n" |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
834 "psubusb %%mm4,%%mm3\n" |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
835 "psubusb %%mm5,%%mm2\n" |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
836 "psubusb %%mm6,%%mm4\n" |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
837 |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
838 "por %%mm1,%%mm2\n" |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
839 "por %%mm3,%%mm4\n" |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
840 |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
841 /* now convert to 16-bit vectors so we can square them */ |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
842 "movq %%mm2,%%mm1\n" |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
843 "movq %%mm4,%%mm3\n" |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
844 |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
845 "punpckhbw %%mm0,%%mm2\n" |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
846 "punpckhbw %%mm0,%%mm4\n" |
2979 | 847 "punpcklbw %%mm0,%%mm1\n" /* mm1 now spread over (mm1,mm2) */ |
848 "punpcklbw %%mm0,%%mm3\n" /* mm4 now spread over (mm3,mm4) */ | |
997
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
849 |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
850 "pmaddwd %%mm2,%%mm2\n" |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
851 "pmaddwd %%mm4,%%mm4\n" |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
852 "pmaddwd %%mm1,%%mm1\n" |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
853 "pmaddwd %%mm3,%%mm3\n" |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
854 |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
855 "add %3,%0\n" |
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
856 "add %3,%1\n" |
997
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
857 |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
858 "paddd %%mm2,%%mm1\n" |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
859 "paddd %%mm4,%%mm3\n" |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
860 "paddd %%mm1,%%mm7\n" |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
861 "paddd %%mm3,%%mm7\n" |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
862 |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
863 "decl %%ecx\n" |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
864 "jnz 1b\n" |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
865 |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
866 "movq %%mm7,%%mm1\n" |
2979 | 867 "psrlq $32, %%mm7\n" /* shift hi dword to lo */ |
997
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
868 "paddd %%mm7,%%mm1\n" |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
869 "movd %%mm1,%2\n" |
2967 | 870 : "+r" (pix1), "+r" (pix2), "=r"(tmp) |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
871 : "r" ((long)line_size) , "m" (h) |
1708 | 872 : "%ecx"); |
997
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
873 return tmp; |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
874 } |
4dfe15ae0078
sse16 & pix_norm1 optimization patch by (Felix von Leitner <felix-ffmpeg at fefe dot de>) (with some modifications)
michaelni
parents:
984
diff
changeset
|
875 |
2899
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
876 static int sse16_sse2(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h) { |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
877 int tmp; |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
878 asm volatile ( |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
879 "shr $1,%2\n" |
2979 | 880 "pxor %%xmm0,%%xmm0\n" /* mm0 = 0 */ |
881 "pxor %%xmm7,%%xmm7\n" /* mm7 holds the sum */ | |
2899
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
882 "1:\n" |
2979 | 883 "movdqu (%0),%%xmm1\n" /* mm1 = pix1[0][0-15] */ |
884 "movdqu (%1),%%xmm2\n" /* mm2 = pix2[0][0-15] */ | |
885 "movdqu (%0,%4),%%xmm3\n" /* mm3 = pix1[1][0-15] */ | |
886 "movdqu (%1,%4),%%xmm4\n" /* mm4 = pix2[1][0-15] */ | |
2899
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
887 |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
888 /* todo: mm1-mm2, mm3-mm4 */ |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
889 /* algo: substract mm1 from mm2 with saturation and vice versa */ |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
890 /* OR the results to get absolute difference */ |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
891 "movdqa %%xmm1,%%xmm5\n" |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
892 "movdqa %%xmm3,%%xmm6\n" |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
893 "psubusb %%xmm2,%%xmm1\n" |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
894 "psubusb %%xmm4,%%xmm3\n" |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
895 "psubusb %%xmm5,%%xmm2\n" |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
896 "psubusb %%xmm6,%%xmm4\n" |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
897 |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
898 "por %%xmm1,%%xmm2\n" |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
899 "por %%xmm3,%%xmm4\n" |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
900 |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
901 /* now convert to 16-bit vectors so we can square them */ |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
902 "movdqa %%xmm2,%%xmm1\n" |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
903 "movdqa %%xmm4,%%xmm3\n" |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
904 |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
905 "punpckhbw %%xmm0,%%xmm2\n" |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
906 "punpckhbw %%xmm0,%%xmm4\n" |
2979 | 907 "punpcklbw %%xmm0,%%xmm1\n" /* mm1 now spread over (mm1,mm2) */ |
908 "punpcklbw %%xmm0,%%xmm3\n" /* mm4 now spread over (mm3,mm4) */ | |
2899
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
909 |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
910 "pmaddwd %%xmm2,%%xmm2\n" |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
911 "pmaddwd %%xmm4,%%xmm4\n" |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
912 "pmaddwd %%xmm1,%%xmm1\n" |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
913 "pmaddwd %%xmm3,%%xmm3\n" |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
914 |
2979 | 915 "lea (%0,%4,2), %0\n" /* pix1 += 2*line_size */ |
916 "lea (%1,%4,2), %1\n" /* pix2 += 2*line_size */ | |
2899
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
917 |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
918 "paddd %%xmm2,%%xmm1\n" |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
919 "paddd %%xmm4,%%xmm3\n" |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
920 "paddd %%xmm1,%%xmm7\n" |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
921 "paddd %%xmm3,%%xmm7\n" |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
922 |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
923 "decl %2\n" |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
924 "jnz 1b\n" |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
925 |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
926 "movdqa %%xmm7,%%xmm1\n" |
2979 | 927 "psrldq $8, %%xmm7\n" /* shift hi qword to lo */ |
2899
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
928 "paddd %%xmm1,%%xmm7\n" |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
929 "movdqa %%xmm7,%%xmm1\n" |
2979 | 930 "psrldq $4, %%xmm7\n" /* shift hi dword to lo */ |
2899
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
931 "paddd %%xmm1,%%xmm7\n" |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
932 "movd %%xmm7,%3\n" |
2967 | 933 : "+r" (pix1), "+r" (pix2), "+r"(h), "=r"(tmp) |
2899
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
934 : "r" ((long)line_size)); |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
935 return tmp; |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
936 } |
d3a726717baf
sse2 16x16 sum squared diff (306=>268 cycles on a K8)
lorenm
parents:
2892
diff
changeset
|
937 |
2067 | 938 static int hf_noise8_mmx(uint8_t * pix1, int line_size, int h) { |
939 int tmp; | |
940 asm volatile ( | |
941 "movl %3,%%ecx\n" | |
942 "pxor %%mm7,%%mm7\n" | |
943 "pxor %%mm6,%%mm6\n" | |
2967 | 944 |
2067 | 945 "movq (%0),%%mm0\n" |
946 "movq %%mm0, %%mm1\n" | |
947 "psllq $8, %%mm0\n" | |
948 "psrlq $8, %%mm1\n" | |
949 "psrlq $8, %%mm0\n" | |
950 "movq %%mm0, %%mm2\n" | |
951 "movq %%mm1, %%mm3\n" | |
952 "punpcklbw %%mm7,%%mm0\n" | |
953 "punpcklbw %%mm7,%%mm1\n" | |
954 "punpckhbw %%mm7,%%mm2\n" | |
955 "punpckhbw %%mm7,%%mm3\n" | |
956 "psubw %%mm1, %%mm0\n" | |
957 "psubw %%mm3, %%mm2\n" | |
2967 | 958 |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
959 "add %2,%0\n" |
2967 | 960 |
2067 | 961 "movq (%0),%%mm4\n" |
962 "movq %%mm4, %%mm1\n" | |
963 "psllq $8, %%mm4\n" | |
964 "psrlq $8, %%mm1\n" | |
965 "psrlq $8, %%mm4\n" | |
966 "movq %%mm4, %%mm5\n" | |
967 "movq %%mm1, %%mm3\n" | |
968 "punpcklbw %%mm7,%%mm4\n" | |
969 "punpcklbw %%mm7,%%mm1\n" | |
970 "punpckhbw %%mm7,%%mm5\n" | |
971 "punpckhbw %%mm7,%%mm3\n" | |
972 "psubw %%mm1, %%mm4\n" | |
973 "psubw %%mm3, %%mm5\n" | |
974 "psubw %%mm4, %%mm0\n" | |
975 "psubw %%mm5, %%mm2\n" | |
976 "pxor %%mm3, %%mm3\n" | |
977 "pxor %%mm1, %%mm1\n" | |
978 "pcmpgtw %%mm0, %%mm3\n\t" | |
979 "pcmpgtw %%mm2, %%mm1\n\t" | |
980 "pxor %%mm3, %%mm0\n" | |
981 "pxor %%mm1, %%mm2\n" | |
2967 | 982 "psubw %%mm3, %%mm0\n" |
2067 | 983 "psubw %%mm1, %%mm2\n" |
984 "paddw %%mm0, %%mm2\n" | |
985 "paddw %%mm2, %%mm6\n" | |
986 | |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
987 "add %2,%0\n" |
2067 | 988 "1:\n" |
2967 | 989 |
2067 | 990 "movq (%0),%%mm0\n" |
991 "movq %%mm0, %%mm1\n" | |
992 "psllq $8, %%mm0\n" | |
993 "psrlq $8, %%mm1\n" | |
994 "psrlq $8, %%mm0\n" | |
995 "movq %%mm0, %%mm2\n" | |
996 "movq %%mm1, %%mm3\n" | |
997 "punpcklbw %%mm7,%%mm0\n" | |
998 "punpcklbw %%mm7,%%mm1\n" | |
999 "punpckhbw %%mm7,%%mm2\n" | |
1000 "punpckhbw %%mm7,%%mm3\n" | |
1001 "psubw %%mm1, %%mm0\n" | |
1002 "psubw %%mm3, %%mm2\n" | |
1003 "psubw %%mm0, %%mm4\n" | |
1004 "psubw %%mm2, %%mm5\n" | |
1005 "pxor %%mm3, %%mm3\n" | |
1006 "pxor %%mm1, %%mm1\n" | |
1007 "pcmpgtw %%mm4, %%mm3\n\t" | |
1008 "pcmpgtw %%mm5, %%mm1\n\t" | |
1009 "pxor %%mm3, %%mm4\n" | |
1010 "pxor %%mm1, %%mm5\n" | |
2967 | 1011 "psubw %%mm3, %%mm4\n" |
2067 | 1012 "psubw %%mm1, %%mm5\n" |
1013 "paddw %%mm4, %%mm5\n" | |
1014 "paddw %%mm5, %%mm6\n" | |
2967 | 1015 |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
1016 "add %2,%0\n" |
2967 | 1017 |
2067 | 1018 "movq (%0),%%mm4\n" |
1019 "movq %%mm4, %%mm1\n" | |
1020 "psllq $8, %%mm4\n" | |
1021 "psrlq $8, %%mm1\n" | |
1022 "psrlq $8, %%mm4\n" | |
1023 "movq %%mm4, %%mm5\n" | |
1024 "movq %%mm1, %%mm3\n" | |
1025 "punpcklbw %%mm7,%%mm4\n" | |
1026 "punpcklbw %%mm7,%%mm1\n" | |
1027 "punpckhbw %%mm7,%%mm5\n" | |
1028 "punpckhbw %%mm7,%%mm3\n" | |
1029 "psubw %%mm1, %%mm4\n" | |
1030 "psubw %%mm3, %%mm5\n" | |
1031 "psubw %%mm4, %%mm0\n" | |
1032 "psubw %%mm5, %%mm2\n" | |
1033 "pxor %%mm3, %%mm3\n" | |
1034 "pxor %%mm1, %%mm1\n" | |
1035 "pcmpgtw %%mm0, %%mm3\n\t" | |
1036 "pcmpgtw %%mm2, %%mm1\n\t" | |
1037 "pxor %%mm3, %%mm0\n" | |
1038 "pxor %%mm1, %%mm2\n" | |
2967 | 1039 "psubw %%mm3, %%mm0\n" |
2067 | 1040 "psubw %%mm1, %%mm2\n" |
1041 "paddw %%mm0, %%mm2\n" | |
1042 "paddw %%mm2, %%mm6\n" | |
1043 | |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
1044 "add %2,%0\n" |
2067 | 1045 "subl $2, %%ecx\n" |
1046 " jnz 1b\n" | |
1047 | |
1048 "movq %%mm6, %%mm0\n" | |
1049 "punpcklwd %%mm7,%%mm0\n" | |
1050 "punpckhwd %%mm7,%%mm6\n" | |
1051 "paddd %%mm0, %%mm6\n" | |
2967 | 1052 |
2067 | 1053 "movq %%mm6,%%mm0\n" |
1054 "psrlq $32, %%mm6\n" | |
1055 "paddd %%mm6,%%mm0\n" | |
1056 "movd %%mm0,%1\n" | |
2967 | 1057 : "+r" (pix1), "=r"(tmp) |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
1058 : "r" ((long)line_size) , "g" (h-2) |
2067 | 1059 : "%ecx"); |
1060 return tmp; | |
1061 } | |
1062 | |
1063 static int hf_noise16_mmx(uint8_t * pix1, int line_size, int h) { | |
1064 int tmp; | |
1065 uint8_t * pix= pix1; | |
1066 asm volatile ( | |
1067 "movl %3,%%ecx\n" | |
1068 "pxor %%mm7,%%mm7\n" | |
1069 "pxor %%mm6,%%mm6\n" | |
2967 | 1070 |
2067 | 1071 "movq (%0),%%mm0\n" |
1072 "movq 1(%0),%%mm1\n" | |
1073 "movq %%mm0, %%mm2\n" | |
1074 "movq %%mm1, %%mm3\n" | |
1075 "punpcklbw %%mm7,%%mm0\n" | |
1076 "punpcklbw %%mm7,%%mm1\n" | |
1077 "punpckhbw %%mm7,%%mm2\n" | |
1078 "punpckhbw %%mm7,%%mm3\n" | |
1079 "psubw %%mm1, %%mm0\n" | |
1080 "psubw %%mm3, %%mm2\n" | |
2967 | 1081 |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
1082 "add %2,%0\n" |
2967 | 1083 |
2067 | 1084 "movq (%0),%%mm4\n" |
1085 "movq 1(%0),%%mm1\n" | |
1086 "movq %%mm4, %%mm5\n" | |
1087 "movq %%mm1, %%mm3\n" | |
1088 "punpcklbw %%mm7,%%mm4\n" | |
1089 "punpcklbw %%mm7,%%mm1\n" | |
1090 "punpckhbw %%mm7,%%mm5\n" | |
1091 "punpckhbw %%mm7,%%mm3\n" | |
1092 "psubw %%mm1, %%mm4\n" | |
1093 "psubw %%mm3, %%mm5\n" | |
1094 "psubw %%mm4, %%mm0\n" | |
1095 "psubw %%mm5, %%mm2\n" | |
1096 "pxor %%mm3, %%mm3\n" | |
1097 "pxor %%mm1, %%mm1\n" | |
1098 "pcmpgtw %%mm0, %%mm3\n\t" | |
1099 "pcmpgtw %%mm2, %%mm1\n\t" | |
1100 "pxor %%mm3, %%mm0\n" | |
1101 "pxor %%mm1, %%mm2\n" | |
2967 | 1102 "psubw %%mm3, %%mm0\n" |
2067 | 1103 "psubw %%mm1, %%mm2\n" |
1104 "paddw %%mm0, %%mm2\n" | |
1105 "paddw %%mm2, %%mm6\n" | |
1106 | |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
1107 "add %2,%0\n" |
2067 | 1108 "1:\n" |
2967 | 1109 |
2067 | 1110 "movq (%0),%%mm0\n" |
1111 "movq 1(%0),%%mm1\n" | |
1112 "movq %%mm0, %%mm2\n" | |
1113 "movq %%mm1, %%mm3\n" | |
1114 "punpcklbw %%mm7,%%mm0\n" | |
1115 "punpcklbw %%mm7,%%mm1\n" | |
1116 "punpckhbw %%mm7,%%mm2\n" | |
1117 "punpckhbw %%mm7,%%mm3\n" | |
1118 "psubw %%mm1, %%mm0\n" | |
1119 "psubw %%mm3, %%mm2\n" | |
1120 "psubw %%mm0, %%mm4\n" | |
1121 "psubw %%mm2, %%mm5\n" | |
1122 "pxor %%mm3, %%mm3\n" | |
1123 "pxor %%mm1, %%mm1\n" | |
1124 "pcmpgtw %%mm4, %%mm3\n\t" | |
1125 "pcmpgtw %%mm5, %%mm1\n\t" | |
1126 "pxor %%mm3, %%mm4\n" | |
1127 "pxor %%mm1, %%mm5\n" | |
1128 "psubw %%mm3, %%mm4\n" | |
1129 "psubw %%mm1, %%mm5\n" | |
1130 "paddw %%mm4, %%mm5\n" | |
1131 "paddw %%mm5, %%mm6\n" | |
2967 | 1132 |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
1133 "add %2,%0\n" |
2967 | 1134 |
2067 | 1135 "movq (%0),%%mm4\n" |
1136 "movq 1(%0),%%mm1\n" | |
1137 "movq %%mm4, %%mm5\n" | |
1138 "movq %%mm1, %%mm3\n" | |
1139 "punpcklbw %%mm7,%%mm4\n" | |
1140 "punpcklbw %%mm7,%%mm1\n" | |
1141 "punpckhbw %%mm7,%%mm5\n" | |
1142 "punpckhbw %%mm7,%%mm3\n" | |
1143 "psubw %%mm1, %%mm4\n" | |
1144 "psubw %%mm3, %%mm5\n" | |
1145 "psubw %%mm4, %%mm0\n" | |
1146 "psubw %%mm5, %%mm2\n" | |
1147 "pxor %%mm3, %%mm3\n" | |
1148 "pxor %%mm1, %%mm1\n" | |
1149 "pcmpgtw %%mm0, %%mm3\n\t" | |
1150 "pcmpgtw %%mm2, %%mm1\n\t" | |
1151 "pxor %%mm3, %%mm0\n" | |
1152 "pxor %%mm1, %%mm2\n" | |
2967 | 1153 "psubw %%mm3, %%mm0\n" |
2067 | 1154 "psubw %%mm1, %%mm2\n" |
1155 "paddw %%mm0, %%mm2\n" | |
1156 "paddw %%mm2, %%mm6\n" | |
1157 | |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
1158 "add %2,%0\n" |
2067 | 1159 "subl $2, %%ecx\n" |
1160 " jnz 1b\n" | |
1161 | |
1162 "movq %%mm6, %%mm0\n" | |
1163 "punpcklwd %%mm7,%%mm0\n" | |
1164 "punpckhwd %%mm7,%%mm6\n" | |
1165 "paddd %%mm0, %%mm6\n" | |
2967 | 1166 |
2067 | 1167 "movq %%mm6,%%mm0\n" |
1168 "psrlq $32, %%mm6\n" | |
1169 "paddd %%mm6,%%mm0\n" | |
1170 "movd %%mm0,%1\n" | |
2967 | 1171 : "+r" (pix1), "=r"(tmp) |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
1172 : "r" ((long)line_size) , "g" (h-2) |
2067 | 1173 : "%ecx"); |
1174 return tmp + hf_noise8_mmx(pix+8, line_size, h); | |
1175 } | |
1176 | |
2864
95bac7109ff0
Kill some compiler warnings. Compiled code verified identical after changes.
mru
parents:
2754
diff
changeset
|
1177 static int nsse16_mmx(void *p, uint8_t * pix1, uint8_t * pix2, int line_size, int h) { |
95bac7109ff0
Kill some compiler warnings. Compiled code verified identical after changes.
mru
parents:
2754
diff
changeset
|
1178 MpegEncContext *c = p; |
2940 | 1179 int score1, score2; |
1180 | |
1181 if(c) score1 = c->dsp.sse[0](c, pix1, pix2, line_size, h); | |
1182 else score1 = sse16_mmx(c, pix1, pix2, line_size, h); | |
1183 score2= hf_noise16_mmx(pix1, line_size, h) - hf_noise16_mmx(pix2, line_size, h); | |
2067 | 1184 |
1185 if(c) return score1 + ABS(score2)*c->avctx->nsse_weight; | |
1186 else return score1 + ABS(score2)*8; | |
1187 } | |
1188 | |
2864
95bac7109ff0
Kill some compiler warnings. Compiled code verified identical after changes.
mru
parents:
2754
diff
changeset
|
1189 static int nsse8_mmx(void *p, uint8_t * pix1, uint8_t * pix2, int line_size, int h) { |
95bac7109ff0
Kill some compiler warnings. Compiled code verified identical after changes.
mru
parents:
2754
diff
changeset
|
1190 MpegEncContext *c = p; |
2067 | 1191 int score1= sse8_mmx(c, pix1, pix2, line_size, h); |
1192 int score2= hf_noise8_mmx(pix1, line_size, h) - hf_noise8_mmx(pix2, line_size, h); | |
1193 | |
1194 if(c) return score1 + ABS(score2)*c->avctx->nsse_weight; | |
1195 else return score1 + ABS(score2)*8; | |
1196 } | |
1197 | |
1729 | 1198 static int vsad_intra16_mmx(void *v, uint8_t * pix, uint8_t * dummy, int line_size, int h) { |
1199 int tmp; | |
2967 | 1200 |
1729 | 1201 assert( (((int)pix) & 7) == 0); |
1202 assert((line_size &7) ==0); | |
2967 | 1203 |
1729 | 1204 #define SUM(in0, in1, out0, out1) \ |
1205 "movq (%0), %%mm2\n"\ | |
1206 "movq 8(%0), %%mm3\n"\ | |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
1207 "add %2,%0\n"\ |
1729 | 1208 "movq %%mm2, " #out0 "\n"\ |
1209 "movq %%mm3, " #out1 "\n"\ | |
1210 "psubusb " #in0 ", %%mm2\n"\ | |
1211 "psubusb " #in1 ", %%mm3\n"\ | |
1212 "psubusb " #out0 ", " #in0 "\n"\ | |
1213 "psubusb " #out1 ", " #in1 "\n"\ | |
1214 "por %%mm2, " #in0 "\n"\ | |
1215 "por %%mm3, " #in1 "\n"\ | |
1216 "movq " #in0 ", %%mm2\n"\ | |
1217 "movq " #in1 ", %%mm3\n"\ | |
1218 "punpcklbw %%mm7, " #in0 "\n"\ | |
1219 "punpcklbw %%mm7, " #in1 "\n"\ | |
1220 "punpckhbw %%mm7, %%mm2\n"\ | |
1221 "punpckhbw %%mm7, %%mm3\n"\ | |
1222 "paddw " #in1 ", " #in0 "\n"\ | |
1223 "paddw %%mm3, %%mm2\n"\ | |
1224 "paddw %%mm2, " #in0 "\n"\ | |
1225 "paddw " #in0 ", %%mm6\n" | |
1226 | |
2967 | 1227 |
1729 | 1228 asm volatile ( |
1229 "movl %3,%%ecx\n" | |
1230 "pxor %%mm6,%%mm6\n" | |
1231 "pxor %%mm7,%%mm7\n" | |
1232 "movq (%0),%%mm0\n" | |
1233 "movq 8(%0),%%mm1\n" | |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
1234 "add %2,%0\n" |
1729 | 1235 "subl $2, %%ecx\n" |
1236 SUM(%%mm0, %%mm1, %%mm4, %%mm5) | |
1237 "1:\n" | |
2967 | 1238 |
1729 | 1239 SUM(%%mm4, %%mm5, %%mm0, %%mm1) |
2967 | 1240 |
1729 | 1241 SUM(%%mm0, %%mm1, %%mm4, %%mm5) |
2967 | 1242 |
1729 | 1243 "subl $2, %%ecx\n" |
1244 "jnz 1b\n" | |
1245 | |
1246 "movq %%mm6,%%mm0\n" | |
1247 "psrlq $32, %%mm6\n" | |
1248 "paddw %%mm6,%%mm0\n" | |
1249 "movq %%mm0,%%mm6\n" | |
1250 "psrlq $16, %%mm0\n" | |
1251 "paddw %%mm6,%%mm0\n" | |
1252 "movd %%mm0,%1\n" | |
2967 | 1253 : "+r" (pix), "=r"(tmp) |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
1254 : "r" ((long)line_size) , "m" (h) |
1729 | 1255 : "%ecx"); |
1256 return tmp & 0xFFFF; | |
1257 } | |
1258 #undef SUM | |
1259 | |
1260 static int vsad_intra16_mmx2(void *v, uint8_t * pix, uint8_t * dummy, int line_size, int h) { | |
1261 int tmp; | |
2967 | 1262 |
1729 | 1263 assert( (((int)pix) & 7) == 0); |
1264 assert((line_size &7) ==0); | |
2967 | 1265 |
1729 | 1266 #define SUM(in0, in1, out0, out1) \ |
1267 "movq (%0), " #out0 "\n"\ | |
1268 "movq 8(%0), " #out1 "\n"\ | |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
1269 "add %2,%0\n"\ |
1729 | 1270 "psadbw " #out0 ", " #in0 "\n"\ |
1271 "psadbw " #out1 ", " #in1 "\n"\ | |
1272 "paddw " #in1 ", " #in0 "\n"\ | |
1273 "paddw " #in0 ", %%mm6\n" | |
1274 | |
1275 asm volatile ( | |
1276 "movl %3,%%ecx\n" | |
1277 "pxor %%mm6,%%mm6\n" | |
1278 "pxor %%mm7,%%mm7\n" | |
1279 "movq (%0),%%mm0\n" | |
1280 "movq 8(%0),%%mm1\n" | |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
1281 "add %2,%0\n" |
1729 | 1282 "subl $2, %%ecx\n" |
1283 SUM(%%mm0, %%mm1, %%mm4, %%mm5) | |
1284 "1:\n" | |
2967 | 1285 |
1729 | 1286 SUM(%%mm4, %%mm5, %%mm0, %%mm1) |
2967 | 1287 |
1729 | 1288 SUM(%%mm0, %%mm1, %%mm4, %%mm5) |
2967 | 1289 |
1729 | 1290 "subl $2, %%ecx\n" |
1291 "jnz 1b\n" | |
1292 | |
1293 "movd %%mm6,%1\n" | |
2967 | 1294 : "+r" (pix), "=r"(tmp) |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
1295 : "r" ((long)line_size) , "m" (h) |
1729 | 1296 : "%ecx"); |
1297 return tmp; | |
1298 } | |
1299 #undef SUM | |
1300 | |
1301 static int vsad16_mmx(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h) { | |
1302 int tmp; | |
2967 | 1303 |
1729 | 1304 assert( (((int)pix1) & 7) == 0); |
1305 assert( (((int)pix2) & 7) == 0); | |
1306 assert((line_size &7) ==0); | |
2967 | 1307 |
1729 | 1308 #define SUM(in0, in1, out0, out1) \ |
1309 "movq (%0),%%mm2\n"\ | |
1310 "movq (%1)," #out0 "\n"\ | |
1311 "movq 8(%0),%%mm3\n"\ | |
1312 "movq 8(%1)," #out1 "\n"\ | |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
1313 "add %3,%0\n"\ |
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
1314 "add %3,%1\n"\ |
1729 | 1315 "psubb " #out0 ", %%mm2\n"\ |
1316 "psubb " #out1 ", %%mm3\n"\ | |
1317 "pxor %%mm7, %%mm2\n"\ | |
1318 "pxor %%mm7, %%mm3\n"\ | |
1319 "movq %%mm2, " #out0 "\n"\ | |
1320 "movq %%mm3, " #out1 "\n"\ | |
1321 "psubusb " #in0 ", %%mm2\n"\ | |
1322 "psubusb " #in1 ", %%mm3\n"\ | |
1323 "psubusb " #out0 ", " #in0 "\n"\ | |
1324 "psubusb " #out1 ", " #in1 "\n"\ | |
1325 "por %%mm2, " #in0 "\n"\ | |
1326 "por %%mm3, " #in1 "\n"\ | |
1327 "movq " #in0 ", %%mm2\n"\ | |
1328 "movq " #in1 ", %%mm3\n"\ | |
1329 "punpcklbw %%mm7, " #in0 "\n"\ | |
1330 "punpcklbw %%mm7, " #in1 "\n"\ | |
1331 "punpckhbw %%mm7, %%mm2\n"\ | |
1332 "punpckhbw %%mm7, %%mm3\n"\ | |
1333 "paddw " #in1 ", " #in0 "\n"\ | |
1334 "paddw %%mm3, %%mm2\n"\ | |
1335 "paddw %%mm2, " #in0 "\n"\ | |
1336 "paddw " #in0 ", %%mm6\n" | |
1337 | |
2967 | 1338 |
1729 | 1339 asm volatile ( |
1340 "movl %4,%%ecx\n" | |
1341 "pxor %%mm6,%%mm6\n" | |
1342 "pcmpeqw %%mm7,%%mm7\n" | |
1343 "psllw $15, %%mm7\n" | |
1344 "packsswb %%mm7, %%mm7\n" | |
1345 "movq (%0),%%mm0\n" | |
1346 "movq (%1),%%mm2\n" | |
1347 "movq 8(%0),%%mm1\n" | |
1348 "movq 8(%1),%%mm3\n" | |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
1349 "add %3,%0\n" |
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
1350 "add %3,%1\n" |
1729 | 1351 "subl $2, %%ecx\n" |
1352 "psubb %%mm2, %%mm0\n" | |
1353 "psubb %%mm3, %%mm1\n" | |
1354 "pxor %%mm7, %%mm0\n" | |
1355 "pxor %%mm7, %%mm1\n" | |
1356 SUM(%%mm0, %%mm1, %%mm4, %%mm5) | |
1357 "1:\n" | |
2967 | 1358 |
1729 | 1359 SUM(%%mm4, %%mm5, %%mm0, %%mm1) |
2967 | 1360 |
1729 | 1361 SUM(%%mm0, %%mm1, %%mm4, %%mm5) |
2967 | 1362 |
1729 | 1363 "subl $2, %%ecx\n" |
1364 "jnz 1b\n" | |
1365 | |
1366 "movq %%mm6,%%mm0\n" | |
1367 "psrlq $32, %%mm6\n" | |
1368 "paddw %%mm6,%%mm0\n" | |
1369 "movq %%mm0,%%mm6\n" | |
1370 "psrlq $16, %%mm0\n" | |
1371 "paddw %%mm6,%%mm0\n" | |
1372 "movd %%mm0,%2\n" | |
2967 | 1373 : "+r" (pix1), "+r" (pix2), "=r"(tmp) |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
1374 : "r" ((long)line_size) , "m" (h) |
1729 | 1375 : "%ecx"); |
1376 return tmp & 0x7FFF; | |
1377 } | |
1378 #undef SUM | |
1379 | |
1380 static int vsad16_mmx2(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h) { | |
1381 int tmp; | |
2967 | 1382 |
1729 | 1383 assert( (((int)pix1) & 7) == 0); |
1384 assert( (((int)pix2) & 7) == 0); | |
1385 assert((line_size &7) ==0); | |
2967 | 1386 |
1729 | 1387 #define SUM(in0, in1, out0, out1) \ |
1388 "movq (%0)," #out0 "\n"\ | |
1389 "movq (%1),%%mm2\n"\ | |
1390 "movq 8(%0)," #out1 "\n"\ | |
1391 "movq 8(%1),%%mm3\n"\ | |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
1392 "add %3,%0\n"\ |
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
1393 "add %3,%1\n"\ |
1729 | 1394 "psubb %%mm2, " #out0 "\n"\ |
1395 "psubb %%mm3, " #out1 "\n"\ | |
1396 "pxor %%mm7, " #out0 "\n"\ | |
1397 "pxor %%mm7, " #out1 "\n"\ | |
1398 "psadbw " #out0 ", " #in0 "\n"\ | |
1399 "psadbw " #out1 ", " #in1 "\n"\ | |
1400 "paddw " #in1 ", " #in0 "\n"\ | |
1401 "paddw " #in0 ", %%mm6\n" | |
1402 | |
1403 asm volatile ( | |
1404 "movl %4,%%ecx\n" | |
1405 "pxor %%mm6,%%mm6\n" | |
1406 "pcmpeqw %%mm7,%%mm7\n" | |
1407 "psllw $15, %%mm7\n" | |
1408 "packsswb %%mm7, %%mm7\n" | |
1409 "movq (%0),%%mm0\n" | |
1410 "movq (%1),%%mm2\n" | |
1411 "movq 8(%0),%%mm1\n" | |
1412 "movq 8(%1),%%mm3\n" | |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
1413 "add %3,%0\n" |
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
1414 "add %3,%1\n" |
1729 | 1415 "subl $2, %%ecx\n" |
1416 "psubb %%mm2, %%mm0\n" | |
1417 "psubb %%mm3, %%mm1\n" | |
1418 "pxor %%mm7, %%mm0\n" | |
1419 "pxor %%mm7, %%mm1\n" | |
1420 SUM(%%mm0, %%mm1, %%mm4, %%mm5) | |
1421 "1:\n" | |
2967 | 1422 |
1729 | 1423 SUM(%%mm4, %%mm5, %%mm0, %%mm1) |
2967 | 1424 |
1729 | 1425 SUM(%%mm0, %%mm1, %%mm4, %%mm5) |
2967 | 1426 |
1729 | 1427 "subl $2, %%ecx\n" |
1428 "jnz 1b\n" | |
1429 | |
1430 "movd %%mm6,%2\n" | |
2967 | 1431 : "+r" (pix1), "+r" (pix2), "=r"(tmp) |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
1432 : "r" ((long)line_size) , "m" (h) |
1729 | 1433 : "%ecx"); |
1434 return tmp; | |
1435 } | |
1436 #undef SUM | |
1437 | |
866 | 1438 static void diff_bytes_mmx(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w){ |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
1439 long i=0; |
866 | 1440 asm volatile( |
2979 | 1441 "1: \n\t" |
1442 "movq (%2, %0), %%mm0 \n\t" | |
1443 "movq (%1, %0), %%mm1 \n\t" | |
1444 "psubb %%mm0, %%mm1 \n\t" | |
1445 "movq %%mm1, (%3, %0) \n\t" | |
1446 "movq 8(%2, %0), %%mm0 \n\t" | |
1447 "movq 8(%1, %0), %%mm1 \n\t" | |
1448 "psubb %%mm0, %%mm1 \n\t" | |
1449 "movq %%mm1, 8(%3, %0) \n\t" | |
1450 "add $16, %0 \n\t" | |
1451 "cmp %4, %0 \n\t" | |
1452 " jb 1b \n\t" | |
866 | 1453 : "+r" (i) |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
1454 : "r"(src1), "r"(src2), "r"(dst), "r"((long)w-15) |
866 | 1455 ); |
1456 for(; i<w; i++) | |
1457 dst[i+0] = src1[i+0]-src2[i+0]; | |
1458 } | |
1527 | 1459 |
1460 static void sub_hfyu_median_prediction_mmx2(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w, int *left, int *left_top){ | |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
1461 long i=0; |
1527 | 1462 uint8_t l, lt; |
2967 | 1463 |
1527 | 1464 asm volatile( |
2979 | 1465 "1: \n\t" |
1466 "movq -1(%1, %0), %%mm0 \n\t" // LT | |
1467 "movq (%1, %0), %%mm1 \n\t" // T | |
1468 "movq -1(%2, %0), %%mm2 \n\t" // L | |
1469 "movq (%2, %0), %%mm3 \n\t" // X | |
1470 "movq %%mm2, %%mm4 \n\t" // L | |
1471 "psubb %%mm0, %%mm2 \n\t" | |
1472 "paddb %%mm1, %%mm2 \n\t" // L + T - LT | |
1473 "movq %%mm4, %%mm5 \n\t" // L | |
1474 "pmaxub %%mm1, %%mm4 \n\t" // max(T, L) | |
1475 "pminub %%mm5, %%mm1 \n\t" // min(T, L) | |
1476 "pminub %%mm2, %%mm4 \n\t" | |
1477 "pmaxub %%mm1, %%mm4 \n\t" | |
1478 "psubb %%mm4, %%mm3 \n\t" // dst - pred | |
1479 "movq %%mm3, (%3, %0) \n\t" | |
1480 "add $8, %0 \n\t" | |
1481 "cmp %4, %0 \n\t" | |
1482 " jb 1b \n\t" | |
1527 | 1483 : "+r" (i) |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
1484 : "r"(src1), "r"(src2), "r"(dst), "r"((long)w) |
1527 | 1485 ); |
1486 | |
1487 l= *left; | |
1488 lt= *left_top; | |
2967 | 1489 |
1527 | 1490 dst[0]= src2[0] - mid_pred(l, src1[0], (l + src1[0] - lt)&0xFF); |
2967 | 1491 |
1527 | 1492 *left_top= src1[w-1]; |
1493 *left = src2[w-1]; | |
1494 } | |
1495 | |
1153 | 1496 #define LBUTTERFLY2(a1,b1,a2,b2)\ |
2979 | 1497 "paddw " #b1 ", " #a1 " \n\t"\ |
1498 "paddw " #b2 ", " #a2 " \n\t"\ | |
1499 "paddw " #b1 ", " #b1 " \n\t"\ | |
1500 "paddw " #b2 ", " #b2 " \n\t"\ | |
1501 "psubw " #a1 ", " #b1 " \n\t"\ | |
1502 "psubw " #a2 ", " #b2 " \n\t" | |
866 | 1503 |
936 | 1504 #define HADAMARD48\ |
1153 | 1505 LBUTTERFLY2(%%mm0, %%mm1, %%mm2, %%mm3)\ |
1506 LBUTTERFLY2(%%mm4, %%mm5, %%mm6, %%mm7)\ | |
1507 LBUTTERFLY2(%%mm0, %%mm2, %%mm1, %%mm3)\ | |
1508 LBUTTERFLY2(%%mm4, %%mm6, %%mm5, %%mm7)\ | |
1509 LBUTTERFLY2(%%mm0, %%mm4, %%mm1, %%mm5)\ | |
1510 LBUTTERFLY2(%%mm2, %%mm6, %%mm3, %%mm7)\ | |
936 | 1511 |
1512 #define MMABS(a,z)\ | |
2979 | 1513 "pxor " #z ", " #z " \n\t"\ |
1514 "pcmpgtw " #a ", " #z " \n\t"\ | |
1515 "pxor " #z ", " #a " \n\t"\ | |
1516 "psubw " #z ", " #a " \n\t" | |
936 | 1517 |
1518 #define MMABS_SUM(a,z, sum)\ | |
2979 | 1519 "pxor " #z ", " #z " \n\t"\ |
1520 "pcmpgtw " #a ", " #z " \n\t"\ | |
1521 "pxor " #z ", " #a " \n\t"\ | |
1522 "psubw " #z ", " #a " \n\t"\ | |
1523 "paddusw " #a ", " #sum " \n\t" | |
936 | 1524 |
1153 | 1525 #define MMABS_MMX2(a,z)\ |
2979 | 1526 "pxor " #z ", " #z " \n\t"\ |
1527 "psubw " #a ", " #z " \n\t"\ | |
1528 "pmaxsw " #z ", " #a " \n\t" | |
1153 | 1529 |
1530 #define MMABS_SUM_MMX2(a,z, sum)\ | |
2979 | 1531 "pxor " #z ", " #z " \n\t"\ |
1532 "psubw " #a ", " #z " \n\t"\ | |
1533 "pmaxsw " #z ", " #a " \n\t"\ | |
1534 "paddusw " #a ", " #sum " \n\t" | |
2967 | 1535 |
936 | 1536 #define TRANSPOSE4(a,b,c,d,t)\ |
1537 SBUTTERFLY(a,b,t,wd) /* a=aebf t=cgdh */\ | |
1538 SBUTTERFLY(c,d,b,wd) /* c=imjn b=kolp */\ | |
1539 SBUTTERFLY(a,c,d,dq) /* a=aeim d=bfjn */\ | |
1540 SBUTTERFLY(t,b,c,dq) /* t=cgko c=dhlp */ | |
1541 | |
1542 #define LOAD4(o, a, b, c, d)\ | |
2979 | 1543 "movq "#o"(%1), " #a " \n\t"\ |
1544 "movq "#o"+16(%1), " #b " \n\t"\ | |
1545 "movq "#o"+32(%1), " #c " \n\t"\ | |
1546 "movq "#o"+48(%1), " #d " \n\t" | |
936 | 1547 |
1548 #define STORE4(o, a, b, c, d)\ | |
2979 | 1549 "movq "#a", "#o"(%1) \n\t"\ |
1550 "movq "#b", "#o"+16(%1) \n\t"\ | |
1551 "movq "#c", "#o"+32(%1) \n\t"\ | |
1552 "movq "#d", "#o"+48(%1) \n\t"\ | |
936 | 1553 |
1708 | 1554 static int hadamard8_diff_mmx(void *s, uint8_t *src1, uint8_t *src2, int stride, int h){ |
3089 | 1555 DECLARE_ALIGNED_8(uint64_t, temp[16]); |
936 | 1556 int sum=0; |
2967 | 1557 |
1708 | 1558 assert(h==8); |
936 | 1559 |
1560 diff_pixels_mmx((DCTELEM*)temp, src1, src2, stride); | |
1561 | |
1562 asm volatile( | |
1563 LOAD4(0 , %%mm0, %%mm1, %%mm2, %%mm3) | |
1564 LOAD4(64, %%mm4, %%mm5, %%mm6, %%mm7) | |
2967 | 1565 |
936 | 1566 HADAMARD48 |
2967 | 1567 |
2979 | 1568 "movq %%mm7, 112(%1) \n\t" |
2967 | 1569 |
936 | 1570 TRANSPOSE4(%%mm0, %%mm1, %%mm2, %%mm3, %%mm7) |
1571 STORE4(0 , %%mm0, %%mm3, %%mm7, %%mm2) | |
2967 | 1572 |
2979 | 1573 "movq 112(%1), %%mm7 \n\t" |
936 | 1574 TRANSPOSE4(%%mm4, %%mm5, %%mm6, %%mm7, %%mm0) |
1575 STORE4(64, %%mm4, %%mm7, %%mm0, %%mm6) | |
1576 | |
1577 LOAD4(8 , %%mm0, %%mm1, %%mm2, %%mm3) | |
1578 LOAD4(72, %%mm4, %%mm5, %%mm6, %%mm7) | |
2967 | 1579 |
936 | 1580 HADAMARD48 |
2967 | 1581 |
2979 | 1582 "movq %%mm7, 120(%1) \n\t" |
2967 | 1583 |
936 | 1584 TRANSPOSE4(%%mm0, %%mm1, %%mm2, %%mm3, %%mm7) |
1585 STORE4(8 , %%mm0, %%mm3, %%mm7, %%mm2) | |
2967 | 1586 |
2979 | 1587 "movq 120(%1), %%mm7 \n\t" |
936 | 1588 TRANSPOSE4(%%mm4, %%mm5, %%mm6, %%mm7, %%mm0) |
2979 | 1589 "movq %%mm7, %%mm5 \n\t"//FIXME remove |
1590 "movq %%mm6, %%mm7 \n\t" | |
1591 "movq %%mm0, %%mm6 \n\t" | |
936 | 1592 // STORE4(72, %%mm4, %%mm7, %%mm0, %%mm6) //FIXME remove |
2967 | 1593 |
936 | 1594 LOAD4(64, %%mm0, %%mm1, %%mm2, %%mm3) |
1595 // LOAD4(72, %%mm4, %%mm5, %%mm6, %%mm7) | |
2967 | 1596 |
936 | 1597 HADAMARD48 |
2979 | 1598 "movq %%mm7, 64(%1) \n\t" |
936 | 1599 MMABS(%%mm0, %%mm7) |
1600 MMABS_SUM(%%mm1, %%mm7, %%mm0) | |
1601 MMABS_SUM(%%mm2, %%mm7, %%mm0) | |
1602 MMABS_SUM(%%mm3, %%mm7, %%mm0) | |
1603 MMABS_SUM(%%mm4, %%mm7, %%mm0) | |
1604 MMABS_SUM(%%mm5, %%mm7, %%mm0) | |
1605 MMABS_SUM(%%mm6, %%mm7, %%mm0) | |
2979 | 1606 "movq 64(%1), %%mm1 \n\t" |
936 | 1607 MMABS_SUM(%%mm1, %%mm7, %%mm0) |
2979 | 1608 "movq %%mm0, 64(%1) \n\t" |
2967 | 1609 |
936 | 1610 LOAD4(0 , %%mm0, %%mm1, %%mm2, %%mm3) |
1611 LOAD4(8 , %%mm4, %%mm5, %%mm6, %%mm7) | |
2967 | 1612 |
936 | 1613 HADAMARD48 |
2979 | 1614 "movq %%mm7, (%1) \n\t" |
936 | 1615 MMABS(%%mm0, %%mm7) |
1616 MMABS_SUM(%%mm1, %%mm7, %%mm0) | |
1617 MMABS_SUM(%%mm2, %%mm7, %%mm0) | |
1618 MMABS_SUM(%%mm3, %%mm7, %%mm0) | |
1619 MMABS_SUM(%%mm4, %%mm7, %%mm0) | |
1620 MMABS_SUM(%%mm5, %%mm7, %%mm0) | |
1621 MMABS_SUM(%%mm6, %%mm7, %%mm0) | |
2979 | 1622 "movq (%1), %%mm1 \n\t" |
936 | 1623 MMABS_SUM(%%mm1, %%mm7, %%mm0) |
2979 | 1624 "movq 64(%1), %%mm1 \n\t" |
936 | 1625 MMABS_SUM(%%mm1, %%mm7, %%mm0) |
2967 | 1626 |
2979 | 1627 "movq %%mm0, %%mm1 \n\t" |
1628 "psrlq $32, %%mm0 \n\t" | |
1629 "paddusw %%mm1, %%mm0 \n\t" | |
1630 "movq %%mm0, %%mm1 \n\t" | |
1631 "psrlq $16, %%mm0 \n\t" | |
1632 "paddusw %%mm1, %%mm0 \n\t" | |
1633 "movd %%mm0, %0 \n\t" | |
2967 | 1634 |
936 | 1635 : "=r" (sum) |
1636 : "r"(temp) | |
1637 ); | |
1638 return sum&0xFFFF; | |
1639 } | |
1640 | |
1708 | 1641 static int hadamard8_diff_mmx2(void *s, uint8_t *src1, uint8_t *src2, int stride, int h){ |
3089 | 1642 DECLARE_ALIGNED_8(uint64_t, temp[16]); |
1153 | 1643 int sum=0; |
2967 | 1644 |
1708 | 1645 assert(h==8); |
1153 | 1646 |
1647 diff_pixels_mmx((DCTELEM*)temp, src1, src2, stride); | |
1648 | |
1649 asm volatile( | |
1650 LOAD4(0 , %%mm0, %%mm1, %%mm2, %%mm3) | |
1651 LOAD4(64, %%mm4, %%mm5, %%mm6, %%mm7) | |
2967 | 1652 |
1153 | 1653 HADAMARD48 |
2967 | 1654 |
2979 | 1655 "movq %%mm7, 112(%1) \n\t" |
2967 | 1656 |
1153 | 1657 TRANSPOSE4(%%mm0, %%mm1, %%mm2, %%mm3, %%mm7) |
1658 STORE4(0 , %%mm0, %%mm3, %%mm7, %%mm2) | |
2967 | 1659 |
2979 | 1660 "movq 112(%1), %%mm7 \n\t" |
1153 | 1661 TRANSPOSE4(%%mm4, %%mm5, %%mm6, %%mm7, %%mm0) |
1662 STORE4(64, %%mm4, %%mm7, %%mm0, %%mm6) | |
1663 | |
1664 LOAD4(8 , %%mm0, %%mm1, %%mm2, %%mm3) | |
1665 LOAD4(72, %%mm4, %%mm5, %%mm6, %%mm7) | |
2967 | 1666 |
1153 | 1667 HADAMARD48 |
2967 | 1668 |
2979 | 1669 "movq %%mm7, 120(%1) \n\t" |
2967 | 1670 |
1153 | 1671 TRANSPOSE4(%%mm0, %%mm1, %%mm2, %%mm3, %%mm7) |
1672 STORE4(8 , %%mm0, %%mm3, %%mm7, %%mm2) | |
2967 | 1673 |
2979 | 1674 "movq 120(%1), %%mm7 \n\t" |
1153 | 1675 TRANSPOSE4(%%mm4, %%mm5, %%mm6, %%mm7, %%mm0) |
2979 | 1676 "movq %%mm7, %%mm5 \n\t"//FIXME remove |
1677 "movq %%mm6, %%mm7 \n\t" | |
1678 "movq %%mm0, %%mm6 \n\t" | |
1153 | 1679 // STORE4(72, %%mm4, %%mm7, %%mm0, %%mm6) //FIXME remove |
2967 | 1680 |
1153 | 1681 LOAD4(64, %%mm0, %%mm1, %%mm2, %%mm3) |
1682 // LOAD4(72, %%mm4, %%mm5, %%mm6, %%mm7) | |
2967 | 1683 |
1153 | 1684 HADAMARD48 |
2979 | 1685 "movq %%mm7, 64(%1) \n\t" |
1153 | 1686 MMABS_MMX2(%%mm0, %%mm7) |
1687 MMABS_SUM_MMX2(%%mm1, %%mm7, %%mm0) | |
1688 MMABS_SUM_MMX2(%%mm2, %%mm7, %%mm0) | |
1689 MMABS_SUM_MMX2(%%mm3, %%mm7, %%mm0) | |
1690 MMABS_SUM_MMX2(%%mm4, %%mm7, %%mm0) | |
1691 MMABS_SUM_MMX2(%%mm5, %%mm7, %%mm0) | |
1692 MMABS_SUM_MMX2(%%mm6, %%mm7, %%mm0) | |
2979 | 1693 "movq 64(%1), %%mm1 \n\t" |
1153 | 1694 MMABS_SUM_MMX2(%%mm1, %%mm7, %%mm0) |
2979 | 1695 "movq %%mm0, 64(%1) \n\t" |
2967 | 1696 |
1153 | 1697 LOAD4(0 , %%mm0, %%mm1, %%mm2, %%mm3) |
1698 LOAD4(8 , %%mm4, %%mm5, %%mm6, %%mm7) | |
2967 | 1699 |
1153 | 1700 HADAMARD48 |
2979 | 1701 "movq %%mm7, (%1) \n\t" |
1153 | 1702 MMABS_MMX2(%%mm0, %%mm7) |
1703 MMABS_SUM_MMX2(%%mm1, %%mm7, %%mm0) | |
1704 MMABS_SUM_MMX2(%%mm2, %%mm7, %%mm0) | |
1705 MMABS_SUM_MMX2(%%mm3, %%mm7, %%mm0) | |
1706 MMABS_SUM_MMX2(%%mm4, %%mm7, %%mm0) | |
1707 MMABS_SUM_MMX2(%%mm5, %%mm7, %%mm0) | |
1708 MMABS_SUM_MMX2(%%mm6, %%mm7, %%mm0) | |
2979 | 1709 "movq (%1), %%mm1 \n\t" |
1153 | 1710 MMABS_SUM_MMX2(%%mm1, %%mm7, %%mm0) |
2979 | 1711 "movq 64(%1), %%mm1 \n\t" |
1153 | 1712 MMABS_SUM_MMX2(%%mm1, %%mm7, %%mm0) |
2967 | 1713 |
2892
41315d0120b3
replace a few mov + psrlq with pshufw, there are more cases which could benefit from this but they would require us to duplicate some functions ...
michael
parents:
2871
diff
changeset
|
1714 "pshufw $0x0E, %%mm0, %%mm1 \n\t" |
2979 | 1715 "paddusw %%mm1, %%mm0 \n\t" |
2892
41315d0120b3
replace a few mov + psrlq with pshufw, there are more cases which could benefit from this but they would require us to duplicate some functions ...
michael
parents:
2871
diff
changeset
|
1716 "pshufw $0x01, %%mm0, %%mm1 \n\t" |
2979 | 1717 "paddusw %%mm1, %%mm0 \n\t" |
1718 "movd %%mm0, %0 \n\t" | |
2967 | 1719 |
1153 | 1720 : "=r" (sum) |
1721 : "r"(temp) | |
1722 ); | |
1723 return sum&0xFFFF; | |
1724 } | |
1725 | |
1726 | |
1708 | 1727 WARPER8_16_SQ(hadamard8_diff_mmx, hadamard8_diff16_mmx) |
1728 WARPER8_16_SQ(hadamard8_diff_mmx2, hadamard8_diff16_mmx2) | |
1530
3b31998fe22f
disable encoders where appropriate (patch courtesy of BERO
melanson
parents:
1527
diff
changeset
|
1729 #endif //CONFIG_ENCODERS |
866 | 1730 |
959 | 1731 #define put_no_rnd_pixels8_mmx(a,b,c,d) put_pixels8_mmx(a,b,c,d) |
1732 #define put_no_rnd_pixels16_mmx(a,b,c,d) put_pixels16_mmx(a,b,c,d) | |
1733 | |
954 | 1734 #define QPEL_V_LOW(m3,m4,m5,m6, pw_20, pw_3, rnd, in0, in1, in2, in7, out, OP)\ |
2979 | 1735 "paddw " #m4 ", " #m3 " \n\t" /* x1 */\ |
1736 "movq "MANGLE(ff_pw_20)", %%mm4 \n\t" /* 20 */\ | |
1737 "pmullw " #m3 ", %%mm4 \n\t" /* 20x1 */\ | |
1738 "movq "#in7", " #m3 " \n\t" /* d */\ | |
1739 "movq "#in0", %%mm5 \n\t" /* D */\ | |
1740 "paddw " #m3 ", %%mm5 \n\t" /* x4 */\ | |
1741 "psubw %%mm5, %%mm4 \n\t" /* 20x1 - x4 */\ | |
1742 "movq "#in1", %%mm5 \n\t" /* C */\ | |
1743 "movq "#in2", %%mm6 \n\t" /* B */\ | |
1744 "paddw " #m6 ", %%mm5 \n\t" /* x3 */\ | |
1745 "paddw " #m5 ", %%mm6 \n\t" /* x2 */\ | |
1746 "paddw %%mm6, %%mm6 \n\t" /* 2x2 */\ | |
1747 "psubw %%mm6, %%mm5 \n\t" /* -2x2 + x3 */\ | |
1748 "pmullw "MANGLE(ff_pw_3)", %%mm5 \n\t" /* -6x2 + 3x3 */\ | |
1749 "paddw " #rnd ", %%mm4 \n\t" /* x2 */\ | |
1750 "paddw %%mm4, %%mm5 \n\t" /* 20x1 - 6x2 + 3x3 - x4 */\ | |
1751 "psraw $5, %%mm5 \n\t"\ | |
1752 "packuswb %%mm5, %%mm5 \n\t"\ | |
954 | 1753 OP(%%mm5, out, %%mm7, d) |
1754 | |
959 | 1755 #define QPEL_BASE(OPNAME, ROUNDER, RND, OP_MMX2, OP_3DNOW)\ |
1057 | 1756 static void OPNAME ## mpeg4_qpel16_h_lowpass_mmx2(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\ |
954 | 1757 uint64_t temp;\ |
1758 \ | |
1759 asm volatile(\ | |
2979 | 1760 "pxor %%mm7, %%mm7 \n\t"\ |
1761 "1: \n\t"\ | |
1762 "movq (%0), %%mm0 \n\t" /* ABCDEFGH */\ | |
1763 "movq %%mm0, %%mm1 \n\t" /* ABCDEFGH */\ | |
1764 "movq %%mm0, %%mm2 \n\t" /* ABCDEFGH */\ | |
1765 "punpcklbw %%mm7, %%mm0 \n\t" /* 0A0B0C0D */\ | |
1766 "punpckhbw %%mm7, %%mm1 \n\t" /* 0E0F0G0H */\ | |
1767 "pshufw $0x90, %%mm0, %%mm5 \n\t" /* 0A0A0B0C */\ | |
1768 "pshufw $0x41, %%mm0, %%mm6 \n\t" /* 0B0A0A0B */\ | |
1769 "movq %%mm2, %%mm3 \n\t" /* ABCDEFGH */\ | |
1770 "movq %%mm2, %%mm4 \n\t" /* ABCDEFGH */\ | |
1771 "psllq $8, %%mm2 \n\t" /* 0ABCDEFG */\ | |
1772 "psllq $16, %%mm3 \n\t" /* 00ABCDEF */\ | |
1773 "psllq $24, %%mm4 \n\t" /* 000ABCDE */\ | |
1774 "punpckhbw %%mm7, %%mm2 \n\t" /* 0D0E0F0G */\ | |
1775 "punpckhbw %%mm7, %%mm3 \n\t" /* 0C0D0E0F */\ | |
1776 "punpckhbw %%mm7, %%mm4 \n\t" /* 0B0C0D0E */\ | |
1777 "paddw %%mm3, %%mm5 \n\t" /* b */\ | |
1778 "paddw %%mm2, %%mm6 \n\t" /* c */\ | |
1779 "paddw %%mm5, %%mm5 \n\t" /* 2b */\ | |
1780 "psubw %%mm5, %%mm6 \n\t" /* c - 2b */\ | |
1781 "pshufw $0x06, %%mm0, %%mm5 \n\t" /* 0C0B0A0A */\ | |
1782 "pmullw "MANGLE(ff_pw_3)", %%mm6 \n\t" /* 3c - 6b */\ | |
1783 "paddw %%mm4, %%mm0 \n\t" /* a */\ | |
1784 "paddw %%mm1, %%mm5 \n\t" /* d */\ | |
1785 "pmullw "MANGLE(ff_pw_20)", %%mm0 \n\t" /* 20a */\ | |
1786 "psubw %%mm5, %%mm0 \n\t" /* 20a - d */\ | |
1787 "paddw %6, %%mm6 \n\t"\ | |
1788 "paddw %%mm6, %%mm0 \n\t" /* 20a - 6b + 3c - d */\ | |
1789 "psraw $5, %%mm0 \n\t"\ | |
1790 "movq %%mm0, %5 \n\t"\ | |
954 | 1791 /* mm1=EFGH, mm2=DEFG, mm3=CDEF, mm4=BCDE, mm7=0 */\ |
1792 \ | |
2979 | 1793 "movq 5(%0), %%mm0 \n\t" /* FGHIJKLM */\ |
1794 "movq %%mm0, %%mm5 \n\t" /* FGHIJKLM */\ | |
1795 "movq %%mm0, %%mm6 \n\t" /* FGHIJKLM */\ | |
1796 "psrlq $8, %%mm0 \n\t" /* GHIJKLM0 */\ | |
1797 "psrlq $16, %%mm5 \n\t" /* HIJKLM00 */\ | |
1798 "punpcklbw %%mm7, %%mm0 \n\t" /* 0G0H0I0J */\ | |
1799 "punpcklbw %%mm7, %%mm5 \n\t" /* 0H0I0J0K */\ | |
1800 "paddw %%mm0, %%mm2 \n\t" /* b */\ | |
1801 "paddw %%mm5, %%mm3 \n\t" /* c */\ | |
1802 "paddw %%mm2, %%mm2 \n\t" /* 2b */\ | |
1803 "psubw %%mm2, %%mm3 \n\t" /* c - 2b */\ | |
1804 "movq %%mm6, %%mm2 \n\t" /* FGHIJKLM */\ | |
1805 "psrlq $24, %%mm6 \n\t" /* IJKLM000 */\ | |
1806 "punpcklbw %%mm7, %%mm2 \n\t" /* 0F0G0H0I */\ | |
1807 "punpcklbw %%mm7, %%mm6 \n\t" /* 0I0J0K0L */\ | |
1808 "pmullw "MANGLE(ff_pw_3)", %%mm3 \n\t" /* 3c - 6b */\ | |
1809 "paddw %%mm2, %%mm1 \n\t" /* a */\ | |
1810 "paddw %%mm6, %%mm4 \n\t" /* d */\ | |
1811 "pmullw "MANGLE(ff_pw_20)", %%mm1 \n\t" /* 20a */\ | |
1812 "psubw %%mm4, %%mm3 \n\t" /* - 6b +3c - d */\ | |
1813 "paddw %6, %%mm1 \n\t"\ | |
1814 "paddw %%mm1, %%mm3 \n\t" /* 20a - 6b +3c - d */\ | |
1815 "psraw $5, %%mm3 \n\t"\ | |
1816 "movq %5, %%mm1 \n\t"\ | |
1817 "packuswb %%mm3, %%mm1 \n\t"\ | |
959 | 1818 OP_MMX2(%%mm1, (%1),%%mm4, q)\ |
954 | 1819 /* mm0= GHIJ, mm2=FGHI, mm5=HIJK, mm6=IJKL, mm7=0 */\ |
1820 \ | |
2979 | 1821 "movq 9(%0), %%mm1 \n\t" /* JKLMNOPQ */\ |
1822 "movq %%mm1, %%mm4 \n\t" /* JKLMNOPQ */\ | |
1823 "movq %%mm1, %%mm3 \n\t" /* JKLMNOPQ */\ | |
1824 "psrlq $8, %%mm1 \n\t" /* KLMNOPQ0 */\ | |
1825 "psrlq $16, %%mm4 \n\t" /* LMNOPQ00 */\ | |
1826 "punpcklbw %%mm7, %%mm1 \n\t" /* 0K0L0M0N */\ | |
1827 "punpcklbw %%mm7, %%mm4 \n\t" /* 0L0M0N0O */\ | |
1828 "paddw %%mm1, %%mm5 \n\t" /* b */\ | |
1829 "paddw %%mm4, %%mm0 \n\t" /* c */\ | |
1830 "paddw %%mm5, %%mm5 \n\t" /* 2b */\ | |
1831 "psubw %%mm5, %%mm0 \n\t" /* c - 2b */\ | |
1832 "movq %%mm3, %%mm5 \n\t" /* JKLMNOPQ */\ | |
1833 "psrlq $24, %%mm3 \n\t" /* MNOPQ000 */\ | |
1834 "pmullw "MANGLE(ff_pw_3)", %%mm0 \n\t" /* 3c - 6b */\ | |
1835 "punpcklbw %%mm7, %%mm3 \n\t" /* 0M0N0O0P */\ | |
1836 "paddw %%mm3, %%mm2 \n\t" /* d */\ | |
1837 "psubw %%mm2, %%mm0 \n\t" /* -6b + 3c - d */\ | |
1838 "movq %%mm5, %%mm2 \n\t" /* JKLMNOPQ */\ | |
1839 "punpcklbw %%mm7, %%mm2 \n\t" /* 0J0K0L0M */\ | |
1840 "punpckhbw %%mm7, %%mm5 \n\t" /* 0N0O0P0Q */\ | |
1841 "paddw %%mm2, %%mm6 \n\t" /* a */\ | |
1842 "pmullw "MANGLE(ff_pw_20)", %%mm6 \n\t" /* 20a */\ | |
1843 "paddw %6, %%mm0 \n\t"\ | |
1844 "paddw %%mm6, %%mm0 \n\t" /* 20a - 6b + 3c - d */\ | |
1845 "psraw $5, %%mm0 \n\t"\ | |
954 | 1846 /* mm1=KLMN, mm2=JKLM, mm3=MNOP, mm4=LMNO, mm5=NOPQ mm7=0 */\ |
1847 \ | |
2979 | 1848 "paddw %%mm5, %%mm3 \n\t" /* a */\ |
1849 "pshufw $0xF9, %%mm5, %%mm6 \n\t" /* 0O0P0Q0Q */\ | |
1850 "paddw %%mm4, %%mm6 \n\t" /* b */\ | |
1851 "pshufw $0xBE, %%mm5, %%mm4 \n\t" /* 0P0Q0Q0P */\ | |
1852 "pshufw $0x6F, %%mm5, %%mm5 \n\t" /* 0Q0Q0P0O */\ | |
1853 "paddw %%mm1, %%mm4 \n\t" /* c */\ | |
1854 "paddw %%mm2, %%mm5 \n\t" /* d */\ | |
1855 "paddw %%mm6, %%mm6 \n\t" /* 2b */\ | |
1856 "psubw %%mm6, %%mm4 \n\t" /* c - 2b */\ | |
1857 "pmullw "MANGLE(ff_pw_20)", %%mm3 \n\t" /* 20a */\ | |
1858 "pmullw "MANGLE(ff_pw_3)", %%mm4 \n\t" /* 3c - 6b */\ | |
1859 "psubw %%mm5, %%mm3 \n\t" /* -6b + 3c - d */\ | |
1860 "paddw %6, %%mm4 \n\t"\ | |
1861 "paddw %%mm3, %%mm4 \n\t" /* 20a - 6b + 3c - d */\ | |
1862 "psraw $5, %%mm4 \n\t"\ | |
1863 "packuswb %%mm4, %%mm0 \n\t"\ | |
959 | 1864 OP_MMX2(%%mm0, 8(%1), %%mm4, q)\ |
954 | 1865 \ |
2979 | 1866 "add %3, %0 \n\t"\ |
1867 "add %4, %1 \n\t"\ | |
1868 "decl %2 \n\t"\ | |
1869 " jnz 1b \n\t"\ | |
967 | 1870 : "+a"(src), "+c"(dst), "+m"(h)\ |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
1871 : "d"((long)srcStride), "S"((long)dstStride), /*"m"(ff_pw_20), "m"(ff_pw_3),*/ "m"(temp), "m"(ROUNDER)\ |
966 | 1872 : "memory"\ |
954 | 1873 );\ |
1874 }\ | |
1875 \ | |
1876 static void OPNAME ## mpeg4_qpel16_h_lowpass_3dnow(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\ | |
1877 int i;\ | |
1878 int16_t temp[16];\ | |
1879 /* quick HACK, XXX FIXME MUST be optimized */\ | |
1880 for(i=0; i<h; i++)\ | |
1881 {\ | |
1882 temp[ 0]= (src[ 0]+src[ 1])*20 - (src[ 0]+src[ 2])*6 + (src[ 1]+src[ 3])*3 - (src[ 2]+src[ 4]);\ | |
1883 temp[ 1]= (src[ 1]+src[ 2])*20 - (src[ 0]+src[ 3])*6 + (src[ 0]+src[ 4])*3 - (src[ 1]+src[ 5]);\ | |
1884 temp[ 2]= (src[ 2]+src[ 3])*20 - (src[ 1]+src[ 4])*6 + (src[ 0]+src[ 5])*3 - (src[ 0]+src[ 6]);\ | |
1885 temp[ 3]= (src[ 3]+src[ 4])*20 - (src[ 2]+src[ 5])*6 + (src[ 1]+src[ 6])*3 - (src[ 0]+src[ 7]);\ | |
1886 temp[ 4]= (src[ 4]+src[ 5])*20 - (src[ 3]+src[ 6])*6 + (src[ 2]+src[ 7])*3 - (src[ 1]+src[ 8]);\ | |
1887 temp[ 5]= (src[ 5]+src[ 6])*20 - (src[ 4]+src[ 7])*6 + (src[ 3]+src[ 8])*3 - (src[ 2]+src[ 9]);\ | |
1888 temp[ 6]= (src[ 6]+src[ 7])*20 - (src[ 5]+src[ 8])*6 + (src[ 4]+src[ 9])*3 - (src[ 3]+src[10]);\ | |
1889 temp[ 7]= (src[ 7]+src[ 8])*20 - (src[ 6]+src[ 9])*6 + (src[ 5]+src[10])*3 - (src[ 4]+src[11]);\ | |
1890 temp[ 8]= (src[ 8]+src[ 9])*20 - (src[ 7]+src[10])*6 + (src[ 6]+src[11])*3 - (src[ 5]+src[12]);\ | |
1891 temp[ 9]= (src[ 9]+src[10])*20 - (src[ 8]+src[11])*6 + (src[ 7]+src[12])*3 - (src[ 6]+src[13]);\ | |
1892 temp[10]= (src[10]+src[11])*20 - (src[ 9]+src[12])*6 + (src[ 8]+src[13])*3 - (src[ 7]+src[14]);\ | |
1893 temp[11]= (src[11]+src[12])*20 - (src[10]+src[13])*6 + (src[ 9]+src[14])*3 - (src[ 8]+src[15]);\ | |
1894 temp[12]= (src[12]+src[13])*20 - (src[11]+src[14])*6 + (src[10]+src[15])*3 - (src[ 9]+src[16]);\ | |
1895 temp[13]= (src[13]+src[14])*20 - (src[12]+src[15])*6 + (src[11]+src[16])*3 - (src[10]+src[16]);\ | |
1896 temp[14]= (src[14]+src[15])*20 - (src[13]+src[16])*6 + (src[12]+src[16])*3 - (src[11]+src[15]);\ | |
1897 temp[15]= (src[15]+src[16])*20 - (src[14]+src[16])*6 + (src[13]+src[15])*3 - (src[12]+src[14]);\ | |
1898 asm volatile(\ | |
2979 | 1899 "movq (%0), %%mm0 \n\t"\ |
1900 "movq 8(%0), %%mm1 \n\t"\ | |
1901 "paddw %2, %%mm0 \n\t"\ | |
1902 "paddw %2, %%mm1 \n\t"\ | |
1903 "psraw $5, %%mm0 \n\t"\ | |
1904 "psraw $5, %%mm1 \n\t"\ | |
1905 "packuswb %%mm1, %%mm0 \n\t"\ | |
959 | 1906 OP_3DNOW(%%mm0, (%1), %%mm1, q)\ |
2979 | 1907 "movq 16(%0), %%mm0 \n\t"\ |
1908 "movq 24(%0), %%mm1 \n\t"\ | |
1909 "paddw %2, %%mm0 \n\t"\ | |
1910 "paddw %2, %%mm1 \n\t"\ | |
1911 "psraw $5, %%mm0 \n\t"\ | |
1912 "psraw $5, %%mm1 \n\t"\ | |
1913 "packuswb %%mm1, %%mm0 \n\t"\ | |
959 | 1914 OP_3DNOW(%%mm0, 8(%1), %%mm1, q)\ |
954 | 1915 :: "r"(temp), "r"(dst), "m"(ROUNDER)\ |
966 | 1916 : "memory"\ |
954 | 1917 );\ |
1918 dst+=dstStride;\ | |
1919 src+=srcStride;\ | |
1920 }\ | |
1921 }\ | |
1922 \ | |
1057 | 1923 static void OPNAME ## mpeg4_qpel8_h_lowpass_mmx2(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\ |
959 | 1924 uint64_t temp;\ |
1925 \ | |
1926 asm volatile(\ | |
2979 | 1927 "pxor %%mm7, %%mm7 \n\t"\ |
1928 "1: \n\t"\ | |
1929 "movq (%0), %%mm0 \n\t" /* ABCDEFGH */\ | |
1930 "movq %%mm0, %%mm1 \n\t" /* ABCDEFGH */\ | |
1931 "movq %%mm0, %%mm2 \n\t" /* ABCDEFGH */\ | |
1932 "punpcklbw %%mm7, %%mm0 \n\t" /* 0A0B0C0D */\ | |
1933 "punpckhbw %%mm7, %%mm1 \n\t" /* 0E0F0G0H */\ | |
1934 "pshufw $0x90, %%mm0, %%mm5 \n\t" /* 0A0A0B0C */\ | |
1935 "pshufw $0x41, %%mm0, %%mm6 \n\t" /* 0B0A0A0B */\ | |
1936 "movq %%mm2, %%mm3 \n\t" /* ABCDEFGH */\ | |
1937 "movq %%mm2, %%mm4 \n\t" /* ABCDEFGH */\ | |
1938 "psllq $8, %%mm2 \n\t" /* 0ABCDEFG */\ | |
1939 "psllq $16, %%mm3 \n\t" /* 00ABCDEF */\ | |
1940 "psllq $24, %%mm4 \n\t" /* 000ABCDE */\ | |
1941 "punpckhbw %%mm7, %%mm2 \n\t" /* 0D0E0F0G */\ | |
1942 "punpckhbw %%mm7, %%mm3 \n\t" /* 0C0D0E0F */\ | |
1943 "punpckhbw %%mm7, %%mm4 \n\t" /* 0B0C0D0E */\ | |
1944 "paddw %%mm3, %%mm5 \n\t" /* b */\ | |
1945 "paddw %%mm2, %%mm6 \n\t" /* c */\ | |
1946 "paddw %%mm5, %%mm5 \n\t" /* 2b */\ | |
1947 "psubw %%mm5, %%mm6 \n\t" /* c - 2b */\ | |
1948 "pshufw $0x06, %%mm0, %%mm5 \n\t" /* 0C0B0A0A */\ | |
1949 "pmullw "MANGLE(ff_pw_3)", %%mm6 \n\t" /* 3c - 6b */\ | |
1950 "paddw %%mm4, %%mm0 \n\t" /* a */\ | |
1951 "paddw %%mm1, %%mm5 \n\t" /* d */\ | |
1952 "pmullw "MANGLE(ff_pw_20)", %%mm0 \n\t" /* 20a */\ | |
1953 "psubw %%mm5, %%mm0 \n\t" /* 20a - d */\ | |
1954 "paddw %6, %%mm6 \n\t"\ | |
1955 "paddw %%mm6, %%mm0 \n\t" /* 20a - 6b + 3c - d */\ | |
1956 "psraw $5, %%mm0 \n\t"\ | |
959 | 1957 /* mm1=EFGH, mm2=DEFG, mm3=CDEF, mm4=BCDE, mm7=0 */\ |
1958 \ | |
2979 | 1959 "movd 5(%0), %%mm5 \n\t" /* FGHI */\ |
1960 "punpcklbw %%mm7, %%mm5 \n\t" /* 0F0G0H0I */\ | |
1961 "pshufw $0xF9, %%mm5, %%mm6 \n\t" /* 0G0H0I0I */\ | |
1962 "paddw %%mm5, %%mm1 \n\t" /* a */\ | |
1963 "paddw %%mm6, %%mm2 \n\t" /* b */\ | |
1964 "pshufw $0xBE, %%mm5, %%mm6 \n\t" /* 0H0I0I0H */\ | |
1965 "pshufw $0x6F, %%mm5, %%mm5 \n\t" /* 0I0I0H0G */\ | |
1966 "paddw %%mm6, %%mm3 \n\t" /* c */\ | |
1967 "paddw %%mm5, %%mm4 \n\t" /* d */\ | |
1968 "paddw %%mm2, %%mm2 \n\t" /* 2b */\ | |
1969 "psubw %%mm2, %%mm3 \n\t" /* c - 2b */\ | |
1970 "pmullw "MANGLE(ff_pw_20)", %%mm1 \n\t" /* 20a */\ | |
1971 "pmullw "MANGLE(ff_pw_3)", %%mm3 \n\t" /* 3c - 6b */\ | |
1972 "psubw %%mm4, %%mm3 \n\t" /* -6b + 3c - d */\ | |
1973 "paddw %6, %%mm1 \n\t"\ | |
1974 "paddw %%mm1, %%mm3 \n\t" /* 20a - 6b + 3c - d */\ | |
1975 "psraw $5, %%mm3 \n\t"\ | |
1976 "packuswb %%mm3, %%mm0 \n\t"\ | |
959 | 1977 OP_MMX2(%%mm0, (%1), %%mm4, q)\ |
1978 \ | |
2979 | 1979 "add %3, %0 \n\t"\ |
1980 "add %4, %1 \n\t"\ | |
1981 "decl %2 \n\t"\ | |
1982 " jnz 1b \n\t"\ | |
967 | 1983 : "+a"(src), "+c"(dst), "+m"(h)\ |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
1984 : "S"((long)srcStride), "D"((long)dstStride), /*"m"(ff_pw_20), "m"(ff_pw_3),*/ "m"(temp), "m"(ROUNDER)\ |
966 | 1985 : "memory"\ |
959 | 1986 );\ |
1987 }\ | |
1988 \ | |
1989 static void OPNAME ## mpeg4_qpel8_h_lowpass_3dnow(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\ | |
1990 int i;\ | |
1991 int16_t temp[8];\ | |
1992 /* quick HACK, XXX FIXME MUST be optimized */\ | |
1993 for(i=0; i<h; i++)\ | |
1994 {\ | |
1995 temp[ 0]= (src[ 0]+src[ 1])*20 - (src[ 0]+src[ 2])*6 + (src[ 1]+src[ 3])*3 - (src[ 2]+src[ 4]);\ | |
1996 temp[ 1]= (src[ 1]+src[ 2])*20 - (src[ 0]+src[ 3])*6 + (src[ 0]+src[ 4])*3 - (src[ 1]+src[ 5]);\ | |
1997 temp[ 2]= (src[ 2]+src[ 3])*20 - (src[ 1]+src[ 4])*6 + (src[ 0]+src[ 5])*3 - (src[ 0]+src[ 6]);\ | |
1998 temp[ 3]= (src[ 3]+src[ 4])*20 - (src[ 2]+src[ 5])*6 + (src[ 1]+src[ 6])*3 - (src[ 0]+src[ 7]);\ | |
1999 temp[ 4]= (src[ 4]+src[ 5])*20 - (src[ 3]+src[ 6])*6 + (src[ 2]+src[ 7])*3 - (src[ 1]+src[ 8]);\ | |
2000 temp[ 5]= (src[ 5]+src[ 6])*20 - (src[ 4]+src[ 7])*6 + (src[ 3]+src[ 8])*3 - (src[ 2]+src[ 8]);\ | |
2001 temp[ 6]= (src[ 6]+src[ 7])*20 - (src[ 5]+src[ 8])*6 + (src[ 4]+src[ 8])*3 - (src[ 3]+src[ 7]);\ | |
2002 temp[ 7]= (src[ 7]+src[ 8])*20 - (src[ 6]+src[ 8])*6 + (src[ 5]+src[ 7])*3 - (src[ 4]+src[ 6]);\ | |
2003 asm volatile(\ | |
2979 | 2004 "movq (%0), %%mm0 \n\t"\ |
2005 "movq 8(%0), %%mm1 \n\t"\ | |
2006 "paddw %2, %%mm0 \n\t"\ | |
2007 "paddw %2, %%mm1 \n\t"\ | |
2008 "psraw $5, %%mm0 \n\t"\ | |
2009 "psraw $5, %%mm1 \n\t"\ | |
2010 "packuswb %%mm1, %%mm0 \n\t"\ | |
959 | 2011 OP_3DNOW(%%mm0, (%1), %%mm1, q)\ |
2012 :: "r"(temp), "r"(dst), "m"(ROUNDER)\ | |
966 | 2013 :"memory"\ |
959 | 2014 );\ |
2015 dst+=dstStride;\ | |
2016 src+=srcStride;\ | |
2017 }\ | |
2018 } | |
2019 | |
2020 #define QPEL_OP(OPNAME, ROUNDER, RND, OP, MMX)\ | |
2021 \ | |
2022 static void OPNAME ## mpeg4_qpel16_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\ | |
954 | 2023 uint64_t temp[17*4];\ |
2024 uint64_t *temp_ptr= temp;\ | |
2025 int count= 17;\ | |
2026 \ | |
2027 /*FIXME unroll */\ | |
2028 asm volatile(\ | |
2979 | 2029 "pxor %%mm7, %%mm7 \n\t"\ |
2030 "1: \n\t"\ | |
2031 "movq (%0), %%mm0 \n\t"\ | |
2032 "movq (%0), %%mm1 \n\t"\ | |
2033 "movq 8(%0), %%mm2 \n\t"\ | |
2034 "movq 8(%0), %%mm3 \n\t"\ | |
2035 "punpcklbw %%mm7, %%mm0 \n\t"\ | |
2036 "punpckhbw %%mm7, %%mm1 \n\t"\ | |
2037 "punpcklbw %%mm7, %%mm2 \n\t"\ | |
2038 "punpckhbw %%mm7, %%mm3 \n\t"\ | |
2039 "movq %%mm0, (%1) \n\t"\ | |
2040 "movq %%mm1, 17*8(%1) \n\t"\ | |
2041 "movq %%mm2, 2*17*8(%1) \n\t"\ | |
2042 "movq %%mm3, 3*17*8(%1) \n\t"\ | |
2043 "add $8, %1 \n\t"\ | |
2044 "add %3, %0 \n\t"\ | |
2045 "decl %2 \n\t"\ | |
2046 " jnz 1b \n\t"\ | |
954 | 2047 : "+r" (src), "+r" (temp_ptr), "+r"(count)\ |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
2048 : "r" ((long)srcStride)\ |
966 | 2049 : "memory"\ |
954 | 2050 );\ |
2051 \ | |
2052 temp_ptr= temp;\ | |
2053 count=4;\ | |
2054 \ | |
2055 /*FIXME reorder for speed */\ | |
2056 asm volatile(\ | |
2979 | 2057 /*"pxor %%mm7, %%mm7 \n\t"*/\ |
2058 "1: \n\t"\ | |
2059 "movq (%0), %%mm0 \n\t"\ | |
2060 "movq 8(%0), %%mm1 \n\t"\ | |
2061 "movq 16(%0), %%mm2 \n\t"\ | |
2062 "movq 24(%0), %%mm3 \n\t"\ | |
961 | 2063 QPEL_V_LOW(%%mm0, %%mm1, %%mm2, %%mm3, %5, %6, %5, 16(%0), 8(%0), (%0), 32(%0), (%1), OP)\ |
2064 QPEL_V_LOW(%%mm1, %%mm2, %%mm3, %%mm0, %5, %6, %5, 8(%0), (%0), (%0), 40(%0), (%1, %3), OP)\ | |
2979 | 2065 "add %4, %1 \n\t"\ |
961 | 2066 QPEL_V_LOW(%%mm2, %%mm3, %%mm0, %%mm1, %5, %6, %5, (%0), (%0), 8(%0), 48(%0), (%1), OP)\ |
954 | 2067 \ |
961 | 2068 QPEL_V_LOW(%%mm3, %%mm0, %%mm1, %%mm2, %5, %6, %5, (%0), 8(%0), 16(%0), 56(%0), (%1, %3), OP)\ |
2979 | 2069 "add %4, %1 \n\t"\ |
961 | 2070 QPEL_V_LOW(%%mm0, %%mm1, %%mm2, %%mm3, %5, %6, %5, 8(%0), 16(%0), 24(%0), 64(%0), (%1), OP)\ |
2071 QPEL_V_LOW(%%mm1, %%mm2, %%mm3, %%mm0, %5, %6, %5, 16(%0), 24(%0), 32(%0), 72(%0), (%1, %3), OP)\ | |
2979 | 2072 "add %4, %1 \n\t"\ |
961 | 2073 QPEL_V_LOW(%%mm2, %%mm3, %%mm0, %%mm1, %5, %6, %5, 24(%0), 32(%0), 40(%0), 80(%0), (%1), OP)\ |
2074 QPEL_V_LOW(%%mm3, %%mm0, %%mm1, %%mm2, %5, %6, %5, 32(%0), 40(%0), 48(%0), 88(%0), (%1, %3), OP)\ | |
2979 | 2075 "add %4, %1 \n\t"\ |
961 | 2076 QPEL_V_LOW(%%mm0, %%mm1, %%mm2, %%mm3, %5, %6, %5, 40(%0), 48(%0), 56(%0), 96(%0), (%1), OP)\ |
2077 QPEL_V_LOW(%%mm1, %%mm2, %%mm3, %%mm0, %5, %6, %5, 48(%0), 56(%0), 64(%0),104(%0), (%1, %3), OP)\ | |
2979 | 2078 "add %4, %1 \n\t"\ |
961 | 2079 QPEL_V_LOW(%%mm2, %%mm3, %%mm0, %%mm1, %5, %6, %5, 56(%0), 64(%0), 72(%0),112(%0), (%1), OP)\ |
2080 QPEL_V_LOW(%%mm3, %%mm0, %%mm1, %%mm2, %5, %6, %5, 64(%0), 72(%0), 80(%0),120(%0), (%1, %3), OP)\ | |
2979 | 2081 "add %4, %1 \n\t"\ |
961 | 2082 QPEL_V_LOW(%%mm0, %%mm1, %%mm2, %%mm3, %5, %6, %5, 72(%0), 80(%0), 88(%0),128(%0), (%1), OP)\ |
954 | 2083 \ |
961 | 2084 QPEL_V_LOW(%%mm1, %%mm2, %%mm3, %%mm0, %5, %6, %5, 80(%0), 88(%0), 96(%0),128(%0), (%1, %3), OP)\ |
2979 | 2085 "add %4, %1 \n\t" \ |
961 | 2086 QPEL_V_LOW(%%mm2, %%mm3, %%mm0, %%mm1, %5, %6, %5, 88(%0), 96(%0),104(%0),120(%0), (%1), OP)\ |
2087 QPEL_V_LOW(%%mm3, %%mm0, %%mm1, %%mm2, %5, %6, %5, 96(%0),104(%0),112(%0),112(%0), (%1, %3), OP)\ | |
954 | 2088 \ |
2979 | 2089 "add $136, %0 \n\t"\ |
2090 "add %6, %1 \n\t"\ | |
2091 "decl %2 \n\t"\ | |
2092 " jnz 1b \n\t"\ | |
958
9bb668034ecf
slowdown / gcc 2.95.* bug workaround (this should be reversed as soon as gcc 2.95.* support is droped)
michaelni
parents:
954
diff
changeset
|
2093 \ |
967 | 2094 : "+r"(temp_ptr), "+r"(dst), "+g"(count)\ |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
2095 : "r"((long)dstStride), "r"(2*(long)dstStride), /*"m"(ff_pw_20), "m"(ff_pw_3),*/ "m"(ROUNDER), "g"(4-14*(long)dstStride)\ |
966 | 2096 :"memory"\ |
954 | 2097 );\ |
2098 }\ | |
2099 \ | |
1057 | 2100 static void OPNAME ## mpeg4_qpel8_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\ |
2209 | 2101 uint64_t temp[9*2];\ |
954 | 2102 uint64_t *temp_ptr= temp;\ |
2103 int count= 9;\ | |
2104 \ | |
2105 /*FIXME unroll */\ | |
2106 asm volatile(\ | |
2979 | 2107 "pxor %%mm7, %%mm7 \n\t"\ |
2108 "1: \n\t"\ | |
2109 "movq (%0), %%mm0 \n\t"\ | |
2110 "movq (%0), %%mm1 \n\t"\ | |
2111 "punpcklbw %%mm7, %%mm0 \n\t"\ | |
2112 "punpckhbw %%mm7, %%mm1 \n\t"\ | |
2113 "movq %%mm0, (%1) \n\t"\ | |
2114 "movq %%mm1, 9*8(%1) \n\t"\ | |
2115 "add $8, %1 \n\t"\ | |
2116 "add %3, %0 \n\t"\ | |
2117 "decl %2 \n\t"\ | |
2118 " jnz 1b \n\t"\ | |
954 | 2119 : "+r" (src), "+r" (temp_ptr), "+r"(count)\ |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
2120 : "r" ((long)srcStride)\ |
966 | 2121 : "memory"\ |
954 | 2122 );\ |
2123 \ | |
2124 temp_ptr= temp;\ | |
2125 count=2;\ | |
2126 \ | |
2127 /*FIXME reorder for speed */\ | |
2128 asm volatile(\ | |
2979 | 2129 /*"pxor %%mm7, %%mm7 \n\t"*/\ |
2130 "1: \n\t"\ | |
2131 "movq (%0), %%mm0 \n\t"\ | |
2132 "movq 8(%0), %%mm1 \n\t"\ | |
2133 "movq 16(%0), %%mm2 \n\t"\ | |
2134 "movq 24(%0), %%mm3 \n\t"\ | |
961 | 2135 QPEL_V_LOW(%%mm0, %%mm1, %%mm2, %%mm3, %5, %6, %5, 16(%0), 8(%0), (%0), 32(%0), (%1), OP)\ |
2136 QPEL_V_LOW(%%mm1, %%mm2, %%mm3, %%mm0, %5, %6, %5, 8(%0), (%0), (%0), 40(%0), (%1, %3), OP)\ | |
2979 | 2137 "add %4, %1 \n\t"\ |
961 | 2138 QPEL_V_LOW(%%mm2, %%mm3, %%mm0, %%mm1, %5, %6, %5, (%0), (%0), 8(%0), 48(%0), (%1), OP)\ |
954 | 2139 \ |
961 | 2140 QPEL_V_LOW(%%mm3, %%mm0, %%mm1, %%mm2, %5, %6, %5, (%0), 8(%0), 16(%0), 56(%0), (%1, %3), OP)\ |
2979 | 2141 "add %4, %1 \n\t"\ |
961 | 2142 QPEL_V_LOW(%%mm0, %%mm1, %%mm2, %%mm3, %5, %6, %5, 8(%0), 16(%0), 24(%0), 64(%0), (%1), OP)\ |
954 | 2143 \ |
961 | 2144 QPEL_V_LOW(%%mm1, %%mm2, %%mm3, %%mm0, %5, %6, %5, 16(%0), 24(%0), 32(%0), 64(%0), (%1, %3), OP)\ |
2979 | 2145 "add %4, %1 \n\t"\ |
961 | 2146 QPEL_V_LOW(%%mm2, %%mm3, %%mm0, %%mm1, %5, %6, %5, 24(%0), 32(%0), 40(%0), 56(%0), (%1), OP)\ |
2147 QPEL_V_LOW(%%mm3, %%mm0, %%mm1, %%mm2, %5, %6, %5, 32(%0), 40(%0), 48(%0), 48(%0), (%1, %3), OP)\ | |
954 | 2148 \ |
2979 | 2149 "add $72, %0 \n\t"\ |
2150 "add %6, %1 \n\t"\ | |
2151 "decl %2 \n\t"\ | |
2152 " jnz 1b \n\t"\ | |
954 | 2153 \ |
961 | 2154 : "+r"(temp_ptr), "+r"(dst), "+g"(count)\ |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
2155 : "r"((long)dstStride), "r"(2*(long)dstStride), /*"m"(ff_pw_20), "m"(ff_pw_3),*/ "m"(ROUNDER), "g"(4-6*(long)dstStride)\ |
966 | 2156 : "memory"\ |
2157 );\ | |
959 | 2158 }\ |
954 | 2159 \ |
1064 | 2160 static void OPNAME ## qpel8_mc00_ ## MMX (uint8_t *dst, uint8_t *src, int stride){\ |
959 | 2161 OPNAME ## pixels8_mmx(dst, src, stride, 8);\ |
954 | 2162 }\ |
2163 \ | |
1064 | 2164 static void OPNAME ## qpel8_mc10_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 2165 uint64_t temp[8];\ |
954 | 2166 uint8_t * const half= (uint8_t*)temp;\ |
2167 put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(half, src, 8, stride, 8);\ | |
2207
22b768f1261a
10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents:
2067
diff
changeset
|
2168 OPNAME ## pixels8_l2_ ## MMX(dst, src, half, stride, stride, 8);\ |
954 | 2169 }\ |
2170 \ | |
1064 | 2171 static void OPNAME ## qpel8_mc20_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
954 | 2172 OPNAME ## mpeg4_qpel8_h_lowpass_ ## MMX(dst, src, stride, stride, 8);\ |
2173 }\ | |
2174 \ | |
1064 | 2175 static void OPNAME ## qpel8_mc30_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 2176 uint64_t temp[8];\ |
954 | 2177 uint8_t * const half= (uint8_t*)temp;\ |
2178 put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(half, src, 8, stride, 8);\ | |
2207
22b768f1261a
10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents:
2067
diff
changeset
|
2179 OPNAME ## pixels8_l2_ ## MMX(dst, src+1, half, stride, stride, 8);\ |
954 | 2180 }\ |
2181 \ | |
1064 | 2182 static void OPNAME ## qpel8_mc01_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 2183 uint64_t temp[8];\ |
954 | 2184 uint8_t * const half= (uint8_t*)temp;\ |
959 | 2185 put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(half, src, 8, stride);\ |
2207
22b768f1261a
10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents:
2067
diff
changeset
|
2186 OPNAME ## pixels8_l2_ ## MMX(dst, src, half, stride, stride, 8);\ |
954 | 2187 }\ |
2188 \ | |
1064 | 2189 static void OPNAME ## qpel8_mc02_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
959 | 2190 OPNAME ## mpeg4_qpel8_v_lowpass_ ## MMX(dst, src, stride, stride);\ |
954 | 2191 }\ |
2192 \ | |
1064 | 2193 static void OPNAME ## qpel8_mc03_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 2194 uint64_t temp[8];\ |
954 | 2195 uint8_t * const half= (uint8_t*)temp;\ |
959 | 2196 put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(half, src, 8, stride);\ |
2207
22b768f1261a
10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents:
2067
diff
changeset
|
2197 OPNAME ## pixels8_l2_ ## MMX(dst, src+stride, half, stride, stride, 8);\ |
954 | 2198 }\ |
1064 | 2199 static void OPNAME ## qpel8_mc11_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 2200 uint64_t half[8 + 9];\ |
2201 uint8_t * const halfH= ((uint8_t*)half) + 64;\ | |
2202 uint8_t * const halfHV= ((uint8_t*)half);\ | |
954 | 2203 put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, stride, 9);\ |
2207
22b768f1261a
10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents:
2067
diff
changeset
|
2204 put ## RND ## pixels8_l2_ ## MMX(halfH, src, halfH, 8, stride, 9);\ |
959 | 2205 put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(halfHV, halfH, 8, 8);\ |
2207
22b768f1261a
10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents:
2067
diff
changeset
|
2206 OPNAME ## pixels8_l2_ ## MMX(dst, halfH, halfHV, stride, 8, 8);\ |
954 | 2207 }\ |
1064 | 2208 static void OPNAME ## qpel8_mc31_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 2209 uint64_t half[8 + 9];\ |
2210 uint8_t * const halfH= ((uint8_t*)half) + 64;\ | |
2211 uint8_t * const halfHV= ((uint8_t*)half);\ | |
954 | 2212 put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, stride, 9);\ |
2207
22b768f1261a
10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents:
2067
diff
changeset
|
2213 put ## RND ## pixels8_l2_ ## MMX(halfH, src+1, halfH, 8, stride, 9);\ |
959 | 2214 put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(halfHV, halfH, 8, 8);\ |
2207
22b768f1261a
10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents:
2067
diff
changeset
|
2215 OPNAME ## pixels8_l2_ ## MMX(dst, halfH, halfHV, stride, 8, 8);\ |
954 | 2216 }\ |
1064 | 2217 static void OPNAME ## qpel8_mc13_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 2218 uint64_t half[8 + 9];\ |
2219 uint8_t * const halfH= ((uint8_t*)half) + 64;\ | |
2220 uint8_t * const halfHV= ((uint8_t*)half);\ | |
954 | 2221 put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, stride, 9);\ |
2207
22b768f1261a
10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents:
2067
diff
changeset
|
2222 put ## RND ## pixels8_l2_ ## MMX(halfH, src, halfH, 8, stride, 9);\ |
959 | 2223 put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(halfHV, halfH, 8, 8);\ |
2207
22b768f1261a
10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents:
2067
diff
changeset
|
2224 OPNAME ## pixels8_l2_ ## MMX(dst, halfH+8, halfHV, stride, 8, 8);\ |
954 | 2225 }\ |
1064 | 2226 static void OPNAME ## qpel8_mc33_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 2227 uint64_t half[8 + 9];\ |
2228 uint8_t * const halfH= ((uint8_t*)half) + 64;\ | |
2229 uint8_t * const halfHV= ((uint8_t*)half);\ | |
2230 put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, stride, 9);\ | |
2207
22b768f1261a
10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents:
2067
diff
changeset
|
2231 put ## RND ## pixels8_l2_ ## MMX(halfH, src+1, halfH, 8, stride, 9);\ |
959 | 2232 put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(halfHV, halfH, 8, 8);\ |
2207
22b768f1261a
10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents:
2067
diff
changeset
|
2233 OPNAME ## pixels8_l2_ ## MMX(dst, halfH+8, halfHV, stride, 8, 8);\ |
954 | 2234 }\ |
1064 | 2235 static void OPNAME ## qpel8_mc21_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 2236 uint64_t half[8 + 9];\ |
954 | 2237 uint8_t * const halfH= ((uint8_t*)half) + 64;\ |
2238 uint8_t * const halfHV= ((uint8_t*)half);\ | |
2239 put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, stride, 9);\ | |
959 | 2240 put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(halfHV, halfH, 8, 8);\ |
2207
22b768f1261a
10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents:
2067
diff
changeset
|
2241 OPNAME ## pixels8_l2_ ## MMX(dst, halfH, halfHV, stride, 8, 8);\ |
954 | 2242 }\ |
1064 | 2243 static void OPNAME ## qpel8_mc23_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 2244 uint64_t half[8 + 9];\ |
954 | 2245 uint8_t * const halfH= ((uint8_t*)half) + 64;\ |
2246 uint8_t * const halfHV= ((uint8_t*)half);\ | |
2247 put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, stride, 9);\ | |
959 | 2248 put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(halfHV, halfH, 8, 8);\ |
2207
22b768f1261a
10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents:
2067
diff
changeset
|
2249 OPNAME ## pixels8_l2_ ## MMX(dst, halfH+8, halfHV, stride, 8, 8);\ |
954 | 2250 }\ |
1064 | 2251 static void OPNAME ## qpel8_mc12_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 2252 uint64_t half[8 + 9];\ |
2253 uint8_t * const halfH= ((uint8_t*)half);\ | |
954 | 2254 put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, stride, 9);\ |
2207
22b768f1261a
10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents:
2067
diff
changeset
|
2255 put ## RND ## pixels8_l2_ ## MMX(halfH, src, halfH, 8, stride, 9);\ |
984 | 2256 OPNAME ## mpeg4_qpel8_v_lowpass_ ## MMX(dst, halfH, stride, 8);\ |
954 | 2257 }\ |
1064 | 2258 static void OPNAME ## qpel8_mc32_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 2259 uint64_t half[8 + 9];\ |
2260 uint8_t * const halfH= ((uint8_t*)half);\ | |
954 | 2261 put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, stride, 9);\ |
2207
22b768f1261a
10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents:
2067
diff
changeset
|
2262 put ## RND ## pixels8_l2_ ## MMX(halfH, src+1, halfH, 8, stride, 9);\ |
984 | 2263 OPNAME ## mpeg4_qpel8_v_lowpass_ ## MMX(dst, halfH, stride, 8);\ |
954 | 2264 }\ |
1064 | 2265 static void OPNAME ## qpel8_mc22_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 2266 uint64_t half[9];\ |
954 | 2267 uint8_t * const halfH= ((uint8_t*)half);\ |
2268 put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, stride, 9);\ | |
959 | 2269 OPNAME ## mpeg4_qpel8_v_lowpass_ ## MMX(dst, halfH, stride, 8);\ |
954 | 2270 }\ |
1064 | 2271 static void OPNAME ## qpel16_mc00_ ## MMX (uint8_t *dst, uint8_t *src, int stride){\ |
959 | 2272 OPNAME ## pixels16_mmx(dst, src, stride, 16);\ |
954 | 2273 }\ |
2274 \ | |
1064 | 2275 static void OPNAME ## qpel16_mc10_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
954 | 2276 uint64_t temp[32];\ |
2277 uint8_t * const half= (uint8_t*)temp;\ | |
2278 put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(half, src, 16, stride, 16);\ | |
2207
22b768f1261a
10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents:
2067
diff
changeset
|
2279 OPNAME ## pixels16_l2_ ## MMX(dst, src, half, stride, stride, 16);\ |
954 | 2280 }\ |
2281 \ | |
1064 | 2282 static void OPNAME ## qpel16_mc20_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
954 | 2283 OPNAME ## mpeg4_qpel16_h_lowpass_ ## MMX(dst, src, stride, stride, 16);\ |
2284 }\ | |
2285 \ | |
1064 | 2286 static void OPNAME ## qpel16_mc30_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
954 | 2287 uint64_t temp[32];\ |
2288 uint8_t * const half= (uint8_t*)temp;\ | |
2289 put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(half, src, 16, stride, 16);\ | |
2207
22b768f1261a
10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents:
2067
diff
changeset
|
2290 OPNAME ## pixels16_l2_ ## MMX(dst, src+1, half, stride, stride, 16);\ |
954 | 2291 }\ |
2292 \ | |
1064 | 2293 static void OPNAME ## qpel16_mc01_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
954 | 2294 uint64_t temp[32];\ |
2295 uint8_t * const half= (uint8_t*)temp;\ | |
959 | 2296 put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(half, src, 16, stride);\ |
2207
22b768f1261a
10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents:
2067
diff
changeset
|
2297 OPNAME ## pixels16_l2_ ## MMX(dst, src, half, stride, stride, 16);\ |
954 | 2298 }\ |
2299 \ | |
1064 | 2300 static void OPNAME ## qpel16_mc02_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
959 | 2301 OPNAME ## mpeg4_qpel16_v_lowpass_ ## MMX(dst, src, stride, stride);\ |
954 | 2302 }\ |
2303 \ | |
1064 | 2304 static void OPNAME ## qpel16_mc03_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
954 | 2305 uint64_t temp[32];\ |
2306 uint8_t * const half= (uint8_t*)temp;\ | |
959 | 2307 put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(half, src, 16, stride);\ |
2207
22b768f1261a
10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents:
2067
diff
changeset
|
2308 OPNAME ## pixels16_l2_ ## MMX(dst, src+stride, half, stride, stride, 16);\ |
954 | 2309 }\ |
1064 | 2310 static void OPNAME ## qpel16_mc11_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 2311 uint64_t half[16*2 + 17*2];\ |
2312 uint8_t * const halfH= ((uint8_t*)half) + 256;\ | |
2313 uint8_t * const halfHV= ((uint8_t*)half);\ | |
954 | 2314 put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, stride, 17);\ |
2207
22b768f1261a
10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents:
2067
diff
changeset
|
2315 put ## RND ## pixels16_l2_ ## MMX(halfH, src, halfH, 16, stride, 17);\ |
959 | 2316 put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(halfHV, halfH, 16, 16);\ |
2207
22b768f1261a
10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents:
2067
diff
changeset
|
2317 OPNAME ## pixels16_l2_ ## MMX(dst, halfH, halfHV, stride, 16, 16);\ |
954 | 2318 }\ |
1064 | 2319 static void OPNAME ## qpel16_mc31_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 2320 uint64_t half[16*2 + 17*2];\ |
2321 uint8_t * const halfH= ((uint8_t*)half) + 256;\ | |
2322 uint8_t * const halfHV= ((uint8_t*)half);\ | |
954 | 2323 put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, stride, 17);\ |
2207
22b768f1261a
10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents:
2067
diff
changeset
|
2324 put ## RND ## pixels16_l2_ ## MMX(halfH, src+1, halfH, 16, stride, 17);\ |
959 | 2325 put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(halfHV, halfH, 16, 16);\ |
2207
22b768f1261a
10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents:
2067
diff
changeset
|
2326 OPNAME ## pixels16_l2_ ## MMX(dst, halfH, halfHV, stride, 16, 16);\ |
954 | 2327 }\ |
1064 | 2328 static void OPNAME ## qpel16_mc13_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 2329 uint64_t half[16*2 + 17*2];\ |
2330 uint8_t * const halfH= ((uint8_t*)half) + 256;\ | |
2331 uint8_t * const halfHV= ((uint8_t*)half);\ | |
954 | 2332 put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, stride, 17);\ |
2207
22b768f1261a
10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents:
2067
diff
changeset
|
2333 put ## RND ## pixels16_l2_ ## MMX(halfH, src, halfH, 16, stride, 17);\ |
959 | 2334 put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(halfHV, halfH, 16, 16);\ |
2207
22b768f1261a
10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents:
2067
diff
changeset
|
2335 OPNAME ## pixels16_l2_ ## MMX(dst, halfH+16, halfHV, stride, 16, 16);\ |
954 | 2336 }\ |
1064 | 2337 static void OPNAME ## qpel16_mc33_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 2338 uint64_t half[16*2 + 17*2];\ |
2339 uint8_t * const halfH= ((uint8_t*)half) + 256;\ | |
2340 uint8_t * const halfHV= ((uint8_t*)half);\ | |
2341 put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, stride, 17);\ | |
2207
22b768f1261a
10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents:
2067
diff
changeset
|
2342 put ## RND ## pixels16_l2_ ## MMX(halfH, src+1, halfH, 16, stride, 17);\ |
959 | 2343 put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(halfHV, halfH, 16, 16);\ |
2207
22b768f1261a
10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents:
2067
diff
changeset
|
2344 OPNAME ## pixels16_l2_ ## MMX(dst, halfH+16, halfHV, stride, 16, 16);\ |
954 | 2345 }\ |
1064 | 2346 static void OPNAME ## qpel16_mc21_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
954 | 2347 uint64_t half[16*2 + 17*2];\ |
2348 uint8_t * const halfH= ((uint8_t*)half) + 256;\ | |
2349 uint8_t * const halfHV= ((uint8_t*)half);\ | |
2350 put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, stride, 17);\ | |
959 | 2351 put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(halfHV, halfH, 16, 16);\ |
2207
22b768f1261a
10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents:
2067
diff
changeset
|
2352 OPNAME ## pixels16_l2_ ## MMX(dst, halfH, halfHV, stride, 16, 16);\ |
954 | 2353 }\ |
1064 | 2354 static void OPNAME ## qpel16_mc23_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
954 | 2355 uint64_t half[16*2 + 17*2];\ |
2356 uint8_t * const halfH= ((uint8_t*)half) + 256;\ | |
2357 uint8_t * const halfHV= ((uint8_t*)half);\ | |
2358 put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, stride, 17);\ | |
959 | 2359 put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(halfHV, halfH, 16, 16);\ |
2207
22b768f1261a
10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents:
2067
diff
changeset
|
2360 OPNAME ## pixels16_l2_ ## MMX(dst, halfH+16, halfHV, stride, 16, 16);\ |
954 | 2361 }\ |
1064 | 2362 static void OPNAME ## qpel16_mc12_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 2363 uint64_t half[17*2];\ |
2364 uint8_t * const halfH= ((uint8_t*)half);\ | |
954 | 2365 put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, stride, 17);\ |
2207
22b768f1261a
10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents:
2067
diff
changeset
|
2366 put ## RND ## pixels16_l2_ ## MMX(halfH, src, halfH, 16, stride, 17);\ |
984 | 2367 OPNAME ## mpeg4_qpel16_v_lowpass_ ## MMX(dst, halfH, stride, 16);\ |
954 | 2368 }\ |
1064 | 2369 static void OPNAME ## qpel16_mc32_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 2370 uint64_t half[17*2];\ |
2371 uint8_t * const halfH= ((uint8_t*)half);\ | |
954 | 2372 put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, stride, 17);\ |
2207
22b768f1261a
10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents:
2067
diff
changeset
|
2373 put ## RND ## pixels16_l2_ ## MMX(halfH, src+1, halfH, 16, stride, 17);\ |
984 | 2374 OPNAME ## mpeg4_qpel16_v_lowpass_ ## MMX(dst, halfH, stride, 16);\ |
954 | 2375 }\ |
1064 | 2376 static void OPNAME ## qpel16_mc22_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
954 | 2377 uint64_t half[17*2];\ |
2378 uint8_t * const halfH= ((uint8_t*)half);\ | |
2379 put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, stride, 17);\ | |
959 | 2380 OPNAME ## mpeg4_qpel16_v_lowpass_ ## MMX(dst, halfH, stride, 16);\ |
954 | 2381 } |
2382 | |
2979 | 2383 #define PUT_OP(a,b,temp, size) "mov" #size " " #a ", " #b " \n\t" |
959 | 2384 #define AVG_3DNOW_OP(a,b,temp, size) \ |
2979 | 2385 "mov" #size " " #b ", " #temp " \n\t"\ |
2386 "pavgusb " #temp ", " #a " \n\t"\ | |
2387 "mov" #size " " #a ", " #b " \n\t" | |
959 | 2388 #define AVG_MMX2_OP(a,b,temp, size) \ |
2979 | 2389 "mov" #size " " #b ", " #temp " \n\t"\ |
2390 "pavgb " #temp ", " #a " \n\t"\ | |
2391 "mov" #size " " #a ", " #b " \n\t" | |
959 | 2392 |
2393 QPEL_BASE(put_ , ff_pw_16, _ , PUT_OP, PUT_OP) | |
2394 QPEL_BASE(avg_ , ff_pw_16, _ , AVG_MMX2_OP, AVG_3DNOW_OP) | |
2395 QPEL_BASE(put_no_rnd_, ff_pw_15, _no_rnd_, PUT_OP, PUT_OP) | |
2396 QPEL_OP(put_ , ff_pw_16, _ , PUT_OP, 3dnow) | |
2397 QPEL_OP(avg_ , ff_pw_16, _ , AVG_3DNOW_OP, 3dnow) | |
2398 QPEL_OP(put_no_rnd_, ff_pw_15, _no_rnd_, PUT_OP, 3dnow) | |
954 | 2399 QPEL_OP(put_ , ff_pw_16, _ , PUT_OP, mmx2) |
959 | 2400 QPEL_OP(avg_ , ff_pw_16, _ , AVG_MMX2_OP, mmx2) |
954 | 2401 QPEL_OP(put_no_rnd_, ff_pw_15, _no_rnd_, PUT_OP, mmx2) |
2402 | |
3807
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2403 /***********************************/ |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2404 /* bilinear qpel: not compliant to any spec, only for -lavdopts fast */ |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2405 |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2406 #define QPEL_2TAP_XY(OPNAME, SIZE, MMX, XY, HPEL)\ |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2407 static void OPNAME ## 2tap_qpel ## SIZE ## _mc ## XY ## _ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2408 OPNAME ## pixels ## SIZE ## HPEL(dst, src, stride, SIZE);\ |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2409 } |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2410 #define QPEL_2TAP_L3(OPNAME, SIZE, MMX, XY, S0, S1, S2)\ |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2411 static void OPNAME ## 2tap_qpel ## SIZE ## _mc ## XY ## _ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2412 OPNAME ## 2tap_qpel ## SIZE ## _l3_ ## MMX(dst, src+S0, stride, SIZE, S1, S2);\ |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2413 } |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2414 |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2415 #define QPEL_2TAP(OPNAME, SIZE, MMX)\ |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2416 QPEL_2TAP_XY(OPNAME, SIZE, MMX, 20, _x2_ ## MMX)\ |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2417 QPEL_2TAP_XY(OPNAME, SIZE, MMX, 02, _y2_ ## MMX)\ |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2418 QPEL_2TAP_XY(OPNAME, SIZE, MMX, 22, _xy2_mmx)\ |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2419 static const qpel_mc_func OPNAME ## 2tap_qpel ## SIZE ## _mc00_ ## MMX =\ |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2420 OPNAME ## qpel ## SIZE ## _mc00_ ## MMX;\ |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2421 static const qpel_mc_func OPNAME ## 2tap_qpel ## SIZE ## _mc21_ ## MMX =\ |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2422 OPNAME ## 2tap_qpel ## SIZE ## _mc20_ ## MMX;\ |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2423 static const qpel_mc_func OPNAME ## 2tap_qpel ## SIZE ## _mc12_ ## MMX =\ |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2424 OPNAME ## 2tap_qpel ## SIZE ## _mc02_ ## MMX;\ |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2425 static void OPNAME ## 2tap_qpel ## SIZE ## _mc32_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2426 OPNAME ## pixels ## SIZE ## _y2_ ## MMX(dst, src+1, stride, SIZE);\ |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2427 }\ |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2428 static void OPNAME ## 2tap_qpel ## SIZE ## _mc23_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2429 OPNAME ## pixels ## SIZE ## _x2_ ## MMX(dst, src+stride, stride, SIZE);\ |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2430 }\ |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2431 QPEL_2TAP_L3(OPNAME, SIZE, MMX, 10, 0, 1, 0)\ |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2432 QPEL_2TAP_L3(OPNAME, SIZE, MMX, 30, 1, -1, 0)\ |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2433 QPEL_2TAP_L3(OPNAME, SIZE, MMX, 01, 0, stride, 0)\ |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2434 QPEL_2TAP_L3(OPNAME, SIZE, MMX, 03, stride, -stride, 0)\ |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2435 QPEL_2TAP_L3(OPNAME, SIZE, MMX, 11, 0, stride, 1)\ |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2436 QPEL_2TAP_L3(OPNAME, SIZE, MMX, 31, 1, stride, -1)\ |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2437 QPEL_2TAP_L3(OPNAME, SIZE, MMX, 13, stride, -stride, 1)\ |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2438 QPEL_2TAP_L3(OPNAME, SIZE, MMX, 33, stride+1, -stride, -1)\ |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2439 |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2440 QPEL_2TAP(put_, 16, mmx2) |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2441 QPEL_2TAP(avg_, 16, mmx2) |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2442 QPEL_2TAP(put_, 8, mmx2) |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2443 QPEL_2TAP(avg_, 8, mmx2) |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2444 QPEL_2TAP(put_, 16, 3dnow) |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2445 QPEL_2TAP(avg_, 16, 3dnow) |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2446 QPEL_2TAP(put_, 8, 3dnow) |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2447 QPEL_2TAP(avg_, 8, 3dnow) |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2448 |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2449 |
393 | 2450 #if 0 |
247
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
2451 static void just_return() { return; } |
393 | 2452 #endif |
247
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
2453 |
954 | 2454 #define SET_QPEL_FUNC(postfix1, postfix2) \ |
2455 c->put_ ## postfix1 = put_ ## postfix2;\ | |
2456 c->put_no_rnd_ ## postfix1 = put_no_rnd_ ## postfix2;\ | |
2457 c->avg_ ## postfix1 = avg_ ## postfix2; | |
1092 | 2458 |
3248
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2459 static void gmc_mmx(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy, |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2460 int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height){ |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2461 const int w = 8; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2462 const int ix = ox>>(16+shift); |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2463 const int iy = oy>>(16+shift); |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2464 const int oxs = ox>>4; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2465 const int oys = oy>>4; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2466 const int dxxs = dxx>>4; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2467 const int dxys = dxy>>4; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2468 const int dyxs = dyx>>4; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2469 const int dyys = dyy>>4; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2470 const uint16_t r4[4] = {r,r,r,r}; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2471 const uint16_t dxy4[4] = {dxys,dxys,dxys,dxys}; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2472 const uint16_t dyy4[4] = {dyys,dyys,dyys,dyys}; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2473 const uint64_t shift2 = 2*shift; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2474 uint8_t edge_buf[(h+1)*stride]; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2475 int x, y; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2476 |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2477 const int dxw = (dxx-(1<<(16+shift)))*(w-1); |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2478 const int dyh = (dyy-(1<<(16+shift)))*(h-1); |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2479 const int dxh = dxy*(h-1); |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2480 const int dyw = dyx*(w-1); |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2481 if( // non-constant fullpel offset (3% of blocks) |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2482 (ox^(ox+dxw) | ox^(ox+dxh) | ox^(ox+dxw+dxh) | |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2483 oy^(oy+dyw) | oy^(oy+dyh) | oy^(oy+dyw+dyh)) >> (16+shift) |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2484 // uses more than 16 bits of subpel mv (only at huge resolution) |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2485 || (dxx|dxy|dyx|dyy)&15 ) |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2486 { |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2487 //FIXME could still use mmx for some of the rows |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2488 ff_gmc_c(dst, src, stride, h, ox, oy, dxx, dxy, dyx, dyy, shift, r, width, height); |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2489 return; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2490 } |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2491 |
3250 | 2492 src += ix + iy*stride; |
3248
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2493 if( (unsigned)ix >= width-w || |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2494 (unsigned)iy >= height-h ) |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2495 { |
3250 | 2496 ff_emulated_edge_mc(edge_buf, src, stride, w+1, h+1, ix, iy, width, height); |
3248
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2497 src = edge_buf; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2498 } |
3250 | 2499 |
2500 asm volatile( | |
2501 "movd %0, %%mm6 \n\t" | |
2502 "pxor %%mm7, %%mm7 \n\t" | |
2503 "punpcklwd %%mm6, %%mm6 \n\t" | |
2504 "punpcklwd %%mm6, %%mm6 \n\t" | |
2505 :: "r"(1<<shift) | |
2506 ); | |
3248
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2507 |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2508 for(x=0; x<w; x+=4){ |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2509 uint16_t dx4[4] = { oxs - dxys + dxxs*(x+0), |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2510 oxs - dxys + dxxs*(x+1), |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2511 oxs - dxys + dxxs*(x+2), |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2512 oxs - dxys + dxxs*(x+3) }; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2513 uint16_t dy4[4] = { oys - dyys + dyxs*(x+0), |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2514 oys - dyys + dyxs*(x+1), |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2515 oys - dyys + dyxs*(x+2), |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2516 oys - dyys + dyxs*(x+3) }; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2517 |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2518 for(y=0; y<h; y++){ |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2519 asm volatile( |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2520 "movq %0, %%mm4 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2521 "movq %1, %%mm5 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2522 "paddw %2, %%mm4 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2523 "paddw %3, %%mm5 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2524 "movq %%mm4, %0 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2525 "movq %%mm5, %1 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2526 "psrlw $12, %%mm4 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2527 "psrlw $12, %%mm5 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2528 : "+m"(*dx4), "+m"(*dy4) |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2529 : "m"(*dxy4), "m"(*dyy4) |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2530 ); |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2531 |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2532 asm volatile( |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2533 "movq %%mm6, %%mm2 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2534 "movq %%mm6, %%mm1 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2535 "psubw %%mm4, %%mm2 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2536 "psubw %%mm5, %%mm1 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2537 "movq %%mm2, %%mm0 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2538 "movq %%mm4, %%mm3 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2539 "pmullw %%mm1, %%mm0 \n\t" // (s-dx)*(s-dy) |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2540 "pmullw %%mm5, %%mm3 \n\t" // dx*dy |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2541 "pmullw %%mm5, %%mm2 \n\t" // (s-dx)*dy |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2542 "pmullw %%mm4, %%mm1 \n\t" // dx*(s-dy) |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2543 |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2544 "movd %4, %%mm5 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2545 "movd %3, %%mm4 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2546 "punpcklbw %%mm7, %%mm5 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2547 "punpcklbw %%mm7, %%mm4 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2548 "pmullw %%mm5, %%mm3 \n\t" // src[1,1] * dx*dy |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2549 "pmullw %%mm4, %%mm2 \n\t" // src[0,1] * (s-dx)*dy |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2550 |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2551 "movd %2, %%mm5 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2552 "movd %1, %%mm4 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2553 "punpcklbw %%mm7, %%mm5 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2554 "punpcklbw %%mm7, %%mm4 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2555 "pmullw %%mm5, %%mm1 \n\t" // src[1,0] * dx*(s-dy) |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2556 "pmullw %%mm4, %%mm0 \n\t" // src[0,0] * (s-dx)*(s-dy) |
3250 | 2557 "paddw %5, %%mm1 \n\t" |
3248
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2558 "paddw %%mm3, %%mm2 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2559 "paddw %%mm1, %%mm0 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2560 "paddw %%mm2, %%mm0 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2561 |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2562 "psrlw %6, %%mm0 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2563 "packuswb %%mm0, %%mm0 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2564 "movd %%mm0, %0 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2565 |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2566 : "=m"(dst[x+y*stride]) |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2567 : "m"(src[0]), "m"(src[1]), |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2568 "m"(src[stride]), "m"(src[stride+1]), |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2569 "m"(*r4), "m"(shift2) |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2570 ); |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2571 src += stride; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2572 } |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2573 src += 4-h*stride; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2574 } |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2575 } |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2576 |
3777 | 2577 #ifdef CONFIG_ENCODERS |
1784 | 2578 static int try_8x8basis_mmx(int16_t rem[64], int16_t weight[64], int16_t basis[64], int scale){ |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
2579 long i=0; |
2967 | 2580 |
1784 | 2581 assert(ABS(scale) < 256); |
2582 scale<<= 16 + 1 - BASIS_SHIFT + RECON_SHIFT; | |
2583 | |
2584 asm volatile( | |
2979 | 2585 "pcmpeqw %%mm6, %%mm6 \n\t" // -1w |
2586 "psrlw $15, %%mm6 \n\t" // 1w | |
2587 "pxor %%mm7, %%mm7 \n\t" | |
2588 "movd %4, %%mm5 \n\t" | |
2589 "punpcklwd %%mm5, %%mm5 \n\t" | |
2590 "punpcklwd %%mm5, %%mm5 \n\t" | |
2591 "1: \n\t" | |
2592 "movq (%1, %0), %%mm0 \n\t" | |
2593 "movq 8(%1, %0), %%mm1 \n\t" | |
2594 "pmulhw %%mm5, %%mm0 \n\t" | |
2595 "pmulhw %%mm5, %%mm1 \n\t" | |
2596 "paddw %%mm6, %%mm0 \n\t" | |
2597 "paddw %%mm6, %%mm1 \n\t" | |
2598 "psraw $1, %%mm0 \n\t" | |
2599 "psraw $1, %%mm1 \n\t" | |
2600 "paddw (%2, %0), %%mm0 \n\t" | |
2601 "paddw 8(%2, %0), %%mm1 \n\t" | |
2602 "psraw $6, %%mm0 \n\t" | |
2603 "psraw $6, %%mm1 \n\t" | |
2604 "pmullw (%3, %0), %%mm0 \n\t" | |
2605 "pmullw 8(%3, %0), %%mm1 \n\t" | |
2606 "pmaddwd %%mm0, %%mm0 \n\t" | |
2607 "pmaddwd %%mm1, %%mm1 \n\t" | |
2608 "paddd %%mm1, %%mm0 \n\t" | |
2609 "psrld $4, %%mm0 \n\t" | |
2610 "paddd %%mm0, %%mm7 \n\t" | |
2611 "add $16, %0 \n\t" | |
2612 "cmp $128, %0 \n\t" //FIXME optimize & bench | |
2613 " jb 1b \n\t" | |
2614 "movq %%mm7, %%mm6 \n\t" | |
2615 "psrlq $32, %%mm7 \n\t" | |
2616 "paddd %%mm6, %%mm7 \n\t" | |
2617 "psrld $2, %%mm7 \n\t" | |
2618 "movd %%mm7, %0 \n\t" | |
2967 | 2619 |
1784 | 2620 : "+r" (i) |
2621 : "r"(basis), "r"(rem), "r"(weight), "g"(scale) | |
2622 ); | |
2623 return i; | |
2624 } | |
2625 | |
2626 static void add_8x8basis_mmx(int16_t rem[64], int16_t basis[64], int scale){ | |
2293
15cfba1b97b5
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64 patch by (Aurelien Jacobs <aurel at gnuage dot org>)
michael
parents:
2256
diff
changeset
|
2627 long i=0; |
2967 | 2628 |
1784 | 2629 if(ABS(scale) < 256){ |
2630 scale<<= 16 + 1 - BASIS_SHIFT + RECON_SHIFT; | |
2631 asm volatile( | |
2979 | 2632 "pcmpeqw %%mm6, %%mm6 \n\t" // -1w |
2633 "psrlw $15, %%mm6 \n\t" // 1w | |
2634 "movd %3, %%mm5 \n\t" | |
2635 "punpcklwd %%mm5, %%mm5 \n\t" | |
2636 "punpcklwd %%mm5, %%mm5 \n\t" | |
2637 "1: \n\t" | |
2638 "movq (%1, %0), %%mm0 \n\t" | |
2639 "movq 8(%1, %0), %%mm1 \n\t" | |
2640 "pmulhw %%mm5, %%mm0 \n\t" | |
2641 "pmulhw %%mm5, %%mm1 \n\t" | |
2642 "paddw %%mm6, %%mm0 \n\t" | |
2643 "paddw %%mm6, %%mm1 \n\t" | |
2644 "psraw $1, %%mm0 \n\t" | |
2645 "psraw $1, %%mm1 \n\t" | |
2646 "paddw (%2, %0), %%mm0 \n\t" | |
2647 "paddw 8(%2, %0), %%mm1 \n\t" | |
2648 "movq %%mm0, (%2, %0) \n\t" | |
2649 "movq %%mm1, 8(%2, %0) \n\t" | |
2650 "add $16, %0 \n\t" | |
2651 "cmp $128, %0 \n\t" //FIXME optimize & bench | |
2652 " jb 1b \n\t" | |
2967 | 2653 |
1784 | 2654 : "+r" (i) |
2655 : "r"(basis), "r"(rem), "g"(scale) | |
2656 ); | |
2657 }else{ | |
2658 for(i=0; i<8*8; i++){ | |
2659 rem[i] += (basis[i]*scale + (1<<(BASIS_SHIFT - RECON_SHIFT-1)))>>(BASIS_SHIFT - RECON_SHIFT); | |
2967 | 2660 } |
1784 | 2661 } |
2662 } | |
3777 | 2663 #endif /* CONFIG_ENCODERS */ |
2754 | 2664 |
3215
06f98047ff26
prefetch pixels for future motion compensation. 2-5% faster h264.
lorenm
parents:
3213
diff
changeset
|
2665 #define PREFETCH(name, op) \ |
06f98047ff26
prefetch pixels for future motion compensation. 2-5% faster h264.
lorenm
parents:
3213
diff
changeset
|
2666 void name(void *mem, int stride, int h){\ |
06f98047ff26
prefetch pixels for future motion compensation. 2-5% faster h264.
lorenm
parents:
3213
diff
changeset
|
2667 const uint8_t *p= mem;\ |
06f98047ff26
prefetch pixels for future motion compensation. 2-5% faster h264.
lorenm
parents:
3213
diff
changeset
|
2668 do{\ |
06f98047ff26
prefetch pixels for future motion compensation. 2-5% faster h264.
lorenm
parents:
3213
diff
changeset
|
2669 asm volatile(#op" %0" :: "m"(*p));\ |
06f98047ff26
prefetch pixels for future motion compensation. 2-5% faster h264.
lorenm
parents:
3213
diff
changeset
|
2670 p+= stride;\ |
06f98047ff26
prefetch pixels for future motion compensation. 2-5% faster h264.
lorenm
parents:
3213
diff
changeset
|
2671 }while(--h);\ |
06f98047ff26
prefetch pixels for future motion compensation. 2-5% faster h264.
lorenm
parents:
3213
diff
changeset
|
2672 } |
06f98047ff26
prefetch pixels for future motion compensation. 2-5% faster h264.
lorenm
parents:
3213
diff
changeset
|
2673 PREFETCH(prefetch_mmx2, prefetcht0) |
06f98047ff26
prefetch pixels for future motion compensation. 2-5% faster h264.
lorenm
parents:
3213
diff
changeset
|
2674 PREFETCH(prefetch_3dnow, prefetch) |
06f98047ff26
prefetch pixels for future motion compensation. 2-5% faster h264.
lorenm
parents:
3213
diff
changeset
|
2675 #undef PREFETCH |
06f98047ff26
prefetch pixels for future motion compensation. 2-5% faster h264.
lorenm
parents:
3213
diff
changeset
|
2676 |
2754 | 2677 #include "h264dsp_mmx.c" |
2967 | 2678 |
3524 | 2679 /* AVS specific */ |
2680 void ff_cavsdsp_init_mmx2(DSPContext* c, AVCodecContext *avctx); | |
2681 | |
2682 void ff_put_cavs_qpel8_mc00_mmx2(uint8_t *dst, uint8_t *src, int stride) { | |
2683 put_pixels8_mmx(dst, src, stride, 8); | |
2684 } | |
2685 void ff_avg_cavs_qpel8_mc00_mmx2(uint8_t *dst, uint8_t *src, int stride) { | |
2686 avg_pixels8_mmx(dst, src, stride, 8); | |
2687 } | |
2688 void ff_put_cavs_qpel16_mc00_mmx2(uint8_t *dst, uint8_t *src, int stride) { | |
2689 put_pixels16_mmx(dst, src, stride, 16); | |
2690 } | |
2691 void ff_avg_cavs_qpel16_mc00_mmx2(uint8_t *dst, uint8_t *src, int stride) { | |
2692 avg_pixels16_mmx(dst, src, stride, 16); | |
2693 } | |
2694 | |
1092 | 2695 /* external functions, from idct_mmx.c */ |
2696 void ff_mmx_idct(DCTELEM *block); | |
2697 void ff_mmxext_idct(DCTELEM *block); | |
2698 | |
2696
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
2699 void ff_vp3_idct_sse2(int16_t *input_data); |
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
2700 void ff_vp3_idct_mmx(int16_t *data); |
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
2701 void ff_vp3_dsp_init_mmx(void); |
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
2702 |
1092 | 2703 /* XXX: those functions should be suppressed ASAP when all IDCTs are |
2704 converted */ | |
2705 static void ff_libmpeg2mmx_idct_put(uint8_t *dest, int line_size, DCTELEM *block) | |
2706 { | |
2707 ff_mmx_idct (block); | |
2708 put_pixels_clamped_mmx(block, dest, line_size); | |
2709 } | |
2710 static void ff_libmpeg2mmx_idct_add(uint8_t *dest, int line_size, DCTELEM *block) | |
2711 { | |
2712 ff_mmx_idct (block); | |
2713 add_pixels_clamped_mmx(block, dest, line_size); | |
2714 } | |
2715 static void ff_libmpeg2mmx2_idct_put(uint8_t *dest, int line_size, DCTELEM *block) | |
2716 { | |
2717 ff_mmxext_idct (block); | |
2718 put_pixels_clamped_mmx(block, dest, line_size); | |
2719 } | |
2720 static void ff_libmpeg2mmx2_idct_add(uint8_t *dest, int line_size, DCTELEM *block) | |
2721 { | |
2722 ff_mmxext_idct (block); | |
2723 add_pixels_clamped_mmx(block, dest, line_size); | |
2724 } | |
2696
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
2725 static void ff_vp3_idct_put_sse2(uint8_t *dest, int line_size, DCTELEM *block) |
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
2726 { |
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
2727 ff_vp3_idct_sse2(block); |
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
2728 put_signed_pixels_clamped_mmx(block, dest, line_size); |
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
2729 } |
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
2730 static void ff_vp3_idct_add_sse2(uint8_t *dest, int line_size, DCTELEM *block) |
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
2731 { |
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
2732 ff_vp3_idct_sse2(block); |
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
2733 add_pixels_clamped_mmx(block, dest, line_size); |
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
2734 } |
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
2735 static void ff_vp3_idct_put_mmx(uint8_t *dest, int line_size, DCTELEM *block) |
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
2736 { |
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
2737 ff_vp3_idct_mmx(block); |
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
2738 put_signed_pixels_clamped_mmx(block, dest, line_size); |
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
2739 } |
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
2740 static void ff_vp3_idct_add_mmx(uint8_t *dest, int line_size, DCTELEM *block) |
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
2741 { |
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
2742 ff_vp3_idct_mmx(block); |
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
2743 add_pixels_clamped_mmx(block, dest, line_size); |
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
2744 } |
2868 | 2745 #ifdef CONFIG_GPL |
2746 static void ff_idct_xvid_mmx_put(uint8_t *dest, int line_size, DCTELEM *block) | |
2747 { | |
2748 ff_idct_xvid_mmx (block); | |
2749 put_pixels_clamped_mmx(block, dest, line_size); | |
2750 } | |
2751 static void ff_idct_xvid_mmx_add(uint8_t *dest, int line_size, DCTELEM *block) | |
2752 { | |
2753 ff_idct_xvid_mmx (block); | |
2754 add_pixels_clamped_mmx(block, dest, line_size); | |
2755 } | |
2756 static void ff_idct_xvid_mmx2_put(uint8_t *dest, int line_size, DCTELEM *block) | |
2757 { | |
2758 ff_idct_xvid_mmx2 (block); | |
2759 put_pixels_clamped_mmx(block, dest, line_size); | |
2760 } | |
2761 static void ff_idct_xvid_mmx2_add(uint8_t *dest, int line_size, DCTELEM *block) | |
2762 { | |
2763 ff_idct_xvid_mmx2 (block); | |
2764 add_pixels_clamped_mmx(block, dest, line_size); | |
2765 } | |
2766 #endif | |
2967 | 2767 |
3541
3fbddeb13686
10l, vorbis_inverse_coupling_sse() was really 3dnow
lorenm
parents:
3536
diff
changeset
|
2768 static void vorbis_inverse_coupling_3dnow(float *mag, float *ang, int blocksize) |
3536
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2769 { |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2770 int i; |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2771 asm volatile("pxor %%mm7, %%mm7":); |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2772 for(i=0; i<blocksize; i+=2) { |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2773 asm volatile( |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2774 "movq %0, %%mm0 \n\t" |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2775 "movq %1, %%mm1 \n\t" |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2776 "movq %%mm0, %%mm2 \n\t" |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2777 "movq %%mm1, %%mm3 \n\t" |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2778 "pfcmpge %%mm7, %%mm2 \n\t" // m <= 0.0 |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2779 "pfcmpge %%mm7, %%mm3 \n\t" // a <= 0.0 |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2780 "pslld $31, %%mm2 \n\t" // keep only the sign bit |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2781 "pxor %%mm2, %%mm1 \n\t" |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2782 "movq %%mm3, %%mm4 \n\t" |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2783 "pand %%mm1, %%mm3 \n\t" |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2784 "pandn %%mm1, %%mm4 \n\t" |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2785 "pfadd %%mm0, %%mm3 \n\t" // a = m + ((a<0) & (a ^ sign(m))) |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2786 "pfsub %%mm4, %%mm0 \n\t" // m = m + ((a>0) & (a ^ sign(m))) |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2787 "movq %%mm3, %1 \n\t" |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2788 "movq %%mm0, %0 \n\t" |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2789 :"+m"(mag[i]), "+m"(ang[i]) |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2790 ::"memory" |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2791 ); |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2792 } |
3561 | 2793 asm volatile("femms"); |
3536
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2794 } |
3557
8e13ec0f8aa3
change vorbis_inverse_coupling_sse2() so it works on sse1 cpus
michael
parents:
3541
diff
changeset
|
2795 static void vorbis_inverse_coupling_sse(float *mag, float *ang, int blocksize) |
3536
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2796 { |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2797 int i; |
3557
8e13ec0f8aa3
change vorbis_inverse_coupling_sse2() so it works on sse1 cpus
michael
parents:
3541
diff
changeset
|
2798 |
8e13ec0f8aa3
change vorbis_inverse_coupling_sse2() so it works on sse1 cpus
michael
parents:
3541
diff
changeset
|
2799 asm volatile( |
8e13ec0f8aa3
change vorbis_inverse_coupling_sse2() so it works on sse1 cpus
michael
parents:
3541
diff
changeset
|
2800 "movaps %0, %%xmm5 \n\t" |
8e13ec0f8aa3
change vorbis_inverse_coupling_sse2() so it works on sse1 cpus
michael
parents:
3541
diff
changeset
|
2801 ::"m"(ff_pdw_80000000[0]) |
8e13ec0f8aa3
change vorbis_inverse_coupling_sse2() so it works on sse1 cpus
michael
parents:
3541
diff
changeset
|
2802 ); |
3536
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2803 for(i=0; i<blocksize; i+=4) { |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2804 asm volatile( |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2805 "movaps %0, %%xmm0 \n\t" |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2806 "movaps %1, %%xmm1 \n\t" |
3557
8e13ec0f8aa3
change vorbis_inverse_coupling_sse2() so it works on sse1 cpus
michael
parents:
3541
diff
changeset
|
2807 "xorps %%xmm2, %%xmm2 \n\t" |
8e13ec0f8aa3
change vorbis_inverse_coupling_sse2() so it works on sse1 cpus
michael
parents:
3541
diff
changeset
|
2808 "xorps %%xmm3, %%xmm3 \n\t" |
3536
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2809 "cmpleps %%xmm0, %%xmm2 \n\t" // m <= 0.0 |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2810 "cmpleps %%xmm1, %%xmm3 \n\t" // a <= 0.0 |
3557
8e13ec0f8aa3
change vorbis_inverse_coupling_sse2() so it works on sse1 cpus
michael
parents:
3541
diff
changeset
|
2811 "andps %%xmm5, %%xmm2 \n\t" // keep only the sign bit |
8e13ec0f8aa3
change vorbis_inverse_coupling_sse2() so it works on sse1 cpus
michael
parents:
3541
diff
changeset
|
2812 "xorps %%xmm2, %%xmm1 \n\t" |
3536
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2813 "movaps %%xmm3, %%xmm4 \n\t" |
3557
8e13ec0f8aa3
change vorbis_inverse_coupling_sse2() so it works on sse1 cpus
michael
parents:
3541
diff
changeset
|
2814 "andps %%xmm1, %%xmm3 \n\t" |
8e13ec0f8aa3
change vorbis_inverse_coupling_sse2() so it works on sse1 cpus
michael
parents:
3541
diff
changeset
|
2815 "andnps %%xmm1, %%xmm4 \n\t" |
3536
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2816 "addps %%xmm0, %%xmm3 \n\t" // a = m + ((a<0) & (a ^ sign(m))) |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2817 "subps %%xmm4, %%xmm0 \n\t" // m = m + ((a>0) & (a ^ sign(m))) |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2818 "movaps %%xmm3, %1 \n\t" |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2819 "movaps %%xmm0, %0 \n\t" |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2820 :"+m"(mag[i]), "+m"(ang[i]) |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2821 ::"memory" |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2822 ); |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2823 } |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2824 } |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2825 |
3568
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2826 static void vector_fmul_3dnow(float *dst, const float *src, int len){ |
3574 | 2827 long i = (len-4)*4; |
2828 asm volatile( | |
2829 "1: \n\t" | |
2830 "movq (%1,%0), %%mm0 \n\t" | |
2831 "movq 8(%1,%0), %%mm1 \n\t" | |
2832 "pfmul (%2,%0), %%mm0 \n\t" | |
2833 "pfmul 8(%2,%0), %%mm1 \n\t" | |
2834 "movq %%mm0, (%1,%0) \n\t" | |
2835 "movq %%mm1, 8(%1,%0) \n\t" | |
2836 "sub $16, %0 \n\t" | |
2837 "jge 1b \n\t" | |
2838 "femms \n\t" | |
2839 :"+r"(i) | |
2840 :"r"(dst), "r"(src) | |
2841 :"memory" | |
2842 ); | |
3568
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2843 } |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2844 static void vector_fmul_sse(float *dst, const float *src, int len){ |
3574 | 2845 long i = (len-8)*4; |
2846 asm volatile( | |
2847 "1: \n\t" | |
2848 "movaps (%1,%0), %%xmm0 \n\t" | |
2849 "movaps 16(%1,%0), %%xmm1 \n\t" | |
2850 "mulps (%2,%0), %%xmm0 \n\t" | |
2851 "mulps 16(%2,%0), %%xmm1 \n\t" | |
2852 "movaps %%xmm0, (%1,%0) \n\t" | |
2853 "movaps %%xmm1, 16(%1,%0) \n\t" | |
2854 "sub $32, %0 \n\t" | |
2855 "jge 1b \n\t" | |
2856 :"+r"(i) | |
2857 :"r"(dst), "r"(src) | |
2858 :"memory" | |
2859 ); | |
3568
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2860 } |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2861 |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2862 static void vector_fmul_reverse_3dnow2(float *dst, const float *src0, const float *src1, int len){ |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2863 long i = len*4-16; |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2864 asm volatile( |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2865 "1: \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2866 "pswapd 8(%1), %%mm0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2867 "pswapd (%1), %%mm1 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2868 "pfmul (%3,%0), %%mm0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2869 "pfmul 8(%3,%0), %%mm1 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2870 "movq %%mm0, (%2,%0) \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2871 "movq %%mm1, 8(%2,%0) \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2872 "add $16, %1 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2873 "sub $16, %0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2874 "jge 1b \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2875 :"+r"(i), "+r"(src1) |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2876 :"r"(dst), "r"(src0) |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2877 ); |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2878 asm volatile("femms"); |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2879 } |
3569
c42c03f3b402
convert vector_fmul_reverse_sse2 and vector_fmul_add_add_sse2 to sse
michael
parents:
3568
diff
changeset
|
2880 static void vector_fmul_reverse_sse(float *dst, const float *src0, const float *src1, int len){ |
3568
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2881 long i = len*4-32; |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2882 asm volatile( |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2883 "1: \n\t" |
3569
c42c03f3b402
convert vector_fmul_reverse_sse2 and vector_fmul_add_add_sse2 to sse
michael
parents:
3568
diff
changeset
|
2884 "movaps 16(%1), %%xmm0 \n\t" |
c42c03f3b402
convert vector_fmul_reverse_sse2 and vector_fmul_add_add_sse2 to sse
michael
parents:
3568
diff
changeset
|
2885 "movaps (%1), %%xmm1 \n\t" |
c42c03f3b402
convert vector_fmul_reverse_sse2 and vector_fmul_add_add_sse2 to sse
michael
parents:
3568
diff
changeset
|
2886 "shufps $0x1b, %%xmm0, %%xmm0 \n\t" |
c42c03f3b402
convert vector_fmul_reverse_sse2 and vector_fmul_add_add_sse2 to sse
michael
parents:
3568
diff
changeset
|
2887 "shufps $0x1b, %%xmm1, %%xmm1 \n\t" |
3568
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2888 "mulps (%3,%0), %%xmm0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2889 "mulps 16(%3,%0), %%xmm1 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2890 "movaps %%xmm0, (%2,%0) \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2891 "movaps %%xmm1, 16(%2,%0) \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2892 "add $32, %1 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2893 "sub $32, %0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2894 "jge 1b \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2895 :"+r"(i), "+r"(src1) |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2896 :"r"(dst), "r"(src0) |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2897 ); |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2898 } |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2899 |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2900 static void vector_fmul_add_add_3dnow(float *dst, const float *src0, const float *src1, |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2901 const float *src2, int src3, int len, int step){ |
3574 | 2902 long i = (len-4)*4; |
3568
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2903 if(step == 2 && src3 == 0){ |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2904 dst += (len-4)*2; |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2905 asm volatile( |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2906 "1: \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2907 "movq (%2,%0), %%mm0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2908 "movq 8(%2,%0), %%mm1 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2909 "pfmul (%3,%0), %%mm0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2910 "pfmul 8(%3,%0), %%mm1 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2911 "pfadd (%4,%0), %%mm0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2912 "pfadd 8(%4,%0), %%mm1 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2913 "movd %%mm0, (%1) \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2914 "movd %%mm1, 16(%1) \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2915 "psrlq $32, %%mm0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2916 "psrlq $32, %%mm1 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2917 "movd %%mm0, 8(%1) \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2918 "movd %%mm1, 24(%1) \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2919 "sub $32, %1 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2920 "sub $16, %0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2921 "jge 1b \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2922 :"+r"(i), "+r"(dst) |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2923 :"r"(src0), "r"(src1), "r"(src2) |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2924 :"memory" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2925 ); |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2926 } |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2927 else if(step == 1 && src3 == 0){ |
3574 | 2928 asm volatile( |
2929 "1: \n\t" | |
2930 "movq (%2,%0), %%mm0 \n\t" | |
2931 "movq 8(%2,%0), %%mm1 \n\t" | |
2932 "pfmul (%3,%0), %%mm0 \n\t" | |
2933 "pfmul 8(%3,%0), %%mm1 \n\t" | |
2934 "pfadd (%4,%0), %%mm0 \n\t" | |
2935 "pfadd 8(%4,%0), %%mm1 \n\t" | |
2936 "movq %%mm0, (%1,%0) \n\t" | |
2937 "movq %%mm1, 8(%1,%0) \n\t" | |
2938 "sub $16, %0 \n\t" | |
2939 "jge 1b \n\t" | |
2940 :"+r"(i) | |
2941 :"r"(dst), "r"(src0), "r"(src1), "r"(src2) | |
2942 :"memory" | |
2943 ); | |
3568
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2944 } |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2945 else |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2946 ff_vector_fmul_add_add_c(dst, src0, src1, src2, src3, len, step); |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2947 asm volatile("femms"); |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2948 } |
3569
c42c03f3b402
convert vector_fmul_reverse_sse2 and vector_fmul_add_add_sse2 to sse
michael
parents:
3568
diff
changeset
|
2949 static void vector_fmul_add_add_sse(float *dst, const float *src0, const float *src1, |
3574 | 2950 const float *src2, int src3, int len, int step){ |
2951 long i = (len-8)*4; | |
3568
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2952 if(step == 2 && src3 == 0){ |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2953 dst += (len-8)*2; |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2954 asm volatile( |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2955 "1: \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2956 "movaps (%2,%0), %%xmm0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2957 "movaps 16(%2,%0), %%xmm1 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2958 "mulps (%3,%0), %%xmm0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2959 "mulps 16(%3,%0), %%xmm1 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2960 "addps (%4,%0), %%xmm0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2961 "addps 16(%4,%0), %%xmm1 \n\t" |
3569
c42c03f3b402
convert vector_fmul_reverse_sse2 and vector_fmul_add_add_sse2 to sse
michael
parents:
3568
diff
changeset
|
2962 "movss %%xmm0, (%1) \n\t" |
c42c03f3b402
convert vector_fmul_reverse_sse2 and vector_fmul_add_add_sse2 to sse
michael
parents:
3568
diff
changeset
|
2963 "movss %%xmm1, 32(%1) \n\t" |
c42c03f3b402
convert vector_fmul_reverse_sse2 and vector_fmul_add_add_sse2 to sse
michael
parents:
3568
diff
changeset
|
2964 "movhlps %%xmm0, %%xmm2 \n\t" |
c42c03f3b402
convert vector_fmul_reverse_sse2 and vector_fmul_add_add_sse2 to sse
michael
parents:
3568
diff
changeset
|
2965 "movhlps %%xmm1, %%xmm3 \n\t" |
c42c03f3b402
convert vector_fmul_reverse_sse2 and vector_fmul_add_add_sse2 to sse
michael
parents:
3568
diff
changeset
|
2966 "movss %%xmm2, 16(%1) \n\t" |
c42c03f3b402
convert vector_fmul_reverse_sse2 and vector_fmul_add_add_sse2 to sse
michael
parents:
3568
diff
changeset
|
2967 "movss %%xmm3, 48(%1) \n\t" |
c42c03f3b402
convert vector_fmul_reverse_sse2 and vector_fmul_add_add_sse2 to sse
michael
parents:
3568
diff
changeset
|
2968 "shufps $0xb1, %%xmm0, %%xmm0 \n\t" |
c42c03f3b402
convert vector_fmul_reverse_sse2 and vector_fmul_add_add_sse2 to sse
michael
parents:
3568
diff
changeset
|
2969 "shufps $0xb1, %%xmm1, %%xmm1 \n\t" |
c42c03f3b402
convert vector_fmul_reverse_sse2 and vector_fmul_add_add_sse2 to sse
michael
parents:
3568
diff
changeset
|
2970 "movss %%xmm0, 8(%1) \n\t" |
c42c03f3b402
convert vector_fmul_reverse_sse2 and vector_fmul_add_add_sse2 to sse
michael
parents:
3568
diff
changeset
|
2971 "movss %%xmm1, 40(%1) \n\t" |
c42c03f3b402
convert vector_fmul_reverse_sse2 and vector_fmul_add_add_sse2 to sse
michael
parents:
3568
diff
changeset
|
2972 "movhlps %%xmm0, %%xmm2 \n\t" |
c42c03f3b402
convert vector_fmul_reverse_sse2 and vector_fmul_add_add_sse2 to sse
michael
parents:
3568
diff
changeset
|
2973 "movhlps %%xmm1, %%xmm3 \n\t" |
c42c03f3b402
convert vector_fmul_reverse_sse2 and vector_fmul_add_add_sse2 to sse
michael
parents:
3568
diff
changeset
|
2974 "movss %%xmm2, 24(%1) \n\t" |
c42c03f3b402
convert vector_fmul_reverse_sse2 and vector_fmul_add_add_sse2 to sse
michael
parents:
3568
diff
changeset
|
2975 "movss %%xmm3, 56(%1) \n\t" |
3568
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2976 "sub $64, %1 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2977 "sub $32, %0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2978 "jge 1b \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2979 :"+r"(i), "+r"(dst) |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2980 :"r"(src0), "r"(src1), "r"(src2) |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2981 :"memory" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2982 ); |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2983 } |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2984 else if(step == 1 && src3 == 0){ |
3574 | 2985 asm volatile( |
2986 "1: \n\t" | |
2987 "movaps (%2,%0), %%xmm0 \n\t" | |
2988 "movaps 16(%2,%0), %%xmm1 \n\t" | |
2989 "mulps (%3,%0), %%xmm0 \n\t" | |
2990 "mulps 16(%3,%0), %%xmm1 \n\t" | |
2991 "addps (%4,%0), %%xmm0 \n\t" | |
2992 "addps 16(%4,%0), %%xmm1 \n\t" | |
2993 "movaps %%xmm0, (%1,%0) \n\t" | |
2994 "movaps %%xmm1, 16(%1,%0) \n\t" | |
2995 "sub $32, %0 \n\t" | |
2996 "jge 1b \n\t" | |
2997 :"+r"(i) | |
2998 :"r"(dst), "r"(src0), "r"(src1), "r"(src2) | |
2999 :"memory" | |
3000 ); | |
3568
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3001 } |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3002 else |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3003 ff_vector_fmul_add_add_c(dst, src0, src1, src2, src3, len, step); |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3004 } |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3005 |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3006 void float_to_int16_3dnow(int16_t *dst, const float *src, int len){ |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3007 // not bit-exact: pf2id uses different rounding than C and SSE |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3008 int i; |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3009 for(i=0; i<len; i+=4) { |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3010 asm volatile( |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3011 "pf2id %1, %%mm0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3012 "pf2id %2, %%mm1 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3013 "packssdw %%mm1, %%mm0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3014 "movq %%mm0, %0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3015 :"=m"(dst[i]) |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3016 :"m"(src[i]), "m"(src[i+2]) |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3017 ); |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3018 } |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3019 asm volatile("femms"); |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3020 } |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3021 void float_to_int16_sse(int16_t *dst, const float *src, int len){ |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3022 int i; |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3023 for(i=0; i<len; i+=4) { |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3024 asm volatile( |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3025 "cvtps2pi %1, %%mm0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3026 "cvtps2pi %2, %%mm1 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3027 "packssdw %%mm1, %%mm0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3028 "movq %%mm0, %0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3029 :"=m"(dst[i]) |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3030 :"m"(src[i]), "m"(src[i+2]) |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3031 ); |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3032 } |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3033 asm volatile("emms"); |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3034 } |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3035 |
3210 | 3036 #ifdef CONFIG_SNOW_ENCODER |
3037 extern void ff_snow_horizontal_compose97i_sse2(DWTELEM *b, int width); | |
3038 extern void ff_snow_horizontal_compose97i_mmx(DWTELEM *b, int width); | |
3207
33110c1008a4
Add the mmx and sse2 implementations of ff_snow_vertical_compose().
gpoirier
parents:
3174
diff
changeset
|
3039 extern void ff_snow_vertical_compose97i_sse2(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, DWTELEM *b3, DWTELEM *b4, DWTELEM *b5, int width); |
33110c1008a4
Add the mmx and sse2 implementations of ff_snow_vertical_compose().
gpoirier
parents:
3174
diff
changeset
|
3040 extern void ff_snow_vertical_compose97i_mmx(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, DWTELEM *b3, DWTELEM *b4, DWTELEM *b5, int width); |
3211
b77b5e7072d6
add MMX and SSE versions of ff_snow_inner_add_yblock
gpoirier
parents:
3210
diff
changeset
|
3041 extern void ff_snow_inner_add_yblock_sse2(uint8_t *obmc, const int obmc_stride, uint8_t * * block, int b_w, int b_h, |
b77b5e7072d6
add MMX and SSE versions of ff_snow_inner_add_yblock
gpoirier
parents:
3210
diff
changeset
|
3042 int src_x, int src_y, int src_stride, slice_buffer * sb, int add, uint8_t * dst8); |
b77b5e7072d6
add MMX and SSE versions of ff_snow_inner_add_yblock
gpoirier
parents:
3210
diff
changeset
|
3043 extern void ff_snow_inner_add_yblock_mmx(uint8_t *obmc, const int obmc_stride, uint8_t * * block, int b_w, int b_h, |
b77b5e7072d6
add MMX and SSE versions of ff_snow_inner_add_yblock
gpoirier
parents:
3210
diff
changeset
|
3044 int src_x, int src_y, int src_stride, slice_buffer * sb, int add, uint8_t * dst8); |
3210 | 3045 #endif |
3207
33110c1008a4
Add the mmx and sse2 implementations of ff_snow_vertical_compose().
gpoirier
parents:
3174
diff
changeset
|
3046 |
1092 | 3047 void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) |
0 | 3048 { |
3049 mm_flags = mm_support(); | |
1115 | 3050 |
1122 | 3051 if (avctx->dsp_mask) { |
2979 | 3052 if (avctx->dsp_mask & FF_MM_FORCE) |
3053 mm_flags |= (avctx->dsp_mask & 0xffff); | |
3054 else | |
3055 mm_flags &= ~(avctx->dsp_mask & 0xffff); | |
1122 | 3056 } |
1115 | 3057 |
631
47a8964ba5cd
be less verbose patch by (Lennert Buytenhek <buytenh at math dot leidenuniv dot nl>)
michaelni
parents:
629
diff
changeset
|
3058 #if 0 |
1868 | 3059 av_log(avctx, AV_LOG_INFO, "libavcodec: CPU flags:"); |
0 | 3060 if (mm_flags & MM_MMX) |
1868 | 3061 av_log(avctx, AV_LOG_INFO, " mmx"); |
0 | 3062 if (mm_flags & MM_MMXEXT) |
1868 | 3063 av_log(avctx, AV_LOG_INFO, " mmxext"); |
0 | 3064 if (mm_flags & MM_3DNOW) |
1868 | 3065 av_log(avctx, AV_LOG_INFO, " 3dnow"); |
0 | 3066 if (mm_flags & MM_SSE) |
1868 | 3067 av_log(avctx, AV_LOG_INFO, " sse"); |
0 | 3068 if (mm_flags & MM_SSE2) |
1868 | 3069 av_log(avctx, AV_LOG_INFO, " sse2"); |
3070 av_log(avctx, AV_LOG_INFO, "\n"); | |
0 | 3071 #endif |
3072 | |
3073 if (mm_flags & MM_MMX) { | |
1092 | 3074 const int idct_algo= avctx->idct_algo; |
3075 | |
1232
e88d3b1fb2a1
more #ifdef CONFIG_ENCODERS by (Wolfgang Hesseler <qv at multimediaware dot com>)
michaelni
parents:
1186
diff
changeset
|
3076 #ifdef CONFIG_ENCODERS |
2024
f65d87bfdd5a
some of the warning fixes by (Michael Roitzsch <mroi at users dot sourceforge dot net>)
michael
parents:
1985
diff
changeset
|
3077 const int dct_algo = avctx->dct_algo; |
1565 | 3078 if(dct_algo==FF_DCT_AUTO || dct_algo==FF_DCT_MMX){ |
1765
e31754bc5b65
SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents:
1739
diff
changeset
|
3079 if(mm_flags & MM_SSE2){ |
e31754bc5b65
SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michael
parents:
1739
diff
changeset
|
3080 c->fdct = ff_fdct_sse2; |
2979 | 3081 }else if(mm_flags & MM_MMXEXT){ |
1565 | 3082 c->fdct = ff_fdct_mmx2; |
3083 }else{ | |
3084 c->fdct = ff_fdct_mmx; | |
3085 } | |
3086 } | |
1232
e88d3b1fb2a1
more #ifdef CONFIG_ENCODERS by (Wolfgang Hesseler <qv at multimediaware dot com>)
michaelni
parents:
1186
diff
changeset
|
3087 #endif //CONFIG_ENCODERS |
2256 | 3088 if(avctx->lowres==0){ |
3089 if(idct_algo==FF_IDCT_AUTO || idct_algo==FF_IDCT_SIMPLEMMX){ | |
3090 c->idct_put= ff_simple_idct_put_mmx; | |
3091 c->idct_add= ff_simple_idct_add_mmx; | |
3092 c->idct = ff_simple_idct_mmx; | |
3093 c->idct_permutation_type= FF_SIMPLE_IDCT_PERM; | |
3717
ea9fe1c9d126
Remove the LGPL exception clause as discussed on ffmpeg-devel
diego
parents:
3712
diff
changeset
|
3094 #ifdef CONFIG_GPL |
2256 | 3095 }else if(idct_algo==FF_IDCT_LIBMPEG2MMX){ |
3096 if(mm_flags & MM_MMXEXT){ | |
3097 c->idct_put= ff_libmpeg2mmx2_idct_put; | |
3098 c->idct_add= ff_libmpeg2mmx2_idct_add; | |
3099 c->idct = ff_mmxext_idct; | |
3100 }else{ | |
3101 c->idct_put= ff_libmpeg2mmx_idct_put; | |
3102 c->idct_add= ff_libmpeg2mmx_idct_add; | |
3103 c->idct = ff_mmx_idct; | |
3104 } | |
3105 c->idct_permutation_type= FF_LIBMPEG2_IDCT_PERM; | |
3717
ea9fe1c9d126
Remove the LGPL exception clause as discussed on ffmpeg-devel
diego
parents:
3712
diff
changeset
|
3106 #endif |
3712
f7f75f718efb
Enables back the mmx/sse optimized version of the vp3 idct.
aurel
parents:
3666
diff
changeset
|
3107 }else if(idct_algo==FF_IDCT_VP3 && |
3721
2000e401593d
disable vp3 mmx idct for theora files to avoid artifacts
aurel
parents:
3717
diff
changeset
|
3108 avctx->codec->id!=CODEC_ID_THEORA && |
3712
f7f75f718efb
Enables back the mmx/sse optimized version of the vp3 idct.
aurel
parents:
3666
diff
changeset
|
3109 !(avctx->flags & CODEC_FLAG_BITEXACT)){ |
2696
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
3110 if(mm_flags & MM_SSE2){ |
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
3111 c->idct_put= ff_vp3_idct_put_sse2; |
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
3112 c->idct_add= ff_vp3_idct_add_sse2; |
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
3113 c->idct = ff_vp3_idct_sse2; |
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
3114 c->idct_permutation_type= FF_TRANSPOSE_IDCT_PERM; |
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
3115 }else{ |
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
3116 ff_vp3_dsp_init_mmx(); |
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
3117 c->idct_put= ff_vp3_idct_put_mmx; |
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
3118 c->idct_add= ff_vp3_idct_add_mmx; |
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
3119 c->idct = ff_vp3_idct_mmx; |
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
3120 c->idct_permutation_type= FF_PARTTRANS_IDCT_PERM; |
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
3121 } |
3524 | 3122 }else if(idct_algo==FF_IDCT_CAVS){ |
3123 c->idct_permutation_type= FF_TRANSPOSE_IDCT_PERM; | |
2868 | 3124 #ifdef CONFIG_GPL |
3125 }else if(idct_algo==FF_IDCT_XVIDMMX){ | |
3126 if(mm_flags & MM_MMXEXT){ | |
3127 c->idct_put= ff_idct_xvid_mmx2_put; | |
3128 c->idct_add= ff_idct_xvid_mmx2_add; | |
3129 c->idct = ff_idct_xvid_mmx2; | |
3130 }else{ | |
3131 c->idct_put= ff_idct_xvid_mmx_put; | |
3132 c->idct_add= ff_idct_xvid_mmx_add; | |
3133 c->idct = ff_idct_xvid_mmx; | |
3134 } | |
2871
f4afa3812818
Fix compile without CONFIG_GPL, misplaced #endif caused a missing }.
reimar
parents:
2868
diff
changeset
|
3135 #endif |
1092 | 3136 } |
3137 } | |
1868 | 3138 |
1530
3b31998fe22f
disable encoders where appropriate (patch courtesy of BERO
melanson
parents:
1527
diff
changeset
|
3139 #ifdef CONFIG_ENCODERS |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3140 c->get_pixels = get_pixels_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3141 c->diff_pixels = diff_pixels_mmx; |
1530
3b31998fe22f
disable encoders where appropriate (patch courtesy of BERO
melanson
parents:
1527
diff
changeset
|
3142 #endif //CONFIG_ENCODERS |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3143 c->put_pixels_clamped = put_pixels_clamped_mmx; |
1984
ef919e9ef73e
separate out put_signed_pixels_clamped() into its own function and
melanson
parents:
1977
diff
changeset
|
3144 c->put_signed_pixels_clamped = put_signed_pixels_clamped_mmx; |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3145 c->add_pixels_clamped = add_pixels_clamped_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3146 c->clear_blocks = clear_blocks_mmx; |
1530
3b31998fe22f
disable encoders where appropriate (patch courtesy of BERO
melanson
parents:
1527
diff
changeset
|
3147 #ifdef CONFIG_ENCODERS |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3148 c->pix_sum = pix_sum16_mmx; |
1530
3b31998fe22f
disable encoders where appropriate (patch courtesy of BERO
melanson
parents:
1527
diff
changeset
|
3149 #endif //CONFIG_ENCODERS |
415 | 3150 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3151 c->put_pixels_tab[0][0] = put_pixels16_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3152 c->put_pixels_tab[0][1] = put_pixels16_x2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3153 c->put_pixels_tab[0][2] = put_pixels16_y2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3154 c->put_pixels_tab[0][3] = put_pixels16_xy2_mmx; |
0 | 3155 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3156 c->put_no_rnd_pixels_tab[0][0] = put_pixels16_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3157 c->put_no_rnd_pixels_tab[0][1] = put_no_rnd_pixels16_x2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3158 c->put_no_rnd_pixels_tab[0][2] = put_no_rnd_pixels16_y2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3159 c->put_no_rnd_pixels_tab[0][3] = put_no_rnd_pixels16_xy2_mmx; |
651 | 3160 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3161 c->avg_pixels_tab[0][0] = avg_pixels16_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3162 c->avg_pixels_tab[0][1] = avg_pixels16_x2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3163 c->avg_pixels_tab[0][2] = avg_pixels16_y2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3164 c->avg_pixels_tab[0][3] = avg_pixels16_xy2_mmx; |
415 | 3165 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3166 c->avg_no_rnd_pixels_tab[0][0] = avg_no_rnd_pixels16_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3167 c->avg_no_rnd_pixels_tab[0][1] = avg_no_rnd_pixels16_x2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3168 c->avg_no_rnd_pixels_tab[0][2] = avg_no_rnd_pixels16_y2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3169 c->avg_no_rnd_pixels_tab[0][3] = avg_no_rnd_pixels16_xy2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3170 |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3171 c->put_pixels_tab[1][0] = put_pixels8_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3172 c->put_pixels_tab[1][1] = put_pixels8_x2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3173 c->put_pixels_tab[1][2] = put_pixels8_y2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3174 c->put_pixels_tab[1][3] = put_pixels8_xy2_mmx; |
0 | 3175 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3176 c->put_no_rnd_pixels_tab[1][0] = put_pixels8_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3177 c->put_no_rnd_pixels_tab[1][1] = put_no_rnd_pixels8_x2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3178 c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3179 c->put_no_rnd_pixels_tab[1][3] = put_no_rnd_pixels8_xy2_mmx; |
651 | 3180 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3181 c->avg_pixels_tab[1][0] = avg_pixels8_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3182 c->avg_pixels_tab[1][1] = avg_pixels8_x2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3183 c->avg_pixels_tab[1][2] = avg_pixels8_y2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3184 c->avg_pixels_tab[1][3] = avg_pixels8_xy2_mmx; |
651 | 3185 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3186 c->avg_no_rnd_pixels_tab[1][0] = avg_no_rnd_pixels8_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3187 c->avg_no_rnd_pixels_tab[1][1] = avg_no_rnd_pixels8_x2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3188 c->avg_no_rnd_pixels_tab[1][2] = avg_no_rnd_pixels8_y2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3189 c->avg_no_rnd_pixels_tab[1][3] = avg_no_rnd_pixels8_xy2_mmx; |
2967 | 3190 |
3248
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
3191 c->gmc= gmc_mmx; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
3192 |
866 | 3193 c->add_bytes= add_bytes_mmx; |
1530
3b31998fe22f
disable encoders where appropriate (patch courtesy of BERO
melanson
parents:
1527
diff
changeset
|
3194 #ifdef CONFIG_ENCODERS |
866 | 3195 c->diff_bytes= diff_bytes_mmx; |
2967 | 3196 |
936 | 3197 c->hadamard8_diff[0]= hadamard8_diff16_mmx; |
3198 c->hadamard8_diff[1]= hadamard8_diff_mmx; | |
2967 | 3199 |
2979 | 3200 c->pix_norm1 = pix_norm1_mmx; |
3201 c->sse[0] = (mm_flags & MM_SSE2) ? sse16_sse2 : sse16_mmx; | |
3202 c->sse[1] = sse8_mmx; | |
1729 | 3203 c->vsad[4]= vsad_intra16_mmx; |
3204 | |
2979 | 3205 c->nsse[0] = nsse16_mmx; |
3206 c->nsse[1] = nsse8_mmx; | |
1729 | 3207 if(!(avctx->flags & CODEC_FLAG_BITEXACT)){ |
3208 c->vsad[0] = vsad16_mmx; | |
3209 } | |
2967 | 3210 |
1784 | 3211 if(!(avctx->flags & CODEC_FLAG_BITEXACT)){ |
3212 c->try_8x8basis= try_8x8basis_mmx; | |
3213 } | |
3214 c->add_8x8basis= add_8x8basis_mmx; | |
2967 | 3215 |
1530
3b31998fe22f
disable encoders where appropriate (patch courtesy of BERO
melanson
parents:
1527
diff
changeset
|
3216 #endif //CONFIG_ENCODERS |
1647 | 3217 |
3218 c->h263_v_loop_filter= h263_v_loop_filter_mmx; | |
2967 | 3219 c->h263_h_loop_filter= h263_h_loop_filter_mmx; |
2979 | 3220 c->put_h264_chroma_pixels_tab[0]= put_h264_chroma_mc8_mmx; |
2922
d772011258ec
faster h264_chroma_mc8_mmx, added h264_chroma_mc4_mmx.
lorenm
parents:
2902
diff
changeset
|
3221 c->put_h264_chroma_pixels_tab[1]= put_h264_chroma_mc4_mmx; |
2967 | 3222 |
3173 | 3223 c->h264_idct_dc_add= |
3224 c->h264_idct_add= ff_h264_idct_add_mmx; | |
3174 | 3225 c->h264_idct8_dc_add= |
3226 c->h264_idct8_add= ff_h264_idct8_add_mmx; | |
3173 | 3227 |
0 | 3228 if (mm_flags & MM_MMXEXT) { |
3215
06f98047ff26
prefetch pixels for future motion compensation. 2-5% faster h264.
lorenm
parents:
3213
diff
changeset
|
3229 c->prefetch = prefetch_mmx2; |
06f98047ff26
prefetch pixels for future motion compensation. 2-5% faster h264.
lorenm
parents:
3213
diff
changeset
|
3230 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3231 c->put_pixels_tab[0][1] = put_pixels16_x2_mmx2; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3232 c->put_pixels_tab[0][2] = put_pixels16_y2_mmx2; |
651 | 3233 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3234 c->avg_pixels_tab[0][0] = avg_pixels16_mmx2; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3235 c->avg_pixels_tab[0][1] = avg_pixels16_x2_mmx2; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3236 c->avg_pixels_tab[0][2] = avg_pixels16_y2_mmx2; |
415 | 3237 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3238 c->put_pixels_tab[1][1] = put_pixels8_x2_mmx2; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3239 c->put_pixels_tab[1][2] = put_pixels8_y2_mmx2; |
651 | 3240 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3241 c->avg_pixels_tab[1][0] = avg_pixels8_mmx2; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3242 c->avg_pixels_tab[1][1] = avg_pixels8_x2_mmx2; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3243 c->avg_pixels_tab[1][2] = avg_pixels8_y2_mmx2; |
1092 | 3244 |
1530
3b31998fe22f
disable encoders where appropriate (patch courtesy of BERO
melanson
parents:
1527
diff
changeset
|
3245 #ifdef CONFIG_ENCODERS |
1153 | 3246 c->hadamard8_diff[0]= hadamard8_diff16_mmx2; |
3247 c->hadamard8_diff[1]= hadamard8_diff_mmx2; | |
1729 | 3248 c->vsad[4]= vsad_intra16_mmx2; |
1530
3b31998fe22f
disable encoders where appropriate (patch courtesy of BERO
melanson
parents:
1527
diff
changeset
|
3249 #endif //CONFIG_ENCODERS |
1153 | 3250 |
3105
2d35fb3cb940
h264: special case dc-only idct. ~1% faster overall
lorenm
parents:
3089
diff
changeset
|
3251 c->h264_idct_dc_add= ff_h264_idct_dc_add_mmx2; |
2d35fb3cb940
h264: special case dc-only idct. ~1% faster overall
lorenm
parents:
3089
diff
changeset
|
3252 c->h264_idct8_dc_add= ff_h264_idct8_dc_add_mmx2; |
2745 | 3253 |
1092 | 3254 if(!(avctx->flags & CODEC_FLAG_BITEXACT)){ |
3255 c->put_no_rnd_pixels_tab[0][1] = put_no_rnd_pixels16_x2_mmx2; | |
3256 c->put_no_rnd_pixels_tab[0][2] = put_no_rnd_pixels16_y2_mmx2; | |
3257 c->put_no_rnd_pixels_tab[1][1] = put_no_rnd_pixels8_x2_mmx2; | |
3258 c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y2_mmx2; | |
3259 c->avg_pixels_tab[0][3] = avg_pixels16_xy2_mmx2; | |
3260 c->avg_pixels_tab[1][3] = avg_pixels8_xy2_mmx2; | |
1772
8cd5257195c9
vsad16_mmx2 only applies if encoders are turned on
melanson
parents:
1765
diff
changeset
|
3261 #ifdef CONFIG_ENCODERS |
1729 | 3262 c->vsad[0] = vsad16_mmx2; |
1772
8cd5257195c9
vsad16_mmx2 only applies if encoders are turned on
melanson
parents:
1765
diff
changeset
|
3263 #endif //CONFIG_ENCODERS |
1092 | 3264 } |
959 | 3265 |
961 | 3266 #if 1 |
954 | 3267 SET_QPEL_FUNC(qpel_pixels_tab[0][ 0], qpel16_mc00_mmx2) |
3268 SET_QPEL_FUNC(qpel_pixels_tab[0][ 1], qpel16_mc10_mmx2) | |
3269 SET_QPEL_FUNC(qpel_pixels_tab[0][ 2], qpel16_mc20_mmx2) | |
3270 SET_QPEL_FUNC(qpel_pixels_tab[0][ 3], qpel16_mc30_mmx2) | |
3271 SET_QPEL_FUNC(qpel_pixels_tab[0][ 4], qpel16_mc01_mmx2) | |
3272 SET_QPEL_FUNC(qpel_pixels_tab[0][ 5], qpel16_mc11_mmx2) | |
3273 SET_QPEL_FUNC(qpel_pixels_tab[0][ 6], qpel16_mc21_mmx2) | |
3274 SET_QPEL_FUNC(qpel_pixels_tab[0][ 7], qpel16_mc31_mmx2) | |
3275 SET_QPEL_FUNC(qpel_pixels_tab[0][ 8], qpel16_mc02_mmx2) | |
3276 SET_QPEL_FUNC(qpel_pixels_tab[0][ 9], qpel16_mc12_mmx2) | |
3277 SET_QPEL_FUNC(qpel_pixels_tab[0][10], qpel16_mc22_mmx2) | |
3278 SET_QPEL_FUNC(qpel_pixels_tab[0][11], qpel16_mc32_mmx2) | |
3279 SET_QPEL_FUNC(qpel_pixels_tab[0][12], qpel16_mc03_mmx2) | |
3280 SET_QPEL_FUNC(qpel_pixels_tab[0][13], qpel16_mc13_mmx2) | |
3281 SET_QPEL_FUNC(qpel_pixels_tab[0][14], qpel16_mc23_mmx2) | |
3282 SET_QPEL_FUNC(qpel_pixels_tab[0][15], qpel16_mc33_mmx2) | |
3283 SET_QPEL_FUNC(qpel_pixels_tab[1][ 0], qpel8_mc00_mmx2) | |
3284 SET_QPEL_FUNC(qpel_pixels_tab[1][ 1], qpel8_mc10_mmx2) | |
3285 SET_QPEL_FUNC(qpel_pixels_tab[1][ 2], qpel8_mc20_mmx2) | |
3286 SET_QPEL_FUNC(qpel_pixels_tab[1][ 3], qpel8_mc30_mmx2) | |
3287 SET_QPEL_FUNC(qpel_pixels_tab[1][ 4], qpel8_mc01_mmx2) | |
3288 SET_QPEL_FUNC(qpel_pixels_tab[1][ 5], qpel8_mc11_mmx2) | |
3289 SET_QPEL_FUNC(qpel_pixels_tab[1][ 6], qpel8_mc21_mmx2) | |
3290 SET_QPEL_FUNC(qpel_pixels_tab[1][ 7], qpel8_mc31_mmx2) | |
3291 SET_QPEL_FUNC(qpel_pixels_tab[1][ 8], qpel8_mc02_mmx2) | |
3292 SET_QPEL_FUNC(qpel_pixels_tab[1][ 9], qpel8_mc12_mmx2) | |
3293 SET_QPEL_FUNC(qpel_pixels_tab[1][10], qpel8_mc22_mmx2) | |
3294 SET_QPEL_FUNC(qpel_pixels_tab[1][11], qpel8_mc32_mmx2) | |
3295 SET_QPEL_FUNC(qpel_pixels_tab[1][12], qpel8_mc03_mmx2) | |
3296 SET_QPEL_FUNC(qpel_pixels_tab[1][13], qpel8_mc13_mmx2) | |
3297 SET_QPEL_FUNC(qpel_pixels_tab[1][14], qpel8_mc23_mmx2) | |
3298 SET_QPEL_FUNC(qpel_pixels_tab[1][15], qpel8_mc33_mmx2) | |
961 | 3299 #endif |
1527 | 3300 |
2209 | 3301 //FIXME 3dnow too |
3302 #define dspfunc(PFX, IDX, NUM) \ | |
3303 c->PFX ## _pixels_tab[IDX][ 0] = PFX ## NUM ## _mc00_mmx2; \ | |
3304 c->PFX ## _pixels_tab[IDX][ 1] = PFX ## NUM ## _mc10_mmx2; \ | |
3305 c->PFX ## _pixels_tab[IDX][ 2] = PFX ## NUM ## _mc20_mmx2; \ | |
3306 c->PFX ## _pixels_tab[IDX][ 3] = PFX ## NUM ## _mc30_mmx2; \ | |
3307 c->PFX ## _pixels_tab[IDX][ 4] = PFX ## NUM ## _mc01_mmx2; \ | |
3308 c->PFX ## _pixels_tab[IDX][ 5] = PFX ## NUM ## _mc11_mmx2; \ | |
3309 c->PFX ## _pixels_tab[IDX][ 6] = PFX ## NUM ## _mc21_mmx2; \ | |
3310 c->PFX ## _pixels_tab[IDX][ 7] = PFX ## NUM ## _mc31_mmx2; \ | |
3311 c->PFX ## _pixels_tab[IDX][ 8] = PFX ## NUM ## _mc02_mmx2; \ | |
3312 c->PFX ## _pixels_tab[IDX][ 9] = PFX ## NUM ## _mc12_mmx2; \ | |
3313 c->PFX ## _pixels_tab[IDX][10] = PFX ## NUM ## _mc22_mmx2; \ | |
3314 c->PFX ## _pixels_tab[IDX][11] = PFX ## NUM ## _mc32_mmx2; \ | |
3315 c->PFX ## _pixels_tab[IDX][12] = PFX ## NUM ## _mc03_mmx2; \ | |
3316 c->PFX ## _pixels_tab[IDX][13] = PFX ## NUM ## _mc13_mmx2; \ | |
3317 c->PFX ## _pixels_tab[IDX][14] = PFX ## NUM ## _mc23_mmx2; \ | |
3318 c->PFX ## _pixels_tab[IDX][15] = PFX ## NUM ## _mc33_mmx2 | |
3319 | |
3320 dspfunc(put_h264_qpel, 0, 16); | |
3321 dspfunc(put_h264_qpel, 1, 8); | |
3322 dspfunc(put_h264_qpel, 2, 4); | |
3323 dspfunc(avg_h264_qpel, 0, 16); | |
3324 dspfunc(avg_h264_qpel, 1, 8); | |
3325 dspfunc(avg_h264_qpel, 2, 4); | |
3807
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
3326 |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
3327 dspfunc(put_2tap_qpel, 0, 16); |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
3328 dspfunc(put_2tap_qpel, 1, 8); |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
3329 dspfunc(avg_2tap_qpel, 0, 16); |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
3330 dspfunc(avg_2tap_qpel, 1, 8); |
2209 | 3331 #undef dspfunc |
3332 | |
2979 | 3333 c->avg_h264_chroma_pixels_tab[0]= avg_h264_chroma_mc8_mmx2; |
2922
d772011258ec
faster h264_chroma_mc8_mmx, added h264_chroma_mc4_mmx.
lorenm
parents:
2902
diff
changeset
|
3334 c->avg_h264_chroma_pixels_tab[1]= avg_h264_chroma_mc4_mmx2; |
3213 | 3335 c->avg_h264_chroma_pixels_tab[2]= avg_h264_chroma_mc2_mmx2; |
3336 c->put_h264_chroma_pixels_tab[2]= put_h264_chroma_mc2_mmx2; | |
2633 | 3337 c->h264_v_loop_filter_luma= h264_v_loop_filter_luma_mmx2; |
3338 c->h264_h_loop_filter_luma= h264_h_loop_filter_luma_mmx2; | |
3339 c->h264_v_loop_filter_chroma= h264_v_loop_filter_chroma_mmx2; | |
3340 c->h264_h_loop_filter_chroma= h264_h_loop_filter_chroma_mmx2; | |
2707
360024d31dab
H.264 deblocking optimizations (mmx for chroma_bS4 case, convert existing cases to 8-bit math)
lorenm
parents:
2696
diff
changeset
|
3341 c->h264_v_loop_filter_chroma_intra= h264_v_loop_filter_chroma_intra_mmx2; |
360024d31dab
H.264 deblocking optimizations (mmx for chroma_bS4 case, convert existing cases to 8-bit math)
lorenm
parents:
2696
diff
changeset
|
3342 c->h264_h_loop_filter_chroma_intra= h264_h_loop_filter_chroma_intra_mmx2; |
3645
47821be55b6c
mmx implementation of deblocking strength decision.
lorenm
parents:
3576
diff
changeset
|
3343 c->h264_loop_filter_strength= h264_loop_filter_strength_mmx2; |
2633 | 3344 |
2902
3c79bc9f3aa9
h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents:
2899
diff
changeset
|
3345 c->weight_h264_pixels_tab[0]= ff_h264_weight_16x16_mmx2; |
3c79bc9f3aa9
h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents:
2899
diff
changeset
|
3346 c->weight_h264_pixels_tab[1]= ff_h264_weight_16x8_mmx2; |
3c79bc9f3aa9
h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents:
2899
diff
changeset
|
3347 c->weight_h264_pixels_tab[2]= ff_h264_weight_8x16_mmx2; |
3c79bc9f3aa9
h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents:
2899
diff
changeset
|
3348 c->weight_h264_pixels_tab[3]= ff_h264_weight_8x8_mmx2; |
3c79bc9f3aa9
h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents:
2899
diff
changeset
|
3349 c->weight_h264_pixels_tab[4]= ff_h264_weight_8x4_mmx2; |
3c79bc9f3aa9
h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents:
2899
diff
changeset
|
3350 c->weight_h264_pixels_tab[5]= ff_h264_weight_4x8_mmx2; |
3c79bc9f3aa9
h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents:
2899
diff
changeset
|
3351 c->weight_h264_pixels_tab[6]= ff_h264_weight_4x4_mmx2; |
3c79bc9f3aa9
h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents:
2899
diff
changeset
|
3352 c->weight_h264_pixels_tab[7]= ff_h264_weight_4x2_mmx2; |
3c79bc9f3aa9
h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents:
2899
diff
changeset
|
3353 |
3c79bc9f3aa9
h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents:
2899
diff
changeset
|
3354 c->biweight_h264_pixels_tab[0]= ff_h264_biweight_16x16_mmx2; |
3c79bc9f3aa9
h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents:
2899
diff
changeset
|
3355 c->biweight_h264_pixels_tab[1]= ff_h264_biweight_16x8_mmx2; |
3c79bc9f3aa9
h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents:
2899
diff
changeset
|
3356 c->biweight_h264_pixels_tab[2]= ff_h264_biweight_8x16_mmx2; |
3c79bc9f3aa9
h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents:
2899
diff
changeset
|
3357 c->biweight_h264_pixels_tab[3]= ff_h264_biweight_8x8_mmx2; |
3c79bc9f3aa9
h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents:
2899
diff
changeset
|
3358 c->biweight_h264_pixels_tab[4]= ff_h264_biweight_8x4_mmx2; |
3c79bc9f3aa9
h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents:
2899
diff
changeset
|
3359 c->biweight_h264_pixels_tab[5]= ff_h264_biweight_4x8_mmx2; |
3c79bc9f3aa9
h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents:
2899
diff
changeset
|
3360 c->biweight_h264_pixels_tab[6]= ff_h264_biweight_4x4_mmx2; |
3c79bc9f3aa9
h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents:
2899
diff
changeset
|
3361 c->biweight_h264_pixels_tab[7]= ff_h264_biweight_4x2_mmx2; |
3c79bc9f3aa9
h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents:
2899
diff
changeset
|
3362 |
3524 | 3363 #ifdef CONFIG_CAVS_DECODER |
3364 ff_cavsdsp_init_mmx2(c, avctx); | |
3365 #endif | |
3366 | |
1686
68abbec33289
Here are juste two added #ifdef CONFIG_ENCODERS to allow
michael
parents:
1648
diff
changeset
|
3367 #ifdef CONFIG_ENCODERS |
1527 | 3368 c->sub_hfyu_median_prediction= sub_hfyu_median_prediction_mmx2; |
1686
68abbec33289
Here are juste two added #ifdef CONFIG_ENCODERS to allow
michael
parents:
1648
diff
changeset
|
3369 #endif //CONFIG_ENCODERS |
0 | 3370 } else if (mm_flags & MM_3DNOW) { |
3215
06f98047ff26
prefetch pixels for future motion compensation. 2-5% faster h264.
lorenm
parents:
3213
diff
changeset
|
3371 c->prefetch = prefetch_3dnow; |
06f98047ff26
prefetch pixels for future motion compensation. 2-5% faster h264.
lorenm
parents:
3213
diff
changeset
|
3372 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3373 c->put_pixels_tab[0][1] = put_pixels16_x2_3dnow; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3374 c->put_pixels_tab[0][2] = put_pixels16_y2_3dnow; |
393 | 3375 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3376 c->avg_pixels_tab[0][0] = avg_pixels16_3dnow; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3377 c->avg_pixels_tab[0][1] = avg_pixels16_x2_3dnow; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3378 c->avg_pixels_tab[0][2] = avg_pixels16_y2_3dnow; |
651 | 3379 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3380 c->put_pixels_tab[1][1] = put_pixels8_x2_3dnow; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3381 c->put_pixels_tab[1][2] = put_pixels8_y2_3dnow; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3382 |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3383 c->avg_pixels_tab[1][0] = avg_pixels8_3dnow; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3384 c->avg_pixels_tab[1][1] = avg_pixels8_x2_3dnow; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
3385 c->avg_pixels_tab[1][2] = avg_pixels8_y2_3dnow; |
1092 | 3386 |
3387 if(!(avctx->flags & CODEC_FLAG_BITEXACT)){ | |
3388 c->put_no_rnd_pixels_tab[0][1] = put_no_rnd_pixels16_x2_3dnow; | |
3389 c->put_no_rnd_pixels_tab[0][2] = put_no_rnd_pixels16_y2_3dnow; | |
3390 c->put_no_rnd_pixels_tab[1][1] = put_no_rnd_pixels8_x2_3dnow; | |
3391 c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y2_3dnow; | |
3392 c->avg_pixels_tab[0][3] = avg_pixels16_xy2_3dnow; | |
3393 c->avg_pixels_tab[1][3] = avg_pixels8_xy2_3dnow; | |
3394 } | |
984 | 3395 |
954 | 3396 SET_QPEL_FUNC(qpel_pixels_tab[0][ 0], qpel16_mc00_3dnow) |
3397 SET_QPEL_FUNC(qpel_pixels_tab[0][ 1], qpel16_mc10_3dnow) | |
3398 SET_QPEL_FUNC(qpel_pixels_tab[0][ 2], qpel16_mc20_3dnow) | |
3399 SET_QPEL_FUNC(qpel_pixels_tab[0][ 3], qpel16_mc30_3dnow) | |
3400 SET_QPEL_FUNC(qpel_pixels_tab[0][ 4], qpel16_mc01_3dnow) | |
3401 SET_QPEL_FUNC(qpel_pixels_tab[0][ 5], qpel16_mc11_3dnow) | |
3402 SET_QPEL_FUNC(qpel_pixels_tab[0][ 6], qpel16_mc21_3dnow) | |
3403 SET_QPEL_FUNC(qpel_pixels_tab[0][ 7], qpel16_mc31_3dnow) | |
3404 SET_QPEL_FUNC(qpel_pixels_tab[0][ 8], qpel16_mc02_3dnow) | |
3405 SET_QPEL_FUNC(qpel_pixels_tab[0][ 9], qpel16_mc12_3dnow) | |
3406 SET_QPEL_FUNC(qpel_pixels_tab[0][10], qpel16_mc22_3dnow) | |
3407 SET_QPEL_FUNC(qpel_pixels_tab[0][11], qpel16_mc32_3dnow) | |
3408 SET_QPEL_FUNC(qpel_pixels_tab[0][12], qpel16_mc03_3dnow) | |
3409 SET_QPEL_FUNC(qpel_pixels_tab[0][13], qpel16_mc13_3dnow) | |
3410 SET_QPEL_FUNC(qpel_pixels_tab[0][14], qpel16_mc23_3dnow) | |
3411 SET_QPEL_FUNC(qpel_pixels_tab[0][15], qpel16_mc33_3dnow) | |
3412 SET_QPEL_FUNC(qpel_pixels_tab[1][ 0], qpel8_mc00_3dnow) | |
3413 SET_QPEL_FUNC(qpel_pixels_tab[1][ 1], qpel8_mc10_3dnow) | |
3414 SET_QPEL_FUNC(qpel_pixels_tab[1][ 2], qpel8_mc20_3dnow) | |
3415 SET_QPEL_FUNC(qpel_pixels_tab[1][ 3], qpel8_mc30_3dnow) | |
3416 SET_QPEL_FUNC(qpel_pixels_tab[1][ 4], qpel8_mc01_3dnow) | |
3417 SET_QPEL_FUNC(qpel_pixels_tab[1][ 5], qpel8_mc11_3dnow) | |
3418 SET_QPEL_FUNC(qpel_pixels_tab[1][ 6], qpel8_mc21_3dnow) | |
3419 SET_QPEL_FUNC(qpel_pixels_tab[1][ 7], qpel8_mc31_3dnow) | |
3420 SET_QPEL_FUNC(qpel_pixels_tab[1][ 8], qpel8_mc02_3dnow) | |
3421 SET_QPEL_FUNC(qpel_pixels_tab[1][ 9], qpel8_mc12_3dnow) | |
3422 SET_QPEL_FUNC(qpel_pixels_tab[1][10], qpel8_mc22_3dnow) | |
3423 SET_QPEL_FUNC(qpel_pixels_tab[1][11], qpel8_mc32_3dnow) | |
3424 SET_QPEL_FUNC(qpel_pixels_tab[1][12], qpel8_mc03_3dnow) | |
3425 SET_QPEL_FUNC(qpel_pixels_tab[1][13], qpel8_mc13_3dnow) | |
3426 SET_QPEL_FUNC(qpel_pixels_tab[1][14], qpel8_mc23_3dnow) | |
3427 SET_QPEL_FUNC(qpel_pixels_tab[1][15], qpel8_mc33_3dnow) | |
2209 | 3428 |
3429 #define dspfunc(PFX, IDX, NUM) \ | |
3430 c->PFX ## _pixels_tab[IDX][ 0] = PFX ## NUM ## _mc00_3dnow; \ | |
3431 c->PFX ## _pixels_tab[IDX][ 1] = PFX ## NUM ## _mc10_3dnow; \ | |
3432 c->PFX ## _pixels_tab[IDX][ 2] = PFX ## NUM ## _mc20_3dnow; \ | |
3433 c->PFX ## _pixels_tab[IDX][ 3] = PFX ## NUM ## _mc30_3dnow; \ | |
3434 c->PFX ## _pixels_tab[IDX][ 4] = PFX ## NUM ## _mc01_3dnow; \ | |
3435 c->PFX ## _pixels_tab[IDX][ 5] = PFX ## NUM ## _mc11_3dnow; \ | |
3436 c->PFX ## _pixels_tab[IDX][ 6] = PFX ## NUM ## _mc21_3dnow; \ | |
3437 c->PFX ## _pixels_tab[IDX][ 7] = PFX ## NUM ## _mc31_3dnow; \ | |
3438 c->PFX ## _pixels_tab[IDX][ 8] = PFX ## NUM ## _mc02_3dnow; \ | |
3439 c->PFX ## _pixels_tab[IDX][ 9] = PFX ## NUM ## _mc12_3dnow; \ | |
3440 c->PFX ## _pixels_tab[IDX][10] = PFX ## NUM ## _mc22_3dnow; \ | |
3441 c->PFX ## _pixels_tab[IDX][11] = PFX ## NUM ## _mc32_3dnow; \ | |
3442 c->PFX ## _pixels_tab[IDX][12] = PFX ## NUM ## _mc03_3dnow; \ | |
3443 c->PFX ## _pixels_tab[IDX][13] = PFX ## NUM ## _mc13_3dnow; \ | |
3444 c->PFX ## _pixels_tab[IDX][14] = PFX ## NUM ## _mc23_3dnow; \ | |
3445 c->PFX ## _pixels_tab[IDX][15] = PFX ## NUM ## _mc33_3dnow | |
3446 | |
3447 dspfunc(put_h264_qpel, 0, 16); | |
3448 dspfunc(put_h264_qpel, 1, 8); | |
3449 dspfunc(put_h264_qpel, 2, 4); | |
3450 dspfunc(avg_h264_qpel, 0, 16); | |
3451 dspfunc(avg_h264_qpel, 1, 8); | |
3452 dspfunc(avg_h264_qpel, 2, 4); | |
2732 | 3453 |
3807
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
3454 dspfunc(put_2tap_qpel, 0, 16); |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
3455 dspfunc(put_2tap_qpel, 1, 8); |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
3456 dspfunc(avg_2tap_qpel, 0, 16); |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
3457 dspfunc(avg_2tap_qpel, 1, 8); |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
3458 |
2979 | 3459 c->avg_h264_chroma_pixels_tab[0]= avg_h264_chroma_mc8_3dnow; |
2922
d772011258ec
faster h264_chroma_mc8_mmx, added h264_chroma_mc4_mmx.
lorenm
parents:
2902
diff
changeset
|
3460 c->avg_h264_chroma_pixels_tab[1]= avg_h264_chroma_mc4_3dnow; |
0 | 3461 } |
3207
33110c1008a4
Add the mmx and sse2 implementations of ff_snow_vertical_compose().
gpoirier
parents:
3174
diff
changeset
|
3462 |
33110c1008a4
Add the mmx and sse2 implementations of ff_snow_vertical_compose().
gpoirier
parents:
3174
diff
changeset
|
3463 #ifdef CONFIG_SNOW_ENCODER |
33110c1008a4
Add the mmx and sse2 implementations of ff_snow_vertical_compose().
gpoirier
parents:
3174
diff
changeset
|
3464 if(mm_flags & MM_SSE2){ |
3210 | 3465 c->horizontal_compose97i = ff_snow_horizontal_compose97i_sse2; |
3207
33110c1008a4
Add the mmx and sse2 implementations of ff_snow_vertical_compose().
gpoirier
parents:
3174
diff
changeset
|
3466 c->vertical_compose97i = ff_snow_vertical_compose97i_sse2; |
3211
b77b5e7072d6
add MMX and SSE versions of ff_snow_inner_add_yblock
gpoirier
parents:
3210
diff
changeset
|
3467 c->inner_add_yblock = ff_snow_inner_add_yblock_sse2; |
3207
33110c1008a4
Add the mmx and sse2 implementations of ff_snow_vertical_compose().
gpoirier
parents:
3174
diff
changeset
|
3468 } |
33110c1008a4
Add the mmx and sse2 implementations of ff_snow_vertical_compose().
gpoirier
parents:
3174
diff
changeset
|
3469 else{ |
3210 | 3470 c->horizontal_compose97i = ff_snow_horizontal_compose97i_mmx; |
3207
33110c1008a4
Add the mmx and sse2 implementations of ff_snow_vertical_compose().
gpoirier
parents:
3174
diff
changeset
|
3471 c->vertical_compose97i = ff_snow_vertical_compose97i_mmx; |
3211
b77b5e7072d6
add MMX and SSE versions of ff_snow_inner_add_yblock
gpoirier
parents:
3210
diff
changeset
|
3472 c->inner_add_yblock = ff_snow_inner_add_yblock_mmx; |
3207
33110c1008a4
Add the mmx and sse2 implementations of ff_snow_vertical_compose().
gpoirier
parents:
3174
diff
changeset
|
3473 } |
33110c1008a4
Add the mmx and sse2 implementations of ff_snow_vertical_compose().
gpoirier
parents:
3174
diff
changeset
|
3474 #endif |
3536
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
3475 |
3568
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3476 if(mm_flags & MM_3DNOW){ |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3477 c->vorbis_inverse_coupling = vorbis_inverse_coupling_3dnow; |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3478 c->vector_fmul = vector_fmul_3dnow; |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3479 if(!(avctx->flags & CODEC_FLAG_BITEXACT)) |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3480 c->float_to_int16 = float_to_int16_3dnow; |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3481 } |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3482 if(mm_flags & MM_3DNOWEXT) |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3483 c->vector_fmul_reverse = vector_fmul_reverse_3dnow2; |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3484 if(mm_flags & MM_SSE){ |
3557
8e13ec0f8aa3
change vorbis_inverse_coupling_sse2() so it works on sse1 cpus
michael
parents:
3541
diff
changeset
|
3485 c->vorbis_inverse_coupling = vorbis_inverse_coupling_sse; |
3568
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3486 c->vector_fmul = vector_fmul_sse; |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3487 c->float_to_int16 = float_to_int16_sse; |
3569
c42c03f3b402
convert vector_fmul_reverse_sse2 and vector_fmul_add_add_sse2 to sse
michael
parents:
3568
diff
changeset
|
3488 c->vector_fmul_reverse = vector_fmul_reverse_sse; |
c42c03f3b402
convert vector_fmul_reverse_sse2 and vector_fmul_add_add_sse2 to sse
michael
parents:
3568
diff
changeset
|
3489 c->vector_fmul_add_add = vector_fmul_add_add_sse; |
3568
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3490 } |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
3491 if(mm_flags & MM_3DNOW) |
3574 | 3492 c->vector_fmul_add_add = vector_fmul_add_add_3dnow; // faster than sse |
0 | 3493 } |
2967 | 3494 |
1530
3b31998fe22f
disable encoders where appropriate (patch courtesy of BERO
melanson
parents:
1527
diff
changeset
|
3495 #ifdef CONFIG_ENCODERS |
1092 | 3496 dsputil_init_pix_mmx(c, avctx); |
1530
3b31998fe22f
disable encoders where appropriate (patch courtesy of BERO
melanson
parents:
1527
diff
changeset
|
3497 #endif //CONFIG_ENCODERS |
247
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
3498 #if 0 |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
3499 // for speed testing |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
3500 get_pixels = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
3501 put_pixels_clamped = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
3502 add_pixels_clamped = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
3503 |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
3504 pix_abs16x16 = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
3505 pix_abs16x16_x2 = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
3506 pix_abs16x16_y2 = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
3507 pix_abs16x16_xy2 = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
3508 |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
3509 put_pixels_tab[0] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
3510 put_pixels_tab[1] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
3511 put_pixels_tab[2] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
3512 put_pixels_tab[3] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
3513 |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
3514 put_no_rnd_pixels_tab[0] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
3515 put_no_rnd_pixels_tab[1] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
3516 put_no_rnd_pixels_tab[2] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
3517 put_no_rnd_pixels_tab[3] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
3518 |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
3519 avg_pixels_tab[0] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
3520 avg_pixels_tab[1] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
3521 avg_pixels_tab[2] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
3522 avg_pixels_tab[3] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
3523 |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
3524 avg_no_rnd_pixels_tab[0] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
3525 avg_no_rnd_pixels_tab[1] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
3526 avg_no_rnd_pixels_tab[2] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
3527 avg_no_rnd_pixels_tab[3] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
3528 |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
3529 //av_fdct = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
3530 //ff_idct = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
3531 #endif |
0 | 3532 } |