Mercurial > libavcodec.hg
annotate i386/vp3dsp_sse2.c @ 7778:e31b0b920475 libavcodec
theoradec: skip decoding of uncoded MV in 4MV code
Thusnelda, the new experimental Theora encoder is using this Theora feature
that was previously not exploited.
fixes issue579
author | aurel |
---|---|
date | Wed, 03 Sep 2008 00:17:11 +0000 |
parents | dfbf377bd066 |
children | 4ab419106cb1 |
rev | line source |
---|---|
1970 | 1 /* |
2 * Copyright (C) 2004 the ffmpeg project | |
3 * | |
3947
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3089
diff
changeset
|
4 * This file is part of FFmpeg. |
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3089
diff
changeset
|
5 * |
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3089
diff
changeset
|
6 * FFmpeg is free software; you can redistribute it and/or |
1970 | 7 * modify it under the terms of the GNU Lesser General Public |
8 * 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:
3089
diff
changeset
|
9 * version 2.1 of the License, or (at your option) any later version. |
1970 | 10 * |
3947
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3089
diff
changeset
|
11 * FFmpeg is distributed in the hope that it will be useful, |
1970 | 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 * Lesser General Public License for more details. | |
15 * | |
16 * 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:
3089
diff
changeset
|
17 * License along with FFmpeg; if not, write to the Free Software |
3036
0b546eab515d
Update licensing information: The FSF changed postal address.
diego
parents:
2967
diff
changeset
|
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
1970 | 19 */ |
20 | |
21 /** | |
22 * @file vp3dsp_sse2.c | |
23 * SSE2-optimized functions cribbed from the original VP3 source code. | |
24 */ | |
25 | |
6763 | 26 #include "libavcodec/dsputil.h" |
7742 | 27 #include "dsputil_mmx.h" |
1970 | 28 #include "mmx.h" |
29 | |
7758 | 30 DECLARE_ALIGNED_16(const uint16_t, ff_vp3_idct_data[7 * 8]) = |
1970 | 31 { |
2967 | 32 64277,64277,64277,64277,64277,64277,64277,64277, |
33 60547,60547,60547,60547,60547,60547,60547,60547, | |
34 54491,54491,54491,54491,54491,54491,54491,54491, | |
35 46341,46341,46341,46341,46341,46341,46341,46341, | |
36 36410,36410,36410,36410,36410,36410,36410,36410, | |
37 25080,25080,25080,25080,25080,25080,25080,25080, | |
1970 | 38 12785,12785,12785,12785,12785,12785,12785,12785 |
39 }; | |
40 | |
41 | |
42 #define SSE2_Column_IDCT() { \ | |
43 \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
44 movdqa_m2r(*I(3), xmm2); /* xmm2 = i3 */ \ |
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
45 movdqa_m2r(*C(3), xmm6); /* xmm6 = c3 */ \ |
1970 | 46 \ |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
47 movdqa_r2r(xmm2, xmm4); /* xmm4 = i3 */ \ |
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
48 movdqa_m2r(*I(5), xmm7); /* xmm7 = i5 */ \ |
1970 | 49 \ |
50 pmulhw_r2r(xmm6, xmm4); /* xmm4 = c3 * i3 - i3 */ \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
51 movdqa_m2r(*C(5), xmm1); /* xmm1 = c5 */ \ |
1970 | 52 \ |
53 pmulhw_r2r(xmm7, xmm6); /* xmm6 = c3 * i5 - i5 */ \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
54 movdqa_r2r(xmm1, xmm5); /* xmm5 = c5 */ \ |
1970 | 55 \ |
56 pmulhw_r2r(xmm2, xmm1); /* xmm1 = c5 * i3 - i3 */ \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
57 movdqa_m2r(*I(1), xmm3); /* xmm3 = i1 */ \ |
1970 | 58 \ |
59 pmulhw_r2r(xmm7, xmm5); /* xmm5 = c5 * i5 - i5 */ \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
60 movdqa_m2r(*C(1), xmm0); /* xmm0 = c1 */ \ |
1970 | 61 \ |
62 /* all registers are in use */ \ | |
63 \ | |
64 paddw_r2r(xmm2, xmm4); /* xmm4 = c3 * i3 */ \ | |
65 paddw_r2r(xmm7, xmm6); /* xmm6 = c3 * i5 */ \ | |
66 \ | |
67 paddw_r2r(xmm1, xmm2); /* xmm2 = c5 * i3 */ \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
68 movdqa_m2r(*I(7), xmm1); /* xmm1 = i7 */ \ |
1970 | 69 \ |
70 paddw_r2r(xmm5, xmm7); /* xmm7 = c5 * i5 */ \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
71 movdqa_r2r(xmm0, xmm5); /* xmm5 = c1 */ \ |
1970 | 72 \ |
73 pmulhw_r2r(xmm3, xmm0); /* xmm0 = c1 * i1 - i1 */ \ | |
74 paddsw_r2r(xmm7, xmm4); /* xmm4 = c3 * i3 + c5 * i5 = C */ \ | |
75 \ | |
76 pmulhw_r2r(xmm1, xmm5); /* xmm5 = c1 * i7 - i7 */ \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
77 movdqa_m2r(*C(7), xmm7); /* xmm7 = c7 */ \ |
1970 | 78 \ |
79 psubsw_r2r(xmm2, xmm6); /* xmm6 = c3 * i5 - c5 * i3 = D */ \ | |
80 paddw_r2r(xmm3, xmm0); /* xmm0 = c1 * i1 */ \ | |
81 \ | |
82 pmulhw_r2r(xmm7, xmm3); /* xmm3 = c7 * i1 */ \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
83 movdqa_m2r(*I(2), xmm2); /* xmm2 = i2 */ \ |
1970 | 84 \ |
85 pmulhw_r2r(xmm1, xmm7); /* xmm7 = c7 * i7 */ \ | |
86 paddw_r2r(xmm1, xmm5); /* xmm5 = c1 * i7 */ \ | |
87 \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
88 movdqa_r2r(xmm2, xmm1); /* xmm1 = i2 */ \ |
1970 | 89 pmulhw_m2r(*C(2), xmm2); /* xmm2 = i2 * c2 -i2 */ \ |
90 \ | |
91 psubsw_r2r(xmm5, xmm3); /* xmm3 = c7 * i1 - c1 * i7 = B */ \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
92 movdqa_m2r(*I(6), xmm5); /* xmm5 = i6 */ \ |
1970 | 93 \ |
94 paddsw_r2r(xmm7, xmm0); /* xmm0 = c1 * i1 + c7 * i7 = A */ \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
95 movdqa_r2r(xmm5, xmm7); /* xmm7 = i6 */ \ |
1970 | 96 \ |
97 psubsw_r2r(xmm4, xmm0); /* xmm0 = A - C */ \ | |
98 pmulhw_m2r(*C(2), xmm5); /* xmm5 = c2 * i6 - i6 */ \ | |
99 \ | |
100 paddw_r2r(xmm1, xmm2); /* xmm2 = i2 * c2 */ \ | |
101 pmulhw_m2r(*C(6), xmm1); /* xmm1 = c6 * i2 */ \ | |
102 \ | |
103 paddsw_r2r(xmm4, xmm4); /* xmm4 = C + C */ \ | |
104 paddsw_r2r(xmm0, xmm4); /* xmm4 = A + C = C. */ \ | |
105 \ | |
106 psubsw_r2r(xmm6, xmm3); /* xmm3 = B - D */ \ | |
107 paddw_r2r(xmm7, xmm5); /* xmm5 = c2 * i6 */ \ | |
108 \ | |
109 paddsw_r2r(xmm6, xmm6); /* xmm6 = D + D */ \ | |
110 pmulhw_m2r(*C(6), xmm7); /* xmm7 = c6 * i6 */ \ | |
111 \ | |
112 paddsw_r2r(xmm3, xmm6); /* xmm6 = B + D = D. */ \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
113 movdqa_r2m(xmm4, *I(1)); /* Save C. at I(1) */ \ |
1970 | 114 \ |
115 psubsw_r2r(xmm5, xmm1); /* xmm1 = c6 * i2 - c2 * i6 = H */ \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
116 movdqa_m2r(*C(4), xmm4); /* xmm4 = c4 */ \ |
1970 | 117 \ |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
118 movdqa_r2r(xmm3, xmm5); /* xmm5 = B - D */ \ |
1970 | 119 pmulhw_r2r(xmm4, xmm3); /* xmm3 = ( c4 -1 ) * ( B - D ) */ \ |
120 \ | |
121 paddsw_r2r(xmm2, xmm7); /* xmm7 = c2 * i2 + c6 * i6 = G */ \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
122 movdqa_r2m(xmm6, *I(2)); /* Save D. at I(2) */ \ |
1970 | 123 \ |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
124 movdqa_r2r(xmm0, xmm2); /* xmm2 = A - C */ \ |
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
125 movdqa_m2r(*I(0), xmm6); /* xmm6 = i0 */ \ |
1970 | 126 \ |
127 pmulhw_r2r(xmm4, xmm0); /* xmm0 = ( c4 - 1 ) * ( A - C ) = A. */ \ | |
128 paddw_r2r(xmm3, xmm5); /* xmm5 = c4 * ( B - D ) = B. */ \ | |
129 \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
130 movdqa_m2r(*I(4), xmm3); /* xmm3 = i4 */ \ |
1970 | 131 psubsw_r2r(xmm1, xmm5); /* xmm5 = B. - H = B.. */ \ |
132 \ | |
133 paddw_r2r(xmm0, xmm2); /* xmm2 = c4 * ( A - C) = A. */ \ | |
134 psubsw_r2r(xmm3, xmm6); /* xmm6 = i0 - i4 */ \ | |
135 \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
136 movdqa_r2r(xmm6, xmm0); /* xmm0 = i0 - i4 */ \ |
1970 | 137 pmulhw_r2r(xmm4, xmm6); /* xmm6 = (c4 - 1) * (i0 - i4) = F */ \ |
138 \ | |
139 paddsw_r2r(xmm3, xmm3); /* xmm3 = i4 + i4 */ \ | |
140 paddsw_r2r(xmm1, xmm1); /* xmm1 = H + H */ \ | |
141 \ | |
142 paddsw_r2r(xmm0, xmm3); /* xmm3 = i0 + i4 */ \ | |
143 paddsw_r2r(xmm5, xmm1); /* xmm1 = B. + H = H. */ \ | |
144 \ | |
145 pmulhw_r2r(xmm3, xmm4); /* xmm4 = ( c4 - 1 ) * ( i0 + i4 ) */ \ | |
146 paddw_r2r(xmm0, xmm6); /* xmm6 = c4 * ( i0 - i4 ) */ \ | |
147 \ | |
148 psubsw_r2r(xmm2, xmm6); /* xmm6 = F - A. = F. */ \ | |
149 paddsw_r2r(xmm2, xmm2); /* xmm2 = A. + A. */ \ | |
150 \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
151 movdqa_m2r(*I(1), xmm0); /* Load C. from I(1) */ \ |
1970 | 152 paddsw_r2r(xmm6, xmm2); /* xmm2 = F + A. = A.. */ \ |
153 \ | |
154 paddw_r2r(xmm3, xmm4); /* xmm4 = c4 * ( i0 + i4 ) = 3 */ \ | |
155 psubsw_r2r(xmm1, xmm2); /* xmm2 = A.. - H. = R2 */ \ | |
156 \ | |
157 paddsw_m2r(*Eight, xmm2); /* Adjust R2 and R1 before shifting */ \ | |
158 paddsw_r2r(xmm1, xmm1); /* xmm1 = H. + H. */ \ | |
159 \ | |
160 paddsw_r2r(xmm2, xmm1); /* xmm1 = A.. + H. = R1 */ \ | |
161 psraw_i2r(4, xmm2); /* xmm2 = op2 */ \ | |
162 \ | |
163 psubsw_r2r(xmm7, xmm4); /* xmm4 = E - G = E. */ \ | |
164 psraw_i2r(4, xmm1); /* xmm1 = op1 */ \ | |
165 \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
166 movdqa_m2r(*I(2), xmm3); /* Load D. from I(2) */ \ |
1970 | 167 paddsw_r2r(xmm7, xmm7); /* xmm7 = G + G */ \ |
168 \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
169 movdqa_r2m(xmm2, *O(2)); /* Write out op2 */ \ |
1970 | 170 paddsw_r2r(xmm4, xmm7); /* xmm7 = E + G = G. */ \ |
171 \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
172 movdqa_r2m(xmm1, *O(1)); /* Write out op1 */ \ |
1970 | 173 psubsw_r2r(xmm3, xmm4); /* xmm4 = E. - D. = R4 */ \ |
174 \ | |
175 paddsw_m2r(*Eight, xmm4); /* Adjust R4 and R3 before shifting */ \ | |
176 paddsw_r2r(xmm3, xmm3); /* xmm3 = D. + D. */ \ | |
177 \ | |
178 paddsw_r2r(xmm4, xmm3); /* xmm3 = E. + D. = R3 */ \ | |
179 psraw_i2r(4, xmm4); /* xmm4 = op4 */ \ | |
180 \ | |
181 psubsw_r2r(xmm5, xmm6); /* xmm6 = F. - B..= R6 */ \ | |
182 psraw_i2r(4, xmm3); /* xmm3 = op3 */ \ | |
183 \ | |
184 paddsw_m2r(*Eight, xmm6); /* Adjust R6 and R5 before shifting */ \ | |
185 paddsw_r2r(xmm5, xmm5); /* xmm5 = B.. + B.. */ \ | |
186 \ | |
187 paddsw_r2r(xmm6, xmm5); /* xmm5 = F. + B.. = R5 */ \ | |
188 psraw_i2r(4, xmm6); /* xmm6 = op6 */ \ | |
189 \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
190 movdqa_r2m(xmm4, *O(4)); /* Write out op4 */ \ |
1970 | 191 psraw_i2r(4, xmm5); /* xmm5 = op5 */ \ |
192 \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
193 movdqa_r2m(xmm3, *O(3)); /* Write out op3 */ \ |
1970 | 194 psubsw_r2r(xmm0, xmm7); /* xmm7 = G. - C. = R7 */ \ |
195 \ | |
196 paddsw_m2r(*Eight, xmm7); /* Adjust R7 and R0 before shifting */ \ | |
197 paddsw_r2r(xmm0, xmm0); /* xmm0 = C. + C. */ \ | |
198 \ | |
199 paddsw_r2r(xmm7, xmm0); /* xmm0 = G. + C. */ \ | |
200 psraw_i2r(4, xmm7); /* xmm7 = op7 */ \ | |
201 \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
202 movdqa_r2m(xmm6, *O(6)); /* Write out op6 */ \ |
1970 | 203 psraw_i2r(4, xmm0); /* xmm0 = op0 */ \ |
204 \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
205 movdqa_r2m(xmm5, *O(5)); /* Write out op5 */ \ |
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
206 movdqa_r2m(xmm7, *O(7)); /* Write out op7 */ \ |
1970 | 207 \ |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
208 movdqa_r2m(xmm0, *O(0)); /* Write out op0 */ \ |
1970 | 209 \ |
210 } /* End of SSE2_Column_IDCT macro */ | |
211 | |
212 | |
213 #define SSE2_Row_IDCT() { \ | |
214 \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
215 movdqa_m2r(*I(3), xmm2); /* xmm2 = i3 */ \ |
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
216 movdqa_m2r(*C(3), xmm6); /* xmm6 = c3 */ \ |
1970 | 217 \ |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
218 movdqa_r2r(xmm2, xmm4); /* xmm4 = i3 */ \ |
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
219 movdqa_m2r(*I(5), xmm7); /* xmm7 = i5 */ \ |
1970 | 220 \ |
221 pmulhw_r2r(xmm6, xmm4); /* xmm4 = c3 * i3 - i3 */ \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
222 movdqa_m2r(*C(5), xmm1); /* xmm1 = c5 */ \ |
1970 | 223 \ |
224 pmulhw_r2r(xmm7, xmm6); /* xmm6 = c3 * i5 - i5 */ \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
225 movdqa_r2r(xmm1, xmm5); /* xmm5 = c5 */ \ |
1970 | 226 \ |
227 pmulhw_r2r(xmm2, xmm1); /* xmm1 = c5 * i3 - i3 */ \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
228 movdqa_m2r(*I(1), xmm3); /* xmm3 = i1 */ \ |
1970 | 229 \ |
230 pmulhw_r2r(xmm7, xmm5); /* xmm5 = c5 * i5 - i5 */ \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
231 movdqa_m2r(*C(1), xmm0); /* xmm0 = c1 */ \ |
1970 | 232 \ |
233 /* all registers are in use */ \ | |
234 \ | |
235 paddw_r2r(xmm2, xmm4); /* xmm4 = c3 * i3 */ \ | |
236 paddw_r2r(xmm7, xmm6); /* xmm6 = c3 * i5 */ \ | |
237 \ | |
238 paddw_r2r(xmm1, xmm2); /* xmm2 = c5 * i3 */ \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
239 movdqa_m2r(*I(7), xmm1); /* xmm1 = i7 */ \ |
1970 | 240 \ |
241 paddw_r2r(xmm5, xmm7); /* xmm7 = c5 * i5 */ \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
242 movdqa_r2r(xmm0, xmm5); /* xmm5 = c1 */ \ |
1970 | 243 \ |
244 pmulhw_r2r(xmm3, xmm0); /* xmm0 = c1 * i1 - i1 */ \ | |
245 paddsw_r2r(xmm7, xmm4); /* xmm4 = c3 * i3 + c5 * i5 = C */ \ | |
246 \ | |
247 pmulhw_r2r(xmm1, xmm5); /* xmm5 = c1 * i7 - i7 */ \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
248 movdqa_m2r(*C(7), xmm7); /* xmm7 = c7 */ \ |
1970 | 249 \ |
250 psubsw_r2r(xmm2, xmm6); /* xmm6 = c3 * i5 - c5 * i3 = D */ \ | |
251 paddw_r2r(xmm3, xmm0); /* xmm0 = c1 * i1 */ \ | |
252 \ | |
253 pmulhw_r2r(xmm7, xmm3); /* xmm3 = c7 * i1 */ \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
254 movdqa_m2r(*I(2), xmm2); /* xmm2 = i2 */ \ |
1970 | 255 \ |
256 pmulhw_r2r(xmm1, xmm7); /* xmm7 = c7 * i7 */ \ | |
257 paddw_r2r(xmm1, xmm5); /* xmm5 = c1 * i7 */ \ | |
258 \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
259 movdqa_r2r(xmm2, xmm1); /* xmm1 = i2 */ \ |
1970 | 260 pmulhw_m2r(*C(2), xmm2); /* xmm2 = i2 * c2 -i2 */ \ |
261 \ | |
262 psubsw_r2r(xmm5, xmm3); /* xmm3 = c7 * i1 - c1 * i7 = B */ \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
263 movdqa_m2r(*I(6), xmm5); /* xmm5 = i6 */ \ |
1970 | 264 \ |
265 paddsw_r2r(xmm7, xmm0); /* xmm0 = c1 * i1 + c7 * i7 = A */ \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
266 movdqa_r2r(xmm5, xmm7); /* xmm7 = i6 */ \ |
1970 | 267 \ |
268 psubsw_r2r(xmm4, xmm0); /* xmm0 = A - C */ \ | |
269 pmulhw_m2r(*C(2), xmm5); /* xmm5 = c2 * i6 - i6 */ \ | |
270 \ | |
271 paddw_r2r(xmm1, xmm2); /* xmm2 = i2 * c2 */ \ | |
272 pmulhw_m2r(*C(6), xmm1); /* xmm1 = c6 * i2 */ \ | |
273 \ | |
274 paddsw_r2r(xmm4, xmm4); /* xmm4 = C + C */ \ | |
275 paddsw_r2r(xmm0, xmm4); /* xmm4 = A + C = C. */ \ | |
276 \ | |
277 psubsw_r2r(xmm6, xmm3); /* xmm3 = B - D */ \ | |
278 paddw_r2r(xmm7, xmm5); /* xmm5 = c2 * i6 */ \ | |
279 \ | |
280 paddsw_r2r(xmm6, xmm6); /* xmm6 = D + D */ \ | |
281 pmulhw_m2r(*C(6), xmm7); /* xmm7 = c6 * i6 */ \ | |
282 \ | |
283 paddsw_r2r(xmm3, xmm6); /* xmm6 = B + D = D. */ \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
284 movdqa_r2m(xmm4, *I(1)); /* Save C. at I(1) */ \ |
1970 | 285 \ |
286 psubsw_r2r(xmm5, xmm1); /* xmm1 = c6 * i2 - c2 * i6 = H */ \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
287 movdqa_m2r(*C(4), xmm4); /* xmm4 = c4 */ \ |
1970 | 288 \ |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
289 movdqa_r2r(xmm3, xmm5); /* xmm5 = B - D */ \ |
1970 | 290 pmulhw_r2r(xmm4, xmm3); /* xmm3 = ( c4 -1 ) * ( B - D ) */ \ |
291 \ | |
292 paddsw_r2r(xmm2, xmm7); /* xmm7 = c2 * i2 + c6 * i6 = G */ \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
293 movdqa_r2m(xmm6, *I(2)); /* Save D. at I(2) */ \ |
1970 | 294 \ |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
295 movdqa_r2r(xmm0, xmm2); /* xmm2 = A - C */ \ |
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
296 movdqa_m2r(*I(0), xmm6); /* xmm6 = i0 */ \ |
1970 | 297 \ |
298 pmulhw_r2r(xmm4, xmm0); /* xmm0 = ( c4 - 1 ) * ( A - C ) = A. */ \ | |
299 paddw_r2r(xmm3, xmm5); /* xmm5 = c4 * ( B - D ) = B. */ \ | |
300 \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
301 movdqa_m2r(*I(4), xmm3); /* xmm3 = i4 */ \ |
1970 | 302 psubsw_r2r(xmm1, xmm5); /* xmm5 = B. - H = B.. */ \ |
303 \ | |
304 paddw_r2r(xmm0, xmm2); /* xmm2 = c4 * ( A - C) = A. */ \ | |
305 psubsw_r2r(xmm3, xmm6); /* xmm6 = i0 - i4 */ \ | |
306 \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
307 movdqa_r2r(xmm6, xmm0); /* xmm0 = i0 - i4 */ \ |
1970 | 308 pmulhw_r2r(xmm4, xmm6); /* xmm6 = ( c4 - 1 ) * ( i0 - i4 ) = F */ \ |
309 \ | |
310 paddsw_r2r(xmm3, xmm3); /* xmm3 = i4 + i4 */ \ | |
311 paddsw_r2r(xmm1, xmm1); /* xmm1 = H + H */ \ | |
312 \ | |
313 paddsw_r2r(xmm0, xmm3); /* xmm3 = i0 + i4 */ \ | |
314 paddsw_r2r(xmm5, xmm1); /* xmm1 = B. + H = H. */ \ | |
315 \ | |
316 pmulhw_r2r(xmm3, xmm4); /* xmm4 = ( c4 - 1 ) * ( i0 + i4 ) */ \ | |
317 paddw_r2r(xmm0, xmm6); /* xmm6 = c4 * ( i0 - i4 ) */ \ | |
318 \ | |
319 psubsw_r2r(xmm2, xmm6); /* xmm6 = F - A. = F. */ \ | |
320 paddsw_r2r(xmm2, xmm2); /* xmm2 = A. + A. */ \ | |
321 \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
322 movdqa_m2r(*I(1), xmm0); /* Load C. from I(1) */ \ |
1970 | 323 paddsw_r2r(xmm6, xmm2); /* xmm2 = F + A. = A.. */ \ |
324 \ | |
325 paddw_r2r(xmm3, xmm4); /* xmm4 = c4 * ( i0 + i4 ) = 3 */ \ | |
326 psubsw_r2r(xmm1, xmm2); /* xmm2 = A.. - H. = R2 */ \ | |
327 \ | |
328 paddsw_r2r(xmm1, xmm1); /* xmm1 = H. + H. */ \ | |
329 paddsw_r2r(xmm2, xmm1); /* xmm1 = A.. + H. = R1 */ \ | |
330 \ | |
331 psubsw_r2r(xmm7, xmm4); /* xmm4 = E - G = E. */ \ | |
332 \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
333 movdqa_m2r(*I(2), xmm3); /* Load D. from I(2) */ \ |
1970 | 334 paddsw_r2r(xmm7, xmm7); /* xmm7 = G + G */ \ |
335 \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
336 movdqa_r2m(xmm2, *I(2)); /* Write out op2 */ \ |
1970 | 337 paddsw_r2r(xmm4, xmm7); /* xmm7 = E + G = G. */ \ |
338 \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
339 movdqa_r2m(xmm1, *I(1)); /* Write out op1 */ \ |
1970 | 340 psubsw_r2r(xmm3, xmm4); /* xmm4 = E. - D. = R4 */ \ |
341 \ | |
342 paddsw_r2r(xmm3, xmm3); /* xmm3 = D. + D. */ \ | |
343 \ | |
344 paddsw_r2r(xmm4, xmm3); /* xmm3 = E. + D. = R3 */ \ | |
345 \ | |
346 psubsw_r2r(xmm5, xmm6); /* xmm6 = F. - B..= R6 */ \ | |
347 \ | |
348 paddsw_r2r(xmm5, xmm5); /* xmm5 = B.. + B.. */ \ | |
349 \ | |
350 paddsw_r2r(xmm6, xmm5); /* xmm5 = F. + B.. = R5 */ \ | |
351 \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
352 movdqa_r2m(xmm4, *I(4)); /* Write out op4 */ \ |
1970 | 353 \ |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
354 movdqa_r2m(xmm3, *I(3)); /* Write out op3 */ \ |
1970 | 355 psubsw_r2r(xmm0, xmm7); /* xmm7 = G. - C. = R7 */ \ |
356 \ | |
357 paddsw_r2r(xmm0, xmm0); /* xmm0 = C. + C. */ \ | |
358 \ | |
359 paddsw_r2r(xmm7, xmm0); /* xmm0 = G. + C. */ \ | |
360 \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
361 movdqa_r2m(xmm6, *I(6)); /* Write out op6 */ \ |
1970 | 362 \ |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
363 movdqa_r2m(xmm5, *I(5)); /* Write out op5 */ \ |
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
364 movdqa_r2m(xmm7, *I(7)); /* Write out op7 */ \ |
1970 | 365 \ |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
366 movdqa_r2m(xmm0, *I(0)); /* Write out op0 */ \ |
1970 | 367 \ |
368 } /* End of SSE2_Row_IDCT macro */ | |
369 | |
370 | |
371 #define SSE2_Transpose() { \ | |
372 \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
373 movdqa_m2r(*I(4), xmm4); /* xmm4=e7e6e5e4e3e2e1e0 */ \ |
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
374 movdqa_m2r(*I(5), xmm0); /* xmm4=f7f6f5f4f3f2f1f0 */ \ |
1970 | 375 \ |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
376 movdqa_r2r(xmm4, xmm5); /* make a copy */ \ |
1970 | 377 punpcklwd_r2r(xmm0, xmm4); /* xmm4=f3e3f2e2f1e1f0e0 */ \ |
378 \ | |
379 punpckhwd_r2r(xmm0, xmm5); /* xmm5=f7e7f6e6f5e5f4e4 */ \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
380 movdqa_m2r(*I(6), xmm6); /* xmm6=g7g6g5g4g3g2g1g0 */ \ |
1970 | 381 \ |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
382 movdqa_m2r(*I(7), xmm0); /* xmm0=h7h6h5h4h3h2h1h0 */ \ |
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
383 movdqa_r2r(xmm6, xmm7); /* make a copy */ \ |
1970 | 384 \ |
385 punpcklwd_r2r(xmm0, xmm6); /* xmm6=h3g3h3g2h1g1h0g0 */ \ | |
386 punpckhwd_r2r(xmm0, xmm7); /* xmm7=h7g7h6g6h5g5h4g4 */ \ | |
387 \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
388 movdqa_r2r(xmm4, xmm3); /* make a copy */ \ |
1970 | 389 punpckldq_r2r(xmm6, xmm4); /* xmm4=h1g1f1e1h0g0f0e0 */ \ |
390 \ | |
391 punpckhdq_r2r(xmm6, xmm3); /* xmm3=h3g3g3e3h2g2f2e2 */ \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
392 movdqa_r2m(xmm3, *I(6)); /* save h3g3g3e3h2g2f2e2 */ \ |
1970 | 393 /* Free xmm6 */ \ |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
394 movdqa_r2r(xmm5, xmm6); /* make a copy */ \ |
1970 | 395 punpckldq_r2r(xmm7, xmm5); /* xmm5=h5g5f5e5h4g4f4e4 */ \ |
396 \ | |
397 punpckhdq_r2r(xmm7, xmm6); /* xmm6=h7g7f7e7h6g6f6e6 */ \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
398 movdqa_m2r(*I(0), xmm0); /* xmm0=a7a6a5a4a3a2a1a0 */ \ |
1970 | 399 /* Free xmm7 */ \ |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
400 movdqa_m2r(*I(1), xmm1); /* xmm1=b7b6b5b4b3b2b1b0 */ \ |
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
401 movdqa_r2r(xmm0, xmm7); /* make a copy */ \ |
1970 | 402 \ |
403 punpcklwd_r2r(xmm1, xmm0); /* xmm0=b3a3b2a2b1a1b0a0 */ \ | |
404 punpckhwd_r2r(xmm1, xmm7); /* xmm7=b7a7b6a6b5a5b4a4 */ \ | |
405 /* Free xmm1 */ \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
406 movdqa_m2r(*I(2), xmm2); /* xmm2=c7c6c5c4c3c2c1c0 */ \ |
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
407 movdqa_m2r(*I(3), xmm3); /* xmm3=d7d6d5d4d3d2d1d0 */ \ |
1970 | 408 \ |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
409 movdqa_r2r(xmm2, xmm1); /* make a copy */ \ |
1970 | 410 punpcklwd_r2r(xmm3, xmm2); /* xmm2=d3c3d2c2d1c1d0c0 */ \ |
411 \ | |
412 punpckhwd_r2r(xmm3, xmm1); /* xmm1=d7c7d6c6d5c5d4c4 */ \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
413 movdqa_r2r(xmm0, xmm3); /* make a copy */ \ |
1970 | 414 \ |
415 punpckldq_r2r(xmm2, xmm0); /* xmm0=d1c1b1a1d0c0b0a0 */ \ | |
416 punpckhdq_r2r(xmm2, xmm3); /* xmm3=d3c3b3a3d2c2b2a2 */ \ | |
417 /* Free xmm2 */ \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
418 movdqa_r2r(xmm7, xmm2); /* make a copy */ \ |
1970 | 419 punpckldq_r2r(xmm1, xmm2); /* xmm2=d5c5b5a5d4c4b4a4 */ \ |
420 \ | |
421 punpckhdq_r2r(xmm1, xmm7); /* xmm7=d7c7b7a7d6c6b6a6 */ \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
422 movdqa_r2r(xmm0, xmm1); /* make a copy */ \ |
1970 | 423 \ |
424 punpcklqdq_r2r(xmm4, xmm0); /* xmm0=h0g0f0e0d0c0b0a0 */ \ | |
425 punpckhqdq_r2r(xmm4, xmm1); /* xmm1=h1g1g1e1d1c1b1a1 */ \ | |
426 \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
427 movdqa_r2m(xmm0, *I(0)); /* save I(0) */ \ |
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
428 movdqa_r2m(xmm1, *I(1)); /* save I(1) */ \ |
1970 | 429 \ |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
430 movdqa_m2r(*I(6), xmm0); /* load h3g3g3e3h2g2f2e2 */ \ |
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
431 movdqa_r2r(xmm3, xmm1); /* make a copy */ \ |
1970 | 432 \ |
433 punpcklqdq_r2r(xmm0, xmm1); /* xmm1=h2g2f2e2d2c2b2a2 */ \ | |
434 punpckhqdq_r2r(xmm0, xmm3); /* xmm3=h3g3f3e3d3c3b3a3 */ \ | |
435 \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
436 movdqa_r2r(xmm2, xmm4); /* make a copy */ \ |
1970 | 437 punpcklqdq_r2r(xmm5, xmm4); /* xmm4=h4g4f4e4d4c4b4a4 */ \ |
438 \ | |
439 punpckhqdq_r2r(xmm5, xmm2); /* xmm2=h5g5f5e5d5c5b5a5 */ \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
440 movdqa_r2m(xmm1, *I(2)); /* save I(2) */ \ |
1970 | 441 \ |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
442 movdqa_r2m(xmm3, *I(3)); /* save I(3) */ \ |
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
443 movdqa_r2m(xmm4, *I(4)); /* save I(4) */ \ |
1970 | 444 \ |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
445 movdqa_r2m(xmm2, *I(5)); /* save I(5) */ \ |
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
446 movdqa_r2r(xmm7, xmm5); /* make a copy */ \ |
1970 | 447 \ |
448 punpcklqdq_r2r(xmm6, xmm5); /* xmm5=h6g6f6e6d6c6b6a6 */ \ | |
449 punpckhqdq_r2r(xmm6, xmm7); /* xmm7=h7g7f7e7d7c7b7a7 */ \ | |
450 \ | |
6597
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
451 movdqa_r2m(xmm5, *I(6)); /* save I(6) */ \ |
25ed93c16c00
Eliminate movdqu in vp3dsp_sse2, patch from Alexander Strange astrangeAtithinkswDoTcom
lu_zero
parents:
6376
diff
changeset
|
452 movdqa_r2m(xmm7, *I(7)); /* save I(7) */ \ |
1970 | 453 \ |
454 } /* End of Transpose Macro */ | |
455 | |
2696
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
1978
diff
changeset
|
456 void ff_vp3_idct_sse2(int16_t *input_data) |
1970 | 457 { |
458 unsigned char *input_bytes = (unsigned char *)input_data; | |
2696
9699d325049d
porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michael
parents:
1978
diff
changeset
|
459 unsigned char *output_data_bytes = (unsigned char *)input_data; |
7757
b04a9742669c
Don't declare SSE vp3 idct data static, so it can be used in the mmx version
conrad
parents:
7743
diff
changeset
|
460 const unsigned char *idct_data_bytes = (const unsigned char *)ff_vp3_idct_data; |
7742 | 461 const unsigned char *Eight = (const unsigned char *)&ff_pw_8; |
1970 | 462 |
463 #define eax input_bytes | |
464 #define edx idct_data_bytes | |
465 | |
466 #define I(i) (eax + 16 * i) | |
467 #define O(i) (ebx + 16 * i) | |
468 #define C(i) (edx + 16 * (i-1)) | |
469 | |
470 #define ebx output_data_bytes | |
471 | |
472 SSE2_Row_IDCT(); | |
473 | |
474 SSE2_Transpose(); | |
2967 | 475 |
1970 | 476 SSE2_Column_IDCT(); |
477 } | |
5014
42b99a3aadde
better separation of vp3dsp functions from dsputil_mmx.c
aurel
parents:
5010
diff
changeset
|
478 |
42b99a3aadde
better separation of vp3dsp functions from dsputil_mmx.c
aurel
parents:
5010
diff
changeset
|
479 void ff_vp3_idct_put_sse2(uint8_t *dest, int line_size, DCTELEM *block) |
42b99a3aadde
better separation of vp3dsp functions from dsputil_mmx.c
aurel
parents:
5010
diff
changeset
|
480 { |
42b99a3aadde
better separation of vp3dsp functions from dsputil_mmx.c
aurel
parents:
5010
diff
changeset
|
481 ff_vp3_idct_sse2(block); |
42b99a3aadde
better separation of vp3dsp functions from dsputil_mmx.c
aurel
parents:
5010
diff
changeset
|
482 put_signed_pixels_clamped_mmx(block, dest, line_size); |
42b99a3aadde
better separation of vp3dsp functions from dsputil_mmx.c
aurel
parents:
5010
diff
changeset
|
483 } |
42b99a3aadde
better separation of vp3dsp functions from dsputil_mmx.c
aurel
parents:
5010
diff
changeset
|
484 |
42b99a3aadde
better separation of vp3dsp functions from dsputil_mmx.c
aurel
parents:
5010
diff
changeset
|
485 void ff_vp3_idct_add_sse2(uint8_t *dest, int line_size, DCTELEM *block) |
42b99a3aadde
better separation of vp3dsp functions from dsputil_mmx.c
aurel
parents:
5010
diff
changeset
|
486 { |
42b99a3aadde
better separation of vp3dsp functions from dsputil_mmx.c
aurel
parents:
5010
diff
changeset
|
487 ff_vp3_idct_sse2(block); |
42b99a3aadde
better separation of vp3dsp functions from dsputil_mmx.c
aurel
parents:
5010
diff
changeset
|
488 add_pixels_clamped_mmx(block, dest, line_size); |
42b99a3aadde
better separation of vp3dsp functions from dsputil_mmx.c
aurel
parents:
5010
diff
changeset
|
489 } |