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