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