Mercurial > libavcodec.hg
annotate i386/dsputil_mmx.c @ 6557:e1208c4f8898 libavcodec
h264 chroma mc ssse3
width8: 180->92, width4: 78->63 cycles (core2)
author | lorenm |
---|---|
date | Tue, 01 Apr 2008 04:51:28 +0000 |
parents | dfa76e0734e5 |
children | 0ec61ed36c29 |
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 | |
5010
d5ba514e3f4a
Add libavcodec to compiler include flags in order to simplify header
diego
parents:
5007
diff
changeset
|
25 #include "dsputil.h" |
5946
55251379b5b1
make ff_p* vars extern so that they can be used in various *_mmx.c files
aurel
parents:
5933
diff
changeset
|
26 #include "dsputil_mmx.h" |
5010
d5ba514e3f4a
Add libavcodec to compiler include flags in order to simplify header
diego
parents:
5007
diff
changeset
|
27 #include "simple_idct.h" |
d5ba514e3f4a
Add libavcodec to compiler include flags in order to simplify header
diego
parents:
5007
diff
changeset
|
28 #include "mpegvideo.h" |
3398
e0927bc44a10
Move REG_* macros from libavcodec/i386/mmx.h to libavutil/x86_cpu.h
lucabe
parents:
3250
diff
changeset
|
29 #include "x86_cpu.h" |
1984
ef919e9ef73e
separate out put_signed_pixels_clamped() into its own function and
melanson
parents:
1977
diff
changeset
|
30 #include "mmx.h" |
5014
42b99a3aadde
better separation of vp3dsp functions from dsputil_mmx.c
aurel
parents:
5010
diff
changeset
|
31 #include "vp3dsp_mmx.h" |
42b99a3aadde
better separation of vp3dsp functions from dsputil_mmx.c
aurel
parents:
5010
diff
changeset
|
32 #include "vp3dsp_sse2.h" |
5277
7b3fcb7c61ce
Avoid linking with h263.c functions when the relevant codecs
aurel
parents:
5255
diff
changeset
|
33 #include "h263.h" |
0 | 34 |
1729 | 35 //#undef NDEBUG |
36 //#include <assert.h> | |
37 | |
2868 | 38 extern void ff_idct_xvid_mmx(short *block); |
39 extern void ff_idct_xvid_mmx2(short *block); | |
1647 | 40 |
4197 | 41 int mm_flags; /* multimedia extension flags */ |
936 | 42 |
0 | 43 /* pixel operations */ |
5947 | 44 DECLARE_ALIGNED_8 (const uint64_t, ff_bone) = 0x0101010101010101ULL; |
45 DECLARE_ALIGNED_8 (const uint64_t, ff_wtwo) = 0x0002000200020002ULL; | |
5946
55251379b5b1
make ff_p* vars extern so that they can be used in various *_mmx.c files
aurel
parents:
5933
diff
changeset
|
46 |
55251379b5b1
make ff_p* vars extern so that they can be used in various *_mmx.c files
aurel
parents:
5933
diff
changeset
|
47 DECLARE_ALIGNED_16(const uint64_t, ff_pdw_80000000[2]) = |
3557
8e13ec0f8aa3
change vorbis_inverse_coupling_sse2() so it works on sse1 cpus
michael
parents:
3541
diff
changeset
|
48 {0x8000000080000000ULL, 0x8000000080000000ULL}; |
8e13ec0f8aa3
change vorbis_inverse_coupling_sse2() so it works on sse1 cpus
michael
parents:
3541
diff
changeset
|
49 |
5946
55251379b5b1
make ff_p* vars extern so that they can be used in various *_mmx.c files
aurel
parents:
5933
diff
changeset
|
50 DECLARE_ALIGNED_8 (const uint64_t, ff_pw_3 ) = 0x0003000300030003ULL; |
55251379b5b1
make ff_p* vars extern so that they can be used in various *_mmx.c files
aurel
parents:
5933
diff
changeset
|
51 DECLARE_ALIGNED_8 (const uint64_t, ff_pw_4 ) = 0x0004000400040004ULL; |
6331 | 52 DECLARE_ALIGNED_16(const xmm_t, ff_pw_5 ) = {0x0005000500050005ULL, 0x0005000500050005ULL}; |
5946
55251379b5b1
make ff_p* vars extern so that they can be used in various *_mmx.c files
aurel
parents:
5933
diff
changeset
|
53 DECLARE_ALIGNED_8 (const uint64_t, ff_pw_8 ) = 0x0008000800080008ULL; |
55251379b5b1
make ff_p* vars extern so that they can be used in various *_mmx.c files
aurel
parents:
5933
diff
changeset
|
54 DECLARE_ALIGNED_8 (const uint64_t, ff_pw_15 ) = 0x000F000F000F000FULL; |
6331 | 55 DECLARE_ALIGNED_16(const xmm_t, ff_pw_16 ) = {0x0010001000100010ULL, 0x0010001000100010ULL}; |
5946
55251379b5b1
make ff_p* vars extern so that they can be used in various *_mmx.c files
aurel
parents:
5933
diff
changeset
|
56 DECLARE_ALIGNED_8 (const uint64_t, ff_pw_20 ) = 0x0014001400140014ULL; |
6557 | 57 DECLARE_ALIGNED_16(const xmm_t, ff_pw_28 ) = {0x001C001C001C001CULL, 0x001C001C001C001CULL}; |
6329
5969caa9190d
clean up an ugliness introduced in r11826. this syntax will require fewer changes when adding future sse2 code.
lorenm
parents:
6327
diff
changeset
|
58 DECLARE_ALIGNED_16(const xmm_t, ff_pw_32 ) = {0x0020002000200020ULL, 0x0020002000200020ULL}; |
5946
55251379b5b1
make ff_p* vars extern so that they can be used in various *_mmx.c files
aurel
parents:
5933
diff
changeset
|
59 DECLARE_ALIGNED_8 (const uint64_t, ff_pw_42 ) = 0x002A002A002A002AULL; |
55251379b5b1
make ff_p* vars extern so that they can be used in various *_mmx.c files
aurel
parents:
5933
diff
changeset
|
60 DECLARE_ALIGNED_8 (const uint64_t, ff_pw_64 ) = 0x0040004000400040ULL; |
55251379b5b1
make ff_p* vars extern so that they can be used in various *_mmx.c files
aurel
parents:
5933
diff
changeset
|
61 DECLARE_ALIGNED_8 (const uint64_t, ff_pw_96 ) = 0x0060006000600060ULL; |
6333 | 62 DECLARE_ALIGNED_8 (const uint64_t, ff_pw_128) = 0x0080008000800080ULL; |
6384 | 63 DECLARE_ALIGNED_8 (const uint64_t, ff_pw_255) = 0x00ff00ff00ff00ffULL; |
5946
55251379b5b1
make ff_p* vars extern so that they can be used in various *_mmx.c files
aurel
parents:
5933
diff
changeset
|
64 |
55251379b5b1
make ff_p* vars extern so that they can be used in various *_mmx.c files
aurel
parents:
5933
diff
changeset
|
65 DECLARE_ALIGNED_8 (const uint64_t, ff_pb_1 ) = 0x0101010101010101ULL; |
55251379b5b1
make ff_p* vars extern so that they can be used in various *_mmx.c files
aurel
parents:
5933
diff
changeset
|
66 DECLARE_ALIGNED_8 (const uint64_t, ff_pb_3 ) = 0x0303030303030303ULL; |
55251379b5b1
make ff_p* vars extern so that they can be used in various *_mmx.c files
aurel
parents:
5933
diff
changeset
|
67 DECLARE_ALIGNED_8 (const uint64_t, ff_pb_7 ) = 0x0707070707070707ULL; |
55251379b5b1
make ff_p* vars extern so that they can be used in various *_mmx.c files
aurel
parents:
5933
diff
changeset
|
68 DECLARE_ALIGNED_8 (const uint64_t, ff_pb_3F ) = 0x3F3F3F3F3F3F3F3FULL; |
55251379b5b1
make ff_p* vars extern so that they can be used in various *_mmx.c files
aurel
parents:
5933
diff
changeset
|
69 DECLARE_ALIGNED_8 (const uint64_t, ff_pb_A1 ) = 0xA1A1A1A1A1A1A1A1ULL; |
55251379b5b1
make ff_p* vars extern so that they can be used in various *_mmx.c files
aurel
parents:
5933
diff
changeset
|
70 DECLARE_ALIGNED_8 (const uint64_t, ff_pb_FC ) = 0xFCFCFCFCFCFCFCFCULL; |
55251379b5b1
make ff_p* vars extern so that they can be used in various *_mmx.c files
aurel
parents:
5933
diff
changeset
|
71 |
55251379b5b1
make ff_p* vars extern so that they can be used in various *_mmx.c files
aurel
parents:
5933
diff
changeset
|
72 DECLARE_ALIGNED_16(const double, ff_pd_1[2]) = { 1.0, 1.0 }; |
55251379b5b1
make ff_p* vars extern so that they can be used in various *_mmx.c files
aurel
parents:
5933
diff
changeset
|
73 DECLARE_ALIGNED_16(const double, ff_pd_2[2]) = { 2.0, 2.0 }; |
5737 | 74 |
6391
3dc36ec2dcad
__asm __volatile -> asm volatile, improves code consistency and works
reimar
parents:
6384
diff
changeset
|
75 #define JUMPALIGN() asm volatile (ASMALIGN(3)::) |
3dc36ec2dcad
__asm __volatile -> asm volatile, improves code consistency and works
reimar
parents:
6384
diff
changeset
|
76 #define MOVQ_ZERO(regd) asm volatile ("pxor %%" #regd ", %%" #regd ::) |
247
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
77 |
448 | 78 #define MOVQ_BFE(regd) \ |
6391
3dc36ec2dcad
__asm __volatile -> asm volatile, improves code consistency and works
reimar
parents:
6384
diff
changeset
|
79 asm volatile ( \ |
448 | 80 "pcmpeqd %%" #regd ", %%" #regd " \n\t"\ |
81 "paddb %%" #regd ", %%" #regd " \n\t" ::) | |
82 | |
247
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
83 #ifndef PIC |
6391
3dc36ec2dcad
__asm __volatile -> asm volatile, improves code consistency and works
reimar
parents:
6384
diff
changeset
|
84 #define MOVQ_BONE(regd) asm volatile ("movq %0, %%" #regd " \n\t" ::"m"(ff_bone)) |
3dc36ec2dcad
__asm __volatile -> asm volatile, improves code consistency and works
reimar
parents:
6384
diff
changeset
|
85 #define MOVQ_WTWO(regd) asm volatile ("movq %0, %%" #regd " \n\t" ::"m"(ff_wtwo)) |
247
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
86 #else |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
87 // 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
|
88 // pcmpeqd -> -1 |
448 | 89 #define MOVQ_BONE(regd) \ |
6391
3dc36ec2dcad
__asm __volatile -> asm volatile, improves code consistency and works
reimar
parents:
6384
diff
changeset
|
90 asm volatile ( \ |
448 | 91 "pcmpeqd %%" #regd ", %%" #regd " \n\t" \ |
92 "psrlw $15, %%" #regd " \n\t" \ | |
93 "packuswb %%" #regd ", %%" #regd " \n\t" ::) | |
247
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
94 |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
95 #define MOVQ_WTWO(regd) \ |
6391
3dc36ec2dcad
__asm __volatile -> asm volatile, improves code consistency and works
reimar
parents:
6384
diff
changeset
|
96 asm volatile ( \ |
448 | 97 "pcmpeqd %%" #regd ", %%" #regd " \n\t" \ |
98 "psrlw $15, %%" #regd " \n\t" \ | |
99 "psllw $1, %%" #regd " \n\t"::) | |
387 | 100 |
247
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
101 #endif |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
102 |
448 | 103 // 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
|
104 // first argument is unmodifed and second is trashed |
471 | 105 // regfe is supposed to contain 0xfefefefefefefefe |
106 #define PAVGB_MMX_NO_RND(rega, regb, regr, regfe) \ | |
2979 | 107 "movq " #rega ", " #regr " \n\t"\ |
108 "pand " #regb ", " #regr " \n\t"\ | |
109 "pxor " #rega ", " #regb " \n\t"\ | |
110 "pand " #regfe "," #regb " \n\t"\ | |
111 "psrlq $1, " #regb " \n\t"\ | |
112 "paddb " #regb ", " #regr " \n\t" | |
444
a5edef76dac6
* new mmx code - based upon http://aggregate.org/MAGIC
kabi
parents:
438
diff
changeset
|
113 |
471 | 114 #define PAVGB_MMX(rega, regb, regr, regfe) \ |
2979 | 115 "movq " #rega ", " #regr " \n\t"\ |
116 "por " #regb ", " #regr " \n\t"\ | |
117 "pxor " #rega ", " #regb " \n\t"\ | |
118 "pand " #regfe "," #regb " \n\t"\ | |
119 "psrlq $1, " #regb " \n\t"\ | |
120 "psubb " #regb ", " #regr " \n\t" | |
445
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
121 |
471 | 122 // mm6 is supposed to contain 0xfefefefefefefefe |
446
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
123 #define PAVGBP_MMX_NO_RND(rega, regb, regr, regc, regd, regp) \ |
2979 | 124 "movq " #rega ", " #regr " \n\t"\ |
125 "movq " #regc ", " #regp " \n\t"\ | |
126 "pand " #regb ", " #regr " \n\t"\ | |
127 "pand " #regd ", " #regp " \n\t"\ | |
128 "pxor " #rega ", " #regb " \n\t"\ | |
129 "pxor " #regc ", " #regd " \n\t"\ | |
130 "pand %%mm6, " #regb " \n\t"\ | |
131 "pand %%mm6, " #regd " \n\t"\ | |
132 "psrlq $1, " #regb " \n\t"\ | |
133 "psrlq $1, " #regd " \n\t"\ | |
134 "paddb " #regb ", " #regr " \n\t"\ | |
135 "paddb " #regd ", " #regp " \n\t" | |
446
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
136 |
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
137 #define PAVGBP_MMX(rega, regb, regr, regc, regd, regp) \ |
2979 | 138 "movq " #rega ", " #regr " \n\t"\ |
139 "movq " #regc ", " #regp " \n\t"\ | |
140 "por " #regb ", " #regr " \n\t"\ | |
141 "por " #regd ", " #regp " \n\t"\ | |
142 "pxor " #rega ", " #regb " \n\t"\ | |
143 "pxor " #regc ", " #regd " \n\t"\ | |
144 "pand %%mm6, " #regb " \n\t"\ | |
145 "pand %%mm6, " #regd " \n\t"\ | |
146 "psrlq $1, " #regd " \n\t"\ | |
147 "psrlq $1, " #regb " \n\t"\ | |
148 "psubb " #regb ", " #regr " \n\t"\ | |
149 "psubb " #regd ", " #regp " \n\t" | |
446
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
150 |
445
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
151 /***********************************/ |
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
152 /* MMX no rounding */ |
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
153 #define DEF(x, y) x ## _no_rnd_ ## y ##_mmx |
448 | 154 #define SET_RND MOVQ_WONE |
2979 | 155 #define PAVGBP(a, b, c, d, e, f) PAVGBP_MMX_NO_RND(a, b, c, d, e, f) |
156 #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
|
157 |
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
158 #include "dsputil_mmx_rnd.h" |
444
a5edef76dac6
* new mmx code - based upon http://aggregate.org/MAGIC
kabi
parents:
438
diff
changeset
|
159 |
445
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
160 #undef DEF |
448 | 161 #undef SET_RND |
446
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
162 #undef PAVGBP |
471 | 163 #undef PAVGB |
445
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
164 /***********************************/ |
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
165 /* MMX rounding */ |
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 #define DEF(x, y) x ## _ ## y ##_mmx |
448 | 168 #define SET_RND MOVQ_WTWO |
2979 | 169 #define PAVGBP(a, b, c, d, e, f) PAVGBP_MMX(a, b, c, d, e, f) |
170 #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
|
171 |
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
172 #include "dsputil_mmx_rnd.h" |
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
173 |
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
174 #undef DEF |
448 | 175 #undef SET_RND |
446
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
176 #undef PAVGBP |
471 | 177 #undef PAVGB |
387 | 178 |
0 | 179 /***********************************/ |
180 /* 3Dnow specific */ | |
181 | |
182 #define DEF(x) x ## _3dnow | |
183 #define PAVGB "pavgusb" | |
184 | |
185 #include "dsputil_mmx_avg.h" | |
186 | |
187 #undef DEF | |
188 #undef PAVGB | |
189 | |
190 /***********************************/ | |
191 /* MMX2 specific */ | |
192 | |
386 | 193 #define DEF(x) x ## _mmx2 |
0 | 194 |
195 /* Introduced only in MMX2 set */ | |
196 #define PAVGB "pavgb" | |
197 | |
198 #include "dsputil_mmx_avg.h" | |
199 | |
200 #undef DEF | |
201 #undef PAVGB | |
202 | |
6327 | 203 #define put_no_rnd_pixels16_mmx put_pixels16_mmx |
204 #define put_no_rnd_pixels8_mmx put_pixels8_mmx | |
6321 | 205 #define put_pixels16_mmx2 put_pixels16_mmx |
206 #define put_pixels8_mmx2 put_pixels8_mmx | |
207 #define put_pixels4_mmx2 put_pixels4_mmx | |
208 #define put_no_rnd_pixels16_mmx2 put_no_rnd_pixels16_mmx | |
209 #define put_no_rnd_pixels8_mmx2 put_no_rnd_pixels8_mmx | |
210 #define put_pixels16_3dnow put_pixels16_mmx | |
211 #define put_pixels8_3dnow put_pixels8_mmx | |
212 #define put_pixels4_3dnow put_pixels4_mmx | |
213 #define put_no_rnd_pixels16_3dnow put_no_rnd_pixels16_mmx | |
214 #define put_no_rnd_pixels8_3dnow put_no_rnd_pixels8_mmx | |
215 | |
0 | 216 /***********************************/ |
217 /* standard MMX */ | |
218 | |
1064 | 219 void put_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size) |
0 | 220 { |
221 const DCTELEM *p; | |
1064 | 222 uint8_t *pix; |
0 | 223 |
224 /* read the pixels */ | |
225 p = block; | |
226 pix = pixels; | |
247
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
227 /* unrolled loop */ |
6391
3dc36ec2dcad
__asm __volatile -> asm volatile, improves code consistency and works
reimar
parents:
6384
diff
changeset
|
228 asm volatile( |
2979 | 229 "movq %3, %%mm0 \n\t" |
230 "movq 8%3, %%mm1 \n\t" | |
231 "movq 16%3, %%mm2 \n\t" | |
232 "movq 24%3, %%mm3 \n\t" | |
233 "movq 32%3, %%mm4 \n\t" | |
234 "movq 40%3, %%mm5 \n\t" | |
235 "movq 48%3, %%mm6 \n\t" | |
236 "movq 56%3, %%mm7 \n\t" | |
237 "packuswb %%mm1, %%mm0 \n\t" | |
238 "packuswb %%mm3, %%mm2 \n\t" | |
239 "packuswb %%mm5, %%mm4 \n\t" | |
240 "packuswb %%mm7, %%mm6 \n\t" | |
241 "movq %%mm0, (%0) \n\t" | |
242 "movq %%mm2, (%0, %1) \n\t" | |
243 "movq %%mm4, (%0, %1, 2) \n\t" | |
244 "movq %%mm6, (%0, %2) \n\t" | |
245 ::"r" (pix), "r" ((long)line_size), "r" ((long)line_size*3), "m"(*p) | |
246 :"memory"); | |
0 | 247 pix += line_size*4; |
248 p += 32; | |
247
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
249 |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
250 // 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
|
251 // compiler would generate some very strange code |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
252 // thus using "r" |
6391
3dc36ec2dcad
__asm __volatile -> asm volatile, improves code consistency and works
reimar
parents:
6384
diff
changeset
|
253 asm volatile( |
2979 | 254 "movq (%3), %%mm0 \n\t" |
255 "movq 8(%3), %%mm1 \n\t" | |
256 "movq 16(%3), %%mm2 \n\t" | |
257 "movq 24(%3), %%mm3 \n\t" | |
258 "movq 32(%3), %%mm4 \n\t" | |
259 "movq 40(%3), %%mm5 \n\t" | |
260 "movq 48(%3), %%mm6 \n\t" | |
261 "movq 56(%3), %%mm7 \n\t" | |
262 "packuswb %%mm1, %%mm0 \n\t" | |
263 "packuswb %%mm3, %%mm2 \n\t" | |
264 "packuswb %%mm5, %%mm4 \n\t" | |
265 "packuswb %%mm7, %%mm6 \n\t" | |
266 "movq %%mm0, (%0) \n\t" | |
267 "movq %%mm2, (%0, %1) \n\t" | |
268 "movq %%mm4, (%0, %1, 2) \n\t" | |
269 "movq %%mm6, (%0, %2) \n\t" | |
270 ::"r" (pix), "r" ((long)line_size), "r" ((long)line_size*3), "r"(p) | |
271 :"memory"); | |
0 | 272 } |
273 | |
3089 | 274 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
|
275 { 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
|
276 |
1984
ef919e9ef73e
separate out put_signed_pixels_clamped() into its own function and
melanson
parents:
1977
diff
changeset
|
277 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
|
278 { |
ef919e9ef73e
separate out put_signed_pixels_clamped() into its own function and
melanson
parents:
1977
diff
changeset
|
279 int i; |
ef919e9ef73e
separate out put_signed_pixels_clamped() into its own function and
melanson
parents:
1977
diff
changeset
|
280 |
ef919e9ef73e
separate out put_signed_pixels_clamped() into its own function and
melanson
parents:
1977
diff
changeset
|
281 movq_m2r(*vector128, mm1); |
ef919e9ef73e
separate out put_signed_pixels_clamped() into its own function and
melanson
parents:
1977
diff
changeset
|
282 for (i = 0; i < 8; i++) { |
ef919e9ef73e
separate out put_signed_pixels_clamped() into its own function and
melanson
parents:
1977
diff
changeset
|
283 movq_m2r(*(block), mm0); |
ef919e9ef73e
separate out put_signed_pixels_clamped() into its own function and
melanson
parents:
1977
diff
changeset
|
284 packsswb_m2r(*(block + 4), mm0); |
ef919e9ef73e
separate out put_signed_pixels_clamped() into its own function and
melanson
parents:
1977
diff
changeset
|
285 block += 8; |
ef919e9ef73e
separate out put_signed_pixels_clamped() into its own function and
melanson
parents:
1977
diff
changeset
|
286 paddb_r2r(mm1, mm0); |
ef919e9ef73e
separate out put_signed_pixels_clamped() into its own function and
melanson
parents:
1977
diff
changeset
|
287 movq_r2m(mm0, *pixels); |
ef919e9ef73e
separate out put_signed_pixels_clamped() into its own function and
melanson
parents:
1977
diff
changeset
|
288 pixels += line_size; |
ef919e9ef73e
separate out put_signed_pixels_clamped() into its own function and
melanson
parents:
1977
diff
changeset
|
289 } |
ef919e9ef73e
separate out put_signed_pixels_clamped() into its own function and
melanson
parents:
1977
diff
changeset
|
290 } |
ef919e9ef73e
separate out put_signed_pixels_clamped() into its own function and
melanson
parents:
1977
diff
changeset
|
291 |
1064 | 292 void add_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size) |
0 | 293 { |
294 const DCTELEM *p; | |
1064 | 295 uint8_t *pix; |
0 | 296 int i; |
297 | |
298 /* read the pixels */ | |
299 p = block; | |
300 pix = pixels; | |
247
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
301 MOVQ_ZERO(mm7); |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
302 i = 4; |
342
8635a7036395
* fixes problem with -funroll-loops and buggy gcc compiler
kabi
parents:
324
diff
changeset
|
303 do { |
6391
3dc36ec2dcad
__asm __volatile -> asm volatile, improves code consistency and works
reimar
parents:
6384
diff
changeset
|
304 asm volatile( |
2979 | 305 "movq (%2), %%mm0 \n\t" |
306 "movq 8(%2), %%mm1 \n\t" | |
307 "movq 16(%2), %%mm2 \n\t" | |
308 "movq 24(%2), %%mm3 \n\t" | |
309 "movq %0, %%mm4 \n\t" | |
310 "movq %1, %%mm6 \n\t" | |
311 "movq %%mm4, %%mm5 \n\t" | |
312 "punpcklbw %%mm7, %%mm4 \n\t" | |
313 "punpckhbw %%mm7, %%mm5 \n\t" | |
314 "paddsw %%mm4, %%mm0 \n\t" | |
315 "paddsw %%mm5, %%mm1 \n\t" | |
316 "movq %%mm6, %%mm5 \n\t" | |
317 "punpcklbw %%mm7, %%mm6 \n\t" | |
318 "punpckhbw %%mm7, %%mm5 \n\t" | |
319 "paddsw %%mm6, %%mm2 \n\t" | |
320 "paddsw %%mm5, %%mm3 \n\t" | |
321 "packuswb %%mm1, %%mm0 \n\t" | |
322 "packuswb %%mm3, %%mm2 \n\t" | |
323 "movq %%mm0, %0 \n\t" | |
324 "movq %%mm2, %1 \n\t" | |
325 :"+m"(*pix), "+m"(*(pix+line_size)) | |
326 :"r"(p) | |
327 :"memory"); | |
0 | 328 pix += line_size*2; |
329 p += 16; | |
342
8635a7036395
* fixes problem with -funroll-loops and buggy gcc compiler
kabi
parents:
324
diff
changeset
|
330 } while (--i); |
0 | 331 } |
332 | |
2209 | 333 static void put_pixels4_mmx(uint8_t *block, const uint8_t *pixels, int line_size, int h) |
334 { | |
6391
3dc36ec2dcad
__asm __volatile -> asm volatile, improves code consistency and works
reimar
parents:
6384
diff
changeset
|
335 asm volatile( |
2979 | 336 "lea (%3, %3), %%"REG_a" \n\t" |
3576
f7125bf10892
Support for MacIntel, last part: balign directives
gpoirier
parents:
3574
diff
changeset
|
337 ASMALIGN(3) |
2979 | 338 "1: \n\t" |
339 "movd (%1), %%mm0 \n\t" | |
340 "movd (%1, %3), %%mm1 \n\t" | |
341 "movd %%mm0, (%2) \n\t" | |
342 "movd %%mm1, (%2, %3) \n\t" | |
343 "add %%"REG_a", %1 \n\t" | |
344 "add %%"REG_a", %2 \n\t" | |
345 "movd (%1), %%mm0 \n\t" | |
346 "movd (%1, %3), %%mm1 \n\t" | |
347 "movd %%mm0, (%2) \n\t" | |
348 "movd %%mm1, (%2, %3) \n\t" | |
349 "add %%"REG_a", %1 \n\t" | |
350 "add %%"REG_a", %2 \n\t" | |
351 "subl $4, %0 \n\t" | |
352 "jnz 1b \n\t" | |
353 : "+g"(h), "+r" (pixels), "+r" (block) | |
354 : "r"((long)line_size) | |
355 : "%"REG_a, "memory" | |
356 ); | |
2209 | 357 } |
358 | |
1064 | 359 static void put_pixels8_mmx(uint8_t *block, const uint8_t *pixels, int line_size, int h) |
0 | 360 { |
6391
3dc36ec2dcad
__asm __volatile -> asm volatile, improves code consistency and works
reimar
parents:
6384
diff
changeset
|
361 asm volatile( |
2979 | 362 "lea (%3, %3), %%"REG_a" \n\t" |
3576
f7125bf10892
Support for MacIntel, last part: balign directives
gpoirier
parents:
3574
diff
changeset
|
363 ASMALIGN(3) |
2979 | 364 "1: \n\t" |
365 "movq (%1), %%mm0 \n\t" | |
366 "movq (%1, %3), %%mm1 \n\t" | |
367 "movq %%mm0, (%2) \n\t" | |
368 "movq %%mm1, (%2, %3) \n\t" | |
369 "add %%"REG_a", %1 \n\t" | |
370 "add %%"REG_a", %2 \n\t" | |
371 "movq (%1), %%mm0 \n\t" | |
372 "movq (%1, %3), %%mm1 \n\t" | |
373 "movq %%mm0, (%2) \n\t" | |
374 "movq %%mm1, (%2, %3) \n\t" | |
375 "add %%"REG_a", %1 \n\t" | |
376 "add %%"REG_a", %2 \n\t" | |
377 "subl $4, %0 \n\t" | |
378 "jnz 1b \n\t" | |
379 : "+g"(h), "+r" (pixels), "+r" (block) | |
380 : "r"((long)line_size) | |
381 : "%"REG_a, "memory" | |
382 ); | |
0 | 383 } |
384 | |
1064 | 385 static void put_pixels16_mmx(uint8_t *block, const uint8_t *pixels, int line_size, int h) |
651 | 386 { |
6391
3dc36ec2dcad
__asm __volatile -> asm volatile, improves code consistency and works
reimar
parents:
6384
diff
changeset
|
387 asm volatile( |
2979 | 388 "lea (%3, %3), %%"REG_a" \n\t" |
3576
f7125bf10892
Support for MacIntel, last part: balign directives
gpoirier
parents:
3574
diff
changeset
|
389 ASMALIGN(3) |
2979 | 390 "1: \n\t" |
391 "movq (%1), %%mm0 \n\t" | |
392 "movq 8(%1), %%mm4 \n\t" | |
393 "movq (%1, %3), %%mm1 \n\t" | |
394 "movq 8(%1, %3), %%mm5 \n\t" | |
395 "movq %%mm0, (%2) \n\t" | |
396 "movq %%mm4, 8(%2) \n\t" | |
397 "movq %%mm1, (%2, %3) \n\t" | |
398 "movq %%mm5, 8(%2, %3) \n\t" | |
399 "add %%"REG_a", %1 \n\t" | |
400 "add %%"REG_a", %2 \n\t" | |
401 "movq (%1), %%mm0 \n\t" | |
402 "movq 8(%1), %%mm4 \n\t" | |
403 "movq (%1, %3), %%mm1 \n\t" | |
404 "movq 8(%1, %3), %%mm5 \n\t" | |
405 "movq %%mm0, (%2) \n\t" | |
406 "movq %%mm4, 8(%2) \n\t" | |
407 "movq %%mm1, (%2, %3) \n\t" | |
408 "movq %%mm5, 8(%2, %3) \n\t" | |
409 "add %%"REG_a", %1 \n\t" | |
410 "add %%"REG_a", %2 \n\t" | |
411 "subl $4, %0 \n\t" | |
412 "jnz 1b \n\t" | |
413 : "+g"(h), "+r" (pixels), "+r" (block) | |
414 : "r"((long)line_size) | |
415 : "%"REG_a, "memory" | |
416 ); | |
651 | 417 } |
418 | |
6331 | 419 static void put_pixels16_sse2(uint8_t *block, const uint8_t *pixels, int line_size, int h) |
420 { | |
6391
3dc36ec2dcad
__asm __volatile -> asm volatile, improves code consistency and works
reimar
parents:
6384
diff
changeset
|
421 asm volatile( |
6331 | 422 "1: \n\t" |
423 "movdqu (%1), %%xmm0 \n\t" | |
424 "movdqu (%1,%3), %%xmm1 \n\t" | |
425 "movdqu (%1,%3,2), %%xmm2 \n\t" | |
426 "movdqu (%1,%4), %%xmm3 \n\t" | |
427 "movdqa %%xmm0, (%2) \n\t" | |
428 "movdqa %%xmm1, (%2,%3) \n\t" | |
429 "movdqa %%xmm2, (%2,%3,2) \n\t" | |
430 "movdqa %%xmm3, (%2,%4) \n\t" | |
431 "subl $4, %0 \n\t" | |
432 "lea (%1,%3,4), %1 \n\t" | |
433 "lea (%2,%3,4), %2 \n\t" | |
434 "jnz 1b \n\t" | |
435 : "+g"(h), "+r" (pixels), "+r" (block) | |
436 : "r"((long)line_size), "r"(3L*line_size) | |
437 : "memory" | |
438 ); | |
439 } | |
440 | |
441 static void avg_pixels16_sse2(uint8_t *block, const uint8_t *pixels, int line_size, int h) | |
442 { | |
6391
3dc36ec2dcad
__asm __volatile -> asm volatile, improves code consistency and works
reimar
parents:
6384
diff
changeset
|
443 asm volatile( |
6331 | 444 "1: \n\t" |
445 "movdqu (%1), %%xmm0 \n\t" | |
446 "movdqu (%1,%3), %%xmm1 \n\t" | |
447 "movdqu (%1,%3,2), %%xmm2 \n\t" | |
448 "movdqu (%1,%4), %%xmm3 \n\t" | |
449 "pavgb (%2), %%xmm0 \n\t" | |
450 "pavgb (%2,%3), %%xmm1 \n\t" | |
451 "pavgb (%2,%3,2), %%xmm2 \n\t" | |
452 "pavgb (%2,%4), %%xmm3 \n\t" | |
453 "movdqa %%xmm0, (%2) \n\t" | |
454 "movdqa %%xmm1, (%2,%3) \n\t" | |
455 "movdqa %%xmm2, (%2,%3,2) \n\t" | |
456 "movdqa %%xmm3, (%2,%4) \n\t" | |
457 "subl $4, %0 \n\t" | |
458 "lea (%1,%3,4), %1 \n\t" | |
459 "lea (%2,%3,4), %2 \n\t" | |
460 "jnz 1b \n\t" | |
461 : "+g"(h), "+r" (pixels), "+r" (block) | |
462 : "r"((long)line_size), "r"(3L*line_size) | |
463 : "memory" | |
464 ); | |
465 } | |
466 | |
296 | 467 static void clear_blocks_mmx(DCTELEM *blocks) |
468 { | |
6391
3dc36ec2dcad
__asm __volatile -> asm volatile, improves code consistency and works
reimar
parents:
6384
diff
changeset
|
469 asm volatile( |
2979 | 470 "pxor %%mm7, %%mm7 \n\t" |
471 "mov $-128*6, %%"REG_a" \n\t" | |
472 "1: \n\t" | |
473 "movq %%mm7, (%0, %%"REG_a") \n\t" | |
474 "movq %%mm7, 8(%0, %%"REG_a") \n\t" | |
475 "movq %%mm7, 16(%0, %%"REG_a") \n\t" | |
476 "movq %%mm7, 24(%0, %%"REG_a") \n\t" | |
477 "add $32, %%"REG_a" \n\t" | |
478 " 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
|
479 : : "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
|
480 : "%"REG_a |
296 | 481 ); |
482 } | |
483 | |
866 | 484 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
|
485 long i=0; |
866 | 486 asm volatile( |
2979 | 487 "1: \n\t" |
488 "movq (%1, %0), %%mm0 \n\t" | |
489 "movq (%2, %0), %%mm1 \n\t" | |
490 "paddb %%mm0, %%mm1 \n\t" | |
491 "movq %%mm1, (%2, %0) \n\t" | |
492 "movq 8(%1, %0), %%mm0 \n\t" | |
493 "movq 8(%2, %0), %%mm1 \n\t" | |
494 "paddb %%mm0, %%mm1 \n\t" | |
495 "movq %%mm1, 8(%2, %0) \n\t" | |
496 "add $16, %0 \n\t" | |
497 "cmp %3, %0 \n\t" | |
498 " jb 1b \n\t" | |
866 | 499 : "+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
|
500 : "r"(src), "r"(dst), "r"((long)w-15) |
866 | 501 ); |
502 for(; i<w; i++) | |
503 dst[i+0] += src[i+0]; | |
504 } | |
505 | |
6384 | 506 static void add_bytes_l2_mmx(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w){ |
507 long i=0; | |
508 asm volatile( | |
509 "1: \n\t" | |
510 "movq (%2, %0), %%mm0 \n\t" | |
511 "movq 8(%2, %0), %%mm1 \n\t" | |
512 "paddb (%3, %0), %%mm0 \n\t" | |
513 "paddb 8(%3, %0), %%mm1 \n\t" | |
514 "movq %%mm0, (%1, %0) \n\t" | |
515 "movq %%mm1, 8(%1, %0) \n\t" | |
516 "add $16, %0 \n\t" | |
517 "cmp %4, %0 \n\t" | |
518 " jb 1b \n\t" | |
519 : "+r" (i) | |
520 : "r"(dst), "r"(src1), "r"(src2), "r"((long)w-15) | |
521 ); | |
522 for(; i<w; i++) | |
523 dst[i] = src1[i] + src2[i]; | |
524 } | |
525 | |
1648 | 526 #define H263_LOOP_FILTER \ |
2979 | 527 "pxor %%mm7, %%mm7 \n\t"\ |
528 "movq %0, %%mm0 \n\t"\ | |
529 "movq %0, %%mm1 \n\t"\ | |
530 "movq %3, %%mm2 \n\t"\ | |
531 "movq %3, %%mm3 \n\t"\ | |
532 "punpcklbw %%mm7, %%mm0 \n\t"\ | |
533 "punpckhbw %%mm7, %%mm1 \n\t"\ | |
534 "punpcklbw %%mm7, %%mm2 \n\t"\ | |
535 "punpckhbw %%mm7, %%mm3 \n\t"\ | |
536 "psubw %%mm2, %%mm0 \n\t"\ | |
537 "psubw %%mm3, %%mm1 \n\t"\ | |
538 "movq %1, %%mm2 \n\t"\ | |
539 "movq %1, %%mm3 \n\t"\ | |
540 "movq %2, %%mm4 \n\t"\ | |
541 "movq %2, %%mm5 \n\t"\ | |
542 "punpcklbw %%mm7, %%mm2 \n\t"\ | |
543 "punpckhbw %%mm7, %%mm3 \n\t"\ | |
544 "punpcklbw %%mm7, %%mm4 \n\t"\ | |
545 "punpckhbw %%mm7, %%mm5 \n\t"\ | |
546 "psubw %%mm2, %%mm4 \n\t"\ | |
547 "psubw %%mm3, %%mm5 \n\t"\ | |
548 "psllw $2, %%mm4 \n\t"\ | |
549 "psllw $2, %%mm5 \n\t"\ | |
550 "paddw %%mm0, %%mm4 \n\t"\ | |
551 "paddw %%mm1, %%mm5 \n\t"\ | |
552 "pxor %%mm6, %%mm6 \n\t"\ | |
553 "pcmpgtw %%mm4, %%mm6 \n\t"\ | |
554 "pcmpgtw %%mm5, %%mm7 \n\t"\ | |
555 "pxor %%mm6, %%mm4 \n\t"\ | |
556 "pxor %%mm7, %%mm5 \n\t"\ | |
557 "psubw %%mm6, %%mm4 \n\t"\ | |
558 "psubw %%mm7, %%mm5 \n\t"\ | |
559 "psrlw $3, %%mm4 \n\t"\ | |
560 "psrlw $3, %%mm5 \n\t"\ | |
561 "packuswb %%mm5, %%mm4 \n\t"\ | |
562 "packsswb %%mm7, %%mm6 \n\t"\ | |
563 "pxor %%mm7, %%mm7 \n\t"\ | |
564 "movd %4, %%mm2 \n\t"\ | |
565 "punpcklbw %%mm2, %%mm2 \n\t"\ | |
566 "punpcklbw %%mm2, %%mm2 \n\t"\ | |
567 "punpcklbw %%mm2, %%mm2 \n\t"\ | |
568 "psubusb %%mm4, %%mm2 \n\t"\ | |
569 "movq %%mm2, %%mm3 \n\t"\ | |
570 "psubusb %%mm4, %%mm3 \n\t"\ | |
571 "psubb %%mm3, %%mm2 \n\t"\ | |
572 "movq %1, %%mm3 \n\t"\ | |
573 "movq %2, %%mm4 \n\t"\ | |
574 "pxor %%mm6, %%mm3 \n\t"\ | |
575 "pxor %%mm6, %%mm4 \n\t"\ | |
576 "paddusb %%mm2, %%mm3 \n\t"\ | |
577 "psubusb %%mm2, %%mm4 \n\t"\ | |
578 "pxor %%mm6, %%mm3 \n\t"\ | |
579 "pxor %%mm6, %%mm4 \n\t"\ | |
580 "paddusb %%mm2, %%mm2 \n\t"\ | |
581 "packsswb %%mm1, %%mm0 \n\t"\ | |
582 "pcmpgtb %%mm0, %%mm7 \n\t"\ | |
583 "pxor %%mm7, %%mm0 \n\t"\ | |
584 "psubb %%mm7, %%mm0 \n\t"\ | |
585 "movq %%mm0, %%mm1 \n\t"\ | |
586 "psubusb %%mm2, %%mm0 \n\t"\ | |
587 "psubb %%mm0, %%mm1 \n\t"\ | |
588 "pand %5, %%mm1 \n\t"\ | |
589 "psrlw $2, %%mm1 \n\t"\ | |
590 "pxor %%mm7, %%mm1 \n\t"\ | |
591 "psubb %%mm7, %%mm1 \n\t"\ | |
592 "movq %0, %%mm5 \n\t"\ | |
593 "movq %3, %%mm6 \n\t"\ | |
594 "psubb %%mm1, %%mm5 \n\t"\ | |
595 "paddb %%mm1, %%mm6 \n\t" | |
1648 | 596 |
1647 | 597 static void h263_v_loop_filter_mmx(uint8_t *src, int stride, int qscale){ |
5394
e9a6215f4e3a
help some gcc version to optimize out those functions
aurel
parents:
5278
diff
changeset
|
598 if(ENABLE_ANY_H263) { |
1647 | 599 const int strength= ff_h263_loop_filter_strength[qscale]; |
600 | |
601 asm volatile( | |
2967 | 602 |
1648 | 603 H263_LOOP_FILTER |
2967 | 604 |
2979 | 605 "movq %%mm3, %1 \n\t" |
606 "movq %%mm4, %2 \n\t" | |
607 "movq %%mm5, %0 \n\t" | |
608 "movq %%mm6, %3 \n\t" | |
1647 | 609 : "+m" (*(uint64_t*)(src - 2*stride)), |
610 "+m" (*(uint64_t*)(src - 1*stride)), | |
611 "+m" (*(uint64_t*)(src + 0*stride)), | |
612 "+m" (*(uint64_t*)(src + 1*stride)) | |
613 : "g" (2*strength), "m"(ff_pb_FC) | |
614 ); | |
5394
e9a6215f4e3a
help some gcc version to optimize out those functions
aurel
parents:
5278
diff
changeset
|
615 } |
1647 | 616 } |
617 | |
1648 | 618 static inline void transpose4x4(uint8_t *dst, uint8_t *src, int dst_stride, int src_stride){ |
619 asm volatile( //FIXME could save 1 instruction if done as 8x4 ... | |
2979 | 620 "movd %4, %%mm0 \n\t" |
621 "movd %5, %%mm1 \n\t" | |
622 "movd %6, %%mm2 \n\t" | |
623 "movd %7, %%mm3 \n\t" | |
624 "punpcklbw %%mm1, %%mm0 \n\t" | |
625 "punpcklbw %%mm3, %%mm2 \n\t" | |
626 "movq %%mm0, %%mm1 \n\t" | |
627 "punpcklwd %%mm2, %%mm0 \n\t" | |
628 "punpckhwd %%mm2, %%mm1 \n\t" | |
629 "movd %%mm0, %0 \n\t" | |
630 "punpckhdq %%mm0, %%mm0 \n\t" | |
631 "movd %%mm0, %1 \n\t" | |
632 "movd %%mm1, %2 \n\t" | |
633 "punpckhdq %%mm1, %%mm1 \n\t" | |
634 "movd %%mm1, %3 \n\t" | |
2967 | 635 |
1648 | 636 : "=m" (*(uint32_t*)(dst + 0*dst_stride)), |
637 "=m" (*(uint32_t*)(dst + 1*dst_stride)), | |
638 "=m" (*(uint32_t*)(dst + 2*dst_stride)), | |
639 "=m" (*(uint32_t*)(dst + 3*dst_stride)) | |
640 : "m" (*(uint32_t*)(src + 0*src_stride)), | |
641 "m" (*(uint32_t*)(src + 1*src_stride)), | |
642 "m" (*(uint32_t*)(src + 2*src_stride)), | |
643 "m" (*(uint32_t*)(src + 3*src_stride)) | |
644 ); | |
645 } | |
646 | |
647 static void h263_h_loop_filter_mmx(uint8_t *src, int stride, int qscale){ | |
5394
e9a6215f4e3a
help some gcc version to optimize out those functions
aurel
parents:
5278
diff
changeset
|
648 if(ENABLE_ANY_H263) { |
1648 | 649 const int strength= ff_h263_loop_filter_strength[qscale]; |
6181 | 650 DECLARE_ALIGNED(8, uint64_t, temp[4]); |
1648 | 651 uint8_t *btemp= (uint8_t*)temp; |
2967 | 652 |
1648 | 653 src -= 2; |
654 | |
655 transpose4x4(btemp , src , 8, stride); | |
656 transpose4x4(btemp+4, src + 4*stride, 8, stride); | |
657 asm volatile( | |
658 H263_LOOP_FILTER // 5 3 4 6 | |
2967 | 659 |
1648 | 660 : "+m" (temp[0]), |
661 "+m" (temp[1]), | |
662 "+m" (temp[2]), | |
663 "+m" (temp[3]) | |
664 : "g" (2*strength), "m"(ff_pb_FC) | |
665 ); | |
666 | |
667 asm volatile( | |
2979 | 668 "movq %%mm5, %%mm1 \n\t" |
669 "movq %%mm4, %%mm0 \n\t" | |
670 "punpcklbw %%mm3, %%mm5 \n\t" | |
671 "punpcklbw %%mm6, %%mm4 \n\t" | |
672 "punpckhbw %%mm3, %%mm1 \n\t" | |
673 "punpckhbw %%mm6, %%mm0 \n\t" | |
674 "movq %%mm5, %%mm3 \n\t" | |
675 "movq %%mm1, %%mm6 \n\t" | |
676 "punpcklwd %%mm4, %%mm5 \n\t" | |
677 "punpcklwd %%mm0, %%mm1 \n\t" | |
678 "punpckhwd %%mm4, %%mm3 \n\t" | |
679 "punpckhwd %%mm0, %%mm6 \n\t" | |
680 "movd %%mm5, (%0) \n\t" | |
681 "punpckhdq %%mm5, %%mm5 \n\t" | |
682 "movd %%mm5, (%0,%2) \n\t" | |
683 "movd %%mm3, (%0,%2,2) \n\t" | |
684 "punpckhdq %%mm3, %%mm3 \n\t" | |
685 "movd %%mm3, (%0,%3) \n\t" | |
686 "movd %%mm1, (%1) \n\t" | |
687 "punpckhdq %%mm1, %%mm1 \n\t" | |
688 "movd %%mm1, (%1,%2) \n\t" | |
689 "movd %%mm6, (%1,%2,2) \n\t" | |
690 "punpckhdq %%mm6, %%mm6 \n\t" | |
691 "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
|
692 :: "r" (src), |
86e2b1424801
optimization and gcc 4.0 bug workaround patch by (Martin Drab >drab kepler.fjfi.cvut cz<)
michael
parents:
2293
diff
changeset
|
693 "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
|
694 "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
|
695 "r" ((long)(3*stride)) |
1648 | 696 ); |
5394
e9a6215f4e3a
help some gcc version to optimize out those functions
aurel
parents:
5278
diff
changeset
|
697 } |
1648 | 698 } |
699 | |
6437 | 700 /* draw the edges of width 'w' of an image of size width, height |
701 this mmx version can only handle w==8 || w==16 */ | |
702 static void draw_edges_mmx(uint8_t *buf, int wrap, int width, int height, int w) | |
703 { | |
704 uint8_t *ptr, *last_line; | |
705 int i; | |
706 | |
707 last_line = buf + (height - 1) * wrap; | |
708 /* left and right */ | |
709 ptr = buf; | |
710 if(w==8) | |
711 { | |
712 asm volatile( | |
713 "1: \n\t" | |
714 "movd (%0), %%mm0 \n\t" | |
715 "punpcklbw %%mm0, %%mm0 \n\t" | |
716 "punpcklwd %%mm0, %%mm0 \n\t" | |
717 "punpckldq %%mm0, %%mm0 \n\t" | |
718 "movq %%mm0, -8(%0) \n\t" | |
719 "movq -8(%0, %2), %%mm1 \n\t" | |
720 "punpckhbw %%mm1, %%mm1 \n\t" | |
721 "punpckhwd %%mm1, %%mm1 \n\t" | |
722 "punpckhdq %%mm1, %%mm1 \n\t" | |
723 "movq %%mm1, (%0, %2) \n\t" | |
724 "add %1, %0 \n\t" | |
725 "cmp %3, %0 \n\t" | |
726 " jb 1b \n\t" | |
727 : "+r" (ptr) | |
728 : "r" ((long)wrap), "r" ((long)width), "r" (ptr + wrap*height) | |
729 ); | |
730 } | |
731 else | |
732 { | |
733 asm volatile( | |
734 "1: \n\t" | |
735 "movd (%0), %%mm0 \n\t" | |
736 "punpcklbw %%mm0, %%mm0 \n\t" | |
737 "punpcklwd %%mm0, %%mm0 \n\t" | |
738 "punpckldq %%mm0, %%mm0 \n\t" | |
739 "movq %%mm0, -8(%0) \n\t" | |
740 "movq %%mm0, -16(%0) \n\t" | |
741 "movq -8(%0, %2), %%mm1 \n\t" | |
742 "punpckhbw %%mm1, %%mm1 \n\t" | |
743 "punpckhwd %%mm1, %%mm1 \n\t" | |
744 "punpckhdq %%mm1, %%mm1 \n\t" | |
745 "movq %%mm1, (%0, %2) \n\t" | |
746 "movq %%mm1, 8(%0, %2) \n\t" | |
747 "add %1, %0 \n\t" | |
748 "cmp %3, %0 \n\t" | |
749 " jb 1b \n\t" | |
750 : "+r" (ptr) | |
751 : "r" ((long)wrap), "r" ((long)width), "r" (ptr + wrap*height) | |
752 ); | |
753 } | |
754 | |
755 for(i=0;i<w;i+=4) { | |
756 /* top and bottom (and hopefully also the corners) */ | |
757 ptr= buf - (i + 1) * wrap - w; | |
758 asm volatile( | |
759 "1: \n\t" | |
760 "movq (%1, %0), %%mm0 \n\t" | |
761 "movq %%mm0, (%0) \n\t" | |
762 "movq %%mm0, (%0, %2) \n\t" | |
763 "movq %%mm0, (%0, %2, 2) \n\t" | |
764 "movq %%mm0, (%0, %3) \n\t" | |
765 "add $8, %0 \n\t" | |
766 "cmp %4, %0 \n\t" | |
767 " jb 1b \n\t" | |
768 : "+r" (ptr) | |
769 : "r" ((long)buf - (long)ptr - w), "r" ((long)-wrap), "r" ((long)-wrap*3), "r" (ptr+width+2*w) | |
770 ); | |
771 ptr= last_line + (i + 1) * wrap - w; | |
772 asm volatile( | |
773 "1: \n\t" | |
774 "movq (%1, %0), %%mm0 \n\t" | |
775 "movq %%mm0, (%0) \n\t" | |
776 "movq %%mm0, (%0, %2) \n\t" | |
777 "movq %%mm0, (%0, %2, 2) \n\t" | |
778 "movq %%mm0, (%0, %3) \n\t" | |
779 "add $8, %0 \n\t" | |
780 "cmp %4, %0 \n\t" | |
781 " jb 1b \n\t" | |
782 : "+r" (ptr) | |
783 : "r" ((long)last_line - (long)ptr - w), "r" ((long)wrap), "r" ((long)wrap*3), "r" (ptr+width+2*w) | |
784 ); | |
785 } | |
786 } | |
787 | |
6384 | 788 #define PAETH(cpu, abs3)\ |
789 void add_png_paeth_prediction_##cpu(uint8_t *dst, uint8_t *src, uint8_t *top, int w, int bpp)\ | |
790 {\ | |
791 long i = -bpp;\ | |
792 long end = w-3;\ | |
793 asm volatile(\ | |
794 "pxor %%mm7, %%mm7 \n"\ | |
795 "movd (%1,%0), %%mm0 \n"\ | |
796 "movd (%2,%0), %%mm1 \n"\ | |
797 "punpcklbw %%mm7, %%mm0 \n"\ | |
798 "punpcklbw %%mm7, %%mm1 \n"\ | |
799 "add %4, %0 \n"\ | |
800 "1: \n"\ | |
801 "movq %%mm1, %%mm2 \n"\ | |
802 "movd (%2,%0), %%mm1 \n"\ | |
803 "movq %%mm2, %%mm3 \n"\ | |
804 "punpcklbw %%mm7, %%mm1 \n"\ | |
805 "movq %%mm2, %%mm4 \n"\ | |
806 "psubw %%mm1, %%mm3 \n"\ | |
807 "psubw %%mm0, %%mm4 \n"\ | |
808 "movq %%mm3, %%mm5 \n"\ | |
809 "paddw %%mm4, %%mm5 \n"\ | |
810 abs3\ | |
811 "movq %%mm4, %%mm6 \n"\ | |
812 "pminsw %%mm5, %%mm6 \n"\ | |
813 "pcmpgtw %%mm6, %%mm3 \n"\ | |
814 "pcmpgtw %%mm5, %%mm4 \n"\ | |
815 "movq %%mm4, %%mm6 \n"\ | |
816 "pand %%mm3, %%mm4 \n"\ | |
817 "pandn %%mm3, %%mm6 \n"\ | |
818 "pandn %%mm0, %%mm3 \n"\ | |
819 "movd (%3,%0), %%mm0 \n"\ | |
820 "pand %%mm1, %%mm6 \n"\ | |
821 "pand %%mm4, %%mm2 \n"\ | |
822 "punpcklbw %%mm7, %%mm0 \n"\ | |
823 "movq %6, %%mm5 \n"\ | |
824 "paddw %%mm6, %%mm0 \n"\ | |
825 "paddw %%mm2, %%mm3 \n"\ | |
826 "paddw %%mm3, %%mm0 \n"\ | |
827 "pand %%mm5, %%mm0 \n"\ | |
828 "movq %%mm0, %%mm3 \n"\ | |
829 "packuswb %%mm3, %%mm3 \n"\ | |
830 "movd %%mm3, (%1,%0) \n"\ | |
831 "add %4, %0 \n"\ | |
832 "cmp %5, %0 \n"\ | |
833 "jle 1b \n"\ | |
834 :"+r"(i)\ | |
835 :"r"(dst), "r"(top), "r"(src), "r"((long)bpp), "g"(end),\ | |
836 "m"(ff_pw_255)\ | |
837 :"memory"\ | |
838 );\ | |
839 } | |
840 | |
841 #define ABS3_MMX2\ | |
842 "psubw %%mm5, %%mm7 \n"\ | |
843 "pmaxsw %%mm7, %%mm5 \n"\ | |
844 "pxor %%mm6, %%mm6 \n"\ | |
845 "pxor %%mm7, %%mm7 \n"\ | |
846 "psubw %%mm3, %%mm6 \n"\ | |
847 "psubw %%mm4, %%mm7 \n"\ | |
848 "pmaxsw %%mm6, %%mm3 \n"\ | |
849 "pmaxsw %%mm7, %%mm4 \n"\ | |
850 "pxor %%mm7, %%mm7 \n" | |
851 | |
852 #define ABS3_SSSE3\ | |
853 "pabsw %%mm3, %%mm3 \n"\ | |
854 "pabsw %%mm4, %%mm4 \n"\ | |
855 "pabsw %%mm5, %%mm5 \n" | |
856 | |
857 PAETH(mmx2, ABS3_MMX2) | |
858 #ifdef HAVE_SSSE3 | |
859 PAETH(ssse3, ABS3_SSSE3) | |
860 #endif | |
861 | |
954 | 862 #define QPEL_V_LOW(m3,m4,m5,m6, pw_20, pw_3, rnd, in0, in1, in2, in7, out, OP)\ |
2979 | 863 "paddw " #m4 ", " #m3 " \n\t" /* x1 */\ |
864 "movq "MANGLE(ff_pw_20)", %%mm4 \n\t" /* 20 */\ | |
865 "pmullw " #m3 ", %%mm4 \n\t" /* 20x1 */\ | |
866 "movq "#in7", " #m3 " \n\t" /* d */\ | |
867 "movq "#in0", %%mm5 \n\t" /* D */\ | |
868 "paddw " #m3 ", %%mm5 \n\t" /* x4 */\ | |
869 "psubw %%mm5, %%mm4 \n\t" /* 20x1 - x4 */\ | |
870 "movq "#in1", %%mm5 \n\t" /* C */\ | |
871 "movq "#in2", %%mm6 \n\t" /* B */\ | |
872 "paddw " #m6 ", %%mm5 \n\t" /* x3 */\ | |
873 "paddw " #m5 ", %%mm6 \n\t" /* x2 */\ | |
874 "paddw %%mm6, %%mm6 \n\t" /* 2x2 */\ | |
875 "psubw %%mm6, %%mm5 \n\t" /* -2x2 + x3 */\ | |
876 "pmullw "MANGLE(ff_pw_3)", %%mm5 \n\t" /* -6x2 + 3x3 */\ | |
877 "paddw " #rnd ", %%mm4 \n\t" /* x2 */\ | |
878 "paddw %%mm4, %%mm5 \n\t" /* 20x1 - 6x2 + 3x3 - x4 */\ | |
879 "psraw $5, %%mm5 \n\t"\ | |
880 "packuswb %%mm5, %%mm5 \n\t"\ | |
954 | 881 OP(%%mm5, out, %%mm7, d) |
882 | |
959 | 883 #define QPEL_BASE(OPNAME, ROUNDER, RND, OP_MMX2, OP_3DNOW)\ |
1057 | 884 static void OPNAME ## mpeg4_qpel16_h_lowpass_mmx2(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\ |
954 | 885 uint64_t temp;\ |
886 \ | |
887 asm volatile(\ | |
2979 | 888 "pxor %%mm7, %%mm7 \n\t"\ |
889 "1: \n\t"\ | |
890 "movq (%0), %%mm0 \n\t" /* ABCDEFGH */\ | |
891 "movq %%mm0, %%mm1 \n\t" /* ABCDEFGH */\ | |
892 "movq %%mm0, %%mm2 \n\t" /* ABCDEFGH */\ | |
893 "punpcklbw %%mm7, %%mm0 \n\t" /* 0A0B0C0D */\ | |
894 "punpckhbw %%mm7, %%mm1 \n\t" /* 0E0F0G0H */\ | |
895 "pshufw $0x90, %%mm0, %%mm5 \n\t" /* 0A0A0B0C */\ | |
896 "pshufw $0x41, %%mm0, %%mm6 \n\t" /* 0B0A0A0B */\ | |
897 "movq %%mm2, %%mm3 \n\t" /* ABCDEFGH */\ | |
898 "movq %%mm2, %%mm4 \n\t" /* ABCDEFGH */\ | |
899 "psllq $8, %%mm2 \n\t" /* 0ABCDEFG */\ | |
900 "psllq $16, %%mm3 \n\t" /* 00ABCDEF */\ | |
901 "psllq $24, %%mm4 \n\t" /* 000ABCDE */\ | |
902 "punpckhbw %%mm7, %%mm2 \n\t" /* 0D0E0F0G */\ | |
903 "punpckhbw %%mm7, %%mm3 \n\t" /* 0C0D0E0F */\ | |
904 "punpckhbw %%mm7, %%mm4 \n\t" /* 0B0C0D0E */\ | |
905 "paddw %%mm3, %%mm5 \n\t" /* b */\ | |
906 "paddw %%mm2, %%mm6 \n\t" /* c */\ | |
907 "paddw %%mm5, %%mm5 \n\t" /* 2b */\ | |
908 "psubw %%mm5, %%mm6 \n\t" /* c - 2b */\ | |
909 "pshufw $0x06, %%mm0, %%mm5 \n\t" /* 0C0B0A0A */\ | |
910 "pmullw "MANGLE(ff_pw_3)", %%mm6 \n\t" /* 3c - 6b */\ | |
911 "paddw %%mm4, %%mm0 \n\t" /* a */\ | |
912 "paddw %%mm1, %%mm5 \n\t" /* d */\ | |
913 "pmullw "MANGLE(ff_pw_20)", %%mm0 \n\t" /* 20a */\ | |
914 "psubw %%mm5, %%mm0 \n\t" /* 20a - d */\ | |
915 "paddw %6, %%mm6 \n\t"\ | |
916 "paddw %%mm6, %%mm0 \n\t" /* 20a - 6b + 3c - d */\ | |
917 "psraw $5, %%mm0 \n\t"\ | |
918 "movq %%mm0, %5 \n\t"\ | |
954 | 919 /* mm1=EFGH, mm2=DEFG, mm3=CDEF, mm4=BCDE, mm7=0 */\ |
920 \ | |
2979 | 921 "movq 5(%0), %%mm0 \n\t" /* FGHIJKLM */\ |
922 "movq %%mm0, %%mm5 \n\t" /* FGHIJKLM */\ | |
923 "movq %%mm0, %%mm6 \n\t" /* FGHIJKLM */\ | |
924 "psrlq $8, %%mm0 \n\t" /* GHIJKLM0 */\ | |
925 "psrlq $16, %%mm5 \n\t" /* HIJKLM00 */\ | |
926 "punpcklbw %%mm7, %%mm0 \n\t" /* 0G0H0I0J */\ | |
927 "punpcklbw %%mm7, %%mm5 \n\t" /* 0H0I0J0K */\ | |
928 "paddw %%mm0, %%mm2 \n\t" /* b */\ | |
929 "paddw %%mm5, %%mm3 \n\t" /* c */\ | |
930 "paddw %%mm2, %%mm2 \n\t" /* 2b */\ | |
931 "psubw %%mm2, %%mm3 \n\t" /* c - 2b */\ | |
932 "movq %%mm6, %%mm2 \n\t" /* FGHIJKLM */\ | |
933 "psrlq $24, %%mm6 \n\t" /* IJKLM000 */\ | |
934 "punpcklbw %%mm7, %%mm2 \n\t" /* 0F0G0H0I */\ | |
935 "punpcklbw %%mm7, %%mm6 \n\t" /* 0I0J0K0L */\ | |
936 "pmullw "MANGLE(ff_pw_3)", %%mm3 \n\t" /* 3c - 6b */\ | |
937 "paddw %%mm2, %%mm1 \n\t" /* a */\ | |
938 "paddw %%mm6, %%mm4 \n\t" /* d */\ | |
939 "pmullw "MANGLE(ff_pw_20)", %%mm1 \n\t" /* 20a */\ | |
940 "psubw %%mm4, %%mm3 \n\t" /* - 6b +3c - d */\ | |
941 "paddw %6, %%mm1 \n\t"\ | |
942 "paddw %%mm1, %%mm3 \n\t" /* 20a - 6b +3c - d */\ | |
943 "psraw $5, %%mm3 \n\t"\ | |
944 "movq %5, %%mm1 \n\t"\ | |
945 "packuswb %%mm3, %%mm1 \n\t"\ | |
959 | 946 OP_MMX2(%%mm1, (%1),%%mm4, q)\ |
954 | 947 /* mm0= GHIJ, mm2=FGHI, mm5=HIJK, mm6=IJKL, mm7=0 */\ |
948 \ | |
2979 | 949 "movq 9(%0), %%mm1 \n\t" /* JKLMNOPQ */\ |
950 "movq %%mm1, %%mm4 \n\t" /* JKLMNOPQ */\ | |
951 "movq %%mm1, %%mm3 \n\t" /* JKLMNOPQ */\ | |
952 "psrlq $8, %%mm1 \n\t" /* KLMNOPQ0 */\ | |
953 "psrlq $16, %%mm4 \n\t" /* LMNOPQ00 */\ | |
954 "punpcklbw %%mm7, %%mm1 \n\t" /* 0K0L0M0N */\ | |
955 "punpcklbw %%mm7, %%mm4 \n\t" /* 0L0M0N0O */\ | |
956 "paddw %%mm1, %%mm5 \n\t" /* b */\ | |
957 "paddw %%mm4, %%mm0 \n\t" /* c */\ | |
958 "paddw %%mm5, %%mm5 \n\t" /* 2b */\ | |
959 "psubw %%mm5, %%mm0 \n\t" /* c - 2b */\ | |
960 "movq %%mm3, %%mm5 \n\t" /* JKLMNOPQ */\ | |
961 "psrlq $24, %%mm3 \n\t" /* MNOPQ000 */\ | |
962 "pmullw "MANGLE(ff_pw_3)", %%mm0 \n\t" /* 3c - 6b */\ | |
963 "punpcklbw %%mm7, %%mm3 \n\t" /* 0M0N0O0P */\ | |
964 "paddw %%mm3, %%mm2 \n\t" /* d */\ | |
965 "psubw %%mm2, %%mm0 \n\t" /* -6b + 3c - d */\ | |
966 "movq %%mm5, %%mm2 \n\t" /* JKLMNOPQ */\ | |
967 "punpcklbw %%mm7, %%mm2 \n\t" /* 0J0K0L0M */\ | |
968 "punpckhbw %%mm7, %%mm5 \n\t" /* 0N0O0P0Q */\ | |
969 "paddw %%mm2, %%mm6 \n\t" /* a */\ | |
970 "pmullw "MANGLE(ff_pw_20)", %%mm6 \n\t" /* 20a */\ | |
971 "paddw %6, %%mm0 \n\t"\ | |
972 "paddw %%mm6, %%mm0 \n\t" /* 20a - 6b + 3c - d */\ | |
973 "psraw $5, %%mm0 \n\t"\ | |
954 | 974 /* mm1=KLMN, mm2=JKLM, mm3=MNOP, mm4=LMNO, mm5=NOPQ mm7=0 */\ |
975 \ | |
2979 | 976 "paddw %%mm5, %%mm3 \n\t" /* a */\ |
977 "pshufw $0xF9, %%mm5, %%mm6 \n\t" /* 0O0P0Q0Q */\ | |
978 "paddw %%mm4, %%mm6 \n\t" /* b */\ | |
979 "pshufw $0xBE, %%mm5, %%mm4 \n\t" /* 0P0Q0Q0P */\ | |
980 "pshufw $0x6F, %%mm5, %%mm5 \n\t" /* 0Q0Q0P0O */\ | |
981 "paddw %%mm1, %%mm4 \n\t" /* c */\ | |
982 "paddw %%mm2, %%mm5 \n\t" /* d */\ | |
983 "paddw %%mm6, %%mm6 \n\t" /* 2b */\ | |
984 "psubw %%mm6, %%mm4 \n\t" /* c - 2b */\ | |
985 "pmullw "MANGLE(ff_pw_20)", %%mm3 \n\t" /* 20a */\ | |
986 "pmullw "MANGLE(ff_pw_3)", %%mm4 \n\t" /* 3c - 6b */\ | |
987 "psubw %%mm5, %%mm3 \n\t" /* -6b + 3c - d */\ | |
988 "paddw %6, %%mm4 \n\t"\ | |
989 "paddw %%mm3, %%mm4 \n\t" /* 20a - 6b + 3c - d */\ | |
990 "psraw $5, %%mm4 \n\t"\ | |
991 "packuswb %%mm4, %%mm0 \n\t"\ | |
959 | 992 OP_MMX2(%%mm0, 8(%1), %%mm4, q)\ |
954 | 993 \ |
2979 | 994 "add %3, %0 \n\t"\ |
995 "add %4, %1 \n\t"\ | |
996 "decl %2 \n\t"\ | |
997 " jnz 1b \n\t"\ | |
6513
713c4fd84e0b
Hardcode register to prevent aparent miscompilation.
michael
parents:
6512
diff
changeset
|
998 : "+a"(src), "+c"(dst), "+D"(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
|
999 : "d"((long)srcStride), "S"((long)dstStride), /*"m"(ff_pw_20), "m"(ff_pw_3),*/ "m"(temp), "m"(ROUNDER)\ |
966 | 1000 : "memory"\ |
954 | 1001 );\ |
1002 }\ | |
1003 \ | |
1004 static void OPNAME ## mpeg4_qpel16_h_lowpass_3dnow(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\ | |
1005 int i;\ | |
1006 int16_t temp[16];\ | |
1007 /* quick HACK, XXX FIXME MUST be optimized */\ | |
1008 for(i=0; i<h; i++)\ | |
1009 {\ | |
1010 temp[ 0]= (src[ 0]+src[ 1])*20 - (src[ 0]+src[ 2])*6 + (src[ 1]+src[ 3])*3 - (src[ 2]+src[ 4]);\ | |
1011 temp[ 1]= (src[ 1]+src[ 2])*20 - (src[ 0]+src[ 3])*6 + (src[ 0]+src[ 4])*3 - (src[ 1]+src[ 5]);\ | |
1012 temp[ 2]= (src[ 2]+src[ 3])*20 - (src[ 1]+src[ 4])*6 + (src[ 0]+src[ 5])*3 - (src[ 0]+src[ 6]);\ | |
1013 temp[ 3]= (src[ 3]+src[ 4])*20 - (src[ 2]+src[ 5])*6 + (src[ 1]+src[ 6])*3 - (src[ 0]+src[ 7]);\ | |
1014 temp[ 4]= (src[ 4]+src[ 5])*20 - (src[ 3]+src[ 6])*6 + (src[ 2]+src[ 7])*3 - (src[ 1]+src[ 8]);\ | |
1015 temp[ 5]= (src[ 5]+src[ 6])*20 - (src[ 4]+src[ 7])*6 + (src[ 3]+src[ 8])*3 - (src[ 2]+src[ 9]);\ | |
1016 temp[ 6]= (src[ 6]+src[ 7])*20 - (src[ 5]+src[ 8])*6 + (src[ 4]+src[ 9])*3 - (src[ 3]+src[10]);\ | |
1017 temp[ 7]= (src[ 7]+src[ 8])*20 - (src[ 6]+src[ 9])*6 + (src[ 5]+src[10])*3 - (src[ 4]+src[11]);\ | |
1018 temp[ 8]= (src[ 8]+src[ 9])*20 - (src[ 7]+src[10])*6 + (src[ 6]+src[11])*3 - (src[ 5]+src[12]);\ | |
1019 temp[ 9]= (src[ 9]+src[10])*20 - (src[ 8]+src[11])*6 + (src[ 7]+src[12])*3 - (src[ 6]+src[13]);\ | |
1020 temp[10]= (src[10]+src[11])*20 - (src[ 9]+src[12])*6 + (src[ 8]+src[13])*3 - (src[ 7]+src[14]);\ | |
1021 temp[11]= (src[11]+src[12])*20 - (src[10]+src[13])*6 + (src[ 9]+src[14])*3 - (src[ 8]+src[15]);\ | |
1022 temp[12]= (src[12]+src[13])*20 - (src[11]+src[14])*6 + (src[10]+src[15])*3 - (src[ 9]+src[16]);\ | |
1023 temp[13]= (src[13]+src[14])*20 - (src[12]+src[15])*6 + (src[11]+src[16])*3 - (src[10]+src[16]);\ | |
1024 temp[14]= (src[14]+src[15])*20 - (src[13]+src[16])*6 + (src[12]+src[16])*3 - (src[11]+src[15]);\ | |
1025 temp[15]= (src[15]+src[16])*20 - (src[14]+src[16])*6 + (src[13]+src[15])*3 - (src[12]+src[14]);\ | |
1026 asm volatile(\ | |
2979 | 1027 "movq (%0), %%mm0 \n\t"\ |
1028 "movq 8(%0), %%mm1 \n\t"\ | |
1029 "paddw %2, %%mm0 \n\t"\ | |
1030 "paddw %2, %%mm1 \n\t"\ | |
1031 "psraw $5, %%mm0 \n\t"\ | |
1032 "psraw $5, %%mm1 \n\t"\ | |
1033 "packuswb %%mm1, %%mm0 \n\t"\ | |
959 | 1034 OP_3DNOW(%%mm0, (%1), %%mm1, q)\ |
2979 | 1035 "movq 16(%0), %%mm0 \n\t"\ |
1036 "movq 24(%0), %%mm1 \n\t"\ | |
1037 "paddw %2, %%mm0 \n\t"\ | |
1038 "paddw %2, %%mm1 \n\t"\ | |
1039 "psraw $5, %%mm0 \n\t"\ | |
1040 "psraw $5, %%mm1 \n\t"\ | |
1041 "packuswb %%mm1, %%mm0 \n\t"\ | |
959 | 1042 OP_3DNOW(%%mm0, 8(%1), %%mm1, q)\ |
954 | 1043 :: "r"(temp), "r"(dst), "m"(ROUNDER)\ |
966 | 1044 : "memory"\ |
954 | 1045 );\ |
1046 dst+=dstStride;\ | |
1047 src+=srcStride;\ | |
1048 }\ | |
1049 }\ | |
1050 \ | |
1057 | 1051 static void OPNAME ## mpeg4_qpel8_h_lowpass_mmx2(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\ |
959 | 1052 asm volatile(\ |
2979 | 1053 "pxor %%mm7, %%mm7 \n\t"\ |
1054 "1: \n\t"\ | |
1055 "movq (%0), %%mm0 \n\t" /* ABCDEFGH */\ | |
1056 "movq %%mm0, %%mm1 \n\t" /* ABCDEFGH */\ | |
1057 "movq %%mm0, %%mm2 \n\t" /* ABCDEFGH */\ | |
1058 "punpcklbw %%mm7, %%mm0 \n\t" /* 0A0B0C0D */\ | |
1059 "punpckhbw %%mm7, %%mm1 \n\t" /* 0E0F0G0H */\ | |
1060 "pshufw $0x90, %%mm0, %%mm5 \n\t" /* 0A0A0B0C */\ | |
1061 "pshufw $0x41, %%mm0, %%mm6 \n\t" /* 0B0A0A0B */\ | |
1062 "movq %%mm2, %%mm3 \n\t" /* ABCDEFGH */\ | |
1063 "movq %%mm2, %%mm4 \n\t" /* ABCDEFGH */\ | |
1064 "psllq $8, %%mm2 \n\t" /* 0ABCDEFG */\ | |
1065 "psllq $16, %%mm3 \n\t" /* 00ABCDEF */\ | |
1066 "psllq $24, %%mm4 \n\t" /* 000ABCDE */\ | |
1067 "punpckhbw %%mm7, %%mm2 \n\t" /* 0D0E0F0G */\ | |
1068 "punpckhbw %%mm7, %%mm3 \n\t" /* 0C0D0E0F */\ | |
1069 "punpckhbw %%mm7, %%mm4 \n\t" /* 0B0C0D0E */\ | |
1070 "paddw %%mm3, %%mm5 \n\t" /* b */\ | |
1071 "paddw %%mm2, %%mm6 \n\t" /* c */\ | |
1072 "paddw %%mm5, %%mm5 \n\t" /* 2b */\ | |
1073 "psubw %%mm5, %%mm6 \n\t" /* c - 2b */\ | |
1074 "pshufw $0x06, %%mm0, %%mm5 \n\t" /* 0C0B0A0A */\ | |
1075 "pmullw "MANGLE(ff_pw_3)", %%mm6 \n\t" /* 3c - 6b */\ | |
1076 "paddw %%mm4, %%mm0 \n\t" /* a */\ | |
1077 "paddw %%mm1, %%mm5 \n\t" /* d */\ | |
1078 "pmullw "MANGLE(ff_pw_20)", %%mm0 \n\t" /* 20a */\ | |
1079 "psubw %%mm5, %%mm0 \n\t" /* 20a - d */\ | |
6512 | 1080 "paddw %5, %%mm6 \n\t"\ |
2979 | 1081 "paddw %%mm6, %%mm0 \n\t" /* 20a - 6b + 3c - d */\ |
1082 "psraw $5, %%mm0 \n\t"\ | |
959 | 1083 /* mm1=EFGH, mm2=DEFG, mm3=CDEF, mm4=BCDE, mm7=0 */\ |
1084 \ | |
2979 | 1085 "movd 5(%0), %%mm5 \n\t" /* FGHI */\ |
1086 "punpcklbw %%mm7, %%mm5 \n\t" /* 0F0G0H0I */\ | |
1087 "pshufw $0xF9, %%mm5, %%mm6 \n\t" /* 0G0H0I0I */\ | |
1088 "paddw %%mm5, %%mm1 \n\t" /* a */\ | |
1089 "paddw %%mm6, %%mm2 \n\t" /* b */\ | |
1090 "pshufw $0xBE, %%mm5, %%mm6 \n\t" /* 0H0I0I0H */\ | |
1091 "pshufw $0x6F, %%mm5, %%mm5 \n\t" /* 0I0I0H0G */\ | |
1092 "paddw %%mm6, %%mm3 \n\t" /* c */\ | |
1093 "paddw %%mm5, %%mm4 \n\t" /* d */\ | |
1094 "paddw %%mm2, %%mm2 \n\t" /* 2b */\ | |
1095 "psubw %%mm2, %%mm3 \n\t" /* c - 2b */\ | |
1096 "pmullw "MANGLE(ff_pw_20)", %%mm1 \n\t" /* 20a */\ | |
1097 "pmullw "MANGLE(ff_pw_3)", %%mm3 \n\t" /* 3c - 6b */\ | |
1098 "psubw %%mm4, %%mm3 \n\t" /* -6b + 3c - d */\ | |
6512 | 1099 "paddw %5, %%mm1 \n\t"\ |
2979 | 1100 "paddw %%mm1, %%mm3 \n\t" /* 20a - 6b + 3c - d */\ |
1101 "psraw $5, %%mm3 \n\t"\ | |
1102 "packuswb %%mm3, %%mm0 \n\t"\ | |
959 | 1103 OP_MMX2(%%mm0, (%1), %%mm4, q)\ |
1104 \ | |
2979 | 1105 "add %3, %0 \n\t"\ |
1106 "add %4, %1 \n\t"\ | |
1107 "decl %2 \n\t"\ | |
1108 " jnz 1b \n\t"\ | |
6513
713c4fd84e0b
Hardcode register to prevent aparent miscompilation.
michael
parents:
6512
diff
changeset
|
1109 : "+a"(src), "+c"(dst), "+d"(h)\ |
6512 | 1110 : "S"((long)srcStride), "D"((long)dstStride), /*"m"(ff_pw_20), "m"(ff_pw_3),*/ "m"(ROUNDER)\ |
966 | 1111 : "memory"\ |
959 | 1112 );\ |
1113 }\ | |
1114 \ | |
1115 static void OPNAME ## mpeg4_qpel8_h_lowpass_3dnow(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\ | |
1116 int i;\ | |
1117 int16_t temp[8];\ | |
1118 /* quick HACK, XXX FIXME MUST be optimized */\ | |
1119 for(i=0; i<h; i++)\ | |
1120 {\ | |
1121 temp[ 0]= (src[ 0]+src[ 1])*20 - (src[ 0]+src[ 2])*6 + (src[ 1]+src[ 3])*3 - (src[ 2]+src[ 4]);\ | |
1122 temp[ 1]= (src[ 1]+src[ 2])*20 - (src[ 0]+src[ 3])*6 + (src[ 0]+src[ 4])*3 - (src[ 1]+src[ 5]);\ | |
1123 temp[ 2]= (src[ 2]+src[ 3])*20 - (src[ 1]+src[ 4])*6 + (src[ 0]+src[ 5])*3 - (src[ 0]+src[ 6]);\ | |
1124 temp[ 3]= (src[ 3]+src[ 4])*20 - (src[ 2]+src[ 5])*6 + (src[ 1]+src[ 6])*3 - (src[ 0]+src[ 7]);\ | |
1125 temp[ 4]= (src[ 4]+src[ 5])*20 - (src[ 3]+src[ 6])*6 + (src[ 2]+src[ 7])*3 - (src[ 1]+src[ 8]);\ | |
1126 temp[ 5]= (src[ 5]+src[ 6])*20 - (src[ 4]+src[ 7])*6 + (src[ 3]+src[ 8])*3 - (src[ 2]+src[ 8]);\ | |
1127 temp[ 6]= (src[ 6]+src[ 7])*20 - (src[ 5]+src[ 8])*6 + (src[ 4]+src[ 8])*3 - (src[ 3]+src[ 7]);\ | |
1128 temp[ 7]= (src[ 7]+src[ 8])*20 - (src[ 6]+src[ 8])*6 + (src[ 5]+src[ 7])*3 - (src[ 4]+src[ 6]);\ | |
1129 asm volatile(\ | |
2979 | 1130 "movq (%0), %%mm0 \n\t"\ |
1131 "movq 8(%0), %%mm1 \n\t"\ | |
1132 "paddw %2, %%mm0 \n\t"\ | |
1133 "paddw %2, %%mm1 \n\t"\ | |
1134 "psraw $5, %%mm0 \n\t"\ | |
1135 "psraw $5, %%mm1 \n\t"\ | |
1136 "packuswb %%mm1, %%mm0 \n\t"\ | |
959 | 1137 OP_3DNOW(%%mm0, (%1), %%mm1, q)\ |
1138 :: "r"(temp), "r"(dst), "m"(ROUNDER)\ | |
966 | 1139 :"memory"\ |
959 | 1140 );\ |
1141 dst+=dstStride;\ | |
1142 src+=srcStride;\ | |
1143 }\ | |
1144 } | |
1145 | |
1146 #define QPEL_OP(OPNAME, ROUNDER, RND, OP, MMX)\ | |
1147 \ | |
1148 static void OPNAME ## mpeg4_qpel16_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\ | |
954 | 1149 uint64_t temp[17*4];\ |
1150 uint64_t *temp_ptr= temp;\ | |
1151 int count= 17;\ | |
1152 \ | |
1153 /*FIXME unroll */\ | |
1154 asm volatile(\ | |
2979 | 1155 "pxor %%mm7, %%mm7 \n\t"\ |
1156 "1: \n\t"\ | |
1157 "movq (%0), %%mm0 \n\t"\ | |
1158 "movq (%0), %%mm1 \n\t"\ | |
1159 "movq 8(%0), %%mm2 \n\t"\ | |
1160 "movq 8(%0), %%mm3 \n\t"\ | |
1161 "punpcklbw %%mm7, %%mm0 \n\t"\ | |
1162 "punpckhbw %%mm7, %%mm1 \n\t"\ | |
1163 "punpcklbw %%mm7, %%mm2 \n\t"\ | |
1164 "punpckhbw %%mm7, %%mm3 \n\t"\ | |
1165 "movq %%mm0, (%1) \n\t"\ | |
1166 "movq %%mm1, 17*8(%1) \n\t"\ | |
1167 "movq %%mm2, 2*17*8(%1) \n\t"\ | |
1168 "movq %%mm3, 3*17*8(%1) \n\t"\ | |
1169 "add $8, %1 \n\t"\ | |
1170 "add %3, %0 \n\t"\ | |
1171 "decl %2 \n\t"\ | |
1172 " jnz 1b \n\t"\ | |
954 | 1173 : "+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
|
1174 : "r" ((long)srcStride)\ |
966 | 1175 : "memory"\ |
954 | 1176 );\ |
1177 \ | |
1178 temp_ptr= temp;\ | |
1179 count=4;\ | |
1180 \ | |
1181 /*FIXME reorder for speed */\ | |
1182 asm volatile(\ | |
2979 | 1183 /*"pxor %%mm7, %%mm7 \n\t"*/\ |
1184 "1: \n\t"\ | |
1185 "movq (%0), %%mm0 \n\t"\ | |
1186 "movq 8(%0), %%mm1 \n\t"\ | |
1187 "movq 16(%0), %%mm2 \n\t"\ | |
1188 "movq 24(%0), %%mm3 \n\t"\ | |
961 | 1189 QPEL_V_LOW(%%mm0, %%mm1, %%mm2, %%mm3, %5, %6, %5, 16(%0), 8(%0), (%0), 32(%0), (%1), OP)\ |
1190 QPEL_V_LOW(%%mm1, %%mm2, %%mm3, %%mm0, %5, %6, %5, 8(%0), (%0), (%0), 40(%0), (%1, %3), OP)\ | |
2979 | 1191 "add %4, %1 \n\t"\ |
961 | 1192 QPEL_V_LOW(%%mm2, %%mm3, %%mm0, %%mm1, %5, %6, %5, (%0), (%0), 8(%0), 48(%0), (%1), OP)\ |
954 | 1193 \ |
961 | 1194 QPEL_V_LOW(%%mm3, %%mm0, %%mm1, %%mm2, %5, %6, %5, (%0), 8(%0), 16(%0), 56(%0), (%1, %3), OP)\ |
2979 | 1195 "add %4, %1 \n\t"\ |
961 | 1196 QPEL_V_LOW(%%mm0, %%mm1, %%mm2, %%mm3, %5, %6, %5, 8(%0), 16(%0), 24(%0), 64(%0), (%1), OP)\ |
1197 QPEL_V_LOW(%%mm1, %%mm2, %%mm3, %%mm0, %5, %6, %5, 16(%0), 24(%0), 32(%0), 72(%0), (%1, %3), OP)\ | |
2979 | 1198 "add %4, %1 \n\t"\ |
961 | 1199 QPEL_V_LOW(%%mm2, %%mm3, %%mm0, %%mm1, %5, %6, %5, 24(%0), 32(%0), 40(%0), 80(%0), (%1), OP)\ |
1200 QPEL_V_LOW(%%mm3, %%mm0, %%mm1, %%mm2, %5, %6, %5, 32(%0), 40(%0), 48(%0), 88(%0), (%1, %3), OP)\ | |
2979 | 1201 "add %4, %1 \n\t"\ |
961 | 1202 QPEL_V_LOW(%%mm0, %%mm1, %%mm2, %%mm3, %5, %6, %5, 40(%0), 48(%0), 56(%0), 96(%0), (%1), OP)\ |
1203 QPEL_V_LOW(%%mm1, %%mm2, %%mm3, %%mm0, %5, %6, %5, 48(%0), 56(%0), 64(%0),104(%0), (%1, %3), OP)\ | |
2979 | 1204 "add %4, %1 \n\t"\ |
961 | 1205 QPEL_V_LOW(%%mm2, %%mm3, %%mm0, %%mm1, %5, %6, %5, 56(%0), 64(%0), 72(%0),112(%0), (%1), OP)\ |
1206 QPEL_V_LOW(%%mm3, %%mm0, %%mm1, %%mm2, %5, %6, %5, 64(%0), 72(%0), 80(%0),120(%0), (%1, %3), OP)\ | |
2979 | 1207 "add %4, %1 \n\t"\ |
961 | 1208 QPEL_V_LOW(%%mm0, %%mm1, %%mm2, %%mm3, %5, %6, %5, 72(%0), 80(%0), 88(%0),128(%0), (%1), OP)\ |
954 | 1209 \ |
961 | 1210 QPEL_V_LOW(%%mm1, %%mm2, %%mm3, %%mm0, %5, %6, %5, 80(%0), 88(%0), 96(%0),128(%0), (%1, %3), OP)\ |
2979 | 1211 "add %4, %1 \n\t" \ |
961 | 1212 QPEL_V_LOW(%%mm2, %%mm3, %%mm0, %%mm1, %5, %6, %5, 88(%0), 96(%0),104(%0),120(%0), (%1), OP)\ |
1213 QPEL_V_LOW(%%mm3, %%mm0, %%mm1, %%mm2, %5, %6, %5, 96(%0),104(%0),112(%0),112(%0), (%1, %3), OP)\ | |
954 | 1214 \ |
2979 | 1215 "add $136, %0 \n\t"\ |
1216 "add %6, %1 \n\t"\ | |
1217 "decl %2 \n\t"\ | |
1218 " 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
|
1219 \ |
967 | 1220 : "+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
|
1221 : "r"((long)dstStride), "r"(2*(long)dstStride), /*"m"(ff_pw_20), "m"(ff_pw_3),*/ "m"(ROUNDER), "g"(4-14*(long)dstStride)\ |
966 | 1222 :"memory"\ |
954 | 1223 );\ |
1224 }\ | |
1225 \ | |
1057 | 1226 static void OPNAME ## mpeg4_qpel8_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\ |
2209 | 1227 uint64_t temp[9*2];\ |
954 | 1228 uint64_t *temp_ptr= temp;\ |
1229 int count= 9;\ | |
1230 \ | |
1231 /*FIXME unroll */\ | |
1232 asm volatile(\ | |
2979 | 1233 "pxor %%mm7, %%mm7 \n\t"\ |
1234 "1: \n\t"\ | |
1235 "movq (%0), %%mm0 \n\t"\ | |
1236 "movq (%0), %%mm1 \n\t"\ | |
1237 "punpcklbw %%mm7, %%mm0 \n\t"\ | |
1238 "punpckhbw %%mm7, %%mm1 \n\t"\ | |
1239 "movq %%mm0, (%1) \n\t"\ | |
1240 "movq %%mm1, 9*8(%1) \n\t"\ | |
1241 "add $8, %1 \n\t"\ | |
1242 "add %3, %0 \n\t"\ | |
1243 "decl %2 \n\t"\ | |
1244 " jnz 1b \n\t"\ | |
954 | 1245 : "+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
|
1246 : "r" ((long)srcStride)\ |
966 | 1247 : "memory"\ |
954 | 1248 );\ |
1249 \ | |
1250 temp_ptr= temp;\ | |
1251 count=2;\ | |
1252 \ | |
1253 /*FIXME reorder for speed */\ | |
1254 asm volatile(\ | |
2979 | 1255 /*"pxor %%mm7, %%mm7 \n\t"*/\ |
1256 "1: \n\t"\ | |
1257 "movq (%0), %%mm0 \n\t"\ | |
1258 "movq 8(%0), %%mm1 \n\t"\ | |
1259 "movq 16(%0), %%mm2 \n\t"\ | |
1260 "movq 24(%0), %%mm3 \n\t"\ | |
961 | 1261 QPEL_V_LOW(%%mm0, %%mm1, %%mm2, %%mm3, %5, %6, %5, 16(%0), 8(%0), (%0), 32(%0), (%1), OP)\ |
1262 QPEL_V_LOW(%%mm1, %%mm2, %%mm3, %%mm0, %5, %6, %5, 8(%0), (%0), (%0), 40(%0), (%1, %3), OP)\ | |
2979 | 1263 "add %4, %1 \n\t"\ |
961 | 1264 QPEL_V_LOW(%%mm2, %%mm3, %%mm0, %%mm1, %5, %6, %5, (%0), (%0), 8(%0), 48(%0), (%1), OP)\ |
954 | 1265 \ |
961 | 1266 QPEL_V_LOW(%%mm3, %%mm0, %%mm1, %%mm2, %5, %6, %5, (%0), 8(%0), 16(%0), 56(%0), (%1, %3), OP)\ |
2979 | 1267 "add %4, %1 \n\t"\ |
961 | 1268 QPEL_V_LOW(%%mm0, %%mm1, %%mm2, %%mm3, %5, %6, %5, 8(%0), 16(%0), 24(%0), 64(%0), (%1), OP)\ |
954 | 1269 \ |
961 | 1270 QPEL_V_LOW(%%mm1, %%mm2, %%mm3, %%mm0, %5, %6, %5, 16(%0), 24(%0), 32(%0), 64(%0), (%1, %3), OP)\ |
2979 | 1271 "add %4, %1 \n\t"\ |
961 | 1272 QPEL_V_LOW(%%mm2, %%mm3, %%mm0, %%mm1, %5, %6, %5, 24(%0), 32(%0), 40(%0), 56(%0), (%1), OP)\ |
1273 QPEL_V_LOW(%%mm3, %%mm0, %%mm1, %%mm2, %5, %6, %5, 32(%0), 40(%0), 48(%0), 48(%0), (%1, %3), OP)\ | |
954 | 1274 \ |
2979 | 1275 "add $72, %0 \n\t"\ |
1276 "add %6, %1 \n\t"\ | |
1277 "decl %2 \n\t"\ | |
1278 " jnz 1b \n\t"\ | |
954 | 1279 \ |
961 | 1280 : "+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
|
1281 : "r"((long)dstStride), "r"(2*(long)dstStride), /*"m"(ff_pw_20), "m"(ff_pw_3),*/ "m"(ROUNDER), "g"(4-6*(long)dstStride)\ |
966 | 1282 : "memory"\ |
1283 );\ | |
959 | 1284 }\ |
954 | 1285 \ |
1064 | 1286 static void OPNAME ## qpel8_mc00_ ## MMX (uint8_t *dst, uint8_t *src, int stride){\ |
6321 | 1287 OPNAME ## pixels8_ ## MMX(dst, src, stride, 8);\ |
954 | 1288 }\ |
1289 \ | |
1064 | 1290 static void OPNAME ## qpel8_mc10_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 1291 uint64_t temp[8];\ |
954 | 1292 uint8_t * const half= (uint8_t*)temp;\ |
1293 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
|
1294 OPNAME ## pixels8_l2_ ## MMX(dst, src, half, stride, stride, 8);\ |
954 | 1295 }\ |
1296 \ | |
1064 | 1297 static void OPNAME ## qpel8_mc20_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
954 | 1298 OPNAME ## mpeg4_qpel8_h_lowpass_ ## MMX(dst, src, stride, stride, 8);\ |
1299 }\ | |
1300 \ | |
1064 | 1301 static void OPNAME ## qpel8_mc30_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 1302 uint64_t temp[8];\ |
954 | 1303 uint8_t * const half= (uint8_t*)temp;\ |
1304 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
|
1305 OPNAME ## pixels8_l2_ ## MMX(dst, src+1, half, stride, stride, 8);\ |
954 | 1306 }\ |
1307 \ | |
1064 | 1308 static void OPNAME ## qpel8_mc01_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 1309 uint64_t temp[8];\ |
954 | 1310 uint8_t * const half= (uint8_t*)temp;\ |
959 | 1311 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
|
1312 OPNAME ## pixels8_l2_ ## MMX(dst, src, half, stride, stride, 8);\ |
954 | 1313 }\ |
1314 \ | |
1064 | 1315 static void OPNAME ## qpel8_mc02_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
959 | 1316 OPNAME ## mpeg4_qpel8_v_lowpass_ ## MMX(dst, src, stride, stride);\ |
954 | 1317 }\ |
1318 \ | |
1064 | 1319 static void OPNAME ## qpel8_mc03_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 1320 uint64_t temp[8];\ |
954 | 1321 uint8_t * const half= (uint8_t*)temp;\ |
959 | 1322 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
|
1323 OPNAME ## pixels8_l2_ ## MMX(dst, src+stride, half, stride, stride, 8);\ |
954 | 1324 }\ |
1064 | 1325 static void OPNAME ## qpel8_mc11_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 1326 uint64_t half[8 + 9];\ |
1327 uint8_t * const halfH= ((uint8_t*)half) + 64;\ | |
1328 uint8_t * const halfHV= ((uint8_t*)half);\ | |
954 | 1329 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
|
1330 put ## RND ## pixels8_l2_ ## MMX(halfH, src, halfH, 8, stride, 9);\ |
959 | 1331 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
|
1332 OPNAME ## pixels8_l2_ ## MMX(dst, halfH, halfHV, stride, 8, 8);\ |
954 | 1333 }\ |
1064 | 1334 static void OPNAME ## qpel8_mc31_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 1335 uint64_t half[8 + 9];\ |
1336 uint8_t * const halfH= ((uint8_t*)half) + 64;\ | |
1337 uint8_t * const halfHV= ((uint8_t*)half);\ | |
954 | 1338 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
|
1339 put ## RND ## pixels8_l2_ ## MMX(halfH, src+1, halfH, 8, stride, 9);\ |
959 | 1340 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
|
1341 OPNAME ## pixels8_l2_ ## MMX(dst, halfH, halfHV, stride, 8, 8);\ |
954 | 1342 }\ |
1064 | 1343 static void OPNAME ## qpel8_mc13_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 1344 uint64_t half[8 + 9];\ |
1345 uint8_t * const halfH= ((uint8_t*)half) + 64;\ | |
1346 uint8_t * const halfHV= ((uint8_t*)half);\ | |
954 | 1347 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
|
1348 put ## RND ## pixels8_l2_ ## MMX(halfH, src, halfH, 8, stride, 9);\ |
959 | 1349 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
|
1350 OPNAME ## pixels8_l2_ ## MMX(dst, halfH+8, halfHV, stride, 8, 8);\ |
954 | 1351 }\ |
1064 | 1352 static void OPNAME ## qpel8_mc33_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 1353 uint64_t half[8 + 9];\ |
1354 uint8_t * const halfH= ((uint8_t*)half) + 64;\ | |
1355 uint8_t * const halfHV= ((uint8_t*)half);\ | |
1356 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
|
1357 put ## RND ## pixels8_l2_ ## MMX(halfH, src+1, halfH, 8, stride, 9);\ |
959 | 1358 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
|
1359 OPNAME ## pixels8_l2_ ## MMX(dst, halfH+8, halfHV, stride, 8, 8);\ |
954 | 1360 }\ |
1064 | 1361 static void OPNAME ## qpel8_mc21_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 1362 uint64_t half[8 + 9];\ |
954 | 1363 uint8_t * const halfH= ((uint8_t*)half) + 64;\ |
1364 uint8_t * const halfHV= ((uint8_t*)half);\ | |
1365 put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, stride, 9);\ | |
959 | 1366 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
|
1367 OPNAME ## pixels8_l2_ ## MMX(dst, halfH, halfHV, stride, 8, 8);\ |
954 | 1368 }\ |
1064 | 1369 static void OPNAME ## qpel8_mc23_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 1370 uint64_t half[8 + 9];\ |
954 | 1371 uint8_t * const halfH= ((uint8_t*)half) + 64;\ |
1372 uint8_t * const halfHV= ((uint8_t*)half);\ | |
1373 put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, stride, 9);\ | |
959 | 1374 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
|
1375 OPNAME ## pixels8_l2_ ## MMX(dst, halfH+8, halfHV, stride, 8, 8);\ |
954 | 1376 }\ |
1064 | 1377 static void OPNAME ## qpel8_mc12_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 1378 uint64_t half[8 + 9];\ |
1379 uint8_t * const halfH= ((uint8_t*)half);\ | |
954 | 1380 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
|
1381 put ## RND ## pixels8_l2_ ## MMX(halfH, src, halfH, 8, stride, 9);\ |
984 | 1382 OPNAME ## mpeg4_qpel8_v_lowpass_ ## MMX(dst, halfH, stride, 8);\ |
954 | 1383 }\ |
1064 | 1384 static void OPNAME ## qpel8_mc32_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 1385 uint64_t half[8 + 9];\ |
1386 uint8_t * const halfH= ((uint8_t*)half);\ | |
954 | 1387 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
|
1388 put ## RND ## pixels8_l2_ ## MMX(halfH, src+1, halfH, 8, stride, 9);\ |
984 | 1389 OPNAME ## mpeg4_qpel8_v_lowpass_ ## MMX(dst, halfH, stride, 8);\ |
954 | 1390 }\ |
1064 | 1391 static void OPNAME ## qpel8_mc22_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 1392 uint64_t half[9];\ |
954 | 1393 uint8_t * const halfH= ((uint8_t*)half);\ |
1394 put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, stride, 9);\ | |
959 | 1395 OPNAME ## mpeg4_qpel8_v_lowpass_ ## MMX(dst, halfH, stride, 8);\ |
954 | 1396 }\ |
1064 | 1397 static void OPNAME ## qpel16_mc00_ ## MMX (uint8_t *dst, uint8_t *src, int stride){\ |
6321 | 1398 OPNAME ## pixels16_ ## MMX(dst, src, stride, 16);\ |
954 | 1399 }\ |
1400 \ | |
1064 | 1401 static void OPNAME ## qpel16_mc10_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
954 | 1402 uint64_t temp[32];\ |
1403 uint8_t * const half= (uint8_t*)temp;\ | |
1404 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
|
1405 OPNAME ## pixels16_l2_ ## MMX(dst, src, half, stride, stride, 16);\ |
954 | 1406 }\ |
1407 \ | |
1064 | 1408 static void OPNAME ## qpel16_mc20_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
954 | 1409 OPNAME ## mpeg4_qpel16_h_lowpass_ ## MMX(dst, src, stride, stride, 16);\ |
1410 }\ | |
1411 \ | |
1064 | 1412 static void OPNAME ## qpel16_mc30_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
954 | 1413 uint64_t temp[32];\ |
1414 uint8_t * const half= (uint8_t*)temp;\ | |
1415 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
|
1416 OPNAME ## pixels16_l2_ ## MMX(dst, src+1, half, stride, stride, 16);\ |
954 | 1417 }\ |
1418 \ | |
1064 | 1419 static void OPNAME ## qpel16_mc01_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
954 | 1420 uint64_t temp[32];\ |
1421 uint8_t * const half= (uint8_t*)temp;\ | |
959 | 1422 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
|
1423 OPNAME ## pixels16_l2_ ## MMX(dst, src, half, stride, stride, 16);\ |
954 | 1424 }\ |
1425 \ | |
1064 | 1426 static void OPNAME ## qpel16_mc02_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
959 | 1427 OPNAME ## mpeg4_qpel16_v_lowpass_ ## MMX(dst, src, stride, stride);\ |
954 | 1428 }\ |
1429 \ | |
1064 | 1430 static void OPNAME ## qpel16_mc03_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
954 | 1431 uint64_t temp[32];\ |
1432 uint8_t * const half= (uint8_t*)temp;\ | |
959 | 1433 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
|
1434 OPNAME ## pixels16_l2_ ## MMX(dst, src+stride, half, stride, stride, 16);\ |
954 | 1435 }\ |
1064 | 1436 static void OPNAME ## qpel16_mc11_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 1437 uint64_t half[16*2 + 17*2];\ |
1438 uint8_t * const halfH= ((uint8_t*)half) + 256;\ | |
1439 uint8_t * const halfHV= ((uint8_t*)half);\ | |
954 | 1440 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
|
1441 put ## RND ## pixels16_l2_ ## MMX(halfH, src, halfH, 16, stride, 17);\ |
959 | 1442 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
|
1443 OPNAME ## pixels16_l2_ ## MMX(dst, halfH, halfHV, stride, 16, 16);\ |
954 | 1444 }\ |
1064 | 1445 static void OPNAME ## qpel16_mc31_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 1446 uint64_t half[16*2 + 17*2];\ |
1447 uint8_t * const halfH= ((uint8_t*)half) + 256;\ | |
1448 uint8_t * const halfHV= ((uint8_t*)half);\ | |
954 | 1449 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
|
1450 put ## RND ## pixels16_l2_ ## MMX(halfH, src+1, halfH, 16, stride, 17);\ |
959 | 1451 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
|
1452 OPNAME ## pixels16_l2_ ## MMX(dst, halfH, halfHV, stride, 16, 16);\ |
954 | 1453 }\ |
1064 | 1454 static void OPNAME ## qpel16_mc13_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 1455 uint64_t half[16*2 + 17*2];\ |
1456 uint8_t * const halfH= ((uint8_t*)half) + 256;\ | |
1457 uint8_t * const halfHV= ((uint8_t*)half);\ | |
954 | 1458 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
|
1459 put ## RND ## pixels16_l2_ ## MMX(halfH, src, halfH, 16, stride, 17);\ |
959 | 1460 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
|
1461 OPNAME ## pixels16_l2_ ## MMX(dst, halfH+16, halfHV, stride, 16, 16);\ |
954 | 1462 }\ |
1064 | 1463 static void OPNAME ## qpel16_mc33_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 1464 uint64_t half[16*2 + 17*2];\ |
1465 uint8_t * const halfH= ((uint8_t*)half) + 256;\ | |
1466 uint8_t * const halfHV= ((uint8_t*)half);\ | |
1467 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
|
1468 put ## RND ## pixels16_l2_ ## MMX(halfH, src+1, halfH, 16, stride, 17);\ |
959 | 1469 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
|
1470 OPNAME ## pixels16_l2_ ## MMX(dst, halfH+16, halfHV, stride, 16, 16);\ |
954 | 1471 }\ |
1064 | 1472 static void OPNAME ## qpel16_mc21_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
954 | 1473 uint64_t half[16*2 + 17*2];\ |
1474 uint8_t * const halfH= ((uint8_t*)half) + 256;\ | |
1475 uint8_t * const halfHV= ((uint8_t*)half);\ | |
1476 put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, stride, 17);\ | |
959 | 1477 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
|
1478 OPNAME ## pixels16_l2_ ## MMX(dst, halfH, halfHV, stride, 16, 16);\ |
954 | 1479 }\ |
1064 | 1480 static void OPNAME ## qpel16_mc23_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
954 | 1481 uint64_t half[16*2 + 17*2];\ |
1482 uint8_t * const halfH= ((uint8_t*)half) + 256;\ | |
1483 uint8_t * const halfHV= ((uint8_t*)half);\ | |
1484 put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, stride, 17);\ | |
959 | 1485 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
|
1486 OPNAME ## pixels16_l2_ ## MMX(dst, halfH+16, halfHV, stride, 16, 16);\ |
954 | 1487 }\ |
1064 | 1488 static void OPNAME ## qpel16_mc12_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 1489 uint64_t half[17*2];\ |
1490 uint8_t * const halfH= ((uint8_t*)half);\ | |
954 | 1491 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
|
1492 put ## RND ## pixels16_l2_ ## MMX(halfH, src, halfH, 16, stride, 17);\ |
984 | 1493 OPNAME ## mpeg4_qpel16_v_lowpass_ ## MMX(dst, halfH, stride, 16);\ |
954 | 1494 }\ |
1064 | 1495 static void OPNAME ## qpel16_mc32_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
984 | 1496 uint64_t half[17*2];\ |
1497 uint8_t * const halfH= ((uint8_t*)half);\ | |
954 | 1498 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
|
1499 put ## RND ## pixels16_l2_ ## MMX(halfH, src+1, halfH, 16, stride, 17);\ |
984 | 1500 OPNAME ## mpeg4_qpel16_v_lowpass_ ## MMX(dst, halfH, stride, 16);\ |
954 | 1501 }\ |
1064 | 1502 static void OPNAME ## qpel16_mc22_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\ |
954 | 1503 uint64_t half[17*2];\ |
1504 uint8_t * const halfH= ((uint8_t*)half);\ | |
1505 put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, stride, 17);\ | |
959 | 1506 OPNAME ## mpeg4_qpel16_v_lowpass_ ## MMX(dst, halfH, stride, 16);\ |
954 | 1507 } |
1508 | |
2979 | 1509 #define PUT_OP(a,b,temp, size) "mov" #size " " #a ", " #b " \n\t" |
959 | 1510 #define AVG_3DNOW_OP(a,b,temp, size) \ |
2979 | 1511 "mov" #size " " #b ", " #temp " \n\t"\ |
1512 "pavgusb " #temp ", " #a " \n\t"\ | |
1513 "mov" #size " " #a ", " #b " \n\t" | |
959 | 1514 #define AVG_MMX2_OP(a,b,temp, size) \ |
2979 | 1515 "mov" #size " " #b ", " #temp " \n\t"\ |
1516 "pavgb " #temp ", " #a " \n\t"\ | |
1517 "mov" #size " " #a ", " #b " \n\t" | |
959 | 1518 |
1519 QPEL_BASE(put_ , ff_pw_16, _ , PUT_OP, PUT_OP) | |
1520 QPEL_BASE(avg_ , ff_pw_16, _ , AVG_MMX2_OP, AVG_3DNOW_OP) | |
1521 QPEL_BASE(put_no_rnd_, ff_pw_15, _no_rnd_, PUT_OP, PUT_OP) | |
1522 QPEL_OP(put_ , ff_pw_16, _ , PUT_OP, 3dnow) | |
1523 QPEL_OP(avg_ , ff_pw_16, _ , AVG_3DNOW_OP, 3dnow) | |
1524 QPEL_OP(put_no_rnd_, ff_pw_15, _no_rnd_, PUT_OP, 3dnow) | |
954 | 1525 QPEL_OP(put_ , ff_pw_16, _ , PUT_OP, mmx2) |
959 | 1526 QPEL_OP(avg_ , ff_pw_16, _ , AVG_MMX2_OP, mmx2) |
954 | 1527 QPEL_OP(put_no_rnd_, ff_pw_15, _no_rnd_, PUT_OP, mmx2) |
1528 | |
3807
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
1529 /***********************************/ |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
1530 /* 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
|
1531 |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
1532 #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
|
1533 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
|
1534 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
|
1535 } |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
1536 #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
|
1537 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
|
1538 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
|
1539 } |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
1540 |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
1541 #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
|
1542 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
|
1543 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
|
1544 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
|
1545 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
|
1546 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
|
1547 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
|
1548 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
|
1549 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
|
1550 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
|
1551 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
|
1552 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
|
1553 }\ |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
1554 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
|
1555 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
|
1556 }\ |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
1557 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
|
1558 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
|
1559 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
|
1560 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
|
1561 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
|
1562 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
|
1563 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
|
1564 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
|
1565 |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
1566 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
|
1567 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
|
1568 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
|
1569 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
|
1570 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
|
1571 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
|
1572 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
|
1573 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
|
1574 |
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
1575 |
393 | 1576 #if 0 |
247
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1577 static void just_return() { return; } |
393 | 1578 #endif |
247
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1579 |
3248
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1580 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
|
1581 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
|
1582 const int w = 8; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1583 const int ix = ox>>(16+shift); |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1584 const int iy = oy>>(16+shift); |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1585 const int oxs = ox>>4; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1586 const int oys = oy>>4; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1587 const int dxxs = dxx>>4; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1588 const int dxys = dxy>>4; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1589 const int dyxs = dyx>>4; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1590 const int dyys = dyy>>4; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1591 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
|
1592 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
|
1593 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
|
1594 const uint64_t shift2 = 2*shift; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1595 uint8_t edge_buf[(h+1)*stride]; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1596 int x, y; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1597 |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1598 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
|
1599 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
|
1600 const int dxh = dxy*(h-1); |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1601 const int dyw = dyx*(w-1); |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1602 if( // non-constant fullpel offset (3% of blocks) |
6196
166bef5cad01
add parenthesis, fix warning: i386/dsputil_mmx.c:2618: warning: suggest parentheses around arithmetic in operand of |
bcoudurier
parents:
6195
diff
changeset
|
1603 ((ox^(ox+dxw)) | (ox^(ox+dxh)) | (ox^(ox+dxw+dxh)) | |
166bef5cad01
add parenthesis, fix warning: i386/dsputil_mmx.c:2618: warning: suggest parentheses around arithmetic in operand of |
bcoudurier
parents:
6195
diff
changeset
|
1604 (oy^(oy+dyw)) | (oy^(oy+dyh)) | (oy^(oy+dyw+dyh))) >> (16+shift) |
3248
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1605 // 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
|
1606 || (dxx|dxy|dyx|dyy)&15 ) |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1607 { |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1608 //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
|
1609 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
|
1610 return; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1611 } |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1612 |
3250 | 1613 src += ix + iy*stride; |
3248
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1614 if( (unsigned)ix >= width-w || |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1615 (unsigned)iy >= height-h ) |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1616 { |
3250 | 1617 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
|
1618 src = edge_buf; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1619 } |
3250 | 1620 |
1621 asm volatile( | |
1622 "movd %0, %%mm6 \n\t" | |
1623 "pxor %%mm7, %%mm7 \n\t" | |
1624 "punpcklwd %%mm6, %%mm6 \n\t" | |
1625 "punpcklwd %%mm6, %%mm6 \n\t" | |
1626 :: "r"(1<<shift) | |
1627 ); | |
3248
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1628 |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1629 for(x=0; x<w; x+=4){ |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1630 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
|
1631 oxs - dxys + dxxs*(x+1), |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1632 oxs - dxys + dxxs*(x+2), |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1633 oxs - dxys + dxxs*(x+3) }; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1634 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
|
1635 oys - dyys + dyxs*(x+1), |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1636 oys - dyys + dyxs*(x+2), |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1637 oys - dyys + dyxs*(x+3) }; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1638 |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1639 for(y=0; y<h; y++){ |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1640 asm volatile( |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1641 "movq %0, %%mm4 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1642 "movq %1, %%mm5 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1643 "paddw %2, %%mm4 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1644 "paddw %3, %%mm5 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1645 "movq %%mm4, %0 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1646 "movq %%mm5, %1 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1647 "psrlw $12, %%mm4 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1648 "psrlw $12, %%mm5 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1649 : "+m"(*dx4), "+m"(*dy4) |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1650 : "m"(*dxy4), "m"(*dyy4) |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1651 ); |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1652 |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1653 asm volatile( |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1654 "movq %%mm6, %%mm2 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1655 "movq %%mm6, %%mm1 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1656 "psubw %%mm4, %%mm2 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1657 "psubw %%mm5, %%mm1 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1658 "movq %%mm2, %%mm0 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1659 "movq %%mm4, %%mm3 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1660 "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
|
1661 "pmullw %%mm5, %%mm3 \n\t" // dx*dy |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1662 "pmullw %%mm5, %%mm2 \n\t" // (s-dx)*dy |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1663 "pmullw %%mm4, %%mm1 \n\t" // dx*(s-dy) |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1664 |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1665 "movd %4, %%mm5 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1666 "movd %3, %%mm4 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1667 "punpcklbw %%mm7, %%mm5 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1668 "punpcklbw %%mm7, %%mm4 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1669 "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
|
1670 "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
|
1671 |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1672 "movd %2, %%mm5 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1673 "movd %1, %%mm4 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1674 "punpcklbw %%mm7, %%mm5 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1675 "punpcklbw %%mm7, %%mm4 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1676 "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
|
1677 "pmullw %%mm4, %%mm0 \n\t" // src[0,0] * (s-dx)*(s-dy) |
3250 | 1678 "paddw %5, %%mm1 \n\t" |
3248
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1679 "paddw %%mm3, %%mm2 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1680 "paddw %%mm1, %%mm0 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1681 "paddw %%mm2, %%mm0 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1682 |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1683 "psrlw %6, %%mm0 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1684 "packuswb %%mm0, %%mm0 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1685 "movd %%mm0, %0 \n\t" |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1686 |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1687 : "=m"(dst[x+y*stride]) |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1688 : "m"(src[0]), "m"(src[1]), |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1689 "m"(src[stride]), "m"(src[stride+1]), |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1690 "m"(*r4), "m"(shift2) |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1691 ); |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1692 src += stride; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1693 } |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1694 src += 4-h*stride; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1695 } |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1696 } |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
1697 |
3215
06f98047ff26
prefetch pixels for future motion compensation. 2-5% faster h264.
lorenm
parents:
3213
diff
changeset
|
1698 #define PREFETCH(name, op) \ |
4172 | 1699 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
|
1700 const uint8_t *p= mem;\ |
06f98047ff26
prefetch pixels for future motion compensation. 2-5% faster h264.
lorenm
parents:
3213
diff
changeset
|
1701 do{\ |
06f98047ff26
prefetch pixels for future motion compensation. 2-5% faster h264.
lorenm
parents:
3213
diff
changeset
|
1702 asm volatile(#op" %0" :: "m"(*p));\ |
06f98047ff26
prefetch pixels for future motion compensation. 2-5% faster h264.
lorenm
parents:
3213
diff
changeset
|
1703 p+= stride;\ |
06f98047ff26
prefetch pixels for future motion compensation. 2-5% faster h264.
lorenm
parents:
3213
diff
changeset
|
1704 }while(--h);\ |
06f98047ff26
prefetch pixels for future motion compensation. 2-5% faster h264.
lorenm
parents:
3213
diff
changeset
|
1705 } |
06f98047ff26
prefetch pixels for future motion compensation. 2-5% faster h264.
lorenm
parents:
3213
diff
changeset
|
1706 PREFETCH(prefetch_mmx2, prefetcht0) |
06f98047ff26
prefetch pixels for future motion compensation. 2-5% faster h264.
lorenm
parents:
3213
diff
changeset
|
1707 PREFETCH(prefetch_3dnow, prefetch) |
06f98047ff26
prefetch pixels for future motion compensation. 2-5% faster h264.
lorenm
parents:
3213
diff
changeset
|
1708 #undef PREFETCH |
06f98047ff26
prefetch pixels for future motion compensation. 2-5% faster h264.
lorenm
parents:
3213
diff
changeset
|
1709 |
2754 | 1710 #include "h264dsp_mmx.c" |
2967 | 1711 |
6009 | 1712 /* CAVS specific */ |
3524 | 1713 void ff_cavsdsp_init_mmx2(DSPContext* c, AVCodecContext *avctx); |
6522
dfa76e0734e5
Add missed call to ff_cavsdsp_init_3dnow() in dsputil_init_mmx()
zuxy
parents:
6513
diff
changeset
|
1714 void ff_cavsdsp_init_3dnow(DSPContext* c, AVCodecContext *avctx); |
3524 | 1715 |
1716 void ff_put_cavs_qpel8_mc00_mmx2(uint8_t *dst, uint8_t *src, int stride) { | |
1717 put_pixels8_mmx(dst, src, stride, 8); | |
1718 } | |
1719 void ff_avg_cavs_qpel8_mc00_mmx2(uint8_t *dst, uint8_t *src, int stride) { | |
1720 avg_pixels8_mmx(dst, src, stride, 8); | |
1721 } | |
1722 void ff_put_cavs_qpel16_mc00_mmx2(uint8_t *dst, uint8_t *src, int stride) { | |
1723 put_pixels16_mmx(dst, src, stride, 16); | |
1724 } | |
1725 void ff_avg_cavs_qpel16_mc00_mmx2(uint8_t *dst, uint8_t *src, int stride) { | |
1726 avg_pixels16_mmx(dst, src, stride, 16); | |
1727 } | |
1728 | |
5948 | 1729 /* VC1 specific */ |
1730 void ff_vc1dsp_init_mmx(DSPContext* dsp, AVCodecContext *avctx); | |
1731 | |
1732 void ff_put_vc1_mspel_mc00_mmx(uint8_t *dst, const uint8_t *src, int stride, int rnd) { | |
1733 put_pixels8_mmx(dst, src, stride, 8); | |
1734 } | |
1735 | |
1092 | 1736 /* external functions, from idct_mmx.c */ |
1737 void ff_mmx_idct(DCTELEM *block); | |
1738 void ff_mmxext_idct(DCTELEM *block); | |
1739 | |
1740 /* XXX: those functions should be suppressed ASAP when all IDCTs are | |
1741 converted */ | |
4020
723818b5de0f
Put libmpeg2 IDCT functions under CONFIG_GPL, fixes link failure
diego
parents:
4001
diff
changeset
|
1742 #ifdef CONFIG_GPL |
1092 | 1743 static void ff_libmpeg2mmx_idct_put(uint8_t *dest, int line_size, DCTELEM *block) |
1744 { | |
1745 ff_mmx_idct (block); | |
1746 put_pixels_clamped_mmx(block, dest, line_size); | |
1747 } | |
1748 static void ff_libmpeg2mmx_idct_add(uint8_t *dest, int line_size, DCTELEM *block) | |
1749 { | |
1750 ff_mmx_idct (block); | |
1751 add_pixels_clamped_mmx(block, dest, line_size); | |
1752 } | |
1753 static void ff_libmpeg2mmx2_idct_put(uint8_t *dest, int line_size, DCTELEM *block) | |
1754 { | |
1755 ff_mmxext_idct (block); | |
1756 put_pixels_clamped_mmx(block, dest, line_size); | |
1757 } | |
1758 static void ff_libmpeg2mmx2_idct_add(uint8_t *dest, int line_size, DCTELEM *block) | |
1759 { | |
1760 ff_mmxext_idct (block); | |
1761 add_pixels_clamped_mmx(block, dest, line_size); | |
1762 } | |
4020
723818b5de0f
Put libmpeg2 IDCT functions under CONFIG_GPL, fixes link failure
diego
parents:
4001
diff
changeset
|
1763 #endif |
2868 | 1764 static void ff_idct_xvid_mmx_put(uint8_t *dest, int line_size, DCTELEM *block) |
1765 { | |
1766 ff_idct_xvid_mmx (block); | |
1767 put_pixels_clamped_mmx(block, dest, line_size); | |
1768 } | |
1769 static void ff_idct_xvid_mmx_add(uint8_t *dest, int line_size, DCTELEM *block) | |
1770 { | |
1771 ff_idct_xvid_mmx (block); | |
1772 add_pixels_clamped_mmx(block, dest, line_size); | |
1773 } | |
1774 static void ff_idct_xvid_mmx2_put(uint8_t *dest, int line_size, DCTELEM *block) | |
1775 { | |
1776 ff_idct_xvid_mmx2 (block); | |
1777 put_pixels_clamped_mmx(block, dest, line_size); | |
1778 } | |
1779 static void ff_idct_xvid_mmx2_add(uint8_t *dest, int line_size, DCTELEM *block) | |
1780 { | |
1781 ff_idct_xvid_mmx2 (block); | |
1782 add_pixels_clamped_mmx(block, dest, line_size); | |
1783 } | |
2967 | 1784 |
3541
3fbddeb13686
10l, vorbis_inverse_coupling_sse() was really 3dnow
lorenm
parents:
3536
diff
changeset
|
1785 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
|
1786 { |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1787 int i; |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1788 asm volatile("pxor %%mm7, %%mm7":); |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1789 for(i=0; i<blocksize; i+=2) { |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1790 asm volatile( |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1791 "movq %0, %%mm0 \n\t" |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1792 "movq %1, %%mm1 \n\t" |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1793 "movq %%mm0, %%mm2 \n\t" |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1794 "movq %%mm1, %%mm3 \n\t" |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1795 "pfcmpge %%mm7, %%mm2 \n\t" // m <= 0.0 |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1796 "pfcmpge %%mm7, %%mm3 \n\t" // a <= 0.0 |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1797 "pslld $31, %%mm2 \n\t" // keep only the sign bit |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1798 "pxor %%mm2, %%mm1 \n\t" |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1799 "movq %%mm3, %%mm4 \n\t" |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1800 "pand %%mm1, %%mm3 \n\t" |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1801 "pandn %%mm1, %%mm4 \n\t" |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1802 "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
|
1803 "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
|
1804 "movq %%mm3, %1 \n\t" |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1805 "movq %%mm0, %0 \n\t" |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1806 :"+m"(mag[i]), "+m"(ang[i]) |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1807 ::"memory" |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1808 ); |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1809 } |
3561 | 1810 asm volatile("femms"); |
3536
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1811 } |
3557
8e13ec0f8aa3
change vorbis_inverse_coupling_sse2() so it works on sse1 cpus
michael
parents:
3541
diff
changeset
|
1812 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
|
1813 { |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1814 int i; |
3557
8e13ec0f8aa3
change vorbis_inverse_coupling_sse2() so it works on sse1 cpus
michael
parents:
3541
diff
changeset
|
1815 |
8e13ec0f8aa3
change vorbis_inverse_coupling_sse2() so it works on sse1 cpus
michael
parents:
3541
diff
changeset
|
1816 asm volatile( |
8e13ec0f8aa3
change vorbis_inverse_coupling_sse2() so it works on sse1 cpus
michael
parents:
3541
diff
changeset
|
1817 "movaps %0, %%xmm5 \n\t" |
8e13ec0f8aa3
change vorbis_inverse_coupling_sse2() so it works on sse1 cpus
michael
parents:
3541
diff
changeset
|
1818 ::"m"(ff_pdw_80000000[0]) |
8e13ec0f8aa3
change vorbis_inverse_coupling_sse2() so it works on sse1 cpus
michael
parents:
3541
diff
changeset
|
1819 ); |
3536
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1820 for(i=0; i<blocksize; i+=4) { |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1821 asm volatile( |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1822 "movaps %0, %%xmm0 \n\t" |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1823 "movaps %1, %%xmm1 \n\t" |
3557
8e13ec0f8aa3
change vorbis_inverse_coupling_sse2() so it works on sse1 cpus
michael
parents:
3541
diff
changeset
|
1824 "xorps %%xmm2, %%xmm2 \n\t" |
8e13ec0f8aa3
change vorbis_inverse_coupling_sse2() so it works on sse1 cpus
michael
parents:
3541
diff
changeset
|
1825 "xorps %%xmm3, %%xmm3 \n\t" |
3536
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1826 "cmpleps %%xmm0, %%xmm2 \n\t" // m <= 0.0 |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1827 "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
|
1828 "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
|
1829 "xorps %%xmm2, %%xmm1 \n\t" |
3536
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1830 "movaps %%xmm3, %%xmm4 \n\t" |
3557
8e13ec0f8aa3
change vorbis_inverse_coupling_sse2() so it works on sse1 cpus
michael
parents:
3541
diff
changeset
|
1831 "andps %%xmm1, %%xmm3 \n\t" |
8e13ec0f8aa3
change vorbis_inverse_coupling_sse2() so it works on sse1 cpus
michael
parents:
3541
diff
changeset
|
1832 "andnps %%xmm1, %%xmm4 \n\t" |
3536
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1833 "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
|
1834 "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
|
1835 "movaps %%xmm3, %1 \n\t" |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1836 "movaps %%xmm0, %0 \n\t" |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1837 :"+m"(mag[i]), "+m"(ang[i]) |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1838 ::"memory" |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1839 ); |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1840 } |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1841 } |
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
1842 |
3568
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1843 static void vector_fmul_3dnow(float *dst, const float *src, int len){ |
3574 | 1844 long i = (len-4)*4; |
1845 asm volatile( | |
1846 "1: \n\t" | |
1847 "movq (%1,%0), %%mm0 \n\t" | |
1848 "movq 8(%1,%0), %%mm1 \n\t" | |
1849 "pfmul (%2,%0), %%mm0 \n\t" | |
1850 "pfmul 8(%2,%0), %%mm1 \n\t" | |
1851 "movq %%mm0, (%1,%0) \n\t" | |
1852 "movq %%mm1, 8(%1,%0) \n\t" | |
1853 "sub $16, %0 \n\t" | |
1854 "jge 1b \n\t" | |
1855 "femms \n\t" | |
1856 :"+r"(i) | |
1857 :"r"(dst), "r"(src) | |
1858 :"memory" | |
1859 ); | |
3568
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1860 } |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1861 static void vector_fmul_sse(float *dst, const float *src, int len){ |
3574 | 1862 long i = (len-8)*4; |
1863 asm volatile( | |
1864 "1: \n\t" | |
1865 "movaps (%1,%0), %%xmm0 \n\t" | |
1866 "movaps 16(%1,%0), %%xmm1 \n\t" | |
1867 "mulps (%2,%0), %%xmm0 \n\t" | |
1868 "mulps 16(%2,%0), %%xmm1 \n\t" | |
1869 "movaps %%xmm0, (%1,%0) \n\t" | |
1870 "movaps %%xmm1, 16(%1,%0) \n\t" | |
1871 "sub $32, %0 \n\t" | |
1872 "jge 1b \n\t" | |
1873 :"+r"(i) | |
1874 :"r"(dst), "r"(src) | |
1875 :"memory" | |
1876 ); | |
3568
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1877 } |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1878 |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1879 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
|
1880 long i = len*4-16; |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1881 asm volatile( |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1882 "1: \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1883 "pswapd 8(%1), %%mm0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1884 "pswapd (%1), %%mm1 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1885 "pfmul (%3,%0), %%mm0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1886 "pfmul 8(%3,%0), %%mm1 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1887 "movq %%mm0, (%2,%0) \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1888 "movq %%mm1, 8(%2,%0) \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1889 "add $16, %1 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1890 "sub $16, %0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1891 "jge 1b \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1892 :"+r"(i), "+r"(src1) |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1893 :"r"(dst), "r"(src0) |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1894 ); |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1895 asm volatile("femms"); |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1896 } |
3569
c42c03f3b402
convert vector_fmul_reverse_sse2 and vector_fmul_add_add_sse2 to sse
michael
parents:
3568
diff
changeset
|
1897 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
|
1898 long i = len*4-32; |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1899 asm volatile( |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1900 "1: \n\t" |
3569
c42c03f3b402
convert vector_fmul_reverse_sse2 and vector_fmul_add_add_sse2 to sse
michael
parents:
3568
diff
changeset
|
1901 "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
|
1902 "movaps (%1), %%xmm1 \n\t" |
c42c03f3b402
convert vector_fmul_reverse_sse2 and vector_fmul_add_add_sse2 to sse
michael
parents:
3568
diff
changeset
|
1903 "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
|
1904 "shufps $0x1b, %%xmm1, %%xmm1 \n\t" |
3568
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1905 "mulps (%3,%0), %%xmm0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1906 "mulps 16(%3,%0), %%xmm1 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1907 "movaps %%xmm0, (%2,%0) \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1908 "movaps %%xmm1, 16(%2,%0) \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1909 "add $32, %1 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1910 "sub $32, %0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1911 "jge 1b \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1912 :"+r"(i), "+r"(src1) |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1913 :"r"(dst), "r"(src0) |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1914 ); |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1915 } |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1916 |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1917 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
|
1918 const float *src2, int src3, int len, int step){ |
3574 | 1919 long i = (len-4)*4; |
3568
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1920 if(step == 2 && src3 == 0){ |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1921 dst += (len-4)*2; |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1922 asm volatile( |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1923 "1: \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1924 "movq (%2,%0), %%mm0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1925 "movq 8(%2,%0), %%mm1 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1926 "pfmul (%3,%0), %%mm0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1927 "pfmul 8(%3,%0), %%mm1 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1928 "pfadd (%4,%0), %%mm0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1929 "pfadd 8(%4,%0), %%mm1 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1930 "movd %%mm0, (%1) \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1931 "movd %%mm1, 16(%1) \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1932 "psrlq $32, %%mm0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1933 "psrlq $32, %%mm1 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1934 "movd %%mm0, 8(%1) \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1935 "movd %%mm1, 24(%1) \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1936 "sub $32, %1 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1937 "sub $16, %0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1938 "jge 1b \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1939 :"+r"(i), "+r"(dst) |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1940 :"r"(src0), "r"(src1), "r"(src2) |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1941 :"memory" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1942 ); |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1943 } |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1944 else if(step == 1 && src3 == 0){ |
3574 | 1945 asm volatile( |
1946 "1: \n\t" | |
1947 "movq (%2,%0), %%mm0 \n\t" | |
1948 "movq 8(%2,%0), %%mm1 \n\t" | |
1949 "pfmul (%3,%0), %%mm0 \n\t" | |
1950 "pfmul 8(%3,%0), %%mm1 \n\t" | |
1951 "pfadd (%4,%0), %%mm0 \n\t" | |
1952 "pfadd 8(%4,%0), %%mm1 \n\t" | |
1953 "movq %%mm0, (%1,%0) \n\t" | |
1954 "movq %%mm1, 8(%1,%0) \n\t" | |
1955 "sub $16, %0 \n\t" | |
1956 "jge 1b \n\t" | |
1957 :"+r"(i) | |
1958 :"r"(dst), "r"(src0), "r"(src1), "r"(src2) | |
1959 :"memory" | |
1960 ); | |
3568
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1961 } |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1962 else |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1963 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
|
1964 asm volatile("femms"); |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1965 } |
3569
c42c03f3b402
convert vector_fmul_reverse_sse2 and vector_fmul_add_add_sse2 to sse
michael
parents:
3568
diff
changeset
|
1966 static void vector_fmul_add_add_sse(float *dst, const float *src0, const float *src1, |
3574 | 1967 const float *src2, int src3, int len, int step){ |
1968 long i = (len-8)*4; | |
3568
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1969 if(step == 2 && src3 == 0){ |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1970 dst += (len-8)*2; |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1971 asm volatile( |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1972 "1: \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1973 "movaps (%2,%0), %%xmm0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1974 "movaps 16(%2,%0), %%xmm1 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1975 "mulps (%3,%0), %%xmm0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1976 "mulps 16(%3,%0), %%xmm1 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1977 "addps (%4,%0), %%xmm0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1978 "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
|
1979 "movss %%xmm0, (%1) \n\t" |
c42c03f3b402
convert vector_fmul_reverse_sse2 and vector_fmul_add_add_sse2 to sse
michael
parents:
3568
diff
changeset
|
1980 "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
|
1981 "movhlps %%xmm0, %%xmm2 \n\t" |
c42c03f3b402
convert vector_fmul_reverse_sse2 and vector_fmul_add_add_sse2 to sse
michael
parents:
3568
diff
changeset
|
1982 "movhlps %%xmm1, %%xmm3 \n\t" |
c42c03f3b402
convert vector_fmul_reverse_sse2 and vector_fmul_add_add_sse2 to sse
michael
parents:
3568
diff
changeset
|
1983 "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
|
1984 "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
|
1985 "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
|
1986 "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
|
1987 "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
|
1988 "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
|
1989 "movhlps %%xmm0, %%xmm2 \n\t" |
c42c03f3b402
convert vector_fmul_reverse_sse2 and vector_fmul_add_add_sse2 to sse
michael
parents:
3568
diff
changeset
|
1990 "movhlps %%xmm1, %%xmm3 \n\t" |
c42c03f3b402
convert vector_fmul_reverse_sse2 and vector_fmul_add_add_sse2 to sse
michael
parents:
3568
diff
changeset
|
1991 "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
|
1992 "movss %%xmm3, 56(%1) \n\t" |
3568
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1993 "sub $64, %1 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1994 "sub $32, %0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1995 "jge 1b \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1996 :"+r"(i), "+r"(dst) |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1997 :"r"(src0), "r"(src1), "r"(src2) |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1998 :"memory" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
1999 ); |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2000 } |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2001 else if(step == 1 && src3 == 0){ |
3574 | 2002 asm volatile( |
2003 "1: \n\t" | |
2004 "movaps (%2,%0), %%xmm0 \n\t" | |
2005 "movaps 16(%2,%0), %%xmm1 \n\t" | |
2006 "mulps (%3,%0), %%xmm0 \n\t" | |
2007 "mulps 16(%3,%0), %%xmm1 \n\t" | |
2008 "addps (%4,%0), %%xmm0 \n\t" | |
2009 "addps 16(%4,%0), %%xmm1 \n\t" | |
2010 "movaps %%xmm0, (%1,%0) \n\t" | |
2011 "movaps %%xmm1, 16(%1,%0) \n\t" | |
2012 "sub $32, %0 \n\t" | |
2013 "jge 1b \n\t" | |
2014 :"+r"(i) | |
2015 :"r"(dst), "r"(src0), "r"(src1), "r"(src2) | |
2016 :"memory" | |
2017 ); | |
3568
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2018 } |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2019 else |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2020 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
|
2021 } |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2022 |
4172 | 2023 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
|
2024 // 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
|
2025 int i; |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2026 for(i=0; i<len; i+=4) { |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2027 asm volatile( |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2028 "pf2id %1, %%mm0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2029 "pf2id %2, %%mm1 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2030 "packssdw %%mm1, %%mm0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2031 "movq %%mm0, %0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2032 :"=m"(dst[i]) |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2033 :"m"(src[i]), "m"(src[i+2]) |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2034 ); |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2035 } |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2036 asm volatile("femms"); |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2037 } |
4172 | 2038 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
|
2039 int i; |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2040 for(i=0; i<len; i+=4) { |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2041 asm volatile( |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2042 "cvtps2pi %1, %%mm0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2043 "cvtps2pi %2, %%mm1 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2044 "packssdw %%mm1, %%mm0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2045 "movq %%mm0, %0 \n\t" |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2046 :"=m"(dst[i]) |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2047 :"m"(src[i]), "m"(src[i+2]) |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2048 ); |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2049 } |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2050 asm volatile("emms"); |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2051 } |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2052 |
6195
5f704e9cb518
fix prototypes, remove warning: i386/dsputil_mmx.c:3594: warning: assignment from incompatible pointer type
bcoudurier
parents:
6181
diff
changeset
|
2053 extern void ff_snow_horizontal_compose97i_sse2(IDWTELEM *b, int width); |
5f704e9cb518
fix prototypes, remove warning: i386/dsputil_mmx.c:3594: warning: assignment from incompatible pointer type
bcoudurier
parents:
6181
diff
changeset
|
2054 extern void ff_snow_horizontal_compose97i_mmx(IDWTELEM *b, int width); |
5f704e9cb518
fix prototypes, remove warning: i386/dsputil_mmx.c:3594: warning: assignment from incompatible pointer type
bcoudurier
parents:
6181
diff
changeset
|
2055 extern void ff_snow_vertical_compose97i_sse2(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, IDWTELEM *b3, IDWTELEM *b4, IDWTELEM *b5, int width); |
5f704e9cb518
fix prototypes, remove warning: i386/dsputil_mmx.c:3594: warning: assignment from incompatible pointer type
bcoudurier
parents:
6181
diff
changeset
|
2056 extern void ff_snow_vertical_compose97i_mmx(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, IDWTELEM *b3, IDWTELEM *b4, IDWTELEM *b5, int width); |
4436
d3e389536b0a
Add the const specifier as needed to reduce the number of warnings.
takis
parents:
4197
diff
changeset
|
2057 extern void ff_snow_inner_add_yblock_sse2(const uint8_t *obmc, const int obmc_stride, uint8_t * * block, int b_w, int b_h, |
3211
b77b5e7072d6
add MMX and SSE versions of ff_snow_inner_add_yblock
gpoirier
parents:
3210
diff
changeset
|
2058 int src_x, int src_y, int src_stride, slice_buffer * sb, int add, uint8_t * dst8); |
4436
d3e389536b0a
Add the const specifier as needed to reduce the number of warnings.
takis
parents:
4197
diff
changeset
|
2059 extern void ff_snow_inner_add_yblock_mmx(const uint8_t *obmc, const int obmc_stride, uint8_t * * block, int b_w, int b_h, |
3211
b77b5e7072d6
add MMX and SSE versions of ff_snow_inner_add_yblock
gpoirier
parents:
3210
diff
changeset
|
2060 int src_x, int src_y, int src_stride, slice_buffer * sb, int add, uint8_t * dst8); |
3207
33110c1008a4
Add the mmx and sse2 implementations of ff_snow_vertical_compose().
gpoirier
parents:
3174
diff
changeset
|
2061 |
1092 | 2062 void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) |
0 | 2063 { |
4197 | 2064 mm_flags = mm_support(); |
1115 | 2065 |
1122 | 2066 if (avctx->dsp_mask) { |
2979 | 2067 if (avctx->dsp_mask & FF_MM_FORCE) |
4197 | 2068 mm_flags |= (avctx->dsp_mask & 0xffff); |
2979 | 2069 else |
4197 | 2070 mm_flags &= ~(avctx->dsp_mask & 0xffff); |
1122 | 2071 } |
1115 | 2072 |
631
47a8964ba5cd
be less verbose patch by (Lennert Buytenhek <buytenh at math dot leidenuniv dot nl>)
michaelni
parents:
629
diff
changeset
|
2073 #if 0 |
1868 | 2074 av_log(avctx, AV_LOG_INFO, "libavcodec: CPU flags:"); |
4197 | 2075 if (mm_flags & MM_MMX) |
1868 | 2076 av_log(avctx, AV_LOG_INFO, " mmx"); |
4197 | 2077 if (mm_flags & MM_MMXEXT) |
1868 | 2078 av_log(avctx, AV_LOG_INFO, " mmxext"); |
4197 | 2079 if (mm_flags & MM_3DNOW) |
1868 | 2080 av_log(avctx, AV_LOG_INFO, " 3dnow"); |
4197 | 2081 if (mm_flags & MM_SSE) |
1868 | 2082 av_log(avctx, AV_LOG_INFO, " sse"); |
4197 | 2083 if (mm_flags & MM_SSE2) |
1868 | 2084 av_log(avctx, AV_LOG_INFO, " sse2"); |
2085 av_log(avctx, AV_LOG_INFO, "\n"); | |
0 | 2086 #endif |
2087 | |
4197 | 2088 if (mm_flags & MM_MMX) { |
1092 | 2089 const int idct_algo= avctx->idct_algo; |
2090 | |
2256 | 2091 if(avctx->lowres==0){ |
2092 if(idct_algo==FF_IDCT_AUTO || idct_algo==FF_IDCT_SIMPLEMMX){ | |
2093 c->idct_put= ff_simple_idct_put_mmx; | |
2094 c->idct_add= ff_simple_idct_add_mmx; | |
2095 c->idct = ff_simple_idct_mmx; | |
2096 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
|
2097 #ifdef CONFIG_GPL |
2256 | 2098 }else if(idct_algo==FF_IDCT_LIBMPEG2MMX){ |
4197 | 2099 if(mm_flags & MM_MMXEXT){ |
2256 | 2100 c->idct_put= ff_libmpeg2mmx2_idct_put; |
2101 c->idct_add= ff_libmpeg2mmx2_idct_add; | |
2102 c->idct = ff_mmxext_idct; | |
2103 }else{ | |
2104 c->idct_put= ff_libmpeg2mmx_idct_put; | |
2105 c->idct_add= ff_libmpeg2mmx_idct_add; | |
2106 c->idct = ff_mmx_idct; | |
2107 } | |
2108 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
|
2109 #endif |
5007 | 2110 }else if((ENABLE_VP3_DECODER || ENABLE_VP5_DECODER || ENABLE_VP6_DECODER) && |
2111 idct_algo==FF_IDCT_VP3 && | |
3721
2000e401593d
disable vp3 mmx idct for theora files to avoid artifacts
aurel
parents:
3717
diff
changeset
|
2112 avctx->codec->id!=CODEC_ID_THEORA && |
3712
f7f75f718efb
Enables back the mmx/sse optimized version of the vp3 idct.
aurel
parents:
3666
diff
changeset
|
2113 !(avctx->flags & CODEC_FLAG_BITEXACT)){ |
4197 | 2114 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
|
2115 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
|
2116 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
|
2117 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
|
2118 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
|
2119 }else{ |
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
2120 ff_vp3_dsp_init_mmx(); |
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
2691
diff
changeset
|
2121 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
|
2122 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
|
2123 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
|
2124 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
|
2125 } |
3524 | 2126 }else if(idct_algo==FF_IDCT_CAVS){ |
2127 c->idct_permutation_type= FF_TRANSPOSE_IDCT_PERM; | |
2868 | 2128 }else if(idct_algo==FF_IDCT_XVIDMMX){ |
4197 | 2129 if(mm_flags & MM_MMXEXT){ |
2868 | 2130 c->idct_put= ff_idct_xvid_mmx2_put; |
2131 c->idct_add= ff_idct_xvid_mmx2_add; | |
2132 c->idct = ff_idct_xvid_mmx2; | |
2133 }else{ | |
2134 c->idct_put= ff_idct_xvid_mmx_put; | |
2135 c->idct_add= ff_idct_xvid_mmx_add; | |
2136 c->idct = ff_idct_xvid_mmx; | |
2137 } | |
1092 | 2138 } |
2139 } | |
1868 | 2140 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
2141 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
|
2142 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
|
2143 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
|
2144 c->clear_blocks = clear_blocks_mmx; |
415 | 2145 |
6327 | 2146 #define SET_HPEL_FUNCS(PFX, IDX, SIZE, CPU) \ |
2147 c->PFX ## _pixels_tab[IDX][0] = PFX ## _pixels ## SIZE ## _ ## CPU; \ | |
2148 c->PFX ## _pixels_tab[IDX][1] = PFX ## _pixels ## SIZE ## _x2_ ## CPU; \ | |
2149 c->PFX ## _pixels_tab[IDX][2] = PFX ## _pixels ## SIZE ## _y2_ ## CPU; \ | |
2150 c->PFX ## _pixels_tab[IDX][3] = PFX ## _pixels ## SIZE ## _xy2_ ## CPU | |
2151 | |
2152 SET_HPEL_FUNCS(put, 0, 16, mmx); | |
2153 SET_HPEL_FUNCS(put_no_rnd, 0, 16, mmx); | |
2154 SET_HPEL_FUNCS(avg, 0, 16, mmx); | |
2155 SET_HPEL_FUNCS(avg_no_rnd, 0, 16, mmx); | |
2156 SET_HPEL_FUNCS(put, 1, 8, mmx); | |
2157 SET_HPEL_FUNCS(put_no_rnd, 1, 8, mmx); | |
2158 SET_HPEL_FUNCS(avg, 1, 8, mmx); | |
2159 SET_HPEL_FUNCS(avg_no_rnd, 1, 8, mmx); | |
2967 | 2160 |
3248
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2161 c->gmc= gmc_mmx; |
7aa9f80e7954
mmx implementation of 3-point GMC. (5x faster than C)
lorenm
parents:
3215
diff
changeset
|
2162 |
866 | 2163 c->add_bytes= add_bytes_mmx; |
6384 | 2164 c->add_bytes_l2= add_bytes_l2_mmx; |
1647 | 2165 |
6437 | 2166 c->draw_edges = draw_edges_mmx; |
2167 | |
5277
7b3fcb7c61ce
Avoid linking with h263.c functions when the relevant codecs
aurel
parents:
5255
diff
changeset
|
2168 if (ENABLE_ANY_H263) { |
5278 | 2169 c->h263_v_loop_filter= h263_v_loop_filter_mmx; |
2170 c->h263_h_loop_filter= h263_h_loop_filter_mmx; | |
5277
7b3fcb7c61ce
Avoid linking with h263.c functions when the relevant codecs
aurel
parents:
5255
diff
changeset
|
2171 } |
6057
03febc8f506f
add MMX version for put_no_rnd_h264_chroma_mc8_c, used in VC-1 decoding.
gpoirier
parents:
6056
diff
changeset
|
2172 c->put_h264_chroma_pixels_tab[0]= put_h264_chroma_mc8_mmx_rnd; |
2922
d772011258ec
faster h264_chroma_mc8_mmx, added h264_chroma_mc4_mmx.
lorenm
parents:
2902
diff
changeset
|
2173 c->put_h264_chroma_pixels_tab[1]= put_h264_chroma_mc4_mmx; |
6057
03febc8f506f
add MMX version for put_no_rnd_h264_chroma_mc8_c, used in VC-1 decoding.
gpoirier
parents:
6056
diff
changeset
|
2174 c->put_no_rnd_h264_chroma_pixels_tab[0]= put_h264_chroma_mc8_mmx_nornd; |
2967 | 2175 |
3173 | 2176 c->h264_idct_dc_add= |
2177 c->h264_idct_add= ff_h264_idct_add_mmx; | |
3174 | 2178 c->h264_idct8_dc_add= |
2179 c->h264_idct8_add= ff_h264_idct8_add_mmx; | |
6320 | 2180 if (mm_flags & MM_SSE2) |
2181 c->h264_idct8_add= ff_h264_idct8_add_sse2; | |
3173 | 2182 |
4197 | 2183 if (mm_flags & MM_MMXEXT) { |
3215
06f98047ff26
prefetch pixels for future motion compensation. 2-5% faster h264.
lorenm
parents:
3213
diff
changeset
|
2184 c->prefetch = prefetch_mmx2; |
06f98047ff26
prefetch pixels for future motion compensation. 2-5% faster h264.
lorenm
parents:
3213
diff
changeset
|
2185 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
2186 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
|
2187 c->put_pixels_tab[0][2] = put_pixels16_y2_mmx2; |
651 | 2188 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
2189 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
|
2190 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
|
2191 c->avg_pixels_tab[0][2] = avg_pixels16_y2_mmx2; |
415 | 2192 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
2193 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
|
2194 c->put_pixels_tab[1][2] = put_pixels8_y2_mmx2; |
651 | 2195 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
2196 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
|
2197 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
|
2198 c->avg_pixels_tab[1][2] = avg_pixels8_y2_mmx2; |
1092 | 2199 |
3105
2d35fb3cb940
h264: special case dc-only idct. ~1% faster overall
lorenm
parents:
3089
diff
changeset
|
2200 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
|
2201 c->h264_idct8_dc_add= ff_h264_idct8_dc_add_mmx2; |
2745 | 2202 |
1092 | 2203 if(!(avctx->flags & CODEC_FLAG_BITEXACT)){ |
2204 c->put_no_rnd_pixels_tab[0][1] = put_no_rnd_pixels16_x2_mmx2; | |
2205 c->put_no_rnd_pixels_tab[0][2] = put_no_rnd_pixels16_y2_mmx2; | |
2206 c->put_no_rnd_pixels_tab[1][1] = put_no_rnd_pixels8_x2_mmx2; | |
2207 c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y2_mmx2; | |
2208 c->avg_pixels_tab[0][3] = avg_pixels16_xy2_mmx2; | |
2209 c->avg_pixels_tab[1][3] = avg_pixels8_xy2_mmx2; | |
2210 } | |
959 | 2211 |
6327 | 2212 #define SET_QPEL_FUNCS(PFX, IDX, SIZE, CPU) \ |
2213 c->PFX ## _pixels_tab[IDX][ 0] = PFX ## SIZE ## _mc00_ ## CPU; \ | |
2214 c->PFX ## _pixels_tab[IDX][ 1] = PFX ## SIZE ## _mc10_ ## CPU; \ | |
2215 c->PFX ## _pixels_tab[IDX][ 2] = PFX ## SIZE ## _mc20_ ## CPU; \ | |
2216 c->PFX ## _pixels_tab[IDX][ 3] = PFX ## SIZE ## _mc30_ ## CPU; \ | |
2217 c->PFX ## _pixels_tab[IDX][ 4] = PFX ## SIZE ## _mc01_ ## CPU; \ | |
2218 c->PFX ## _pixels_tab[IDX][ 5] = PFX ## SIZE ## _mc11_ ## CPU; \ | |
2219 c->PFX ## _pixels_tab[IDX][ 6] = PFX ## SIZE ## _mc21_ ## CPU; \ | |
2220 c->PFX ## _pixels_tab[IDX][ 7] = PFX ## SIZE ## _mc31_ ## CPU; \ | |
2221 c->PFX ## _pixels_tab[IDX][ 8] = PFX ## SIZE ## _mc02_ ## CPU; \ | |
2222 c->PFX ## _pixels_tab[IDX][ 9] = PFX ## SIZE ## _mc12_ ## CPU; \ | |
2223 c->PFX ## _pixels_tab[IDX][10] = PFX ## SIZE ## _mc22_ ## CPU; \ | |
2224 c->PFX ## _pixels_tab[IDX][11] = PFX ## SIZE ## _mc32_ ## CPU; \ | |
2225 c->PFX ## _pixels_tab[IDX][12] = PFX ## SIZE ## _mc03_ ## CPU; \ | |
2226 c->PFX ## _pixels_tab[IDX][13] = PFX ## SIZE ## _mc13_ ## CPU; \ | |
2227 c->PFX ## _pixels_tab[IDX][14] = PFX ## SIZE ## _mc23_ ## CPU; \ | |
2228 c->PFX ## _pixels_tab[IDX][15] = PFX ## SIZE ## _mc33_ ## CPU | |
2229 | |
2230 SET_QPEL_FUNCS(put_qpel, 0, 16, mmx2); | |
2231 SET_QPEL_FUNCS(put_qpel, 1, 8, mmx2); | |
2232 SET_QPEL_FUNCS(put_no_rnd_qpel, 0, 16, mmx2); | |
2233 SET_QPEL_FUNCS(put_no_rnd_qpel, 1, 8, mmx2); | |
2234 SET_QPEL_FUNCS(avg_qpel, 0, 16, mmx2); | |
2235 SET_QPEL_FUNCS(avg_qpel, 1, 8, mmx2); | |
2236 | |
2237 SET_QPEL_FUNCS(put_h264_qpel, 0, 16, mmx2); | |
2238 SET_QPEL_FUNCS(put_h264_qpel, 1, 8, mmx2); | |
2239 SET_QPEL_FUNCS(put_h264_qpel, 2, 4, mmx2); | |
2240 SET_QPEL_FUNCS(avg_h264_qpel, 0, 16, mmx2); | |
2241 SET_QPEL_FUNCS(avg_h264_qpel, 1, 8, mmx2); | |
2242 SET_QPEL_FUNCS(avg_h264_qpel, 2, 4, mmx2); | |
2243 | |
2244 SET_QPEL_FUNCS(put_2tap_qpel, 0, 16, mmx2); | |
2245 SET_QPEL_FUNCS(put_2tap_qpel, 1, 8, mmx2); | |
2246 SET_QPEL_FUNCS(avg_2tap_qpel, 0, 16, mmx2); | |
2247 SET_QPEL_FUNCS(avg_2tap_qpel, 1, 8, mmx2); | |
2209 | 2248 |
6057
03febc8f506f
add MMX version for put_no_rnd_h264_chroma_mc8_c, used in VC-1 decoding.
gpoirier
parents:
6056
diff
changeset
|
2249 c->avg_h264_chroma_pixels_tab[0]= avg_h264_chroma_mc8_mmx2_rnd; |
2922
d772011258ec
faster h264_chroma_mc8_mmx, added h264_chroma_mc4_mmx.
lorenm
parents:
2902
diff
changeset
|
2250 c->avg_h264_chroma_pixels_tab[1]= avg_h264_chroma_mc4_mmx2; |
3213 | 2251 c->avg_h264_chroma_pixels_tab[2]= avg_h264_chroma_mc2_mmx2; |
2252 c->put_h264_chroma_pixels_tab[2]= put_h264_chroma_mc2_mmx2; | |
2633 | 2253 c->h264_v_loop_filter_luma= h264_v_loop_filter_luma_mmx2; |
2254 c->h264_h_loop_filter_luma= h264_h_loop_filter_luma_mmx2; | |
2255 c->h264_v_loop_filter_chroma= h264_v_loop_filter_chroma_mmx2; | |
2256 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
|
2257 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
|
2258 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
|
2259 c->h264_loop_filter_strength= h264_loop_filter_strength_mmx2; |
2633 | 2260 |
2902
3c79bc9f3aa9
h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents:
2899
diff
changeset
|
2261 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
|
2262 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
|
2263 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
|
2264 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
|
2265 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
|
2266 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
|
2267 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
|
2268 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
|
2269 |
3c79bc9f3aa9
h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents:
2899
diff
changeset
|
2270 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
|
2271 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
|
2272 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
|
2273 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
|
2274 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
|
2275 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
|
2276 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
|
2277 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
|
2278 |
5949 | 2279 if (ENABLE_CAVS_DECODER) |
5950 | 2280 ff_cavsdsp_init_mmx2(c, avctx); |
5949 | 2281 |
2282 if (ENABLE_VC1_DECODER || ENABLE_WMV3_DECODER) | |
5950 | 2283 ff_vc1dsp_init_mmx(c, avctx); |
5933 | 2284 |
6384 | 2285 c->add_png_paeth_prediction= add_png_paeth_prediction_mmx2; |
4197 | 2286 } else if (mm_flags & MM_3DNOW) { |
3215
06f98047ff26
prefetch pixels for future motion compensation. 2-5% faster h264.
lorenm
parents:
3213
diff
changeset
|
2287 c->prefetch = prefetch_3dnow; |
06f98047ff26
prefetch pixels for future motion compensation. 2-5% faster h264.
lorenm
parents:
3213
diff
changeset
|
2288 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
2289 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
|
2290 c->put_pixels_tab[0][2] = put_pixels16_y2_3dnow; |
393 | 2291 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
2292 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
|
2293 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
|
2294 c->avg_pixels_tab[0][2] = avg_pixels16_y2_3dnow; |
651 | 2295 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
2296 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
|
2297 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
|
2298 |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
2299 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
|
2300 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
|
2301 c->avg_pixels_tab[1][2] = avg_pixels8_y2_3dnow; |
1092 | 2302 |
2303 if(!(avctx->flags & CODEC_FLAG_BITEXACT)){ | |
2304 c->put_no_rnd_pixels_tab[0][1] = put_no_rnd_pixels16_x2_3dnow; | |
2305 c->put_no_rnd_pixels_tab[0][2] = put_no_rnd_pixels16_y2_3dnow; | |
2306 c->put_no_rnd_pixels_tab[1][1] = put_no_rnd_pixels8_x2_3dnow; | |
2307 c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y2_3dnow; | |
2308 c->avg_pixels_tab[0][3] = avg_pixels16_xy2_3dnow; | |
2309 c->avg_pixels_tab[1][3] = avg_pixels8_xy2_3dnow; | |
2310 } | |
984 | 2311 |
6327 | 2312 SET_QPEL_FUNCS(put_qpel, 0, 16, 3dnow); |
2313 SET_QPEL_FUNCS(put_qpel, 1, 8, 3dnow); | |
2314 SET_QPEL_FUNCS(put_no_rnd_qpel, 0, 16, 3dnow); | |
2315 SET_QPEL_FUNCS(put_no_rnd_qpel, 1, 8, 3dnow); | |
2316 SET_QPEL_FUNCS(avg_qpel, 0, 16, 3dnow); | |
2317 SET_QPEL_FUNCS(avg_qpel, 1, 8, 3dnow); | |
2318 | |
2319 SET_QPEL_FUNCS(put_h264_qpel, 0, 16, 3dnow); | |
2320 SET_QPEL_FUNCS(put_h264_qpel, 1, 8, 3dnow); | |
2321 SET_QPEL_FUNCS(put_h264_qpel, 2, 4, 3dnow); | |
2322 SET_QPEL_FUNCS(avg_h264_qpel, 0, 16, 3dnow); | |
2323 SET_QPEL_FUNCS(avg_h264_qpel, 1, 8, 3dnow); | |
2324 SET_QPEL_FUNCS(avg_h264_qpel, 2, 4, 3dnow); | |
2325 | |
2326 SET_QPEL_FUNCS(put_2tap_qpel, 0, 16, 3dnow); | |
2327 SET_QPEL_FUNCS(put_2tap_qpel, 1, 8, 3dnow); | |
2328 SET_QPEL_FUNCS(avg_2tap_qpel, 0, 16, 3dnow); | |
2329 SET_QPEL_FUNCS(avg_2tap_qpel, 1, 8, 3dnow); | |
3807
6a40092eb9e6
approximate qpel functions: sacrifice some quality for some decoding speed. enabled on B-frames with -lavdopts fast.
lorenm
parents:
3777
diff
changeset
|
2330 |
6057
03febc8f506f
add MMX version for put_no_rnd_h264_chroma_mc8_c, used in VC-1 decoding.
gpoirier
parents:
6056
diff
changeset
|
2331 c->avg_h264_chroma_pixels_tab[0]= avg_h264_chroma_mc8_3dnow_rnd; |
2922
d772011258ec
faster h264_chroma_mc8_mmx, added h264_chroma_mc4_mmx.
lorenm
parents:
2902
diff
changeset
|
2332 c->avg_h264_chroma_pixels_tab[1]= avg_h264_chroma_mc4_3dnow; |
6522
dfa76e0734e5
Add missed call to ff_cavsdsp_init_3dnow() in dsputil_init_mmx()
zuxy
parents:
6513
diff
changeset
|
2333 |
dfa76e0734e5
Add missed call to ff_cavsdsp_init_3dnow() in dsputil_init_mmx()
zuxy
parents:
6513
diff
changeset
|
2334 if (ENABLE_CAVS_DECODER) |
dfa76e0734e5
Add missed call to ff_cavsdsp_init_3dnow() in dsputil_init_mmx()
zuxy
parents:
6513
diff
changeset
|
2335 ff_cavsdsp_init_3dnow(c, avctx); |
0 | 2336 } |
3207
33110c1008a4
Add the mmx and sse2 implementations of ff_snow_vertical_compose().
gpoirier
parents:
3174
diff
changeset
|
2337 |
6336
ef3fb5a7e275
sse2 h264 motion compensation. not new code, just separate out the cases that didn't need ssse3.
lorenm
parents:
6335
diff
changeset
|
2338 |
ef3fb5a7e275
sse2 h264 motion compensation. not new code, just separate out the cases that didn't need ssse3.
lorenm
parents:
6335
diff
changeset
|
2339 #define H264_QPEL_FUNCS(x, y, CPU)\ |
ef3fb5a7e275
sse2 h264 motion compensation. not new code, just separate out the cases that didn't need ssse3.
lorenm
parents:
6335
diff
changeset
|
2340 c->put_h264_qpel_pixels_tab[0][x+y*4] = put_h264_qpel16_mc##x##y##_##CPU;\ |
ef3fb5a7e275
sse2 h264 motion compensation. not new code, just separate out the cases that didn't need ssse3.
lorenm
parents:
6335
diff
changeset
|
2341 c->put_h264_qpel_pixels_tab[1][x+y*4] = put_h264_qpel8_mc##x##y##_##CPU;\ |
ef3fb5a7e275
sse2 h264 motion compensation. not new code, just separate out the cases that didn't need ssse3.
lorenm
parents:
6335
diff
changeset
|
2342 c->avg_h264_qpel_pixels_tab[0][x+y*4] = avg_h264_qpel16_mc##x##y##_##CPU;\ |
ef3fb5a7e275
sse2 h264 motion compensation. not new code, just separate out the cases that didn't need ssse3.
lorenm
parents:
6335
diff
changeset
|
2343 c->avg_h264_qpel_pixels_tab[1][x+y*4] = avg_h264_qpel8_mc##x##y##_##CPU; |
6331 | 2344 if((mm_flags & MM_SSE2) && !(mm_flags & MM_3DNOW)){ |
2345 // these functions are slower than mmx on AMD, but faster on Intel | |
6336
ef3fb5a7e275
sse2 h264 motion compensation. not new code, just separate out the cases that didn't need ssse3.
lorenm
parents:
6335
diff
changeset
|
2346 /* FIXME works in most codecs, but crashes svq1 due to unaligned chroma |
6331 | 2347 c->put_pixels_tab[0][0] = put_pixels16_sse2; |
2348 c->avg_pixels_tab[0][0] = avg_pixels16_sse2; | |
6336
ef3fb5a7e275
sse2 h264 motion compensation. not new code, just separate out the cases that didn't need ssse3.
lorenm
parents:
6335
diff
changeset
|
2349 */ |
ef3fb5a7e275
sse2 h264 motion compensation. not new code, just separate out the cases that didn't need ssse3.
lorenm
parents:
6335
diff
changeset
|
2350 H264_QPEL_FUNCS(0, 0, sse2); |
6331 | 2351 } |
6336
ef3fb5a7e275
sse2 h264 motion compensation. not new code, just separate out the cases that didn't need ssse3.
lorenm
parents:
6335
diff
changeset
|
2352 if(mm_flags & MM_SSE2){ |
ef3fb5a7e275
sse2 h264 motion compensation. not new code, just separate out the cases that didn't need ssse3.
lorenm
parents:
6335
diff
changeset
|
2353 H264_QPEL_FUNCS(0, 1, sse2); |
ef3fb5a7e275
sse2 h264 motion compensation. not new code, just separate out the cases that didn't need ssse3.
lorenm
parents:
6335
diff
changeset
|
2354 H264_QPEL_FUNCS(0, 2, sse2); |
ef3fb5a7e275
sse2 h264 motion compensation. not new code, just separate out the cases that didn't need ssse3.
lorenm
parents:
6335
diff
changeset
|
2355 H264_QPEL_FUNCS(0, 3, sse2); |
ef3fb5a7e275
sse2 h264 motion compensation. not new code, just separate out the cases that didn't need ssse3.
lorenm
parents:
6335
diff
changeset
|
2356 H264_QPEL_FUNCS(1, 1, sse2); |
ef3fb5a7e275
sse2 h264 motion compensation. not new code, just separate out the cases that didn't need ssse3.
lorenm
parents:
6335
diff
changeset
|
2357 H264_QPEL_FUNCS(1, 2, sse2); |
ef3fb5a7e275
sse2 h264 motion compensation. not new code, just separate out the cases that didn't need ssse3.
lorenm
parents:
6335
diff
changeset
|
2358 H264_QPEL_FUNCS(1, 3, sse2); |
ef3fb5a7e275
sse2 h264 motion compensation. not new code, just separate out the cases that didn't need ssse3.
lorenm
parents:
6335
diff
changeset
|
2359 H264_QPEL_FUNCS(2, 1, sse2); |
ef3fb5a7e275
sse2 h264 motion compensation. not new code, just separate out the cases that didn't need ssse3.
lorenm
parents:
6335
diff
changeset
|
2360 H264_QPEL_FUNCS(2, 2, sse2); |
ef3fb5a7e275
sse2 h264 motion compensation. not new code, just separate out the cases that didn't need ssse3.
lorenm
parents:
6335
diff
changeset
|
2361 H264_QPEL_FUNCS(2, 3, sse2); |
ef3fb5a7e275
sse2 h264 motion compensation. not new code, just separate out the cases that didn't need ssse3.
lorenm
parents:
6335
diff
changeset
|
2362 H264_QPEL_FUNCS(3, 1, sse2); |
ef3fb5a7e275
sse2 h264 motion compensation. not new code, just separate out the cases that didn't need ssse3.
lorenm
parents:
6335
diff
changeset
|
2363 H264_QPEL_FUNCS(3, 2, sse2); |
ef3fb5a7e275
sse2 h264 motion compensation. not new code, just separate out the cases that didn't need ssse3.
lorenm
parents:
6335
diff
changeset
|
2364 H264_QPEL_FUNCS(3, 3, sse2); |
ef3fb5a7e275
sse2 h264 motion compensation. not new code, just separate out the cases that didn't need ssse3.
lorenm
parents:
6335
diff
changeset
|
2365 } |
6331 | 2366 #ifdef HAVE_SSSE3 |
2367 if(mm_flags & MM_SSSE3){ | |
6336
ef3fb5a7e275
sse2 h264 motion compensation. not new code, just separate out the cases that didn't need ssse3.
lorenm
parents:
6335
diff
changeset
|
2368 H264_QPEL_FUNCS(1, 0, ssse3); |
ef3fb5a7e275
sse2 h264 motion compensation. not new code, just separate out the cases that didn't need ssse3.
lorenm
parents:
6335
diff
changeset
|
2369 H264_QPEL_FUNCS(1, 1, ssse3); |
ef3fb5a7e275
sse2 h264 motion compensation. not new code, just separate out the cases that didn't need ssse3.
lorenm
parents:
6335
diff
changeset
|
2370 H264_QPEL_FUNCS(1, 2, ssse3); |
ef3fb5a7e275
sse2 h264 motion compensation. not new code, just separate out the cases that didn't need ssse3.
lorenm
parents:
6335
diff
changeset
|
2371 H264_QPEL_FUNCS(1, 3, ssse3); |
ef3fb5a7e275
sse2 h264 motion compensation. not new code, just separate out the cases that didn't need ssse3.
lorenm
parents:
6335
diff
changeset
|
2372 H264_QPEL_FUNCS(2, 0, ssse3); |
ef3fb5a7e275
sse2 h264 motion compensation. not new code, just separate out the cases that didn't need ssse3.
lorenm
parents:
6335
diff
changeset
|
2373 H264_QPEL_FUNCS(2, 1, ssse3); |
ef3fb5a7e275
sse2 h264 motion compensation. not new code, just separate out the cases that didn't need ssse3.
lorenm
parents:
6335
diff
changeset
|
2374 H264_QPEL_FUNCS(2, 2, ssse3); |
ef3fb5a7e275
sse2 h264 motion compensation. not new code, just separate out the cases that didn't need ssse3.
lorenm
parents:
6335
diff
changeset
|
2375 H264_QPEL_FUNCS(2, 3, ssse3); |
ef3fb5a7e275
sse2 h264 motion compensation. not new code, just separate out the cases that didn't need ssse3.
lorenm
parents:
6335
diff
changeset
|
2376 H264_QPEL_FUNCS(3, 0, ssse3); |
ef3fb5a7e275
sse2 h264 motion compensation. not new code, just separate out the cases that didn't need ssse3.
lorenm
parents:
6335
diff
changeset
|
2377 H264_QPEL_FUNCS(3, 1, ssse3); |
ef3fb5a7e275
sse2 h264 motion compensation. not new code, just separate out the cases that didn't need ssse3.
lorenm
parents:
6335
diff
changeset
|
2378 H264_QPEL_FUNCS(3, 2, ssse3); |
ef3fb5a7e275
sse2 h264 motion compensation. not new code, just separate out the cases that didn't need ssse3.
lorenm
parents:
6335
diff
changeset
|
2379 H264_QPEL_FUNCS(3, 3, ssse3); |
6557 | 2380 c->put_no_rnd_h264_chroma_pixels_tab[0]= put_h264_chroma_mc8_ssse3_nornd; |
2381 c->put_h264_chroma_pixels_tab[0]= put_h264_chroma_mc8_ssse3_rnd; | |
2382 c->avg_h264_chroma_pixels_tab[0]= avg_h264_chroma_mc8_ssse3_rnd; | |
2383 c->put_h264_chroma_pixels_tab[1]= put_h264_chroma_mc4_ssse3; | |
2384 c->avg_h264_chroma_pixels_tab[1]= avg_h264_chroma_mc4_ssse3; | |
6384 | 2385 c->add_png_paeth_prediction= add_png_paeth_prediction_ssse3; |
6331 | 2386 } |
2387 #endif | |
2388 | |
4589
30261f4ed12d
Fix wrong conditional, Snow decoding, not encoding, was SIMD-accelerated.
diego
parents:
4436
diff
changeset
|
2389 #ifdef CONFIG_SNOW_DECODER |
5591 | 2390 if(mm_flags & MM_SSE2 & 0){ |
3210 | 2391 c->horizontal_compose97i = ff_snow_horizontal_compose97i_sse2; |
5602 | 2392 #ifdef HAVE_7REGS |
3207
33110c1008a4
Add the mmx and sse2 implementations of ff_snow_vertical_compose().
gpoirier
parents:
3174
diff
changeset
|
2393 c->vertical_compose97i = ff_snow_vertical_compose97i_sse2; |
5601
b26025b9586d
workaround gcc bug, untested as my gcc is not complaining
michael
parents:
5594
diff
changeset
|
2394 #endif |
3211
b77b5e7072d6
add MMX and SSE versions of ff_snow_inner_add_yblock
gpoirier
parents:
3210
diff
changeset
|
2395 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
|
2396 } |
33110c1008a4
Add the mmx and sse2 implementations of ff_snow_vertical_compose().
gpoirier
parents:
3174
diff
changeset
|
2397 else{ |
5594
384629ebcb93
avoid overflow in the 3rd lifting step, this now needs mmx2 at minimum
michael
parents:
5591
diff
changeset
|
2398 if(mm_flags & MM_MMXEXT){ |
3210 | 2399 c->horizontal_compose97i = ff_snow_horizontal_compose97i_mmx; |
5602 | 2400 #ifdef HAVE_7REGS |
3207
33110c1008a4
Add the mmx and sse2 implementations of ff_snow_vertical_compose().
gpoirier
parents:
3174
diff
changeset
|
2401 c->vertical_compose97i = ff_snow_vertical_compose97i_mmx; |
5601
b26025b9586d
workaround gcc bug, untested as my gcc is not complaining
michael
parents:
5594
diff
changeset
|
2402 #endif |
5594
384629ebcb93
avoid overflow in the 3rd lifting step, this now needs mmx2 at minimum
michael
parents:
5591
diff
changeset
|
2403 } |
3211
b77b5e7072d6
add MMX and SSE versions of ff_snow_inner_add_yblock
gpoirier
parents:
3210
diff
changeset
|
2404 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
|
2405 } |
33110c1008a4
Add the mmx and sse2 implementations of ff_snow_vertical_compose().
gpoirier
parents:
3174
diff
changeset
|
2406 #endif |
3536
545a15c19c91
sse & sse2 implementations of vorbis channel coupling.
lorenm
parents:
3524
diff
changeset
|
2407 |
4197 | 2408 if(mm_flags & MM_3DNOW){ |
3568
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2409 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
|
2410 c->vector_fmul = vector_fmul_3dnow; |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2411 if(!(avctx->flags & CODEC_FLAG_BITEXACT)) |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2412 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
|
2413 } |
4197 | 2414 if(mm_flags & MM_3DNOWEXT) |
3568
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2415 c->vector_fmul_reverse = vector_fmul_reverse_3dnow2; |
4197 | 2416 if(mm_flags & MM_SSE){ |
3557
8e13ec0f8aa3
change vorbis_inverse_coupling_sse2() so it works on sse1 cpus
michael
parents:
3541
diff
changeset
|
2417 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
|
2418 c->vector_fmul = vector_fmul_sse; |
945caa35ee9a
sse and 3dnow implementations of float->int conversion and mdct windowing.
lorenm
parents:
3561
diff
changeset
|
2419 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
|
2420 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
|
2421 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
|
2422 } |
4197 | 2423 if(mm_flags & MM_3DNOW) |
3574 | 2424 c->vector_fmul_add_add = vector_fmul_add_add_3dnow; // faster than sse |
0 | 2425 } |
2967 | 2426 |
6403
9a736918fd90
split encoding part of dsputil_mmx into its own file
aurel
parents:
6391
diff
changeset
|
2427 if (ENABLE_ENCODERS) |
9a736918fd90
split encoding part of dsputil_mmx into its own file
aurel
parents:
6391
diff
changeset
|
2428 dsputilenc_init_mmx(c, avctx); |
9a736918fd90
split encoding part of dsputil_mmx into its own file
aurel
parents:
6391
diff
changeset
|
2429 |
247
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
2430 #if 0 |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
2431 // for speed testing |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
2432 get_pixels = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
2433 put_pixels_clamped = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
2434 add_pixels_clamped = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
2435 |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
2436 pix_abs16x16 = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
2437 pix_abs16x16_x2 = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
2438 pix_abs16x16_y2 = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
2439 pix_abs16x16_xy2 = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
2440 |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
2441 put_pixels_tab[0] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
2442 put_pixels_tab[1] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
2443 put_pixels_tab[2] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
2444 put_pixels_tab[3] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
2445 |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
2446 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
|
2447 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
|
2448 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
|
2449 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
|
2450 |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
2451 avg_pixels_tab[0] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
2452 avg_pixels_tab[1] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
2453 avg_pixels_tab[2] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
2454 avg_pixels_tab[3] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
2455 |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
2456 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
|
2457 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
|
2458 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
|
2459 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
|
2460 |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
2461 //av_fdct = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
2462 //ff_idct = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
2463 #endif |
0 | 2464 } |