Mercurial > libavcodec.hg
annotate sparc/dsputil_vis.c @ 5678:53c43e7156bc libavcodec
cosmetics: rename variables. tbl->tab for consistency with other AC3 tables
author | jbr |
---|---|
date | Sat, 15 Sep 2007 00:19:21 +0000 |
parents | ad0ab0eebd69 |
children | c0f471cc871d |
rev | line source |
---|---|
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
1 /* |
1966
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
2 * dsputil_vis.c |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
3 * Copyright (C) 2003 David S. Miller <davem@redhat.com> |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
4 * |
3947
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3036
diff
changeset
|
5 * This file is part of FFmpeg. |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
6 * |
3987
2c54309fef91
Switch to the LGPL as agreed to by the author according to the
diego
parents:
3947
diff
changeset
|
7 * FFmpeg is free software; you can redistribute it and/or |
2c54309fef91
Switch to the LGPL as agreed to by the author according to the
diego
parents:
3947
diff
changeset
|
8 * modify it under the terms of the GNU Lesser General Public |
2c54309fef91
Switch to the LGPL as agreed to by the author according to the
diego
parents:
3947
diff
changeset
|
9 * License as published by the Free Software Foundation; either |
2c54309fef91
Switch to the LGPL as agreed to by the author according to the
diego
parents:
3947
diff
changeset
|
10 * version 2.1 of the License, or (at your option) any later version. |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
11 * |
3947
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3036
diff
changeset
|
12 * FFmpeg is distributed in the hope that it will be useful, |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3987
2c54309fef91
Switch to the LGPL as agreed to by the author according to the
diego
parents:
3947
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
2c54309fef91
Switch to the LGPL as agreed to by the author according to the
diego
parents:
3947
diff
changeset
|
15 * Lesser General Public License for more details. |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
16 * |
3987
2c54309fef91
Switch to the LGPL as agreed to by the author according to the
diego
parents:
3947
diff
changeset
|
17 * You should have received a copy of the GNU Lesser General Public |
2c54309fef91
Switch to the LGPL as agreed to by the author according to the
diego
parents:
3947
diff
changeset
|
18 * 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
|
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
20 */ |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
21 |
1966
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
22 /* The *no_round* functions have been added by James A. Morrison, 2003,2004. |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
23 The vis code from libmpeg2 was adapted for ffmpeg by James A. Morrison. |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
24 */ |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
25 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
26 #include "config.h" |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
27 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
28 #ifdef ARCH_SPARC |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
29 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
30 #include <inttypes.h> |
1966
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
31 #include <signal.h> |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
32 #include <setjmp.h> |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
33 |
5010
d5ba514e3f4a
Add libavcodec to compiler include flags in order to simplify header
diego
parents:
3987
diff
changeset
|
34 #include "dsputil.h" |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
35 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
36 #include "vis.h" |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
37 |
5618 | 38 extern void ff_simple_idct_put_vis(uint8_t *dest, int line_size, DCTELEM *data); |
39 extern void ff_simple_idct_add_vis(uint8_t *dest, int line_size, DCTELEM *data); | |
40 extern void ff_simple_idct_vis(DCTELEM *data); | |
41 | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
42 /* The trick used in some of this file is the formula from the MMX |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
43 * motion comp code, which is: |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
44 * |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
45 * (x+y+1)>>1 == (x|y)-((x^y)>>1) |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
46 * |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
47 * This allows us to average 8 bytes at a time in a 64-bit FPU reg. |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
48 * We avoid overflows by masking before we do the shift, and we |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
49 * implement the shift by multiplying by 1/2 using mul8x16. So in |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
50 * VIS this is (assume 'x' is in f0, 'y' is in f2, a repeating mask |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
51 * of '0xfe' is in f4, a repeating mask of '0x7f' is in f6, and |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
52 * the value 0x80808080 is in f8): |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
53 * |
2979 | 54 * fxor f0, f2, f10 |
55 * fand f10, f4, f10 | |
56 * fmul8x16 f8, f10, f10 | |
57 * fand f10, f6, f10 | |
58 * for f0, f2, f12 | |
59 * fpsub16 f12, f10, f10 | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
60 */ |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
61 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
62 #define ATTR_ALIGN(alignd) __attribute__ ((aligned(alignd))) |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
63 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
64 #define DUP4(x) {x, x, x, x} |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
65 #define DUP8(x) {x, x, x, x, x, x, x, x} |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
66 static const int16_t constants1[] ATTR_ALIGN(8) = DUP4 (1); |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
67 static const int16_t constants2[] ATTR_ALIGN(8) = DUP4 (2); |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
68 static const int16_t constants3[] ATTR_ALIGN(8) = DUP4 (3); |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
69 static const int16_t constants6[] ATTR_ALIGN(8) = DUP4 (6); |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
70 static const int8_t constants_fe[] ATTR_ALIGN(8) = DUP8 (0xfe); |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
71 static const int8_t constants_7f[] ATTR_ALIGN(8) = DUP8 (0x7f); |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
72 static const int8_t constants128[] ATTR_ALIGN(8) = DUP8 (128); |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
73 static const int16_t constants256_512[] ATTR_ALIGN(8) = |
2979 | 74 {256, 512, 256, 512}; |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
75 static const int16_t constants256_1024[] ATTR_ALIGN(8) = |
2979 | 76 {256, 1024, 256, 1024}; |
77 | |
78 #define REF_0 0 | |
79 #define REF_0_1 1 | |
80 #define REF_2 2 | |
81 #define REF_2_1 3 | |
82 #define REF_4 4 | |
83 #define REF_4_1 5 | |
84 #define REF_6 6 | |
85 #define REF_6_1 7 | |
86 #define REF_S0 8 | |
87 #define REF_S0_1 9 | |
88 #define REF_S2 10 | |
89 #define REF_S2_1 11 | |
90 #define REF_S4 12 | |
91 #define REF_S4_1 13 | |
92 #define REF_S6 14 | |
93 #define REF_S6_1 15 | |
94 #define DST_0 16 | |
95 #define DST_1 17 | |
96 #define DST_2 18 | |
97 #define DST_3 19 | |
98 #define CONST_1 20 | |
99 #define CONST_2 20 | |
100 #define CONST_3 20 | |
101 #define CONST_6 20 | |
102 #define MASK_fe 20 | |
103 #define CONST_128 22 | |
104 #define CONST_256 22 | |
105 #define CONST_512 22 | |
106 #define CONST_1024 22 | |
107 #define TMP0 24 | |
108 #define TMP1 25 | |
109 #define TMP2 26 | |
110 #define TMP3 27 | |
111 #define TMP4 28 | |
112 #define TMP5 29 | |
113 #define ZERO 30 | |
114 #define MASK_7f 30 | |
115 | |
116 #define TMP6 32 | |
117 #define TMP8 34 | |
118 #define TMP10 36 | |
119 #define TMP12 38 | |
120 #define TMP14 40 | |
121 #define TMP16 42 | |
122 #define TMP18 44 | |
123 #define TMP20 46 | |
124 #define TMP22 48 | |
125 #define TMP24 50 | |
126 #define TMP26 52 | |
127 #define TMP28 54 | |
128 #define TMP30 56 | |
129 #define TMP32 58 | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
130 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
131 static void MC_put_o_16_vis (uint8_t * dest, const uint8_t * _ref, |
2979 | 132 const int stride, int height) |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
133 { |
2979 | 134 uint8_t *ref = (uint8_t *) _ref; |
135 | |
136 ref = vis_alignaddr(ref); | |
137 do { /* 5 cycles */ | |
138 vis_ld64(ref[0], TMP0); | |
139 | |
140 vis_ld64_2(ref, 8, TMP2); | |
141 | |
142 vis_ld64_2(ref, 16, TMP4); | |
143 ref += stride; | |
144 | |
145 vis_faligndata(TMP0, TMP2, REF_0); | |
146 vis_st64(REF_0, dest[0]); | |
147 | |
148 vis_faligndata(TMP2, TMP4, REF_2); | |
149 vis_st64_2(REF_2, dest, 8); | |
150 dest += stride; | |
151 } while (--height); | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
152 } |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
153 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
154 static void MC_put_o_8_vis (uint8_t * dest, const uint8_t * _ref, |
2979 | 155 const int stride, int height) |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
156 { |
2979 | 157 uint8_t *ref = (uint8_t *) _ref; |
158 | |
159 ref = vis_alignaddr(ref); | |
160 do { /* 4 cycles */ | |
161 vis_ld64(ref[0], TMP0); | |
162 | |
163 vis_ld64(ref[8], TMP2); | |
164 ref += stride; | |
165 | |
166 /* stall */ | |
167 | |
168 vis_faligndata(TMP0, TMP2, REF_0); | |
169 vis_st64(REF_0, dest[0]); | |
170 dest += stride; | |
171 } while (--height); | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
172 } |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
173 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
174 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
175 static void MC_avg_o_16_vis (uint8_t * dest, const uint8_t * _ref, |
2979 | 176 const int stride, int height) |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
177 { |
2979 | 178 uint8_t *ref = (uint8_t *) _ref; |
179 int stride_8 = stride + 8; | |
180 | |
181 ref = vis_alignaddr(ref); | |
182 | |
183 vis_ld64(ref[0], TMP0); | |
184 | |
185 vis_ld64(ref[8], TMP2); | |
186 | |
187 vis_ld64(ref[16], TMP4); | |
188 | |
189 vis_ld64(dest[0], DST_0); | |
190 | |
191 vis_ld64(dest[8], DST_2); | |
192 | |
193 vis_ld64(constants_fe[0], MASK_fe); | |
194 vis_faligndata(TMP0, TMP2, REF_0); | |
195 | |
196 vis_ld64(constants_7f[0], MASK_7f); | |
197 vis_faligndata(TMP2, TMP4, REF_2); | |
198 | |
199 vis_ld64(constants128[0], CONST_128); | |
200 | |
201 ref += stride; | |
202 height = (height >> 1) - 1; | |
203 | |
204 do { /* 24 cycles */ | |
205 vis_ld64(ref[0], TMP0); | |
206 vis_xor(DST_0, REF_0, TMP6); | |
207 | |
208 vis_ld64_2(ref, 8, TMP2); | |
209 vis_and(TMP6, MASK_fe, TMP6); | |
210 | |
211 vis_ld64_2(ref, 16, TMP4); | |
212 ref += stride; | |
213 vis_mul8x16(CONST_128, TMP6, TMP6); | |
214 vis_xor(DST_2, REF_2, TMP8); | |
215 | |
216 vis_and(TMP8, MASK_fe, TMP8); | |
217 | |
218 vis_or(DST_0, REF_0, TMP10); | |
219 vis_ld64_2(dest, stride, DST_0); | |
220 vis_mul8x16(CONST_128, TMP8, TMP8); | |
221 | |
222 vis_or(DST_2, REF_2, TMP12); | |
223 vis_ld64_2(dest, stride_8, DST_2); | |
224 | |
225 vis_ld64(ref[0], TMP14); | |
226 vis_and(TMP6, MASK_7f, TMP6); | |
227 | |
228 vis_and(TMP8, MASK_7f, TMP8); | |
229 | |
230 vis_psub16(TMP10, TMP6, TMP6); | |
231 vis_st64(TMP6, dest[0]); | |
232 | |
233 vis_psub16(TMP12, TMP8, TMP8); | |
234 vis_st64_2(TMP8, dest, 8); | |
235 | |
236 dest += stride; | |
237 vis_ld64_2(ref, 8, TMP16); | |
238 vis_faligndata(TMP0, TMP2, REF_0); | |
239 | |
240 vis_ld64_2(ref, 16, TMP18); | |
241 vis_faligndata(TMP2, TMP4, REF_2); | |
242 ref += stride; | |
243 | |
244 vis_xor(DST_0, REF_0, TMP20); | |
245 | |
246 vis_and(TMP20, MASK_fe, TMP20); | |
247 | |
248 vis_xor(DST_2, REF_2, TMP22); | |
249 vis_mul8x16(CONST_128, TMP20, TMP20); | |
250 | |
251 vis_and(TMP22, MASK_fe, TMP22); | |
252 | |
253 vis_or(DST_0, REF_0, TMP24); | |
254 vis_mul8x16(CONST_128, TMP22, TMP22); | |
255 | |
256 vis_or(DST_2, REF_2, TMP26); | |
257 | |
258 vis_ld64_2(dest, stride, DST_0); | |
259 vis_faligndata(TMP14, TMP16, REF_0); | |
260 | |
261 vis_ld64_2(dest, stride_8, DST_2); | |
262 vis_faligndata(TMP16, TMP18, REF_2); | |
263 | |
264 vis_and(TMP20, MASK_7f, TMP20); | |
265 | |
266 vis_and(TMP22, MASK_7f, TMP22); | |
267 | |
268 vis_psub16(TMP24, TMP20, TMP20); | |
269 vis_st64(TMP20, dest[0]); | |
270 | |
271 vis_psub16(TMP26, TMP22, TMP22); | |
272 vis_st64_2(TMP22, dest, 8); | |
273 dest += stride; | |
274 } while (--height); | |
275 | |
276 vis_ld64(ref[0], TMP0); | |
277 vis_xor(DST_0, REF_0, TMP6); | |
278 | |
279 vis_ld64_2(ref, 8, TMP2); | |
280 vis_and(TMP6, MASK_fe, TMP6); | |
281 | |
282 vis_ld64_2(ref, 16, TMP4); | |
283 vis_mul8x16(CONST_128, TMP6, TMP6); | |
284 vis_xor(DST_2, REF_2, TMP8); | |
285 | |
286 vis_and(TMP8, MASK_fe, TMP8); | |
287 | |
288 vis_or(DST_0, REF_0, TMP10); | |
289 vis_ld64_2(dest, stride, DST_0); | |
290 vis_mul8x16(CONST_128, TMP8, TMP8); | |
291 | |
292 vis_or(DST_2, REF_2, TMP12); | |
293 vis_ld64_2(dest, stride_8, DST_2); | |
294 | |
295 vis_ld64(ref[0], TMP14); | |
296 vis_and(TMP6, MASK_7f, TMP6); | |
297 | |
298 vis_and(TMP8, MASK_7f, TMP8); | |
299 | |
300 vis_psub16(TMP10, TMP6, TMP6); | |
301 vis_st64(TMP6, dest[0]); | |
302 | |
303 vis_psub16(TMP12, TMP8, TMP8); | |
304 vis_st64_2(TMP8, dest, 8); | |
305 | |
306 dest += stride; | |
307 vis_faligndata(TMP0, TMP2, REF_0); | |
308 | |
309 vis_faligndata(TMP2, TMP4, REF_2); | |
310 | |
311 vis_xor(DST_0, REF_0, TMP20); | |
312 | |
313 vis_and(TMP20, MASK_fe, TMP20); | |
314 | |
315 vis_xor(DST_2, REF_2, TMP22); | |
316 vis_mul8x16(CONST_128, TMP20, TMP20); | |
317 | |
318 vis_and(TMP22, MASK_fe, TMP22); | |
319 | |
320 vis_or(DST_0, REF_0, TMP24); | |
321 vis_mul8x16(CONST_128, TMP22, TMP22); | |
322 | |
323 vis_or(DST_2, REF_2, TMP26); | |
324 | |
325 vis_and(TMP20, MASK_7f, TMP20); | |
326 | |
327 vis_and(TMP22, MASK_7f, TMP22); | |
328 | |
329 vis_psub16(TMP24, TMP20, TMP20); | |
330 vis_st64(TMP20, dest[0]); | |
331 | |
332 vis_psub16(TMP26, TMP22, TMP22); | |
333 vis_st64_2(TMP22, dest, 8); | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
334 } |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
335 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
336 static void MC_avg_o_8_vis (uint8_t * dest, const uint8_t * _ref, |
2979 | 337 const int stride, int height) |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
338 { |
2979 | 339 uint8_t *ref = (uint8_t *) _ref; |
340 | |
341 ref = vis_alignaddr(ref); | |
342 | |
343 vis_ld64(ref[0], TMP0); | |
344 | |
345 vis_ld64(ref[8], TMP2); | |
346 | |
347 vis_ld64(dest[0], DST_0); | |
348 | |
349 vis_ld64(constants_fe[0], MASK_fe); | |
350 | |
351 vis_ld64(constants_7f[0], MASK_7f); | |
352 vis_faligndata(TMP0, TMP2, REF_0); | |
353 | |
354 vis_ld64(constants128[0], CONST_128); | |
355 | |
356 ref += stride; | |
357 height = (height >> 1) - 1; | |
358 | |
359 do { /* 12 cycles */ | |
360 vis_ld64(ref[0], TMP0); | |
361 vis_xor(DST_0, REF_0, TMP4); | |
362 | |
363 vis_ld64(ref[8], TMP2); | |
364 vis_and(TMP4, MASK_fe, TMP4); | |
365 | |
366 vis_or(DST_0, REF_0, TMP6); | |
367 vis_ld64_2(dest, stride, DST_0); | |
368 ref += stride; | |
369 vis_mul8x16(CONST_128, TMP4, TMP4); | |
370 | |
371 vis_ld64(ref[0], TMP12); | |
372 vis_faligndata(TMP0, TMP2, REF_0); | |
373 | |
374 vis_ld64(ref[8], TMP2); | |
375 vis_xor(DST_0, REF_0, TMP0); | |
376 ref += stride; | |
377 | |
378 vis_and(TMP0, MASK_fe, TMP0); | |
379 | |
380 vis_and(TMP4, MASK_7f, TMP4); | |
381 | |
382 vis_psub16(TMP6, TMP4, TMP4); | |
383 vis_st64(TMP4, dest[0]); | |
384 dest += stride; | |
385 vis_mul8x16(CONST_128, TMP0, TMP0); | |
386 | |
387 vis_or(DST_0, REF_0, TMP6); | |
388 vis_ld64_2(dest, stride, DST_0); | |
389 | |
390 vis_faligndata(TMP12, TMP2, REF_0); | |
391 | |
392 vis_and(TMP0, MASK_7f, TMP0); | |
393 | |
394 vis_psub16(TMP6, TMP0, TMP4); | |
395 vis_st64(TMP4, dest[0]); | |
396 dest += stride; | |
397 } while (--height); | |
398 | |
399 vis_ld64(ref[0], TMP0); | |
400 vis_xor(DST_0, REF_0, TMP4); | |
401 | |
402 vis_ld64(ref[8], TMP2); | |
403 vis_and(TMP4, MASK_fe, TMP4); | |
404 | |
405 vis_or(DST_0, REF_0, TMP6); | |
406 vis_ld64_2(dest, stride, DST_0); | |
407 vis_mul8x16(CONST_128, TMP4, TMP4); | |
408 | |
409 vis_faligndata(TMP0, TMP2, REF_0); | |
410 | |
411 vis_xor(DST_0, REF_0, TMP0); | |
412 | |
413 vis_and(TMP0, MASK_fe, TMP0); | |
414 | |
415 vis_and(TMP4, MASK_7f, TMP4); | |
416 | |
417 vis_psub16(TMP6, TMP4, TMP4); | |
418 vis_st64(TMP4, dest[0]); | |
419 dest += stride; | |
420 vis_mul8x16(CONST_128, TMP0, TMP0); | |
421 | |
422 vis_or(DST_0, REF_0, TMP6); | |
423 | |
424 vis_and(TMP0, MASK_7f, TMP0); | |
425 | |
426 vis_psub16(TMP6, TMP0, TMP4); | |
427 vis_st64(TMP4, dest[0]); | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
428 } |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
429 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
430 static void MC_put_x_16_vis (uint8_t * dest, const uint8_t * _ref, |
2979 | 431 const int stride, int height) |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
432 { |
2979 | 433 uint8_t *ref = (uint8_t *) _ref; |
434 unsigned long off = (unsigned long) ref & 0x7; | |
435 unsigned long off_plus_1 = off + 1; | |
436 | |
437 ref = vis_alignaddr(ref); | |
438 | |
439 vis_ld64(ref[0], TMP0); | |
440 | |
441 vis_ld64_2(ref, 8, TMP2); | |
442 | |
443 vis_ld64_2(ref, 16, TMP4); | |
444 | |
445 vis_ld64(constants_fe[0], MASK_fe); | |
446 | |
447 vis_ld64(constants_7f[0], MASK_7f); | |
448 vis_faligndata(TMP0, TMP2, REF_0); | |
449 | |
450 vis_ld64(constants128[0], CONST_128); | |
451 vis_faligndata(TMP2, TMP4, REF_4); | |
452 | |
453 if (off != 0x7) { | |
454 vis_alignaddr_g0((void *)off_plus_1); | |
455 vis_faligndata(TMP0, TMP2, REF_2); | |
456 vis_faligndata(TMP2, TMP4, REF_6); | |
457 } else { | |
458 vis_src1(TMP2, REF_2); | |
459 vis_src1(TMP4, REF_6); | |
460 } | |
461 | |
462 ref += stride; | |
463 height = (height >> 1) - 1; | |
464 | |
465 do { /* 34 cycles */ | |
466 vis_ld64(ref[0], TMP0); | |
467 vis_xor(REF_0, REF_2, TMP6); | |
468 | |
469 vis_ld64_2(ref, 8, TMP2); | |
470 vis_xor(REF_4, REF_6, TMP8); | |
471 | |
472 vis_ld64_2(ref, 16, TMP4); | |
473 vis_and(TMP6, MASK_fe, TMP6); | |
474 ref += stride; | |
475 | |
476 vis_ld64(ref[0], TMP14); | |
477 vis_mul8x16(CONST_128, TMP6, TMP6); | |
478 vis_and(TMP8, MASK_fe, TMP8); | |
479 | |
480 vis_ld64_2(ref, 8, TMP16); | |
481 vis_mul8x16(CONST_128, TMP8, TMP8); | |
482 vis_or(REF_0, REF_2, TMP10); | |
483 | |
484 vis_ld64_2(ref, 16, TMP18); | |
485 ref += stride; | |
486 vis_or(REF_4, REF_6, TMP12); | |
487 | |
488 vis_alignaddr_g0((void *)off); | |
489 | |
490 vis_faligndata(TMP0, TMP2, REF_0); | |
491 | |
492 vis_faligndata(TMP2, TMP4, REF_4); | |
493 | |
494 if (off != 0x7) { | |
495 vis_alignaddr_g0((void *)off_plus_1); | |
496 vis_faligndata(TMP0, TMP2, REF_2); | |
497 vis_faligndata(TMP2, TMP4, REF_6); | |
498 } else { | |
499 vis_src1(TMP2, REF_2); | |
500 vis_src1(TMP4, REF_6); | |
501 } | |
502 | |
503 vis_and(TMP6, MASK_7f, TMP6); | |
504 | |
505 vis_and(TMP8, MASK_7f, TMP8); | |
506 | |
507 vis_psub16(TMP10, TMP6, TMP6); | |
508 vis_st64(TMP6, dest[0]); | |
509 | |
510 vis_psub16(TMP12, TMP8, TMP8); | |
511 vis_st64_2(TMP8, dest, 8); | |
512 dest += stride; | |
513 | |
514 vis_xor(REF_0, REF_2, TMP6); | |
515 | |
516 vis_xor(REF_4, REF_6, TMP8); | |
517 | |
518 vis_and(TMP6, MASK_fe, TMP6); | |
519 | |
520 vis_mul8x16(CONST_128, TMP6, TMP6); | |
521 vis_and(TMP8, MASK_fe, TMP8); | |
522 | |
523 vis_mul8x16(CONST_128, TMP8, TMP8); | |
524 vis_or(REF_0, REF_2, TMP10); | |
525 | |
526 vis_or(REF_4, REF_6, TMP12); | |
527 | |
528 vis_alignaddr_g0((void *)off); | |
529 | |
530 vis_faligndata(TMP14, TMP16, REF_0); | |
531 | |
532 vis_faligndata(TMP16, TMP18, REF_4); | |
533 | |
534 if (off != 0x7) { | |
535 vis_alignaddr_g0((void *)off_plus_1); | |
536 vis_faligndata(TMP14, TMP16, REF_2); | |
537 vis_faligndata(TMP16, TMP18, REF_6); | |
538 } else { | |
539 vis_src1(TMP16, REF_2); | |
540 vis_src1(TMP18, REF_6); | |
541 } | |
542 | |
543 vis_and(TMP6, MASK_7f, TMP6); | |
544 | |
545 vis_and(TMP8, MASK_7f, TMP8); | |
546 | |
547 vis_psub16(TMP10, TMP6, TMP6); | |
548 vis_st64(TMP6, dest[0]); | |
549 | |
550 vis_psub16(TMP12, TMP8, TMP8); | |
551 vis_st64_2(TMP8, dest, 8); | |
552 dest += stride; | |
553 } while (--height); | |
554 | |
555 vis_ld64(ref[0], TMP0); | |
556 vis_xor(REF_0, REF_2, TMP6); | |
557 | |
558 vis_ld64_2(ref, 8, TMP2); | |
559 vis_xor(REF_4, REF_6, TMP8); | |
560 | |
561 vis_ld64_2(ref, 16, TMP4); | |
562 vis_and(TMP6, MASK_fe, TMP6); | |
563 | |
564 vis_mul8x16(CONST_128, TMP6, TMP6); | |
565 vis_and(TMP8, MASK_fe, TMP8); | |
566 | |
567 vis_mul8x16(CONST_128, TMP8, TMP8); | |
568 vis_or(REF_0, REF_2, TMP10); | |
569 | |
570 vis_or(REF_4, REF_6, TMP12); | |
571 | |
572 vis_alignaddr_g0((void *)off); | |
573 | |
574 vis_faligndata(TMP0, TMP2, REF_0); | |
575 | |
576 vis_faligndata(TMP2, TMP4, REF_4); | |
577 | |
578 if (off != 0x7) { | |
579 vis_alignaddr_g0((void *)off_plus_1); | |
580 vis_faligndata(TMP0, TMP2, REF_2); | |
581 vis_faligndata(TMP2, TMP4, REF_6); | |
582 } else { | |
583 vis_src1(TMP2, REF_2); | |
584 vis_src1(TMP4, REF_6); | |
585 } | |
586 | |
587 vis_and(TMP6, MASK_7f, TMP6); | |
588 | |
589 vis_and(TMP8, MASK_7f, TMP8); | |
590 | |
591 vis_psub16(TMP10, TMP6, TMP6); | |
592 vis_st64(TMP6, dest[0]); | |
593 | |
594 vis_psub16(TMP12, TMP8, TMP8); | |
595 vis_st64_2(TMP8, dest, 8); | |
596 dest += stride; | |
597 | |
598 vis_xor(REF_0, REF_2, TMP6); | |
599 | |
600 vis_xor(REF_4, REF_6, TMP8); | |
601 | |
602 vis_and(TMP6, MASK_fe, TMP6); | |
603 | |
604 vis_mul8x16(CONST_128, TMP6, TMP6); | |
605 vis_and(TMP8, MASK_fe, TMP8); | |
606 | |
607 vis_mul8x16(CONST_128, TMP8, TMP8); | |
608 vis_or(REF_0, REF_2, TMP10); | |
609 | |
610 vis_or(REF_4, REF_6, TMP12); | |
611 | |
612 vis_and(TMP6, MASK_7f, TMP6); | |
613 | |
614 vis_and(TMP8, MASK_7f, TMP8); | |
615 | |
616 vis_psub16(TMP10, TMP6, TMP6); | |
617 vis_st64(TMP6, dest[0]); | |
618 | |
619 vis_psub16(TMP12, TMP8, TMP8); | |
620 vis_st64_2(TMP8, dest, 8); | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
621 } |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
622 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
623 static void MC_put_x_8_vis (uint8_t * dest, const uint8_t * _ref, |
2979 | 624 const int stride, int height) |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
625 { |
2979 | 626 uint8_t *ref = (uint8_t *) _ref; |
627 unsigned long off = (unsigned long) ref & 0x7; | |
628 unsigned long off_plus_1 = off + 1; | |
629 | |
630 ref = vis_alignaddr(ref); | |
631 | |
632 vis_ld64(ref[0], TMP0); | |
633 | |
634 vis_ld64(ref[8], TMP2); | |
635 | |
636 vis_ld64(constants_fe[0], MASK_fe); | |
637 | |
638 vis_ld64(constants_7f[0], MASK_7f); | |
639 | |
640 vis_ld64(constants128[0], CONST_128); | |
641 vis_faligndata(TMP0, TMP2, REF_0); | |
642 | |
643 if (off != 0x7) { | |
644 vis_alignaddr_g0((void *)off_plus_1); | |
645 vis_faligndata(TMP0, TMP2, REF_2); | |
646 } else { | |
647 vis_src1(TMP2, REF_2); | |
648 } | |
649 | |
650 ref += stride; | |
651 height = (height >> 1) - 1; | |
652 | |
653 do { /* 20 cycles */ | |
654 vis_ld64(ref[0], TMP0); | |
655 vis_xor(REF_0, REF_2, TMP4); | |
656 | |
657 vis_ld64_2(ref, 8, TMP2); | |
658 vis_and(TMP4, MASK_fe, TMP4); | |
659 ref += stride; | |
660 | |
661 vis_ld64(ref[0], TMP8); | |
662 vis_or(REF_0, REF_2, TMP6); | |
663 vis_mul8x16(CONST_128, TMP4, TMP4); | |
664 | |
665 vis_alignaddr_g0((void *)off); | |
666 | |
667 vis_ld64_2(ref, 8, TMP10); | |
668 ref += stride; | |
669 vis_faligndata(TMP0, TMP2, REF_0); | |
670 | |
671 if (off != 0x7) { | |
672 vis_alignaddr_g0((void *)off_plus_1); | |
673 vis_faligndata(TMP0, TMP2, REF_2); | |
674 } else { | |
675 vis_src1(TMP2, REF_2); | |
676 } | |
677 | |
678 vis_and(TMP4, MASK_7f, TMP4); | |
679 | |
680 vis_psub16(TMP6, TMP4, DST_0); | |
681 vis_st64(DST_0, dest[0]); | |
682 dest += stride; | |
683 | |
684 vis_xor(REF_0, REF_2, TMP12); | |
685 | |
686 vis_and(TMP12, MASK_fe, TMP12); | |
687 | |
688 vis_or(REF_0, REF_2, TMP14); | |
689 vis_mul8x16(CONST_128, TMP12, TMP12); | |
690 | |
691 vis_alignaddr_g0((void *)off); | |
692 vis_faligndata(TMP8, TMP10, REF_0); | |
693 if (off != 0x7) { | |
694 vis_alignaddr_g0((void *)off_plus_1); | |
695 vis_faligndata(TMP8, TMP10, REF_2); | |
696 } else { | |
697 vis_src1(TMP10, REF_2); | |
698 } | |
699 | |
700 vis_and(TMP12, MASK_7f, TMP12); | |
701 | |
702 vis_psub16(TMP14, TMP12, DST_0); | |
703 vis_st64(DST_0, dest[0]); | |
704 dest += stride; | |
705 } while (--height); | |
706 | |
707 vis_ld64(ref[0], TMP0); | |
708 vis_xor(REF_0, REF_2, TMP4); | |
709 | |
710 vis_ld64_2(ref, 8, TMP2); | |
711 vis_and(TMP4, MASK_fe, TMP4); | |
712 | |
713 vis_or(REF_0, REF_2, TMP6); | |
714 vis_mul8x16(CONST_128, TMP4, TMP4); | |
715 | |
716 vis_alignaddr_g0((void *)off); | |
717 | |
718 vis_faligndata(TMP0, TMP2, REF_0); | |
719 | |
720 if (off != 0x7) { | |
721 vis_alignaddr_g0((void *)off_plus_1); | |
722 vis_faligndata(TMP0, TMP2, REF_2); | |
723 } else { | |
724 vis_src1(TMP2, REF_2); | |
725 } | |
726 | |
727 vis_and(TMP4, MASK_7f, TMP4); | |
728 | |
729 vis_psub16(TMP6, TMP4, DST_0); | |
730 vis_st64(DST_0, dest[0]); | |
731 dest += stride; | |
732 | |
733 vis_xor(REF_0, REF_2, TMP12); | |
734 | |
735 vis_and(TMP12, MASK_fe, TMP12); | |
736 | |
737 vis_or(REF_0, REF_2, TMP14); | |
738 vis_mul8x16(CONST_128, TMP12, TMP12); | |
739 | |
740 vis_and(TMP12, MASK_7f, TMP12); | |
741 | |
742 vis_psub16(TMP14, TMP12, DST_0); | |
743 vis_st64(DST_0, dest[0]); | |
744 dest += stride; | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
745 } |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
746 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
747 static void MC_avg_x_16_vis (uint8_t * dest, const uint8_t * _ref, |
2979 | 748 const int stride, int height) |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
749 { |
2979 | 750 uint8_t *ref = (uint8_t *) _ref; |
751 unsigned long off = (unsigned long) ref & 0x7; | |
752 unsigned long off_plus_1 = off + 1; | |
753 | |
754 vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT); | |
755 | |
756 vis_ld64(constants3[0], CONST_3); | |
757 vis_fzero(ZERO); | |
758 vis_ld64(constants256_512[0], CONST_256); | |
759 | |
760 ref = vis_alignaddr(ref); | |
761 do { /* 26 cycles */ | |
762 vis_ld64(ref[0], TMP0); | |
763 | |
764 vis_ld64(ref[8], TMP2); | |
765 | |
766 vis_alignaddr_g0((void *)off); | |
767 | |
768 vis_ld64(ref[16], TMP4); | |
769 | |
770 vis_ld64(dest[0], DST_0); | |
771 vis_faligndata(TMP0, TMP2, REF_0); | |
772 | |
773 vis_ld64(dest[8], DST_2); | |
774 vis_faligndata(TMP2, TMP4, REF_4); | |
775 | |
776 if (off != 0x7) { | |
777 vis_alignaddr_g0((void *)off_plus_1); | |
778 vis_faligndata(TMP0, TMP2, REF_2); | |
779 vis_faligndata(TMP2, TMP4, REF_6); | |
780 } else { | |
781 vis_src1(TMP2, REF_2); | |
782 vis_src1(TMP4, REF_6); | |
783 } | |
784 | |
785 vis_mul8x16au(REF_0, CONST_256, TMP0); | |
786 | |
787 vis_pmerge(ZERO, REF_2, TMP4); | |
788 vis_mul8x16au(REF_0_1, CONST_256, TMP2); | |
789 | |
790 vis_pmerge(ZERO, REF_2_1, TMP6); | |
791 | |
792 vis_padd16(TMP0, TMP4, TMP0); | |
793 | |
794 vis_mul8x16al(DST_0, CONST_512, TMP4); | |
795 vis_padd16(TMP2, TMP6, TMP2); | |
796 | |
797 vis_mul8x16al(DST_1, CONST_512, TMP6); | |
798 | |
799 vis_mul8x16au(REF_6, CONST_256, TMP12); | |
800 | |
801 vis_padd16(TMP0, TMP4, TMP0); | |
802 vis_mul8x16au(REF_6_1, CONST_256, TMP14); | |
803 | |
804 vis_padd16(TMP2, TMP6, TMP2); | |
805 vis_mul8x16au(REF_4, CONST_256, TMP16); | |
806 | |
807 vis_padd16(TMP0, CONST_3, TMP8); | |
808 vis_mul8x16au(REF_4_1, CONST_256, TMP18); | |
809 | |
810 vis_padd16(TMP2, CONST_3, TMP10); | |
811 vis_pack16(TMP8, DST_0); | |
812 | |
813 vis_pack16(TMP10, DST_1); | |
814 vis_padd16(TMP16, TMP12, TMP0); | |
815 | |
816 vis_st64(DST_0, dest[0]); | |
817 vis_mul8x16al(DST_2, CONST_512, TMP4); | |
818 vis_padd16(TMP18, TMP14, TMP2); | |
819 | |
820 vis_mul8x16al(DST_3, CONST_512, TMP6); | |
821 vis_padd16(TMP0, CONST_3, TMP0); | |
822 | |
823 vis_padd16(TMP2, CONST_3, TMP2); | |
824 | |
825 vis_padd16(TMP0, TMP4, TMP0); | |
826 | |
827 vis_padd16(TMP2, TMP6, TMP2); | |
828 vis_pack16(TMP0, DST_2); | |
829 | |
830 vis_pack16(TMP2, DST_3); | |
831 vis_st64(DST_2, dest[8]); | |
832 | |
833 ref += stride; | |
834 dest += stride; | |
835 } while (--height); | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
836 } |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
837 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
838 static void MC_avg_x_8_vis (uint8_t * dest, const uint8_t * _ref, |
2979 | 839 const int stride, int height) |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
840 { |
2979 | 841 uint8_t *ref = (uint8_t *) _ref; |
842 unsigned long off = (unsigned long) ref & 0x7; | |
843 unsigned long off_plus_1 = off + 1; | |
844 int stride_times_2 = stride << 1; | |
845 | |
846 vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT); | |
847 | |
848 vis_ld64(constants3[0], CONST_3); | |
849 vis_fzero(ZERO); | |
850 vis_ld64(constants256_512[0], CONST_256); | |
851 | |
852 ref = vis_alignaddr(ref); | |
853 height >>= 2; | |
854 do { /* 47 cycles */ | |
855 vis_ld64(ref[0], TMP0); | |
856 | |
857 vis_ld64_2(ref, 8, TMP2); | |
858 ref += stride; | |
859 | |
860 vis_alignaddr_g0((void *)off); | |
861 | |
862 vis_ld64(ref[0], TMP4); | |
863 vis_faligndata(TMP0, TMP2, REF_0); | |
864 | |
865 vis_ld64_2(ref, 8, TMP6); | |
866 ref += stride; | |
867 | |
868 vis_ld64(ref[0], TMP8); | |
869 | |
870 vis_ld64_2(ref, 8, TMP10); | |
871 ref += stride; | |
872 vis_faligndata(TMP4, TMP6, REF_4); | |
873 | |
874 vis_ld64(ref[0], TMP12); | |
875 | |
876 vis_ld64_2(ref, 8, TMP14); | |
877 ref += stride; | |
878 vis_faligndata(TMP8, TMP10, REF_S0); | |
879 | |
880 vis_faligndata(TMP12, TMP14, REF_S4); | |
881 | |
882 if (off != 0x7) { | |
883 vis_alignaddr_g0((void *)off_plus_1); | |
884 | |
885 vis_ld64(dest[0], DST_0); | |
886 vis_faligndata(TMP0, TMP2, REF_2); | |
887 | |
888 vis_ld64_2(dest, stride, DST_2); | |
889 vis_faligndata(TMP4, TMP6, REF_6); | |
890 | |
891 vis_faligndata(TMP8, TMP10, REF_S2); | |
892 | |
893 vis_faligndata(TMP12, TMP14, REF_S6); | |
894 } else { | |
895 vis_ld64(dest[0], DST_0); | |
896 vis_src1(TMP2, REF_2); | |
897 | |
898 vis_ld64_2(dest, stride, DST_2); | |
899 vis_src1(TMP6, REF_6); | |
900 | |
901 vis_src1(TMP10, REF_S2); | |
902 | |
903 vis_src1(TMP14, REF_S6); | |
904 } | |
905 | |
906 vis_pmerge(ZERO, REF_0, TMP0); | |
907 vis_mul8x16au(REF_0_1, CONST_256, TMP2); | |
908 | |
909 vis_pmerge(ZERO, REF_2, TMP4); | |
910 vis_mul8x16au(REF_2_1, CONST_256, TMP6); | |
911 | |
912 vis_padd16(TMP0, CONST_3, TMP0); | |
913 vis_mul8x16al(DST_0, CONST_512, TMP16); | |
914 | |
915 vis_padd16(TMP2, CONST_3, TMP2); | |
916 vis_mul8x16al(DST_1, CONST_512, TMP18); | |
917 | |
918 vis_padd16(TMP0, TMP4, TMP0); | |
919 vis_mul8x16au(REF_4, CONST_256, TMP8); | |
920 | |
921 vis_padd16(TMP2, TMP6, TMP2); | |
922 vis_mul8x16au(REF_4_1, CONST_256, TMP10); | |
923 | |
924 vis_padd16(TMP0, TMP16, TMP0); | |
925 vis_mul8x16au(REF_6, CONST_256, TMP12); | |
926 | |
927 vis_padd16(TMP2, TMP18, TMP2); | |
928 vis_mul8x16au(REF_6_1, CONST_256, TMP14); | |
929 | |
930 vis_padd16(TMP8, CONST_3, TMP8); | |
931 vis_mul8x16al(DST_2, CONST_512, TMP16); | |
932 | |
933 vis_padd16(TMP8, TMP12, TMP8); | |
934 vis_mul8x16al(DST_3, CONST_512, TMP18); | |
935 | |
936 vis_padd16(TMP10, TMP14, TMP10); | |
937 vis_pack16(TMP0, DST_0); | |
938 | |
939 vis_pack16(TMP2, DST_1); | |
940 vis_st64(DST_0, dest[0]); | |
941 dest += stride; | |
942 vis_padd16(TMP10, CONST_3, TMP10); | |
943 | |
944 vis_ld64_2(dest, stride, DST_0); | |
945 vis_padd16(TMP8, TMP16, TMP8); | |
946 | |
947 vis_ld64_2(dest, stride_times_2, TMP4/*DST_2*/); | |
948 vis_padd16(TMP10, TMP18, TMP10); | |
949 vis_pack16(TMP8, DST_2); | |
950 | |
951 vis_pack16(TMP10, DST_3); | |
952 vis_st64(DST_2, dest[0]); | |
953 dest += stride; | |
954 | |
955 vis_mul8x16au(REF_S0_1, CONST_256, TMP2); | |
956 vis_pmerge(ZERO, REF_S0, TMP0); | |
957 | |
958 vis_pmerge(ZERO, REF_S2, TMP24); | |
959 vis_mul8x16au(REF_S2_1, CONST_256, TMP6); | |
960 | |
961 vis_padd16(TMP0, CONST_3, TMP0); | |
962 vis_mul8x16au(REF_S4, CONST_256, TMP8); | |
963 | |
964 vis_padd16(TMP2, CONST_3, TMP2); | |
965 vis_mul8x16au(REF_S4_1, CONST_256, TMP10); | |
966 | |
967 vis_padd16(TMP0, TMP24, TMP0); | |
968 vis_mul8x16au(REF_S6, CONST_256, TMP12); | |
969 | |
970 vis_padd16(TMP2, TMP6, TMP2); | |
971 vis_mul8x16au(REF_S6_1, CONST_256, TMP14); | |
972 | |
973 vis_padd16(TMP8, CONST_3, TMP8); | |
974 vis_mul8x16al(DST_0, CONST_512, TMP16); | |
975 | |
976 vis_padd16(TMP10, CONST_3, TMP10); | |
977 vis_mul8x16al(DST_1, CONST_512, TMP18); | |
978 | |
979 vis_padd16(TMP8, TMP12, TMP8); | |
980 vis_mul8x16al(TMP4/*DST_2*/, CONST_512, TMP20); | |
981 | |
982 vis_mul8x16al(TMP5/*DST_3*/, CONST_512, TMP22); | |
983 vis_padd16(TMP0, TMP16, TMP0); | |
984 | |
985 vis_padd16(TMP2, TMP18, TMP2); | |
986 vis_pack16(TMP0, DST_0); | |
987 | |
988 vis_padd16(TMP10, TMP14, TMP10); | |
989 vis_pack16(TMP2, DST_1); | |
990 vis_st64(DST_0, dest[0]); | |
991 dest += stride; | |
992 | |
993 vis_padd16(TMP8, TMP20, TMP8); | |
994 | |
995 vis_padd16(TMP10, TMP22, TMP10); | |
996 vis_pack16(TMP8, DST_2); | |
997 | |
998 vis_pack16(TMP10, DST_3); | |
999 vis_st64(DST_2, dest[0]); | |
1000 dest += stride; | |
1001 } while (--height); | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
1002 } |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
1003 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
1004 static void MC_put_y_16_vis (uint8_t * dest, const uint8_t * _ref, |
2979 | 1005 const int stride, int height) |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
1006 { |
2979 | 1007 uint8_t *ref = (uint8_t *) _ref; |
1008 | |
1009 ref = vis_alignaddr(ref); | |
1010 vis_ld64(ref[0], TMP0); | |
1011 | |
1012 vis_ld64_2(ref, 8, TMP2); | |
1013 | |
1014 vis_ld64_2(ref, 16, TMP4); | |
1015 ref += stride; | |
1016 | |
1017 vis_ld64(ref[0], TMP6); | |
1018 vis_faligndata(TMP0, TMP2, REF_0); | |
1019 | |
1020 vis_ld64_2(ref, 8, TMP8); | |
1021 vis_faligndata(TMP2, TMP4, REF_4); | |
1022 | |
1023 vis_ld64_2(ref, 16, TMP10); | |
1024 ref += stride; | |
1025 | |
1026 vis_ld64(constants_fe[0], MASK_fe); | |
1027 vis_faligndata(TMP6, TMP8, REF_2); | |
1028 | |
1029 vis_ld64(constants_7f[0], MASK_7f); | |
1030 vis_faligndata(TMP8, TMP10, REF_6); | |
1031 | |
1032 vis_ld64(constants128[0], CONST_128); | |
1033 height = (height >> 1) - 1; | |
1034 do { /* 24 cycles */ | |
1035 vis_ld64(ref[0], TMP0); | |
1036 vis_xor(REF_0, REF_2, TMP12); | |
1037 | |
1038 vis_ld64_2(ref, 8, TMP2); | |
1039 vis_xor(REF_4, REF_6, TMP16); | |
1040 | |
1041 vis_ld64_2(ref, 16, TMP4); | |
1042 ref += stride; | |
1043 vis_or(REF_0, REF_2, TMP14); | |
1044 | |
1045 vis_ld64(ref[0], TMP6); | |
1046 vis_or(REF_4, REF_6, TMP18); | |
1047 | |
1048 vis_ld64_2(ref, 8, TMP8); | |
1049 vis_faligndata(TMP0, TMP2, REF_0); | |
1050 | |
1051 vis_ld64_2(ref, 16, TMP10); | |
1052 ref += stride; | |
1053 vis_faligndata(TMP2, TMP4, REF_4); | |
1054 | |
1055 vis_and(TMP12, MASK_fe, TMP12); | |
1056 | |
1057 vis_and(TMP16, MASK_fe, TMP16); | |
1058 vis_mul8x16(CONST_128, TMP12, TMP12); | |
1059 | |
1060 vis_mul8x16(CONST_128, TMP16, TMP16); | |
1061 vis_xor(REF_0, REF_2, TMP0); | |
1062 | |
1063 vis_xor(REF_4, REF_6, TMP2); | |
1064 | |
1065 vis_or(REF_0, REF_2, TMP20); | |
1066 | |
1067 vis_and(TMP12, MASK_7f, TMP12); | |
1068 | |
1069 vis_and(TMP16, MASK_7f, TMP16); | |
1070 | |
1071 vis_psub16(TMP14, TMP12, TMP12); | |
1072 vis_st64(TMP12, dest[0]); | |
1073 | |
1074 vis_psub16(TMP18, TMP16, TMP16); | |
1075 vis_st64_2(TMP16, dest, 8); | |
1076 dest += stride; | |
1077 | |
1078 vis_or(REF_4, REF_6, TMP18); | |
1079 | |
1080 vis_and(TMP0, MASK_fe, TMP0); | |
1081 | |
1082 vis_and(TMP2, MASK_fe, TMP2); | |
1083 vis_mul8x16(CONST_128, TMP0, TMP0); | |
1084 | |
1085 vis_faligndata(TMP6, TMP8, REF_2); | |
1086 vis_mul8x16(CONST_128, TMP2, TMP2); | |
1087 | |
1088 vis_faligndata(TMP8, TMP10, REF_6); | |
1089 | |
1090 vis_and(TMP0, MASK_7f, TMP0); | |
1091 | |
1092 vis_and(TMP2, MASK_7f, TMP2); | |
1093 | |
1094 vis_psub16(TMP20, TMP0, TMP0); | |
1095 vis_st64(TMP0, dest[0]); | |
1096 | |
1097 vis_psub16(TMP18, TMP2, TMP2); | |
1098 vis_st64_2(TMP2, dest, 8); | |
1099 dest += stride; | |
1100 } while (--height); | |
1101 | |
1102 vis_ld64(ref[0], TMP0); | |
1103 vis_xor(REF_0, REF_2, TMP12); | |
1104 | |
1105 vis_ld64_2(ref, 8, TMP2); | |
1106 vis_xor(REF_4, REF_6, TMP16); | |
1107 | |
1108 vis_ld64_2(ref, 16, TMP4); | |
1109 vis_or(REF_0, REF_2, TMP14); | |
1110 | |
1111 vis_or(REF_4, REF_6, TMP18); | |
1112 | |
1113 vis_faligndata(TMP0, TMP2, REF_0); | |
1114 | |
1115 vis_faligndata(TMP2, TMP4, REF_4); | |
1116 | |
1117 vis_and(TMP12, MASK_fe, TMP12); | |
1118 | |
1119 vis_and(TMP16, MASK_fe, TMP16); | |
1120 vis_mul8x16(CONST_128, TMP12, TMP12); | |
1121 | |
1122 vis_mul8x16(CONST_128, TMP16, TMP16); | |
1123 vis_xor(REF_0, REF_2, TMP0); | |
1124 | |
1125 vis_xor(REF_4, REF_6, TMP2); | |
1126 | |
1127 vis_or(REF_0, REF_2, TMP20); | |
1128 | |
1129 vis_and(TMP12, MASK_7f, TMP12); | |
1130 | |
1131 vis_and(TMP16, MASK_7f, TMP16); | |
1132 | |
1133 vis_psub16(TMP14, TMP12, TMP12); | |
1134 vis_st64(TMP12, dest[0]); | |
1135 | |
1136 vis_psub16(TMP18, TMP16, TMP16); | |
1137 vis_st64_2(TMP16, dest, 8); | |
1138 dest += stride; | |
1139 | |
1140 vis_or(REF_4, REF_6, TMP18); | |
1141 | |
1142 vis_and(TMP0, MASK_fe, TMP0); | |
1143 | |
1144 vis_and(TMP2, MASK_fe, TMP2); | |
1145 vis_mul8x16(CONST_128, TMP0, TMP0); | |
1146 | |
1147 vis_mul8x16(CONST_128, TMP2, TMP2); | |
1148 | |
1149 vis_and(TMP0, MASK_7f, TMP0); | |
1150 | |
1151 vis_and(TMP2, MASK_7f, TMP2); | |
1152 | |
1153 vis_psub16(TMP20, TMP0, TMP0); | |
1154 vis_st64(TMP0, dest[0]); | |
1155 | |
1156 vis_psub16(TMP18, TMP2, TMP2); | |
1157 vis_st64_2(TMP2, dest, 8); | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
1158 } |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
1159 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
1160 static void MC_put_y_8_vis (uint8_t * dest, const uint8_t * _ref, |
2979 | 1161 const int stride, int height) |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
1162 { |
2979 | 1163 uint8_t *ref = (uint8_t *) _ref; |
1164 | |
1165 ref = vis_alignaddr(ref); | |
1166 vis_ld64(ref[0], TMP0); | |
1167 | |
1168 vis_ld64_2(ref, 8, TMP2); | |
1169 ref += stride; | |
1170 | |
1171 vis_ld64(ref[0], TMP4); | |
1172 | |
1173 vis_ld64_2(ref, 8, TMP6); | |
1174 ref += stride; | |
1175 | |
1176 vis_ld64(constants_fe[0], MASK_fe); | |
1177 vis_faligndata(TMP0, TMP2, REF_0); | |
1178 | |
1179 vis_ld64(constants_7f[0], MASK_7f); | |
1180 vis_faligndata(TMP4, TMP6, REF_2); | |
1181 | |
1182 vis_ld64(constants128[0], CONST_128); | |
1183 height = (height >> 1) - 1; | |
1184 do { /* 12 cycles */ | |
1185 vis_ld64(ref[0], TMP0); | |
1186 vis_xor(REF_0, REF_2, TMP4); | |
1187 | |
1188 vis_ld64_2(ref, 8, TMP2); | |
1189 ref += stride; | |
1190 vis_and(TMP4, MASK_fe, TMP4); | |
1191 | |
1192 vis_or(REF_0, REF_2, TMP6); | |
1193 vis_mul8x16(CONST_128, TMP4, TMP4); | |
1194 | |
1195 vis_faligndata(TMP0, TMP2, REF_0); | |
1196 vis_ld64(ref[0], TMP0); | |
1197 | |
1198 vis_ld64_2(ref, 8, TMP2); | |
1199 ref += stride; | |
1200 vis_xor(REF_0, REF_2, TMP12); | |
1201 | |
1202 vis_and(TMP4, MASK_7f, TMP4); | |
1203 | |
1204 vis_and(TMP12, MASK_fe, TMP12); | |
1205 | |
1206 vis_mul8x16(CONST_128, TMP12, TMP12); | |
1207 vis_or(REF_0, REF_2, TMP14); | |
1208 | |
1209 vis_psub16(TMP6, TMP4, DST_0); | |
1210 vis_st64(DST_0, dest[0]); | |
1211 dest += stride; | |
1212 | |
1213 vis_faligndata(TMP0, TMP2, REF_2); | |
1214 | |
1215 vis_and(TMP12, MASK_7f, TMP12); | |
1216 | |
1217 vis_psub16(TMP14, TMP12, DST_0); | |
1218 vis_st64(DST_0, dest[0]); | |
1219 dest += stride; | |
1220 } while (--height); | |
1221 | |
1222 vis_ld64(ref[0], TMP0); | |
1223 vis_xor(REF_0, REF_2, TMP4); | |
1224 | |
1225 vis_ld64_2(ref, 8, TMP2); | |
1226 vis_and(TMP4, MASK_fe, TMP4); | |
1227 | |
1228 vis_or(REF_0, REF_2, TMP6); | |
1229 vis_mul8x16(CONST_128, TMP4, TMP4); | |
1230 | |
1231 vis_faligndata(TMP0, TMP2, REF_0); | |
1232 | |
1233 vis_xor(REF_0, REF_2, TMP12); | |
1234 | |
1235 vis_and(TMP4, MASK_7f, TMP4); | |
1236 | |
1237 vis_and(TMP12, MASK_fe, TMP12); | |
1238 | |
1239 vis_mul8x16(CONST_128, TMP12, TMP12); | |
1240 vis_or(REF_0, REF_2, TMP14); | |
1241 | |
1242 vis_psub16(TMP6, TMP4, DST_0); | |
1243 vis_st64(DST_0, dest[0]); | |
1244 dest += stride; | |
1245 | |
1246 vis_and(TMP12, MASK_7f, TMP12); | |
1247 | |
1248 vis_psub16(TMP14, TMP12, DST_0); | |
1249 vis_st64(DST_0, dest[0]); | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
1250 } |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
1251 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
1252 static void MC_avg_y_16_vis (uint8_t * dest, const uint8_t * _ref, |
2979 | 1253 const int stride, int height) |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
1254 { |
2979 | 1255 uint8_t *ref = (uint8_t *) _ref; |
1256 int stride_8 = stride + 8; | |
1257 int stride_16 = stride + 16; | |
1258 | |
1259 vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT); | |
1260 | |
1261 ref = vis_alignaddr(ref); | |
1262 | |
1263 vis_ld64(ref[ 0], TMP0); | |
1264 vis_fzero(ZERO); | |
1265 | |
1266 vis_ld64(ref[ 8], TMP2); | |
1267 | |
1268 vis_ld64(ref[16], TMP4); | |
1269 | |
1270 vis_ld64(constants3[0], CONST_3); | |
1271 vis_faligndata(TMP0, TMP2, REF_2); | |
1272 | |
1273 vis_ld64(constants256_512[0], CONST_256); | |
1274 vis_faligndata(TMP2, TMP4, REF_6); | |
1275 height >>= 1; | |
1276 | |
1277 do { /* 31 cycles */ | |
1278 vis_ld64_2(ref, stride, TMP0); | |
1279 vis_pmerge(ZERO, REF_2, TMP12); | |
1280 vis_mul8x16au(REF_2_1, CONST_256, TMP14); | |
1281 | |
1282 vis_ld64_2(ref, stride_8, TMP2); | |
1283 vis_pmerge(ZERO, REF_6, TMP16); | |
1284 vis_mul8x16au(REF_6_1, CONST_256, TMP18); | |
1285 | |
1286 vis_ld64_2(ref, stride_16, TMP4); | |
1287 ref += stride; | |
1288 | |
1289 vis_ld64(dest[0], DST_0); | |
1290 vis_faligndata(TMP0, TMP2, REF_0); | |
1291 | |
1292 vis_ld64_2(dest, 8, DST_2); | |
1293 vis_faligndata(TMP2, TMP4, REF_4); | |
1294 | |
1295 vis_ld64_2(ref, stride, TMP6); | |
1296 vis_pmerge(ZERO, REF_0, TMP0); | |
1297 vis_mul8x16au(REF_0_1, CONST_256, TMP2); | |
1298 | |
1299 vis_ld64_2(ref, stride_8, TMP8); | |
1300 vis_pmerge(ZERO, REF_4, TMP4); | |
1301 | |
1302 vis_ld64_2(ref, stride_16, TMP10); | |
1303 ref += stride; | |
1304 | |
1305 vis_ld64_2(dest, stride, REF_S0/*DST_4*/); | |
1306 vis_faligndata(TMP6, TMP8, REF_2); | |
1307 vis_mul8x16au(REF_4_1, CONST_256, TMP6); | |
1308 | |
1309 vis_ld64_2(dest, stride_8, REF_S2/*DST_6*/); | |
1310 vis_faligndata(TMP8, TMP10, REF_6); | |
1311 vis_mul8x16al(DST_0, CONST_512, TMP20); | |
1312 | |
1313 vis_padd16(TMP0, CONST_3, TMP0); | |
1314 vis_mul8x16al(DST_1, CONST_512, TMP22); | |
1315 | |
1316 vis_padd16(TMP2, CONST_3, TMP2); | |
1317 vis_mul8x16al(DST_2, CONST_512, TMP24); | |
1318 | |
1319 vis_padd16(TMP4, CONST_3, TMP4); | |
1320 vis_mul8x16al(DST_3, CONST_512, TMP26); | |
1321 | |
1322 vis_padd16(TMP6, CONST_3, TMP6); | |
1323 | |
1324 vis_padd16(TMP12, TMP20, TMP12); | |
1325 vis_mul8x16al(REF_S0, CONST_512, TMP20); | |
1326 | |
1327 vis_padd16(TMP14, TMP22, TMP14); | |
1328 vis_mul8x16al(REF_S0_1, CONST_512, TMP22); | |
1329 | |
1330 vis_padd16(TMP16, TMP24, TMP16); | |
1331 vis_mul8x16al(REF_S2, CONST_512, TMP24); | |
1332 | |
1333 vis_padd16(TMP18, TMP26, TMP18); | |
1334 vis_mul8x16al(REF_S2_1, CONST_512, TMP26); | |
1335 | |
1336 vis_padd16(TMP12, TMP0, TMP12); | |
1337 vis_mul8x16au(REF_2, CONST_256, TMP28); | |
1338 | |
1339 vis_padd16(TMP14, TMP2, TMP14); | |
1340 vis_mul8x16au(REF_2_1, CONST_256, TMP30); | |
1341 | |
1342 vis_padd16(TMP16, TMP4, TMP16); | |
1343 vis_mul8x16au(REF_6, CONST_256, REF_S4); | |
1344 | |
1345 vis_padd16(TMP18, TMP6, TMP18); | |
1346 vis_mul8x16au(REF_6_1, CONST_256, REF_S6); | |
1347 | |
1348 vis_pack16(TMP12, DST_0); | |
1349 vis_padd16(TMP28, TMP0, TMP12); | |
1350 | |
1351 vis_pack16(TMP14, DST_1); | |
1352 vis_st64(DST_0, dest[0]); | |
1353 vis_padd16(TMP30, TMP2, TMP14); | |
1354 | |
1355 vis_pack16(TMP16, DST_2); | |
1356 vis_padd16(REF_S4, TMP4, TMP16); | |
1357 | |
1358 vis_pack16(TMP18, DST_3); | |
1359 vis_st64_2(DST_2, dest, 8); | |
1360 dest += stride; | |
1361 vis_padd16(REF_S6, TMP6, TMP18); | |
1362 | |
1363 vis_padd16(TMP12, TMP20, TMP12); | |
1364 | |
1365 vis_padd16(TMP14, TMP22, TMP14); | |
1366 vis_pack16(TMP12, DST_0); | |
1367 | |
1368 vis_padd16(TMP16, TMP24, TMP16); | |
1369 vis_pack16(TMP14, DST_1); | |
1370 vis_st64(DST_0, dest[0]); | |
1371 | |
1372 vis_padd16(TMP18, TMP26, TMP18); | |
1373 vis_pack16(TMP16, DST_2); | |
1374 | |
1375 vis_pack16(TMP18, DST_3); | |
1376 vis_st64_2(DST_2, dest, 8); | |
1377 dest += stride; | |
1378 } while (--height); | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
1379 } |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
1380 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
1381 static void MC_avg_y_8_vis (uint8_t * dest, const uint8_t * _ref, |
2979 | 1382 const int stride, int height) |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
1383 { |
2979 | 1384 uint8_t *ref = (uint8_t *) _ref; |
1385 int stride_8 = stride + 8; | |
1386 | |
1387 vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT); | |
1388 | |
1389 ref = vis_alignaddr(ref); | |
1390 | |
1391 vis_ld64(ref[ 0], TMP0); | |
1392 vis_fzero(ZERO); | |
1393 | |
1394 vis_ld64(ref[ 8], TMP2); | |
1395 | |
1396 vis_ld64(constants3[0], CONST_3); | |
1397 vis_faligndata(TMP0, TMP2, REF_2); | |
1398 | |
1399 vis_ld64(constants256_512[0], CONST_256); | |
1400 | |
1401 height >>= 1; | |
1402 do { /* 20 cycles */ | |
1403 vis_ld64_2(ref, stride, TMP0); | |
1404 vis_pmerge(ZERO, REF_2, TMP8); | |
1405 vis_mul8x16au(REF_2_1, CONST_256, TMP10); | |
1406 | |
1407 vis_ld64_2(ref, stride_8, TMP2); | |
1408 ref += stride; | |
1409 | |
1410 vis_ld64(dest[0], DST_0); | |
1411 | |
1412 vis_ld64_2(dest, stride, DST_2); | |
1413 vis_faligndata(TMP0, TMP2, REF_0); | |
1414 | |
1415 vis_ld64_2(ref, stride, TMP4); | |
1416 vis_mul8x16al(DST_0, CONST_512, TMP16); | |
1417 vis_pmerge(ZERO, REF_0, TMP12); | |
1418 | |
1419 vis_ld64_2(ref, stride_8, TMP6); | |
1420 ref += stride; | |
1421 vis_mul8x16al(DST_1, CONST_512, TMP18); | |
1422 vis_pmerge(ZERO, REF_0_1, TMP14); | |
1423 | |
1424 vis_padd16(TMP12, CONST_3, TMP12); | |
1425 vis_mul8x16al(DST_2, CONST_512, TMP24); | |
1426 | |
1427 vis_padd16(TMP14, CONST_3, TMP14); | |
1428 vis_mul8x16al(DST_3, CONST_512, TMP26); | |
1429 | |
1430 vis_faligndata(TMP4, TMP6, REF_2); | |
1431 | |
1432 vis_padd16(TMP8, TMP12, TMP8); | |
1433 | |
1434 vis_padd16(TMP10, TMP14, TMP10); | |
1435 vis_mul8x16au(REF_2, CONST_256, TMP20); | |
1436 | |
1437 vis_padd16(TMP8, TMP16, TMP0); | |
1438 vis_mul8x16au(REF_2_1, CONST_256, TMP22); | |
1439 | |
1440 vis_padd16(TMP10, TMP18, TMP2); | |
1441 vis_pack16(TMP0, DST_0); | |
1442 | |
1443 vis_pack16(TMP2, DST_1); | |
1444 vis_st64(DST_0, dest[0]); | |
1445 dest += stride; | |
1446 vis_padd16(TMP12, TMP20, TMP12); | |
1447 | |
1448 vis_padd16(TMP14, TMP22, TMP14); | |
1449 | |
1450 vis_padd16(TMP12, TMP24, TMP0); | |
1451 | |
1452 vis_padd16(TMP14, TMP26, TMP2); | |
1453 vis_pack16(TMP0, DST_2); | |
1454 | |
1455 vis_pack16(TMP2, DST_3); | |
1456 vis_st64(DST_2, dest[0]); | |
1457 dest += stride; | |
1458 } while (--height); | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
1459 } |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
1460 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
1461 static void MC_put_xy_16_vis (uint8_t * dest, const uint8_t * _ref, |
2979 | 1462 const int stride, int height) |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
1463 { |
2979 | 1464 uint8_t *ref = (uint8_t *) _ref; |
1465 unsigned long off = (unsigned long) ref & 0x7; | |
1466 unsigned long off_plus_1 = off + 1; | |
1467 int stride_8 = stride + 8; | |
1468 int stride_16 = stride + 16; | |
1469 | |
1470 vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT); | |
1471 | |
1472 ref = vis_alignaddr(ref); | |
1473 | |
1474 vis_ld64(ref[ 0], TMP0); | |
1475 vis_fzero(ZERO); | |
1476 | |
1477 vis_ld64(ref[ 8], TMP2); | |
1478 | |
1479 vis_ld64(ref[16], TMP4); | |
1480 | |
1481 vis_ld64(constants2[0], CONST_2); | |
1482 vis_faligndata(TMP0, TMP2, REF_S0); | |
1483 | |
1484 vis_ld64(constants256_512[0], CONST_256); | |
1485 vis_faligndata(TMP2, TMP4, REF_S4); | |
1486 | |
1487 if (off != 0x7) { | |
1488 vis_alignaddr_g0((void *)off_plus_1); | |
1489 vis_faligndata(TMP0, TMP2, REF_S2); | |
1490 vis_faligndata(TMP2, TMP4, REF_S6); | |
1491 } else { | |
1492 vis_src1(TMP2, REF_S2); | |
1493 vis_src1(TMP4, REF_S6); | |
1494 } | |
1495 | |
1496 height >>= 1; | |
1497 do { | |
1498 vis_ld64_2(ref, stride, TMP0); | |
1499 vis_mul8x16au(REF_S0, CONST_256, TMP12); | |
1500 vis_pmerge(ZERO, REF_S0_1, TMP14); | |
1501 | |
1502 vis_alignaddr_g0((void *)off); | |
1503 | |
1504 vis_ld64_2(ref, stride_8, TMP2); | |
1505 vis_mul8x16au(REF_S2, CONST_256, TMP16); | |
1506 vis_pmerge(ZERO, REF_S2_1, TMP18); | |
1507 | |
1508 vis_ld64_2(ref, stride_16, TMP4); | |
1509 ref += stride; | |
1510 vis_mul8x16au(REF_S4, CONST_256, TMP20); | |
1511 vis_pmerge(ZERO, REF_S4_1, TMP22); | |
1512 | |
1513 vis_ld64_2(ref, stride, TMP6); | |
1514 vis_mul8x16au(REF_S6, CONST_256, TMP24); | |
1515 vis_pmerge(ZERO, REF_S6_1, TMP26); | |
1516 | |
1517 vis_ld64_2(ref, stride_8, TMP8); | |
1518 vis_faligndata(TMP0, TMP2, REF_0); | |
1519 | |
1520 vis_ld64_2(ref, stride_16, TMP10); | |
1521 ref += stride; | |
1522 vis_faligndata(TMP2, TMP4, REF_4); | |
1523 | |
1524 vis_faligndata(TMP6, TMP8, REF_S0); | |
1525 | |
1526 vis_faligndata(TMP8, TMP10, REF_S4); | |
1527 | |
1528 if (off != 0x7) { | |
1529 vis_alignaddr_g0((void *)off_plus_1); | |
1530 vis_faligndata(TMP0, TMP2, REF_2); | |
1531 vis_faligndata(TMP2, TMP4, REF_6); | |
1532 vis_faligndata(TMP6, TMP8, REF_S2); | |
1533 vis_faligndata(TMP8, TMP10, REF_S6); | |
1534 } else { | |
1535 vis_src1(TMP2, REF_2); | |
1536 vis_src1(TMP4, REF_6); | |
1537 vis_src1(TMP8, REF_S2); | |
1538 vis_src1(TMP10, REF_S6); | |
1539 } | |
1540 | |
1541 vis_mul8x16au(REF_0, CONST_256, TMP0); | |
1542 vis_pmerge(ZERO, REF_0_1, TMP2); | |
1543 | |
1544 vis_mul8x16au(REF_2, CONST_256, TMP4); | |
1545 vis_pmerge(ZERO, REF_2_1, TMP6); | |
1546 | |
1547 vis_padd16(TMP0, CONST_2, TMP8); | |
1548 vis_mul8x16au(REF_4, CONST_256, TMP0); | |
1549 | |
1550 vis_padd16(TMP2, CONST_2, TMP10); | |
1551 vis_mul8x16au(REF_4_1, CONST_256, TMP2); | |
1552 | |
1553 vis_padd16(TMP8, TMP4, TMP8); | |
1554 vis_mul8x16au(REF_6, CONST_256, TMP4); | |
1555 | |
1556 vis_padd16(TMP10, TMP6, TMP10); | |
1557 vis_mul8x16au(REF_6_1, CONST_256, TMP6); | |
1558 | |
1559 vis_padd16(TMP12, TMP8, TMP12); | |
1560 | |
1561 vis_padd16(TMP14, TMP10, TMP14); | |
1562 | |
1563 vis_padd16(TMP12, TMP16, TMP12); | |
1564 | |
1565 vis_padd16(TMP14, TMP18, TMP14); | |
1566 vis_pack16(TMP12, DST_0); | |
1567 | |
1568 vis_pack16(TMP14, DST_1); | |
1569 vis_st64(DST_0, dest[0]); | |
1570 vis_padd16(TMP0, CONST_2, TMP12); | |
1571 | |
1572 vis_mul8x16au(REF_S0, CONST_256, TMP0); | |
1573 vis_padd16(TMP2, CONST_2, TMP14); | |
1574 | |
1575 vis_mul8x16au(REF_S0_1, CONST_256, TMP2); | |
1576 vis_padd16(TMP12, TMP4, TMP12); | |
1577 | |
1578 vis_mul8x16au(REF_S2, CONST_256, TMP4); | |
1579 vis_padd16(TMP14, TMP6, TMP14); | |
1580 | |
1581 vis_mul8x16au(REF_S2_1, CONST_256, TMP6); | |
1582 vis_padd16(TMP20, TMP12, TMP20); | |
1583 | |
1584 vis_padd16(TMP22, TMP14, TMP22); | |
1585 | |
1586 vis_padd16(TMP20, TMP24, TMP20); | |
1587 | |
1588 vis_padd16(TMP22, TMP26, TMP22); | |
1589 vis_pack16(TMP20, DST_2); | |
1590 | |
1591 vis_pack16(TMP22, DST_3); | |
1592 vis_st64_2(DST_2, dest, 8); | |
1593 dest += stride; | |
1594 vis_padd16(TMP0, TMP4, TMP24); | |
1595 | |
1596 vis_mul8x16au(REF_S4, CONST_256, TMP0); | |
1597 vis_padd16(TMP2, TMP6, TMP26); | |
1598 | |
1599 vis_mul8x16au(REF_S4_1, CONST_256, TMP2); | |
1600 vis_padd16(TMP24, TMP8, TMP24); | |
1601 | |
1602 vis_padd16(TMP26, TMP10, TMP26); | |
1603 vis_pack16(TMP24, DST_0); | |
1604 | |
1605 vis_pack16(TMP26, DST_1); | |
1606 vis_st64(DST_0, dest[0]); | |
1607 vis_pmerge(ZERO, REF_S6, TMP4); | |
1608 | |
1609 vis_pmerge(ZERO, REF_S6_1, TMP6); | |
1610 | |
1611 vis_padd16(TMP0, TMP4, TMP0); | |
1612 | |
1613 vis_padd16(TMP2, TMP6, TMP2); | |
1614 | |
1615 vis_padd16(TMP0, TMP12, TMP0); | |
1616 | |
1617 vis_padd16(TMP2, TMP14, TMP2); | |
1618 vis_pack16(TMP0, DST_2); | |
1619 | |
1620 vis_pack16(TMP2, DST_3); | |
1621 vis_st64_2(DST_2, dest, 8); | |
1622 dest += stride; | |
1623 } while (--height); | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
1624 } |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
1625 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
1626 static void MC_put_xy_8_vis (uint8_t * dest, const uint8_t * _ref, |
2979 | 1627 const int stride, int height) |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
1628 { |
2979 | 1629 uint8_t *ref = (uint8_t *) _ref; |
1630 unsigned long off = (unsigned long) ref & 0x7; | |
1631 unsigned long off_plus_1 = off + 1; | |
1632 int stride_8 = stride + 8; | |
1633 | |
1634 vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT); | |
1635 | |
1636 ref = vis_alignaddr(ref); | |
1637 | |
1638 vis_ld64(ref[ 0], TMP0); | |
1639 vis_fzero(ZERO); | |
1640 | |
1641 vis_ld64(ref[ 8], TMP2); | |
1642 | |
1643 vis_ld64(constants2[0], CONST_2); | |
1644 | |
1645 vis_ld64(constants256_512[0], CONST_256); | |
1646 vis_faligndata(TMP0, TMP2, REF_S0); | |
1647 | |
1648 if (off != 0x7) { | |
1649 vis_alignaddr_g0((void *)off_plus_1); | |
1650 vis_faligndata(TMP0, TMP2, REF_S2); | |
1651 } else { | |
1652 vis_src1(TMP2, REF_S2); | |
1653 } | |
1654 | |
1655 height >>= 1; | |
1656 do { /* 26 cycles */ | |
1657 vis_ld64_2(ref, stride, TMP0); | |
1658 vis_mul8x16au(REF_S0, CONST_256, TMP8); | |
1659 vis_pmerge(ZERO, REF_S2, TMP12); | |
1660 | |
1661 vis_alignaddr_g0((void *)off); | |
1662 | |
1663 vis_ld64_2(ref, stride_8, TMP2); | |
1664 ref += stride; | |
1665 vis_mul8x16au(REF_S0_1, CONST_256, TMP10); | |
1666 vis_pmerge(ZERO, REF_S2_1, TMP14); | |
1667 | |
1668 vis_ld64_2(ref, stride, TMP4); | |
1669 | |
1670 vis_ld64_2(ref, stride_8, TMP6); | |
1671 ref += stride; | |
1672 vis_faligndata(TMP0, TMP2, REF_S4); | |
1673 | |
1674 vis_pmerge(ZERO, REF_S4, TMP18); | |
1675 | |
1676 vis_pmerge(ZERO, REF_S4_1, TMP20); | |
1677 | |
1678 vis_faligndata(TMP4, TMP6, REF_S0); | |
1679 | |
1680 if (off != 0x7) { | |
1681 vis_alignaddr_g0((void *)off_plus_1); | |
1682 vis_faligndata(TMP0, TMP2, REF_S6); | |
1683 vis_faligndata(TMP4, TMP6, REF_S2); | |
1684 } else { | |
1685 vis_src1(TMP2, REF_S6); | |
1686 vis_src1(TMP6, REF_S2); | |
1687 } | |
1688 | |
1689 vis_padd16(TMP18, CONST_2, TMP18); | |
1690 vis_mul8x16au(REF_S6, CONST_256, TMP22); | |
1691 | |
1692 vis_padd16(TMP20, CONST_2, TMP20); | |
1693 vis_mul8x16au(REF_S6_1, CONST_256, TMP24); | |
1694 | |
1695 vis_mul8x16au(REF_S0, CONST_256, TMP26); | |
1696 vis_pmerge(ZERO, REF_S0_1, TMP28); | |
1697 | |
1698 vis_mul8x16au(REF_S2, CONST_256, TMP30); | |
1699 vis_padd16(TMP18, TMP22, TMP18); | |
1700 | |
1701 vis_mul8x16au(REF_S2_1, CONST_256, TMP32); | |
1702 vis_padd16(TMP20, TMP24, TMP20); | |
1703 | |
1704 vis_padd16(TMP8, TMP18, TMP8); | |
1705 | |
1706 vis_padd16(TMP10, TMP20, TMP10); | |
1707 | |
1708 vis_padd16(TMP8, TMP12, TMP8); | |
1709 | |
1710 vis_padd16(TMP10, TMP14, TMP10); | |
1711 vis_pack16(TMP8, DST_0); | |
1712 | |
1713 vis_pack16(TMP10, DST_1); | |
1714 vis_st64(DST_0, dest[0]); | |
1715 dest += stride; | |
1716 vis_padd16(TMP18, TMP26, TMP18); | |
1717 | |
1718 vis_padd16(TMP20, TMP28, TMP20); | |
1719 | |
1720 vis_padd16(TMP18, TMP30, TMP18); | |
1721 | |
1722 vis_padd16(TMP20, TMP32, TMP20); | |
1723 vis_pack16(TMP18, DST_2); | |
1724 | |
1725 vis_pack16(TMP20, DST_3); | |
1726 vis_st64(DST_2, dest[0]); | |
1727 dest += stride; | |
1728 } while (--height); | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
1729 } |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
1730 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
1731 static void MC_avg_xy_16_vis (uint8_t * dest, const uint8_t * _ref, |
2979 | 1732 const int stride, int height) |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
1733 { |
2979 | 1734 uint8_t *ref = (uint8_t *) _ref; |
1735 unsigned long off = (unsigned long) ref & 0x7; | |
1736 unsigned long off_plus_1 = off + 1; | |
1737 int stride_8 = stride + 8; | |
1738 int stride_16 = stride + 16; | |
1739 | |
1740 vis_set_gsr(4 << VIS_GSR_SCALEFACT_SHIFT); | |
1741 | |
1742 ref = vis_alignaddr(ref); | |
1743 | |
1744 vis_ld64(ref[ 0], TMP0); | |
1745 vis_fzero(ZERO); | |
1746 | |
1747 vis_ld64(ref[ 8], TMP2); | |
1748 | |
1749 vis_ld64(ref[16], TMP4); | |
1750 | |
1751 vis_ld64(constants6[0], CONST_6); | |
1752 vis_faligndata(TMP0, TMP2, REF_S0); | |
1753 | |
1754 vis_ld64(constants256_1024[0], CONST_256); | |
1755 vis_faligndata(TMP2, TMP4, REF_S4); | |
1756 | |
1757 if (off != 0x7) { | |
1758 vis_alignaddr_g0((void *)off_plus_1); | |
1759 vis_faligndata(TMP0, TMP2, REF_S2); | |
1760 vis_faligndata(TMP2, TMP4, REF_S6); | |
1761 } else { | |
1762 vis_src1(TMP2, REF_S2); | |
1763 vis_src1(TMP4, REF_S6); | |
1764 } | |
1765 | |
1766 height >>= 1; | |
1767 do { /* 55 cycles */ | |
1768 vis_ld64_2(ref, stride, TMP0); | |
1769 vis_mul8x16au(REF_S0, CONST_256, TMP12); | |
1770 vis_pmerge(ZERO, REF_S0_1, TMP14); | |
1771 | |
1772 vis_alignaddr_g0((void *)off); | |
1773 | |
1774 vis_ld64_2(ref, stride_8, TMP2); | |
1775 vis_mul8x16au(REF_S2, CONST_256, TMP16); | |
1776 vis_pmerge(ZERO, REF_S2_1, TMP18); | |
1777 | |
1778 vis_ld64_2(ref, stride_16, TMP4); | |
1779 ref += stride; | |
1780 vis_mul8x16au(REF_S4, CONST_256, TMP20); | |
1781 vis_pmerge(ZERO, REF_S4_1, TMP22); | |
1782 | |
1783 vis_ld64_2(ref, stride, TMP6); | |
1784 vis_mul8x16au(REF_S6, CONST_256, TMP24); | |
1785 vis_pmerge(ZERO, REF_S6_1, TMP26); | |
1786 | |
1787 vis_ld64_2(ref, stride_8, TMP8); | |
1788 vis_faligndata(TMP0, TMP2, REF_0); | |
1789 | |
1790 vis_ld64_2(ref, stride_16, TMP10); | |
1791 ref += stride; | |
1792 vis_faligndata(TMP2, TMP4, REF_4); | |
1793 | |
1794 vis_ld64(dest[0], DST_0); | |
1795 vis_faligndata(TMP6, TMP8, REF_S0); | |
1796 | |
1797 vis_ld64_2(dest, 8, DST_2); | |
1798 vis_faligndata(TMP8, TMP10, REF_S4); | |
1799 | |
1800 if (off != 0x7) { | |
1801 vis_alignaddr_g0((void *)off_plus_1); | |
1802 vis_faligndata(TMP0, TMP2, REF_2); | |
1803 vis_faligndata(TMP2, TMP4, REF_6); | |
1804 vis_faligndata(TMP6, TMP8, REF_S2); | |
1805 vis_faligndata(TMP8, TMP10, REF_S6); | |
1806 } else { | |
1807 vis_src1(TMP2, REF_2); | |
1808 vis_src1(TMP4, REF_6); | |
1809 vis_src1(TMP8, REF_S2); | |
1810 vis_src1(TMP10, REF_S6); | |
1811 } | |
1812 | |
1813 vis_mul8x16al(DST_0, CONST_1024, TMP30); | |
1814 vis_pmerge(ZERO, REF_0, TMP0); | |
1815 | |
1816 vis_mul8x16al(DST_1, CONST_1024, TMP32); | |
1817 vis_pmerge(ZERO, REF_0_1, TMP2); | |
1818 | |
1819 vis_mul8x16au(REF_2, CONST_256, TMP4); | |
1820 vis_pmerge(ZERO, REF_2_1, TMP6); | |
1821 | |
1822 vis_mul8x16al(DST_2, CONST_1024, REF_0); | |
1823 vis_padd16(TMP0, CONST_6, TMP0); | |
1824 | |
1825 vis_mul8x16al(DST_3, CONST_1024, REF_2); | |
1826 vis_padd16(TMP2, CONST_6, TMP2); | |
1827 | |
1828 vis_padd16(TMP0, TMP4, TMP0); | |
1829 vis_mul8x16au(REF_4, CONST_256, TMP4); | |
1830 | |
1831 vis_padd16(TMP2, TMP6, TMP2); | |
1832 vis_mul8x16au(REF_4_1, CONST_256, TMP6); | |
1833 | |
1834 vis_padd16(TMP12, TMP0, TMP12); | |
1835 vis_mul8x16au(REF_6, CONST_256, TMP8); | |
1836 | |
1837 vis_padd16(TMP14, TMP2, TMP14); | |
1838 vis_mul8x16au(REF_6_1, CONST_256, TMP10); | |
1839 | |
1840 vis_padd16(TMP12, TMP16, TMP12); | |
1841 vis_mul8x16au(REF_S0, CONST_256, REF_4); | |
1842 | |
1843 vis_padd16(TMP14, TMP18, TMP14); | |
1844 vis_mul8x16au(REF_S0_1, CONST_256, REF_6); | |
1845 | |
1846 vis_padd16(TMP12, TMP30, TMP12); | |
1847 | |
1848 vis_padd16(TMP14, TMP32, TMP14); | |
1849 vis_pack16(TMP12, DST_0); | |
1850 | |
1851 vis_pack16(TMP14, DST_1); | |
1852 vis_st64(DST_0, dest[0]); | |
1853 vis_padd16(TMP4, CONST_6, TMP4); | |
1854 | |
1855 vis_ld64_2(dest, stride, DST_0); | |
1856 vis_padd16(TMP6, CONST_6, TMP6); | |
1857 vis_mul8x16au(REF_S2, CONST_256, TMP12); | |
1858 | |
1859 vis_padd16(TMP4, TMP8, TMP4); | |
1860 vis_mul8x16au(REF_S2_1, CONST_256, TMP14); | |
1861 | |
1862 vis_padd16(TMP6, TMP10, TMP6); | |
1863 | |
1864 vis_padd16(TMP20, TMP4, TMP20); | |
1865 | |
1866 vis_padd16(TMP22, TMP6, TMP22); | |
1867 | |
1868 vis_padd16(TMP20, TMP24, TMP20); | |
1869 | |
1870 vis_padd16(TMP22, TMP26, TMP22); | |
1871 | |
1872 vis_padd16(TMP20, REF_0, TMP20); | |
1873 vis_mul8x16au(REF_S4, CONST_256, REF_0); | |
1874 | |
1875 vis_padd16(TMP22, REF_2, TMP22); | |
1876 vis_pack16(TMP20, DST_2); | |
1877 | |
1878 vis_pack16(TMP22, DST_3); | |
1879 vis_st64_2(DST_2, dest, 8); | |
1880 dest += stride; | |
1881 | |
1882 vis_ld64_2(dest, 8, DST_2); | |
1883 vis_mul8x16al(DST_0, CONST_1024, TMP30); | |
1884 vis_pmerge(ZERO, REF_S4_1, REF_2); | |
1885 | |
1886 vis_mul8x16al(DST_1, CONST_1024, TMP32); | |
1887 vis_padd16(REF_4, TMP0, TMP8); | |
1888 | |
1889 vis_mul8x16au(REF_S6, CONST_256, REF_4); | |
1890 vis_padd16(REF_6, TMP2, TMP10); | |
1891 | |
1892 vis_mul8x16au(REF_S6_1, CONST_256, REF_6); | |
1893 vis_padd16(TMP8, TMP12, TMP8); | |
1894 | |
1895 vis_padd16(TMP10, TMP14, TMP10); | |
1896 | |
1897 vis_padd16(TMP8, TMP30, TMP8); | |
1898 | |
1899 vis_padd16(TMP10, TMP32, TMP10); | |
1900 vis_pack16(TMP8, DST_0); | |
1901 | |
1902 vis_pack16(TMP10, DST_1); | |
1903 vis_st64(DST_0, dest[0]); | |
1904 | |
1905 vis_padd16(REF_0, TMP4, REF_0); | |
1906 | |
1907 vis_mul8x16al(DST_2, CONST_1024, TMP30); | |
1908 vis_padd16(REF_2, TMP6, REF_2); | |
1909 | |
1910 vis_mul8x16al(DST_3, CONST_1024, TMP32); | |
1911 vis_padd16(REF_0, REF_4, REF_0); | |
1912 | |
1913 vis_padd16(REF_2, REF_6, REF_2); | |
1914 | |
1915 vis_padd16(REF_0, TMP30, REF_0); | |
1916 | |
1917 /* stall */ | |
1918 | |
1919 vis_padd16(REF_2, TMP32, REF_2); | |
1920 vis_pack16(REF_0, DST_2); | |
1921 | |
1922 vis_pack16(REF_2, DST_3); | |
1923 vis_st64_2(DST_2, dest, 8); | |
1924 dest += stride; | |
1925 } while (--height); | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
1926 } |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
1927 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
1928 static void MC_avg_xy_8_vis (uint8_t * dest, const uint8_t * _ref, |
2979 | 1929 const int stride, int height) |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
1930 { |
2979 | 1931 uint8_t *ref = (uint8_t *) _ref; |
1932 unsigned long off = (unsigned long) ref & 0x7; | |
1933 unsigned long off_plus_1 = off + 1; | |
1934 int stride_8 = stride + 8; | |
1935 | |
1936 vis_set_gsr(4 << VIS_GSR_SCALEFACT_SHIFT); | |
1937 | |
1938 ref = vis_alignaddr(ref); | |
1939 | |
1940 vis_ld64(ref[0], TMP0); | |
1941 vis_fzero(ZERO); | |
1942 | |
1943 vis_ld64_2(ref, 8, TMP2); | |
1944 | |
1945 vis_ld64(constants6[0], CONST_6); | |
1946 | |
1947 vis_ld64(constants256_1024[0], CONST_256); | |
1948 vis_faligndata(TMP0, TMP2, REF_S0); | |
1949 | |
1950 if (off != 0x7) { | |
1951 vis_alignaddr_g0((void *)off_plus_1); | |
1952 vis_faligndata(TMP0, TMP2, REF_S2); | |
1953 } else { | |
1954 vis_src1(TMP2, REF_S2); | |
1955 } | |
1956 | |
1957 height >>= 1; | |
1958 do { /* 31 cycles */ | |
1959 vis_ld64_2(ref, stride, TMP0); | |
1960 vis_mul8x16au(REF_S0, CONST_256, TMP8); | |
1961 vis_pmerge(ZERO, REF_S0_1, TMP10); | |
1962 | |
1963 vis_ld64_2(ref, stride_8, TMP2); | |
1964 ref += stride; | |
1965 vis_mul8x16au(REF_S2, CONST_256, TMP12); | |
1966 vis_pmerge(ZERO, REF_S2_1, TMP14); | |
1967 | |
1968 vis_alignaddr_g0((void *)off); | |
1969 | |
1970 vis_ld64_2(ref, stride, TMP4); | |
1971 vis_faligndata(TMP0, TMP2, REF_S4); | |
1972 | |
1973 vis_ld64_2(ref, stride_8, TMP6); | |
1974 ref += stride; | |
1975 | |
1976 vis_ld64(dest[0], DST_0); | |
1977 vis_faligndata(TMP4, TMP6, REF_S0); | |
1978 | |
1979 vis_ld64_2(dest, stride, DST_2); | |
1980 | |
1981 if (off != 0x7) { | |
1982 vis_alignaddr_g0((void *)off_plus_1); | |
1983 vis_faligndata(TMP0, TMP2, REF_S6); | |
1984 vis_faligndata(TMP4, TMP6, REF_S2); | |
1985 } else { | |
1986 vis_src1(TMP2, REF_S6); | |
1987 vis_src1(TMP6, REF_S2); | |
1988 } | |
1989 | |
1990 vis_mul8x16al(DST_0, CONST_1024, TMP30); | |
1991 vis_pmerge(ZERO, REF_S4, TMP22); | |
1992 | |
1993 vis_mul8x16al(DST_1, CONST_1024, TMP32); | |
1994 vis_pmerge(ZERO, REF_S4_1, TMP24); | |
1995 | |
1996 vis_mul8x16au(REF_S6, CONST_256, TMP26); | |
1997 vis_pmerge(ZERO, REF_S6_1, TMP28); | |
1998 | |
1999 vis_mul8x16au(REF_S0, CONST_256, REF_S4); | |
2000 vis_padd16(TMP22, CONST_6, TMP22); | |
2001 | |
2002 vis_mul8x16au(REF_S0_1, CONST_256, REF_S6); | |
2003 vis_padd16(TMP24, CONST_6, TMP24); | |
2004 | |
2005 vis_mul8x16al(DST_2, CONST_1024, REF_0); | |
2006 vis_padd16(TMP22, TMP26, TMP22); | |
2007 | |
2008 vis_mul8x16al(DST_3, CONST_1024, REF_2); | |
2009 vis_padd16(TMP24, TMP28, TMP24); | |
2010 | |
2011 vis_mul8x16au(REF_S2, CONST_256, TMP26); | |
2012 vis_padd16(TMP8, TMP22, TMP8); | |
2013 | |
2014 vis_mul8x16au(REF_S2_1, CONST_256, TMP28); | |
2015 vis_padd16(TMP10, TMP24, TMP10); | |
2016 | |
2017 vis_padd16(TMP8, TMP12, TMP8); | |
2018 | |
2019 vis_padd16(TMP10, TMP14, TMP10); | |
2020 | |
2021 vis_padd16(TMP8, TMP30, TMP8); | |
2022 | |
2023 vis_padd16(TMP10, TMP32, TMP10); | |
2024 vis_pack16(TMP8, DST_0); | |
2025 | |
2026 vis_pack16(TMP10, DST_1); | |
2027 vis_st64(DST_0, dest[0]); | |
2028 dest += stride; | |
2029 | |
2030 vis_padd16(REF_S4, TMP22, TMP12); | |
2031 | |
2032 vis_padd16(REF_S6, TMP24, TMP14); | |
2033 | |
2034 vis_padd16(TMP12, TMP26, TMP12); | |
2035 | |
2036 vis_padd16(TMP14, TMP28, TMP14); | |
2037 | |
2038 vis_padd16(TMP12, REF_0, TMP12); | |
2039 | |
2040 vis_padd16(TMP14, REF_2, TMP14); | |
2041 vis_pack16(TMP12, DST_2); | |
2042 | |
2043 vis_pack16(TMP14, DST_3); | |
2044 vis_st64(DST_2, dest[0]); | |
2045 dest += stride; | |
2046 } while (--height); | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2047 } |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2048 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2049 /* End of rounding code */ |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2050 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2051 /* Start of no rounding code */ |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2052 /* The trick used in some of this file is the formula from the MMX |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2053 * motion comp code, which is: |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2054 * |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2055 * (x+y)>>1 == (x&y)+((x^y)>>1) |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2056 * |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2057 * This allows us to average 8 bytes at a time in a 64-bit FPU reg. |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2058 * We avoid overflows by masking before we do the shift, and we |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2059 * implement the shift by multiplying by 1/2 using mul8x16. So in |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2060 * VIS this is (assume 'x' is in f0, 'y' is in f2, a repeating mask |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2061 * of '0xfe' is in f4, a repeating mask of '0x7f' is in f6, and |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2062 * the value 0x80808080 is in f8): |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2063 * |
2979 | 2064 * fxor f0, f2, f10 |
2065 * fand f10, f4, f10 | |
2066 * fmul8x16 f8, f10, f10 | |
2067 * fand f10, f6, f10 | |
2068 * fand f0, f2, f12 | |
2069 * fpadd16 f12, f10, f10 | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2070 */ |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2071 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2072 static void MC_put_no_round_o_16_vis (uint8_t * dest, const uint8_t * _ref, |
2979 | 2073 const int stride, int height) |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2074 { |
2979 | 2075 uint8_t *ref = (uint8_t *) _ref; |
2076 | |
2077 ref = vis_alignaddr(ref); | |
2078 do { /* 5 cycles */ | |
2079 vis_ld64(ref[0], TMP0); | |
2080 | |
2081 vis_ld64_2(ref, 8, TMP2); | |
2082 | |
2083 vis_ld64_2(ref, 16, TMP4); | |
2084 ref += stride; | |
2085 | |
2086 vis_faligndata(TMP0, TMP2, REF_0); | |
2087 vis_st64(REF_0, dest[0]); | |
2088 | |
2089 vis_faligndata(TMP2, TMP4, REF_2); | |
2090 vis_st64_2(REF_2, dest, 8); | |
2091 dest += stride; | |
2092 } while (--height); | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2093 } |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2094 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2095 static void MC_put_no_round_o_8_vis (uint8_t * dest, const uint8_t * _ref, |
2979 | 2096 const int stride, int height) |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2097 { |
2979 | 2098 uint8_t *ref = (uint8_t *) _ref; |
2099 | |
2100 ref = vis_alignaddr(ref); | |
2101 do { /* 4 cycles */ | |
2102 vis_ld64(ref[0], TMP0); | |
2103 | |
2104 vis_ld64(ref[8], TMP2); | |
2105 ref += stride; | |
2106 | |
2107 /* stall */ | |
2108 | |
2109 vis_faligndata(TMP0, TMP2, REF_0); | |
2110 vis_st64(REF_0, dest[0]); | |
2111 dest += stride; | |
2112 } while (--height); | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2113 } |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2114 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2115 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2116 static void MC_avg_no_round_o_16_vis (uint8_t * dest, const uint8_t * _ref, |
2979 | 2117 const int stride, int height) |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2118 { |
2979 | 2119 uint8_t *ref = (uint8_t *) _ref; |
2120 int stride_8 = stride + 8; | |
2121 | |
2122 ref = vis_alignaddr(ref); | |
2123 | |
2124 vis_ld64(ref[0], TMP0); | |
2125 | |
2126 vis_ld64(ref[8], TMP2); | |
2127 | |
2128 vis_ld64(ref[16], TMP4); | |
2129 | |
2130 vis_ld64(dest[0], DST_0); | |
2131 | |
2132 vis_ld64(dest[8], DST_2); | |
2133 | |
2134 vis_ld64(constants_fe[0], MASK_fe); | |
2135 vis_faligndata(TMP0, TMP2, REF_0); | |
2136 | |
2137 vis_ld64(constants_7f[0], MASK_7f); | |
2138 vis_faligndata(TMP2, TMP4, REF_2); | |
2139 | |
2140 vis_ld64(constants128[0], CONST_128); | |
2141 | |
2142 ref += stride; | |
2143 height = (height >> 1) - 1; | |
2144 | |
2145 do { /* 24 cycles */ | |
2146 vis_ld64(ref[0], TMP0); | |
2147 vis_xor(DST_0, REF_0, TMP6); | |
2148 | |
2149 vis_ld64_2(ref, 8, TMP2); | |
2150 vis_and(TMP6, MASK_fe, TMP6); | |
2151 | |
2152 vis_ld64_2(ref, 16, TMP4); | |
2153 ref += stride; | |
2154 vis_mul8x16(CONST_128, TMP6, TMP6); | |
2155 vis_xor(DST_2, REF_2, TMP8); | |
2156 | |
2157 vis_and(TMP8, MASK_fe, TMP8); | |
2158 | |
2159 vis_and(DST_0, REF_0, TMP10); | |
2160 vis_ld64_2(dest, stride, DST_0); | |
2161 vis_mul8x16(CONST_128, TMP8, TMP8); | |
2162 | |
2163 vis_and(DST_2, REF_2, TMP12); | |
2164 vis_ld64_2(dest, stride_8, DST_2); | |
2165 | |
2166 vis_ld64(ref[0], TMP14); | |
2167 vis_and(TMP6, MASK_7f, TMP6); | |
2168 | |
2169 vis_and(TMP8, MASK_7f, TMP8); | |
2170 | |
2171 vis_padd16(TMP10, TMP6, TMP6); | |
2172 vis_st64(TMP6, dest[0]); | |
2173 | |
2174 vis_padd16(TMP12, TMP8, TMP8); | |
2175 vis_st64_2(TMP8, dest, 8); | |
2176 | |
2177 dest += stride; | |
2178 vis_ld64_2(ref, 8, TMP16); | |
2179 vis_faligndata(TMP0, TMP2, REF_0); | |
2180 | |
2181 vis_ld64_2(ref, 16, TMP18); | |
2182 vis_faligndata(TMP2, TMP4, REF_2); | |
2183 ref += stride; | |
2184 | |
2185 vis_xor(DST_0, REF_0, TMP20); | |
2186 | |
2187 vis_and(TMP20, MASK_fe, TMP20); | |
2188 | |
2189 vis_xor(DST_2, REF_2, TMP22); | |
2190 vis_mul8x16(CONST_128, TMP20, TMP20); | |
2191 | |
2192 vis_and(TMP22, MASK_fe, TMP22); | |
2193 | |
2194 vis_and(DST_0, REF_0, TMP24); | |
2195 vis_mul8x16(CONST_128, TMP22, TMP22); | |
2196 | |
2197 vis_and(DST_2, REF_2, TMP26); | |
2198 | |
2199 vis_ld64_2(dest, stride, DST_0); | |
2200 vis_faligndata(TMP14, TMP16, REF_0); | |
2201 | |
2202 vis_ld64_2(dest, stride_8, DST_2); | |
2203 vis_faligndata(TMP16, TMP18, REF_2); | |
2204 | |
2205 vis_and(TMP20, MASK_7f, TMP20); | |
2206 | |
2207 vis_and(TMP22, MASK_7f, TMP22); | |
2208 | |
2209 vis_padd16(TMP24, TMP20, TMP20); | |
2210 vis_st64(TMP20, dest[0]); | |
2211 | |
2212 vis_padd16(TMP26, TMP22, TMP22); | |
2213 vis_st64_2(TMP22, dest, 8); | |
2214 dest += stride; | |
2215 } while (--height); | |
2216 | |
2217 vis_ld64(ref[0], TMP0); | |
2218 vis_xor(DST_0, REF_0, TMP6); | |
2219 | |
2220 vis_ld64_2(ref, 8, TMP2); | |
2221 vis_and(TMP6, MASK_fe, TMP6); | |
2222 | |
2223 vis_ld64_2(ref, 16, TMP4); | |
2224 vis_mul8x16(CONST_128, TMP6, TMP6); | |
2225 vis_xor(DST_2, REF_2, TMP8); | |
2226 | |
2227 vis_and(TMP8, MASK_fe, TMP8); | |
2228 | |
2229 vis_and(DST_0, REF_0, TMP10); | |
2230 vis_ld64_2(dest, stride, DST_0); | |
2231 vis_mul8x16(CONST_128, TMP8, TMP8); | |
2232 | |
2233 vis_and(DST_2, REF_2, TMP12); | |
2234 vis_ld64_2(dest, stride_8, DST_2); | |
2235 | |
2236 vis_ld64(ref[0], TMP14); | |
2237 vis_and(TMP6, MASK_7f, TMP6); | |
2238 | |
2239 vis_and(TMP8, MASK_7f, TMP8); | |
2240 | |
2241 vis_padd16(TMP10, TMP6, TMP6); | |
2242 vis_st64(TMP6, dest[0]); | |
2243 | |
2244 vis_padd16(TMP12, TMP8, TMP8); | |
2245 vis_st64_2(TMP8, dest, 8); | |
2246 | |
2247 dest += stride; | |
2248 vis_faligndata(TMP0, TMP2, REF_0); | |
2249 | |
2250 vis_faligndata(TMP2, TMP4, REF_2); | |
2251 | |
2252 vis_xor(DST_0, REF_0, TMP20); | |
2253 | |
2254 vis_and(TMP20, MASK_fe, TMP20); | |
2255 | |
2256 vis_xor(DST_2, REF_2, TMP22); | |
2257 vis_mul8x16(CONST_128, TMP20, TMP20); | |
2258 | |
2259 vis_and(TMP22, MASK_fe, TMP22); | |
2260 | |
2261 vis_and(DST_0, REF_0, TMP24); | |
2262 vis_mul8x16(CONST_128, TMP22, TMP22); | |
2263 | |
2264 vis_and(DST_2, REF_2, TMP26); | |
2265 | |
2266 vis_and(TMP20, MASK_7f, TMP20); | |
2267 | |
2268 vis_and(TMP22, MASK_7f, TMP22); | |
2269 | |
2270 vis_padd16(TMP24, TMP20, TMP20); | |
2271 vis_st64(TMP20, dest[0]); | |
2272 | |
2273 vis_padd16(TMP26, TMP22, TMP22); | |
2274 vis_st64_2(TMP22, dest, 8); | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2275 } |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2276 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2277 static void MC_avg_no_round_o_8_vis (uint8_t * dest, const uint8_t * _ref, |
2979 | 2278 const int stride, int height) |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2279 { |
2979 | 2280 uint8_t *ref = (uint8_t *) _ref; |
2281 | |
2282 ref = vis_alignaddr(ref); | |
2283 | |
2284 vis_ld64(ref[0], TMP0); | |
2285 | |
2286 vis_ld64(ref[8], TMP2); | |
2287 | |
2288 vis_ld64(dest[0], DST_0); | |
2289 | |
2290 vis_ld64(constants_fe[0], MASK_fe); | |
2291 | |
2292 vis_ld64(constants_7f[0], MASK_7f); | |
2293 vis_faligndata(TMP0, TMP2, REF_0); | |
2294 | |
2295 vis_ld64(constants128[0], CONST_128); | |
2296 | |
2297 ref += stride; | |
2298 height = (height >> 1) - 1; | |
2299 | |
2300 do { /* 12 cycles */ | |
2301 vis_ld64(ref[0], TMP0); | |
2302 vis_xor(DST_0, REF_0, TMP4); | |
2303 | |
2304 vis_ld64(ref[8], TMP2); | |
2305 vis_and(TMP4, MASK_fe, TMP4); | |
2306 | |
2307 vis_and(DST_0, REF_0, TMP6); | |
2308 vis_ld64_2(dest, stride, DST_0); | |
2309 ref += stride; | |
2310 vis_mul8x16(CONST_128, TMP4, TMP4); | |
2311 | |
2312 vis_ld64(ref[0], TMP12); | |
2313 vis_faligndata(TMP0, TMP2, REF_0); | |
2314 | |
2315 vis_ld64(ref[8], TMP2); | |
2316 vis_xor(DST_0, REF_0, TMP0); | |
2317 ref += stride; | |
2318 | |
2319 vis_and(TMP0, MASK_fe, TMP0); | |
2320 | |
2321 vis_and(TMP4, MASK_7f, TMP4); | |
2322 | |
2323 vis_padd16(TMP6, TMP4, TMP4); | |
2324 vis_st64(TMP4, dest[0]); | |
2325 dest += stride; | |
2326 vis_mul8x16(CONST_128, TMP0, TMP0); | |
2327 | |
2328 vis_and(DST_0, REF_0, TMP6); | |
2329 vis_ld64_2(dest, stride, DST_0); | |
2330 | |
2331 vis_faligndata(TMP12, TMP2, REF_0); | |
2332 | |
2333 vis_and(TMP0, MASK_7f, TMP0); | |
2334 | |
2335 vis_padd16(TMP6, TMP0, TMP4); | |
2336 vis_st64(TMP4, dest[0]); | |
2337 dest += stride; | |
2338 } while (--height); | |
2339 | |
2340 vis_ld64(ref[0], TMP0); | |
2341 vis_xor(DST_0, REF_0, TMP4); | |
2342 | |
2343 vis_ld64(ref[8], TMP2); | |
2344 vis_and(TMP4, MASK_fe, TMP4); | |
2345 | |
2346 vis_and(DST_0, REF_0, TMP6); | |
2347 vis_ld64_2(dest, stride, DST_0); | |
2348 vis_mul8x16(CONST_128, TMP4, TMP4); | |
2349 | |
2350 vis_faligndata(TMP0, TMP2, REF_0); | |
2351 | |
2352 vis_xor(DST_0, REF_0, TMP0); | |
2353 | |
2354 vis_and(TMP0, MASK_fe, TMP0); | |
2355 | |
2356 vis_and(TMP4, MASK_7f, TMP4); | |
2357 | |
2358 vis_padd16(TMP6, TMP4, TMP4); | |
2359 vis_st64(TMP4, dest[0]); | |
2360 dest += stride; | |
2361 vis_mul8x16(CONST_128, TMP0, TMP0); | |
2362 | |
2363 vis_and(DST_0, REF_0, TMP6); | |
2364 | |
2365 vis_and(TMP0, MASK_7f, TMP0); | |
2366 | |
2367 vis_padd16(TMP6, TMP0, TMP4); | |
2368 vis_st64(TMP4, dest[0]); | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2369 } |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2370 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2371 static void MC_put_no_round_x_16_vis (uint8_t * dest, const uint8_t * _ref, |
2979 | 2372 const int stride, int height) |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2373 { |
2979 | 2374 uint8_t *ref = (uint8_t *) _ref; |
2375 unsigned long off = (unsigned long) ref & 0x7; | |
2376 unsigned long off_plus_1 = off + 1; | |
2377 | |
2378 ref = vis_alignaddr(ref); | |
2379 | |
2380 vis_ld64(ref[0], TMP0); | |
2381 | |
2382 vis_ld64_2(ref, 8, TMP2); | |
2383 | |
2384 vis_ld64_2(ref, 16, TMP4); | |
2385 | |
2386 vis_ld64(constants_fe[0], MASK_fe); | |
2387 | |
2388 vis_ld64(constants_7f[0], MASK_7f); | |
2389 vis_faligndata(TMP0, TMP2, REF_0); | |
2390 | |
2391 vis_ld64(constants128[0], CONST_128); | |
2392 vis_faligndata(TMP2, TMP4, REF_4); | |
2393 | |
2394 if (off != 0x7) { | |
2395 vis_alignaddr_g0((void *)off_plus_1); | |
2396 vis_faligndata(TMP0, TMP2, REF_2); | |
2397 vis_faligndata(TMP2, TMP4, REF_6); | |
2398 } else { | |
2399 vis_src1(TMP2, REF_2); | |
2400 vis_src1(TMP4, REF_6); | |
2401 } | |
2402 | |
2403 ref += stride; | |
2404 height = (height >> 1) - 1; | |
2405 | |
2406 do { /* 34 cycles */ | |
2407 vis_ld64(ref[0], TMP0); | |
2408 vis_xor(REF_0, REF_2, TMP6); | |
2409 | |
2410 vis_ld64_2(ref, 8, TMP2); | |
2411 vis_xor(REF_4, REF_6, TMP8); | |
2412 | |
2413 vis_ld64_2(ref, 16, TMP4); | |
2414 vis_and(TMP6, MASK_fe, TMP6); | |
2415 ref += stride; | |
2416 | |
2417 vis_ld64(ref[0], TMP14); | |
2418 vis_mul8x16(CONST_128, TMP6, TMP6); | |
2419 vis_and(TMP8, MASK_fe, TMP8); | |
2420 | |
2421 vis_ld64_2(ref, 8, TMP16); | |
2422 vis_mul8x16(CONST_128, TMP8, TMP8); | |
2423 vis_and(REF_0, REF_2, TMP10); | |
2424 | |
2425 vis_ld64_2(ref, 16, TMP18); | |
2426 ref += stride; | |
2427 vis_and(REF_4, REF_6, TMP12); | |
2428 | |
2429 vis_alignaddr_g0((void *)off); | |
2430 | |
2431 vis_faligndata(TMP0, TMP2, REF_0); | |
2432 | |
2433 vis_faligndata(TMP2, TMP4, REF_4); | |
2434 | |
2435 if (off != 0x7) { | |
2436 vis_alignaddr_g0((void *)off_plus_1); | |
2437 vis_faligndata(TMP0, TMP2, REF_2); | |
2438 vis_faligndata(TMP2, TMP4, REF_6); | |
2439 } else { | |
2440 vis_src1(TMP2, REF_2); | |
2441 vis_src1(TMP4, REF_6); | |
2442 } | |
2443 | |
2444 vis_and(TMP6, MASK_7f, TMP6); | |
2445 | |
2446 vis_and(TMP8, MASK_7f, TMP8); | |
2447 | |
2448 vis_padd16(TMP10, TMP6, TMP6); | |
2449 vis_st64(TMP6, dest[0]); | |
2450 | |
2451 vis_padd16(TMP12, TMP8, TMP8); | |
2452 vis_st64_2(TMP8, dest, 8); | |
2453 dest += stride; | |
2454 | |
2455 vis_xor(REF_0, REF_2, TMP6); | |
2456 | |
2457 vis_xor(REF_4, REF_6, TMP8); | |
2458 | |
2459 vis_and(TMP6, MASK_fe, TMP6); | |
2460 | |
2461 vis_mul8x16(CONST_128, TMP6, TMP6); | |
2462 vis_and(TMP8, MASK_fe, TMP8); | |
2463 | |
2464 vis_mul8x16(CONST_128, TMP8, TMP8); | |
2465 vis_and(REF_0, REF_2, TMP10); | |
2466 | |
2467 vis_and(REF_4, REF_6, TMP12); | |
2468 | |
2469 vis_alignaddr_g0((void *)off); | |
2470 | |
2471 vis_faligndata(TMP14, TMP16, REF_0); | |
2472 | |
2473 vis_faligndata(TMP16, TMP18, REF_4); | |
2474 | |
2475 if (off != 0x7) { | |
2476 vis_alignaddr_g0((void *)off_plus_1); | |
2477 vis_faligndata(TMP14, TMP16, REF_2); | |
2478 vis_faligndata(TMP16, TMP18, REF_6); | |
2479 } else { | |
2480 vis_src1(TMP16, REF_2); | |
2481 vis_src1(TMP18, REF_6); | |
2482 } | |
2483 | |
2484 vis_and(TMP6, MASK_7f, TMP6); | |
2485 | |
2486 vis_and(TMP8, MASK_7f, TMP8); | |
2487 | |
2488 vis_padd16(TMP10, TMP6, TMP6); | |
2489 vis_st64(TMP6, dest[0]); | |
2490 | |
2491 vis_padd16(TMP12, TMP8, TMP8); | |
2492 vis_st64_2(TMP8, dest, 8); | |
2493 dest += stride; | |
2494 } while (--height); | |
2495 | |
2496 vis_ld64(ref[0], TMP0); | |
2497 vis_xor(REF_0, REF_2, TMP6); | |
2498 | |
2499 vis_ld64_2(ref, 8, TMP2); | |
2500 vis_xor(REF_4, REF_6, TMP8); | |
2501 | |
2502 vis_ld64_2(ref, 16, TMP4); | |
2503 vis_and(TMP6, MASK_fe, TMP6); | |
2504 | |
2505 vis_mul8x16(CONST_128, TMP6, TMP6); | |
2506 vis_and(TMP8, MASK_fe, TMP8); | |
2507 | |
2508 vis_mul8x16(CONST_128, TMP8, TMP8); | |
2509 vis_and(REF_0, REF_2, TMP10); | |
2510 | |
2511 vis_and(REF_4, REF_6, TMP12); | |
2512 | |
2513 vis_alignaddr_g0((void *)off); | |
2514 | |
2515 vis_faligndata(TMP0, TMP2, REF_0); | |
2516 | |
2517 vis_faligndata(TMP2, TMP4, REF_4); | |
2518 | |
2519 if (off != 0x7) { | |
2520 vis_alignaddr_g0((void *)off_plus_1); | |
2521 vis_faligndata(TMP0, TMP2, REF_2); | |
2522 vis_faligndata(TMP2, TMP4, REF_6); | |
2523 } else { | |
2524 vis_src1(TMP2, REF_2); | |
2525 vis_src1(TMP4, REF_6); | |
2526 } | |
2527 | |
2528 vis_and(TMP6, MASK_7f, TMP6); | |
2529 | |
2530 vis_and(TMP8, MASK_7f, TMP8); | |
2531 | |
2532 vis_padd16(TMP10, TMP6, TMP6); | |
2533 vis_st64(TMP6, dest[0]); | |
2534 | |
2535 vis_padd16(TMP12, TMP8, TMP8); | |
2536 vis_st64_2(TMP8, dest, 8); | |
2537 dest += stride; | |
2538 | |
2539 vis_xor(REF_0, REF_2, TMP6); | |
2540 | |
2541 vis_xor(REF_4, REF_6, TMP8); | |
2542 | |
2543 vis_and(TMP6, MASK_fe, TMP6); | |
2544 | |
2545 vis_mul8x16(CONST_128, TMP6, TMP6); | |
2546 vis_and(TMP8, MASK_fe, TMP8); | |
2547 | |
2548 vis_mul8x16(CONST_128, TMP8, TMP8); | |
2549 vis_and(REF_0, REF_2, TMP10); | |
2550 | |
2551 vis_and(REF_4, REF_6, TMP12); | |
2552 | |
2553 vis_and(TMP6, MASK_7f, TMP6); | |
2554 | |
2555 vis_and(TMP8, MASK_7f, TMP8); | |
2556 | |
2557 vis_padd16(TMP10, TMP6, TMP6); | |
2558 vis_st64(TMP6, dest[0]); | |
2559 | |
2560 vis_padd16(TMP12, TMP8, TMP8); | |
2561 vis_st64_2(TMP8, dest, 8); | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2562 } |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2563 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2564 static void MC_put_no_round_x_8_vis (uint8_t * dest, const uint8_t * _ref, |
2979 | 2565 const int stride, int height) |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2566 { |
2979 | 2567 uint8_t *ref = (uint8_t *) _ref; |
2568 unsigned long off = (unsigned long) ref & 0x7; | |
2569 unsigned long off_plus_1 = off + 1; | |
2570 | |
2571 ref = vis_alignaddr(ref); | |
2572 | |
2573 vis_ld64(ref[0], TMP0); | |
2574 | |
2575 vis_ld64(ref[8], TMP2); | |
2576 | |
2577 vis_ld64(constants_fe[0], MASK_fe); | |
2578 | |
2579 vis_ld64(constants_7f[0], MASK_7f); | |
2580 | |
2581 vis_ld64(constants128[0], CONST_128); | |
2582 vis_faligndata(TMP0, TMP2, REF_0); | |
2583 | |
2584 if (off != 0x7) { | |
2585 vis_alignaddr_g0((void *)off_plus_1); | |
2586 vis_faligndata(TMP0, TMP2, REF_2); | |
2587 } else { | |
2588 vis_src1(TMP2, REF_2); | |
2589 } | |
2590 | |
2591 ref += stride; | |
2592 height = (height >> 1) - 1; | |
2593 | |
2594 do { /* 20 cycles */ | |
2595 vis_ld64(ref[0], TMP0); | |
2596 vis_xor(REF_0, REF_2, TMP4); | |
2597 | |
2598 vis_ld64_2(ref, 8, TMP2); | |
2599 vis_and(TMP4, MASK_fe, TMP4); | |
2600 ref += stride; | |
2601 | |
2602 vis_ld64(ref[0], TMP8); | |
2603 vis_and(REF_0, REF_2, TMP6); | |
2604 vis_mul8x16(CONST_128, TMP4, TMP4); | |
2605 | |
2606 vis_alignaddr_g0((void *)off); | |
2607 | |
2608 vis_ld64_2(ref, 8, TMP10); | |
2609 ref += stride; | |
2610 vis_faligndata(TMP0, TMP2, REF_0); | |
2611 | |
2612 if (off != 0x7) { | |
2613 vis_alignaddr_g0((void *)off_plus_1); | |
2614 vis_faligndata(TMP0, TMP2, REF_2); | |
2615 } else { | |
2616 vis_src1(TMP2, REF_2); | |
2617 } | |
2618 | |
2619 vis_and(TMP4, MASK_7f, TMP4); | |
2620 | |
2621 vis_padd16(TMP6, TMP4, DST_0); | |
2622 vis_st64(DST_0, dest[0]); | |
2623 dest += stride; | |
2624 | |
2625 vis_xor(REF_0, REF_2, TMP12); | |
2626 | |
2627 vis_and(TMP12, MASK_fe, TMP12); | |
2628 | |
2629 vis_and(REF_0, REF_2, TMP14); | |
2630 vis_mul8x16(CONST_128, TMP12, TMP12); | |
2631 | |
2632 vis_alignaddr_g0((void *)off); | |
2633 vis_faligndata(TMP8, TMP10, REF_0); | |
2634 if (off != 0x7) { | |
2635 vis_alignaddr_g0((void *)off_plus_1); | |
2636 vis_faligndata(TMP8, TMP10, REF_2); | |
2637 } else { | |
2638 vis_src1(TMP10, REF_2); | |
2639 } | |
2640 | |
2641 vis_and(TMP12, MASK_7f, TMP12); | |
2642 | |
2643 vis_padd16(TMP14, TMP12, DST_0); | |
2644 vis_st64(DST_0, dest[0]); | |
2645 dest += stride; | |
2646 } while (--height); | |
2647 | |
2648 vis_ld64(ref[0], TMP0); | |
2649 vis_xor(REF_0, REF_2, TMP4); | |
2650 | |
2651 vis_ld64_2(ref, 8, TMP2); | |
2652 vis_and(TMP4, MASK_fe, TMP4); | |
2653 | |
2654 vis_and(REF_0, REF_2, TMP6); | |
2655 vis_mul8x16(CONST_128, TMP4, TMP4); | |
2656 | |
2657 vis_alignaddr_g0((void *)off); | |
2658 | |
2659 vis_faligndata(TMP0, TMP2, REF_0); | |
2660 | |
2661 if (off != 0x7) { | |
2662 vis_alignaddr_g0((void *)off_plus_1); | |
2663 vis_faligndata(TMP0, TMP2, REF_2); | |
2664 } else { | |
2665 vis_src1(TMP2, REF_2); | |
2666 } | |
2667 | |
2668 vis_and(TMP4, MASK_7f, TMP4); | |
2669 | |
2670 vis_padd16(TMP6, TMP4, DST_0); | |
2671 vis_st64(DST_0, dest[0]); | |
2672 dest += stride; | |
2673 | |
2674 vis_xor(REF_0, REF_2, TMP12); | |
2675 | |
2676 vis_and(TMP12, MASK_fe, TMP12); | |
2677 | |
2678 vis_and(REF_0, REF_2, TMP14); | |
2679 vis_mul8x16(CONST_128, TMP12, TMP12); | |
2680 | |
2681 vis_and(TMP12, MASK_7f, TMP12); | |
2682 | |
2683 vis_padd16(TMP14, TMP12, DST_0); | |
2684 vis_st64(DST_0, dest[0]); | |
2685 dest += stride; | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2686 } |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2687 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2688 static void MC_avg_no_round_x_16_vis (uint8_t * dest, const uint8_t * _ref, |
2979 | 2689 const int stride, int height) |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2690 { |
2979 | 2691 uint8_t *ref = (uint8_t *) _ref; |
2692 unsigned long off = (unsigned long) ref & 0x7; | |
2693 unsigned long off_plus_1 = off + 1; | |
2694 | |
2695 vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT); | |
2696 | |
2697 vis_ld64(constants3[0], CONST_3); | |
2698 vis_fzero(ZERO); | |
2699 vis_ld64(constants256_512[0], CONST_256); | |
2700 | |
2701 ref = vis_alignaddr(ref); | |
2702 do { /* 26 cycles */ | |
2703 vis_ld64(ref[0], TMP0); | |
2704 | |
2705 vis_ld64(ref[8], TMP2); | |
2706 | |
2707 vis_alignaddr_g0((void *)off); | |
2708 | |
2709 vis_ld64(ref[16], TMP4); | |
2710 | |
2711 vis_ld64(dest[0], DST_0); | |
2712 vis_faligndata(TMP0, TMP2, REF_0); | |
2713 | |
2714 vis_ld64(dest[8], DST_2); | |
2715 vis_faligndata(TMP2, TMP4, REF_4); | |
2716 | |
2717 if (off != 0x7) { | |
2718 vis_alignaddr_g0((void *)off_plus_1); | |
2719 vis_faligndata(TMP0, TMP2, REF_2); | |
2720 vis_faligndata(TMP2, TMP4, REF_6); | |
2721 } else { | |
2722 vis_src1(TMP2, REF_2); | |
2723 vis_src1(TMP4, REF_6); | |
2724 } | |
2725 | |
2726 vis_mul8x16au(REF_0, CONST_256, TMP0); | |
2727 | |
2728 vis_pmerge(ZERO, REF_2, TMP4); | |
2729 vis_mul8x16au(REF_0_1, CONST_256, TMP2); | |
2730 | |
2731 vis_pmerge(ZERO, REF_2_1, TMP6); | |
2732 | |
2733 vis_padd16(TMP0, TMP4, TMP0); | |
2734 | |
2735 vis_mul8x16al(DST_0, CONST_512, TMP4); | |
2736 vis_padd16(TMP2, TMP6, TMP2); | |
2737 | |
2738 vis_mul8x16al(DST_1, CONST_512, TMP6); | |
2739 | |
2740 vis_mul8x16au(REF_6, CONST_256, TMP12); | |
2741 | |
2742 vis_padd16(TMP0, TMP4, TMP0); | |
2743 vis_mul8x16au(REF_6_1, CONST_256, TMP14); | |
2744 | |
2745 vis_padd16(TMP2, TMP6, TMP2); | |
2746 vis_mul8x16au(REF_4, CONST_256, TMP16); | |
2747 | |
2748 vis_padd16(TMP0, CONST_3, TMP8); | |
2749 vis_mul8x16au(REF_4_1, CONST_256, TMP18); | |
2750 | |
2751 vis_padd16(TMP2, CONST_3, TMP10); | |
2752 vis_pack16(TMP8, DST_0); | |
2753 | |
2754 vis_pack16(TMP10, DST_1); | |
2755 vis_padd16(TMP16, TMP12, TMP0); | |
2756 | |
2757 vis_st64(DST_0, dest[0]); | |
2758 vis_mul8x16al(DST_2, CONST_512, TMP4); | |
2759 vis_padd16(TMP18, TMP14, TMP2); | |
2760 | |
2761 vis_mul8x16al(DST_3, CONST_512, TMP6); | |
2762 vis_padd16(TMP0, CONST_3, TMP0); | |
2763 | |
2764 vis_padd16(TMP2, CONST_3, TMP2); | |
2765 | |
2766 vis_padd16(TMP0, TMP4, TMP0); | |
2767 | |
2768 vis_padd16(TMP2, TMP6, TMP2); | |
2769 vis_pack16(TMP0, DST_2); | |
2770 | |
2771 vis_pack16(TMP2, DST_3); | |
2772 vis_st64(DST_2, dest[8]); | |
2773 | |
2774 ref += stride; | |
2775 dest += stride; | |
2776 } while (--height); | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2777 } |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2778 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2779 static void MC_avg_no_round_x_8_vis (uint8_t * dest, const uint8_t * _ref, |
2979 | 2780 const int stride, int height) |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2781 { |
2979 | 2782 uint8_t *ref = (uint8_t *) _ref; |
2783 unsigned long off = (unsigned long) ref & 0x7; | |
2784 unsigned long off_plus_1 = off + 1; | |
2785 int stride_times_2 = stride << 1; | |
2786 | |
2787 vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT); | |
2788 | |
2789 vis_ld64(constants3[0], CONST_3); | |
2790 vis_fzero(ZERO); | |
2791 vis_ld64(constants256_512[0], CONST_256); | |
2792 | |
2793 ref = vis_alignaddr(ref); | |
2794 height >>= 2; | |
2795 do { /* 47 cycles */ | |
2796 vis_ld64(ref[0], TMP0); | |
2797 | |
2798 vis_ld64_2(ref, 8, TMP2); | |
2799 ref += stride; | |
2800 | |
2801 vis_alignaddr_g0((void *)off); | |
2802 | |
2803 vis_ld64(ref[0], TMP4); | |
2804 vis_faligndata(TMP0, TMP2, REF_0); | |
2805 | |
2806 vis_ld64_2(ref, 8, TMP6); | |
2807 ref += stride; | |
2808 | |
2809 vis_ld64(ref[0], TMP8); | |
2810 | |
2811 vis_ld64_2(ref, 8, TMP10); | |
2812 ref += stride; | |
2813 vis_faligndata(TMP4, TMP6, REF_4); | |
2814 | |
2815 vis_ld64(ref[0], TMP12); | |
2816 | |
2817 vis_ld64_2(ref, 8, TMP14); | |
2818 ref += stride; | |
2819 vis_faligndata(TMP8, TMP10, REF_S0); | |
2820 | |
2821 vis_faligndata(TMP12, TMP14, REF_S4); | |
2822 | |
2823 if (off != 0x7) { | |
2824 vis_alignaddr_g0((void *)off_plus_1); | |
2825 | |
2826 vis_ld64(dest[0], DST_0); | |
2827 vis_faligndata(TMP0, TMP2, REF_2); | |
2828 | |
2829 vis_ld64_2(dest, stride, DST_2); | |
2830 vis_faligndata(TMP4, TMP6, REF_6); | |
2831 | |
2832 vis_faligndata(TMP8, TMP10, REF_S2); | |
2833 | |
2834 vis_faligndata(TMP12, TMP14, REF_S6); | |
2835 } else { | |
2836 vis_ld64(dest[0], DST_0); | |
2837 vis_src1(TMP2, REF_2); | |
2838 | |
2839 vis_ld64_2(dest, stride, DST_2); | |
2840 vis_src1(TMP6, REF_6); | |
2841 | |
2842 vis_src1(TMP10, REF_S2); | |
2843 | |
2844 vis_src1(TMP14, REF_S6); | |
2845 } | |
2846 | |
2847 vis_pmerge(ZERO, REF_0, TMP0); | |
2848 vis_mul8x16au(REF_0_1, CONST_256, TMP2); | |
2849 | |
2850 vis_pmerge(ZERO, REF_2, TMP4); | |
2851 vis_mul8x16au(REF_2_1, CONST_256, TMP6); | |
2852 | |
2853 vis_padd16(TMP0, CONST_3, TMP0); | |
2854 vis_mul8x16al(DST_0, CONST_512, TMP16); | |
2855 | |
2856 vis_padd16(TMP2, CONST_3, TMP2); | |
2857 vis_mul8x16al(DST_1, CONST_512, TMP18); | |
2858 | |
2859 vis_padd16(TMP0, TMP4, TMP0); | |
2860 vis_mul8x16au(REF_4, CONST_256, TMP8); | |
2861 | |
2862 vis_padd16(TMP2, TMP6, TMP2); | |
2863 vis_mul8x16au(REF_4_1, CONST_256, TMP10); | |
2864 | |
2865 vis_padd16(TMP0, TMP16, TMP0); | |
2866 vis_mul8x16au(REF_6, CONST_256, TMP12); | |
2867 | |
2868 vis_padd16(TMP2, TMP18, TMP2); | |
2869 vis_mul8x16au(REF_6_1, CONST_256, TMP14); | |
2870 | |
2871 vis_padd16(TMP8, CONST_3, TMP8); | |
2872 vis_mul8x16al(DST_2, CONST_512, TMP16); | |
2873 | |
2874 vis_padd16(TMP8, TMP12, TMP8); | |
2875 vis_mul8x16al(DST_3, CONST_512, TMP18); | |
2876 | |
2877 vis_padd16(TMP10, TMP14, TMP10); | |
2878 vis_pack16(TMP0, DST_0); | |
2879 | |
2880 vis_pack16(TMP2, DST_1); | |
2881 vis_st64(DST_0, dest[0]); | |
2882 dest += stride; | |
2883 vis_padd16(TMP10, CONST_3, TMP10); | |
2884 | |
2885 vis_ld64_2(dest, stride, DST_0); | |
2886 vis_padd16(TMP8, TMP16, TMP8); | |
2887 | |
2888 vis_ld64_2(dest, stride_times_2, TMP4/*DST_2*/); | |
2889 vis_padd16(TMP10, TMP18, TMP10); | |
2890 vis_pack16(TMP8, DST_2); | |
2891 | |
2892 vis_pack16(TMP10, DST_3); | |
2893 vis_st64(DST_2, dest[0]); | |
2894 dest += stride; | |
2895 | |
2896 vis_mul8x16au(REF_S0_1, CONST_256, TMP2); | |
2897 vis_pmerge(ZERO, REF_S0, TMP0); | |
2898 | |
2899 vis_pmerge(ZERO, REF_S2, TMP24); | |
2900 vis_mul8x16au(REF_S2_1, CONST_256, TMP6); | |
2901 | |
2902 vis_padd16(TMP0, CONST_3, TMP0); | |
2903 vis_mul8x16au(REF_S4, CONST_256, TMP8); | |
2904 | |
2905 vis_padd16(TMP2, CONST_3, TMP2); | |
2906 vis_mul8x16au(REF_S4_1, CONST_256, TMP10); | |
2907 | |
2908 vis_padd16(TMP0, TMP24, TMP0); | |
2909 vis_mul8x16au(REF_S6, CONST_256, TMP12); | |
2910 | |
2911 vis_padd16(TMP2, TMP6, TMP2); | |
2912 vis_mul8x16au(REF_S6_1, CONST_256, TMP14); | |
2913 | |
2914 vis_padd16(TMP8, CONST_3, TMP8); | |
2915 vis_mul8x16al(DST_0, CONST_512, TMP16); | |
2916 | |
2917 vis_padd16(TMP10, CONST_3, TMP10); | |
2918 vis_mul8x16al(DST_1, CONST_512, TMP18); | |
2919 | |
2920 vis_padd16(TMP8, TMP12, TMP8); | |
2921 vis_mul8x16al(TMP4/*DST_2*/, CONST_512, TMP20); | |
2922 | |
2923 vis_mul8x16al(TMP5/*DST_3*/, CONST_512, TMP22); | |
2924 vis_padd16(TMP0, TMP16, TMP0); | |
2925 | |
2926 vis_padd16(TMP2, TMP18, TMP2); | |
2927 vis_pack16(TMP0, DST_0); | |
2928 | |
2929 vis_padd16(TMP10, TMP14, TMP10); | |
2930 vis_pack16(TMP2, DST_1); | |
2931 vis_st64(DST_0, dest[0]); | |
2932 dest += stride; | |
2933 | |
2934 vis_padd16(TMP8, TMP20, TMP8); | |
2935 | |
2936 vis_padd16(TMP10, TMP22, TMP10); | |
2937 vis_pack16(TMP8, DST_2); | |
2938 | |
2939 vis_pack16(TMP10, DST_3); | |
2940 vis_st64(DST_2, dest[0]); | |
2941 dest += stride; | |
2942 } while (--height); | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2943 } |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2944 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2945 static void MC_put_no_round_y_16_vis (uint8_t * dest, const uint8_t * _ref, |
2979 | 2946 const int stride, int height) |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
2947 { |
2979 | 2948 uint8_t *ref = (uint8_t *) _ref; |
2949 | |
2950 ref = vis_alignaddr(ref); | |
2951 vis_ld64(ref[0], TMP0); | |
2952 | |
2953 vis_ld64_2(ref, 8, TMP2); | |
2954 | |
2955 vis_ld64_2(ref, 16, TMP4); | |
2956 ref += stride; | |
2957 | |
2958 vis_ld64(ref[0], TMP6); | |
2959 vis_faligndata(TMP0, TMP2, REF_0); | |
2960 | |
2961 vis_ld64_2(ref, 8, TMP8); | |
2962 vis_faligndata(TMP2, TMP4, REF_4); | |
2963 | |
2964 vis_ld64_2(ref, 16, TMP10); | |
2965 ref += stride; | |
2966 | |
2967 vis_ld64(constants_fe[0], MASK_fe); | |
2968 vis_faligndata(TMP6, TMP8, REF_2); | |
2969 | |
2970 vis_ld64(constants_7f[0], MASK_7f); | |
2971 vis_faligndata(TMP8, TMP10, REF_6); | |
2972 | |
2973 vis_ld64(constants128[0], CONST_128); | |
2974 height = (height >> 1) - 1; | |
2975 do { /* 24 cycles */ | |
2976 vis_ld64(ref[0], TMP0); | |
2977 vis_xor(REF_0, REF_2, TMP12); | |
2978 | |
2979 vis_ld64_2(ref, 8, TMP2); | |
2980 vis_xor(REF_4, REF_6, TMP16); | |
2981 | |
2982 vis_ld64_2(ref, 16, TMP4); | |
2983 ref += stride; | |
2984 vis_and(REF_0, REF_2, TMP14); | |
2985 | |
2986 vis_ld64(ref[0], TMP6); | |
2987 vis_and(REF_4, REF_6, TMP18); | |
2988 | |
2989 vis_ld64_2(ref, 8, TMP8); | |
2990 vis_faligndata(TMP0, TMP2, REF_0); | |
2991 | |
2992 vis_ld64_2(ref, 16, TMP10); | |
2993 ref += stride; | |
2994 vis_faligndata(TMP2, TMP4, REF_4); | |
2995 | |
2996 vis_and(TMP12, MASK_fe, TMP12); | |
2997 | |
2998 vis_and(TMP16, MASK_fe, TMP16); | |
2999 vis_mul8x16(CONST_128, TMP12, TMP12); | |
3000 | |
3001 vis_mul8x16(CONST_128, TMP16, TMP16); | |
3002 vis_xor(REF_0, REF_2, TMP0); | |
3003 | |
3004 vis_xor(REF_4, REF_6, TMP2); | |
3005 | |
3006 vis_and(REF_0, REF_2, TMP20); | |
3007 | |
3008 vis_and(TMP12, MASK_7f, TMP12); | |
3009 | |
3010 vis_and(TMP16, MASK_7f, TMP16); | |
3011 | |
3012 vis_padd16(TMP14, TMP12, TMP12); | |
3013 vis_st64(TMP12, dest[0]); | |
3014 | |
3015 vis_padd16(TMP18, TMP16, TMP16); | |
3016 vis_st64_2(TMP16, dest, 8); | |
3017 dest += stride; | |
3018 | |
3019 vis_and(REF_4, REF_6, TMP18); | |
3020 | |
3021 vis_and(TMP0, MASK_fe, TMP0); | |
3022 | |
3023 vis_and(TMP2, MASK_fe, TMP2); | |
3024 vis_mul8x16(CONST_128, TMP0, TMP0); | |
3025 | |
3026 vis_faligndata(TMP6, TMP8, REF_2); | |
3027 vis_mul8x16(CONST_128, TMP2, TMP2); | |
3028 | |
3029 vis_faligndata(TMP8, TMP10, REF_6); | |
3030 | |
3031 vis_and(TMP0, MASK_7f, TMP0); | |
3032 | |
3033 vis_and(TMP2, MASK_7f, TMP2); | |
3034 | |
3035 vis_padd16(TMP20, TMP0, TMP0); | |
3036 vis_st64(TMP0, dest[0]); | |
3037 | |
3038 vis_padd16(TMP18, TMP2, TMP2); | |
3039 vis_st64_2(TMP2, dest, 8); | |
3040 dest += stride; | |
3041 } while (--height); | |
3042 | |
3043 vis_ld64(ref[0], TMP0); | |
3044 vis_xor(REF_0, REF_2, TMP12); | |
3045 | |
3046 vis_ld64_2(ref, 8, TMP2); | |
3047 vis_xor(REF_4, REF_6, TMP16); | |
3048 | |
3049 vis_ld64_2(ref, 16, TMP4); | |
3050 vis_and(REF_0, REF_2, TMP14); | |
3051 | |
3052 vis_and(REF_4, REF_6, TMP18); | |
3053 | |
3054 vis_faligndata(TMP0, TMP2, REF_0); | |
3055 | |
3056 vis_faligndata(TMP2, TMP4, REF_4); | |
3057 | |
3058 vis_and(TMP12, MASK_fe, TMP12); | |
3059 | |
3060 vis_and(TMP16, MASK_fe, TMP16); | |
3061 vis_mul8x16(CONST_128, TMP12, TMP12); | |
3062 | |
3063 vis_mul8x16(CONST_128, TMP16, TMP16); | |
3064 vis_xor(REF_0, REF_2, TMP0); | |
3065 | |
3066 vis_xor(REF_4, REF_6, TMP2); | |
3067 | |
3068 vis_and(REF_0, REF_2, TMP20); | |
3069 | |
3070 vis_and(TMP12, MASK_7f, TMP12); | |
3071 | |
3072 vis_and(TMP16, MASK_7f, TMP16); | |
3073 | |
3074 vis_padd16(TMP14, TMP12, TMP12); | |
3075 vis_st64(TMP12, dest[0]); | |
3076 | |
3077 vis_padd16(TMP18, TMP16, TMP16); | |
3078 vis_st64_2(TMP16, dest, 8); | |
3079 dest += stride; | |
3080 | |
3081 vis_and(REF_4, REF_6, TMP18); | |
3082 | |
3083 vis_and(TMP0, MASK_fe, TMP0); | |
3084 | |
3085 vis_and(TMP2, MASK_fe, TMP2); | |
3086 vis_mul8x16(CONST_128, TMP0, TMP0); | |
3087 | |
3088 vis_mul8x16(CONST_128, TMP2, TMP2); | |
3089 | |
3090 vis_and(TMP0, MASK_7f, TMP0); | |
3091 | |
3092 vis_and(TMP2, MASK_7f, TMP2); | |
3093 | |
3094 vis_padd16(TMP20, TMP0, TMP0); | |
3095 vis_st64(TMP0, dest[0]); | |
3096 | |
3097 vis_padd16(TMP18, TMP2, TMP2); | |
3098 vis_st64_2(TMP2, dest, 8); | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
3099 } |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
3100 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
3101 static void MC_put_no_round_y_8_vis (uint8_t * dest, const uint8_t * _ref, |
2979 | 3102 const int stride, int height) |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
3103 { |
2979 | 3104 uint8_t *ref = (uint8_t *) _ref; |
3105 | |
3106 ref = vis_alignaddr(ref); | |
3107 vis_ld64(ref[0], TMP0); | |
3108 | |
3109 vis_ld64_2(ref, 8, TMP2); | |
3110 ref += stride; | |
3111 | |
3112 vis_ld64(ref[0], TMP4); | |
3113 | |
3114 vis_ld64_2(ref, 8, TMP6); | |
3115 ref += stride; | |
3116 | |
3117 vis_ld64(constants_fe[0], MASK_fe); | |
3118 vis_faligndata(TMP0, TMP2, REF_0); | |
3119 | |
3120 vis_ld64(constants_7f[0], MASK_7f); | |
3121 vis_faligndata(TMP4, TMP6, REF_2); | |
3122 | |
3123 vis_ld64(constants128[0], CONST_128); | |
3124 height = (height >> 1) - 1; | |
3125 do { /* 12 cycles */ | |
3126 vis_ld64(ref[0], TMP0); | |
3127 vis_xor(REF_0, REF_2, TMP4); | |
3128 | |
3129 vis_ld64_2(ref, 8, TMP2); | |
3130 ref += stride; | |
3131 vis_and(TMP4, MASK_fe, TMP4); | |
3132 | |
3133 vis_and(REF_0, REF_2, TMP6); | |
3134 vis_mul8x16(CONST_128, TMP4, TMP4); | |
3135 | |
3136 vis_faligndata(TMP0, TMP2, REF_0); | |
3137 vis_ld64(ref[0], TMP0); | |
3138 | |
3139 vis_ld64_2(ref, 8, TMP2); | |
3140 ref += stride; | |
3141 vis_xor(REF_0, REF_2, TMP12); | |
3142 | |
3143 vis_and(TMP4, MASK_7f, TMP4); | |
3144 | |
3145 vis_and(TMP12, MASK_fe, TMP12); | |
3146 | |
3147 vis_mul8x16(CONST_128, TMP12, TMP12); | |
3148 vis_and(REF_0, REF_2, TMP14); | |
3149 | |
3150 vis_padd16(TMP6, TMP4, DST_0); | |
3151 vis_st64(DST_0, dest[0]); | |
3152 dest += stride; | |
3153 | |
3154 vis_faligndata(TMP0, TMP2, REF_2); | |
3155 | |
3156 vis_and(TMP12, MASK_7f, TMP12); | |
3157 | |
3158 vis_padd16(TMP14, TMP12, DST_0); | |
3159 vis_st64(DST_0, dest[0]); | |
3160 dest += stride; | |
3161 } while (--height); | |
3162 | |
3163 vis_ld64(ref[0], TMP0); | |
3164 vis_xor(REF_0, REF_2, TMP4); | |
3165 | |
3166 vis_ld64_2(ref, 8, TMP2); | |
3167 vis_and(TMP4, MASK_fe, TMP4); | |
3168 | |
3169 vis_and(REF_0, REF_2, TMP6); | |
3170 vis_mul8x16(CONST_128, TMP4, TMP4); | |
3171 | |
3172 vis_faligndata(TMP0, TMP2, REF_0); | |
3173 | |
3174 vis_xor(REF_0, REF_2, TMP12); | |
3175 | |
3176 vis_and(TMP4, MASK_7f, TMP4); | |
3177 | |
3178 vis_and(TMP12, MASK_fe, TMP12); | |
3179 | |
3180 vis_mul8x16(CONST_128, TMP12, TMP12); | |
3181 vis_and(REF_0, REF_2, TMP14); | |
3182 | |
3183 vis_padd16(TMP6, TMP4, DST_0); | |
3184 vis_st64(DST_0, dest[0]); | |
3185 dest += stride; | |
3186 | |
3187 vis_and(TMP12, MASK_7f, TMP12); | |
3188 | |
3189 vis_padd16(TMP14, TMP12, DST_0); | |
3190 vis_st64(DST_0, dest[0]); | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
3191 } |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
3192 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
3193 static void MC_avg_no_round_y_16_vis (uint8_t * dest, const uint8_t * _ref, |
2979 | 3194 const int stride, int height) |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
3195 { |
2979 | 3196 uint8_t *ref = (uint8_t *) _ref; |
3197 int stride_8 = stride + 8; | |
3198 int stride_16 = stride + 16; | |
3199 | |
3200 vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT); | |
3201 | |
3202 ref = vis_alignaddr(ref); | |
3203 | |
3204 vis_ld64(ref[ 0], TMP0); | |
3205 vis_fzero(ZERO); | |
3206 | |
3207 vis_ld64(ref[ 8], TMP2); | |
3208 | |
3209 vis_ld64(ref[16], TMP4); | |
3210 | |
3211 vis_ld64(constants3[0], CONST_3); | |
3212 vis_faligndata(TMP0, TMP2, REF_2); | |
3213 | |
3214 vis_ld64(constants256_512[0], CONST_256); | |
3215 vis_faligndata(TMP2, TMP4, REF_6); | |
3216 height >>= 1; | |
3217 | |
3218 do { /* 31 cycles */ | |
3219 vis_ld64_2(ref, stride, TMP0); | |
3220 vis_pmerge(ZERO, REF_2, TMP12); | |
3221 vis_mul8x16au(REF_2_1, CONST_256, TMP14); | |
3222 | |
3223 vis_ld64_2(ref, stride_8, TMP2); | |
3224 vis_pmerge(ZERO, REF_6, TMP16); | |
3225 vis_mul8x16au(REF_6_1, CONST_256, TMP18); | |
3226 | |
3227 vis_ld64_2(ref, stride_16, TMP4); | |
3228 ref += stride; | |
3229 | |
3230 vis_ld64(dest[0], DST_0); | |
3231 vis_faligndata(TMP0, TMP2, REF_0); | |
3232 | |
3233 vis_ld64_2(dest, 8, DST_2); | |
3234 vis_faligndata(TMP2, TMP4, REF_4); | |
3235 | |
3236 vis_ld64_2(ref, stride, TMP6); | |
3237 vis_pmerge(ZERO, REF_0, TMP0); | |
3238 vis_mul8x16au(REF_0_1, CONST_256, TMP2); | |
3239 | |
3240 vis_ld64_2(ref, stride_8, TMP8); | |
3241 vis_pmerge(ZERO, REF_4, TMP4); | |
3242 | |
3243 vis_ld64_2(ref, stride_16, TMP10); | |
3244 ref += stride; | |
3245 | |
3246 vis_ld64_2(dest, stride, REF_S0/*DST_4*/); | |
3247 vis_faligndata(TMP6, TMP8, REF_2); | |
3248 vis_mul8x16au(REF_4_1, CONST_256, TMP6); | |
3249 | |
3250 vis_ld64_2(dest, stride_8, REF_S2/*DST_6*/); | |
3251 vis_faligndata(TMP8, TMP10, REF_6); | |
3252 vis_mul8x16al(DST_0, CONST_512, TMP20); | |
3253 | |
3254 vis_padd16(TMP0, CONST_3, TMP0); | |
3255 vis_mul8x16al(DST_1, CONST_512, TMP22); | |
3256 | |
3257 vis_padd16(TMP2, CONST_3, TMP2); | |
3258 vis_mul8x16al(DST_2, CONST_512, TMP24); | |
3259 | |
3260 vis_padd16(TMP4, CONST_3, TMP4); | |
3261 vis_mul8x16al(DST_3, CONST_512, TMP26); | |
3262 | |
3263 vis_padd16(TMP6, CONST_3, TMP6); | |
3264 | |
3265 vis_padd16(TMP12, TMP20, TMP12); | |
3266 vis_mul8x16al(REF_S0, CONST_512, TMP20); | |
3267 | |
3268 vis_padd16(TMP14, TMP22, TMP14); | |
3269 vis_mul8x16al(REF_S0_1, CONST_512, TMP22); | |
3270 | |
3271 vis_padd16(TMP16, TMP24, TMP16); | |
3272 vis_mul8x16al(REF_S2, CONST_512, TMP24); | |
3273 | |
3274 vis_padd16(TMP18, TMP26, TMP18); | |
3275 vis_mul8x16al(REF_S2_1, CONST_512, TMP26); | |
3276 | |
3277 vis_padd16(TMP12, TMP0, TMP12); | |
3278 vis_mul8x16au(REF_2, CONST_256, TMP28); | |
3279 | |
3280 vis_padd16(TMP14, TMP2, TMP14); | |
3281 vis_mul8x16au(REF_2_1, CONST_256, TMP30); | |
3282 | |
3283 vis_padd16(TMP16, TMP4, TMP16); | |
3284 vis_mul8x16au(REF_6, CONST_256, REF_S4); | |
3285 | |
3286 vis_padd16(TMP18, TMP6, TMP18); | |
3287 vis_mul8x16au(REF_6_1, CONST_256, REF_S6); | |
3288 | |
3289 vis_pack16(TMP12, DST_0); | |
3290 vis_padd16(TMP28, TMP0, TMP12); | |
3291 | |
3292 vis_pack16(TMP14, DST_1); | |
3293 vis_st64(DST_0, dest[0]); | |
3294 vis_padd16(TMP30, TMP2, TMP14); | |
3295 | |
3296 vis_pack16(TMP16, DST_2); | |
3297 vis_padd16(REF_S4, TMP4, TMP16); | |
3298 | |
3299 vis_pack16(TMP18, DST_3); | |
3300 vis_st64_2(DST_2, dest, 8); | |
3301 dest += stride; | |
3302 vis_padd16(REF_S6, TMP6, TMP18); | |
3303 | |
3304 vis_padd16(TMP12, TMP20, TMP12); | |
3305 | |
3306 vis_padd16(TMP14, TMP22, TMP14); | |
3307 vis_pack16(TMP12, DST_0); | |
3308 | |
3309 vis_padd16(TMP16, TMP24, TMP16); | |
3310 vis_pack16(TMP14, DST_1); | |
3311 vis_st64(DST_0, dest[0]); | |
3312 | |
3313 vis_padd16(TMP18, TMP26, TMP18); | |
3314 vis_pack16(TMP16, DST_2); | |
3315 | |
3316 vis_pack16(TMP18, DST_3); | |
3317 vis_st64_2(DST_2, dest, 8); | |
3318 dest += stride; | |
3319 } while (--height); | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
3320 } |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
3321 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
3322 static void MC_avg_no_round_y_8_vis (uint8_t * dest, const uint8_t * _ref, |
2979 | 3323 const int stride, int height) |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
3324 { |
2979 | 3325 uint8_t *ref = (uint8_t *) _ref; |
3326 int stride_8 = stride + 8; | |
3327 | |
3328 vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT); | |
3329 | |
3330 ref = vis_alignaddr(ref); | |
3331 | |
3332 vis_ld64(ref[ 0], TMP0); | |
3333 vis_fzero(ZERO); | |
3334 | |
3335 vis_ld64(ref[ 8], TMP2); | |
3336 | |
3337 vis_ld64(constants3[0], CONST_3); | |
3338 vis_faligndata(TMP0, TMP2, REF_2); | |
3339 | |
3340 vis_ld64(constants256_512[0], CONST_256); | |
3341 | |
3342 height >>= 1; | |
3343 do { /* 20 cycles */ | |
3344 vis_ld64_2(ref, stride, TMP0); | |
3345 vis_pmerge(ZERO, REF_2, TMP8); | |
3346 vis_mul8x16au(REF_2_1, CONST_256, TMP10); | |
3347 | |
3348 vis_ld64_2(ref, stride_8, TMP2); | |
3349 ref += stride; | |
3350 | |
3351 vis_ld64(dest[0], DST_0); | |
3352 | |
3353 vis_ld64_2(dest, stride, DST_2); | |
3354 vis_faligndata(TMP0, TMP2, REF_0); | |
3355 | |
3356 vis_ld64_2(ref, stride, TMP4); | |
3357 vis_mul8x16al(DST_0, CONST_512, TMP16); | |
3358 vis_pmerge(ZERO, REF_0, TMP12); | |
3359 | |
3360 vis_ld64_2(ref, stride_8, TMP6); | |
3361 ref += stride; | |
3362 vis_mul8x16al(DST_1, CONST_512, TMP18); | |
3363 vis_pmerge(ZERO, REF_0_1, TMP14); | |
3364 | |
3365 vis_padd16(TMP12, CONST_3, TMP12); | |
3366 vis_mul8x16al(DST_2, CONST_512, TMP24); | |
3367 | |
3368 vis_padd16(TMP14, CONST_3, TMP14); | |
3369 vis_mul8x16al(DST_3, CONST_512, TMP26); | |
3370 | |
3371 vis_faligndata(TMP4, TMP6, REF_2); | |
3372 | |
3373 vis_padd16(TMP8, TMP12, TMP8); | |
3374 | |
3375 vis_padd16(TMP10, TMP14, TMP10); | |
3376 vis_mul8x16au(REF_2, CONST_256, TMP20); | |
3377 | |
3378 vis_padd16(TMP8, TMP16, TMP0); | |
3379 vis_mul8x16au(REF_2_1, CONST_256, TMP22); | |
3380 | |
3381 vis_padd16(TMP10, TMP18, TMP2); | |
3382 vis_pack16(TMP0, DST_0); | |
3383 | |
3384 vis_pack16(TMP2, DST_1); | |
3385 vis_st64(DST_0, dest[0]); | |
3386 dest += stride; | |
3387 vis_padd16(TMP12, TMP20, TMP12); | |
3388 | |
3389 vis_padd16(TMP14, TMP22, TMP14); | |
3390 | |
3391 vis_padd16(TMP12, TMP24, TMP0); | |
3392 | |
3393 vis_padd16(TMP14, TMP26, TMP2); | |
3394 vis_pack16(TMP0, DST_2); | |
3395 | |
3396 vis_pack16(TMP2, DST_3); | |
3397 vis_st64(DST_2, dest[0]); | |
3398 dest += stride; | |
3399 } while (--height); | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
3400 } |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
3401 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
3402 static void MC_put_no_round_xy_16_vis (uint8_t * dest, const uint8_t * _ref, |
2979 | 3403 const int stride, int height) |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
3404 { |
2979 | 3405 uint8_t *ref = (uint8_t *) _ref; |
3406 unsigned long off = (unsigned long) ref & 0x7; | |
3407 unsigned long off_plus_1 = off + 1; | |
3408 int stride_8 = stride + 8; | |
3409 int stride_16 = stride + 16; | |
3410 | |
3411 vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT); | |
3412 | |
3413 ref = vis_alignaddr(ref); | |
3414 | |
3415 vis_ld64(ref[ 0], TMP0); | |
3416 vis_fzero(ZERO); | |
3417 | |
3418 vis_ld64(ref[ 8], TMP2); | |
3419 | |
3420 vis_ld64(ref[16], TMP4); | |
3421 | |
3422 vis_ld64(constants1[0], CONST_1); | |
3423 vis_faligndata(TMP0, TMP2, REF_S0); | |
3424 | |
3425 vis_ld64(constants256_512[0], CONST_256); | |
3426 vis_faligndata(TMP2, TMP4, REF_S4); | |
3427 | |
3428 if (off != 0x7) { | |
3429 vis_alignaddr_g0((void *)off_plus_1); | |
3430 vis_faligndata(TMP0, TMP2, REF_S2); | |
3431 vis_faligndata(TMP2, TMP4, REF_S6); | |
3432 } else { | |
3433 vis_src1(TMP2, REF_S2); | |
3434 vis_src1(TMP4, REF_S6); | |
3435 } | |
3436 | |
3437 height >>= 1; | |
3438 do { | |
3439 vis_ld64_2(ref, stride, TMP0); | |
3440 vis_mul8x16au(REF_S0, CONST_256, TMP12); | |
3441 vis_pmerge(ZERO, REF_S0_1, TMP14); | |
3442 | |
3443 vis_alignaddr_g0((void *)off); | |
3444 | |
3445 vis_ld64_2(ref, stride_8, TMP2); | |
3446 vis_mul8x16au(REF_S2, CONST_256, TMP16); | |
3447 vis_pmerge(ZERO, REF_S2_1, TMP18); | |
3448 | |
3449 vis_ld64_2(ref, stride_16, TMP4); | |
3450 ref += stride; | |
3451 vis_mul8x16au(REF_S4, CONST_256, TMP20); | |
3452 vis_pmerge(ZERO, REF_S4_1, TMP22); | |
3453 | |
3454 vis_ld64_2(ref, stride, TMP6); | |
3455 vis_mul8x16au(REF_S6, CONST_256, TMP24); | |
3456 vis_pmerge(ZERO, REF_S6_1, TMP26); | |
3457 | |
3458 vis_ld64_2(ref, stride_8, TMP8); | |
3459 vis_faligndata(TMP0, TMP2, REF_0); | |
3460 | |
3461 vis_ld64_2(ref, stride_16, TMP10); | |
3462 ref += stride; | |
3463 vis_faligndata(TMP2, TMP4, REF_4); | |
3464 | |
3465 vis_faligndata(TMP6, TMP8, REF_S0); | |
3466 | |
3467 vis_faligndata(TMP8, TMP10, REF_S4); | |
3468 | |
3469 if (off != 0x7) { | |
3470 vis_alignaddr_g0((void *)off_plus_1); | |
3471 vis_faligndata(TMP0, TMP2, REF_2); | |
3472 vis_faligndata(TMP2, TMP4, REF_6); | |
3473 vis_faligndata(TMP6, TMP8, REF_S2); | |
3474 vis_faligndata(TMP8, TMP10, REF_S6); | |
3475 } else { | |
3476 vis_src1(TMP2, REF_2); | |
3477 vis_src1(TMP4, REF_6); | |
3478 vis_src1(TMP8, REF_S2); | |
3479 vis_src1(TMP10, REF_S6); | |
3480 } | |
3481 | |
3482 vis_mul8x16au(REF_0, CONST_256, TMP0); | |
3483 vis_pmerge(ZERO, REF_0_1, TMP2); | |
3484 | |
3485 vis_mul8x16au(REF_2, CONST_256, TMP4); | |
3486 vis_pmerge(ZERO, REF_2_1, TMP6); | |
3487 | |
3488 vis_padd16(TMP0, CONST_2, TMP8); | |
3489 vis_mul8x16au(REF_4, CONST_256, TMP0); | |
3490 | |
3491 vis_padd16(TMP2, CONST_1, TMP10); | |
3492 vis_mul8x16au(REF_4_1, CONST_256, TMP2); | |
3493 | |
3494 vis_padd16(TMP8, TMP4, TMP8); | |
3495 vis_mul8x16au(REF_6, CONST_256, TMP4); | |
3496 | |
3497 vis_padd16(TMP10, TMP6, TMP10); | |
3498 vis_mul8x16au(REF_6_1, CONST_256, TMP6); | |
3499 | |
3500 vis_padd16(TMP12, TMP8, TMP12); | |
3501 | |
3502 vis_padd16(TMP14, TMP10, TMP14); | |
3503 | |
3504 vis_padd16(TMP12, TMP16, TMP12); | |
3505 | |
3506 vis_padd16(TMP14, TMP18, TMP14); | |
3507 vis_pack16(TMP12, DST_0); | |
3508 | |
3509 vis_pack16(TMP14, DST_1); | |
3510 vis_st64(DST_0, dest[0]); | |
3511 vis_padd16(TMP0, CONST_1, TMP12); | |
3512 | |
3513 vis_mul8x16au(REF_S0, CONST_256, TMP0); | |
3514 vis_padd16(TMP2, CONST_1, TMP14); | |
3515 | |
3516 vis_mul8x16au(REF_S0_1, CONST_256, TMP2); | |
3517 vis_padd16(TMP12, TMP4, TMP12); | |
3518 | |
3519 vis_mul8x16au(REF_S2, CONST_256, TMP4); | |
3520 vis_padd16(TMP14, TMP6, TMP14); | |
3521 | |
3522 vis_mul8x16au(REF_S2_1, CONST_256, TMP6); | |
3523 vis_padd16(TMP20, TMP12, TMP20); | |
3524 | |
3525 vis_padd16(TMP22, TMP14, TMP22); | |
3526 | |
3527 vis_padd16(TMP20, TMP24, TMP20); | |
3528 | |
3529 vis_padd16(TMP22, TMP26, TMP22); | |
3530 vis_pack16(TMP20, DST_2); | |
3531 | |
3532 vis_pack16(TMP22, DST_3); | |
3533 vis_st64_2(DST_2, dest, 8); | |
3534 dest += stride; | |
3535 vis_padd16(TMP0, TMP4, TMP24); | |
3536 | |
3537 vis_mul8x16au(REF_S4, CONST_256, TMP0); | |
3538 vis_padd16(TMP2, TMP6, TMP26); | |
3539 | |
3540 vis_mul8x16au(REF_S4_1, CONST_256, TMP2); | |
3541 vis_padd16(TMP24, TMP8, TMP24); | |
3542 | |
3543 vis_padd16(TMP26, TMP10, TMP26); | |
3544 vis_pack16(TMP24, DST_0); | |
3545 | |
3546 vis_pack16(TMP26, DST_1); | |
3547 vis_st64(DST_0, dest[0]); | |
3548 vis_pmerge(ZERO, REF_S6, TMP4); | |
3549 | |
3550 vis_pmerge(ZERO, REF_S6_1, TMP6); | |
3551 | |
3552 vis_padd16(TMP0, TMP4, TMP0); | |
3553 | |
3554 vis_padd16(TMP2, TMP6, TMP2); | |
3555 | |
3556 vis_padd16(TMP0, TMP12, TMP0); | |
3557 | |
3558 vis_padd16(TMP2, TMP14, TMP2); | |
3559 vis_pack16(TMP0, DST_2); | |
3560 | |
3561 vis_pack16(TMP2, DST_3); | |
3562 vis_st64_2(DST_2, dest, 8); | |
3563 dest += stride; | |
3564 } while (--height); | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
3565 } |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
3566 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
3567 static void MC_put_no_round_xy_8_vis (uint8_t * dest, const uint8_t * _ref, |
2979 | 3568 const int stride, int height) |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
3569 { |
2979 | 3570 uint8_t *ref = (uint8_t *) _ref; |
3571 unsigned long off = (unsigned long) ref & 0x7; | |
3572 unsigned long off_plus_1 = off + 1; | |
3573 int stride_8 = stride + 8; | |
3574 | |
3575 vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT); | |
3576 | |
3577 ref = vis_alignaddr(ref); | |
3578 | |
3579 vis_ld64(ref[ 0], TMP0); | |
3580 vis_fzero(ZERO); | |
3581 | |
3582 vis_ld64(ref[ 8], TMP2); | |
3583 | |
3584 vis_ld64(constants1[0], CONST_1); | |
3585 | |
3586 vis_ld64(constants256_512[0], CONST_256); | |
3587 vis_faligndata(TMP0, TMP2, REF_S0); | |
3588 | |
3589 if (off != 0x7) { | |
3590 vis_alignaddr_g0((void *)off_plus_1); | |
3591 vis_faligndata(TMP0, TMP2, REF_S2); | |
3592 } else { | |
3593 vis_src1(TMP2, REF_S2); | |
3594 } | |
3595 | |
3596 height >>= 1; | |
3597 do { /* 26 cycles */ | |
3598 vis_ld64_2(ref, stride, TMP0); | |
3599 vis_mul8x16au(REF_S0, CONST_256, TMP8); | |
3600 vis_pmerge(ZERO, REF_S2, TMP12); | |
3601 | |
3602 vis_alignaddr_g0((void *)off); | |
3603 | |
3604 vis_ld64_2(ref, stride_8, TMP2); | |
3605 ref += stride; | |
3606 vis_mul8x16au(REF_S0_1, CONST_256, TMP10); | |
3607 vis_pmerge(ZERO, REF_S2_1, TMP14); | |
3608 | |
3609 vis_ld64_2(ref, stride, TMP4); | |
3610 | |
3611 vis_ld64_2(ref, stride_8, TMP6); | |
3612 ref += stride; | |
3613 vis_faligndata(TMP0, TMP2, REF_S4); | |
3614 | |
3615 vis_pmerge(ZERO, REF_S4, TMP18); | |
3616 | |
3617 vis_pmerge(ZERO, REF_S4_1, TMP20); | |
3618 | |
3619 vis_faligndata(TMP4, TMP6, REF_S0); | |
3620 | |
3621 if (off != 0x7) { | |
3622 vis_alignaddr_g0((void *)off_plus_1); | |
3623 vis_faligndata(TMP0, TMP2, REF_S6); | |
3624 vis_faligndata(TMP4, TMP6, REF_S2); | |
3625 } else { | |
3626 vis_src1(TMP2, REF_S6); | |
3627 vis_src1(TMP6, REF_S2); | |
3628 } | |
3629 | |
3630 vis_padd16(TMP18, CONST_1, TMP18); | |
3631 vis_mul8x16au(REF_S6, CONST_256, TMP22); | |
3632 | |
3633 vis_padd16(TMP20, CONST_1, TMP20); | |
3634 vis_mul8x16au(REF_S6_1, CONST_256, TMP24); | |
3635 | |
3636 vis_mul8x16au(REF_S0, CONST_256, TMP26); | |
3637 vis_pmerge(ZERO, REF_S0_1, TMP28); | |
3638 | |
3639 vis_mul8x16au(REF_S2, CONST_256, TMP30); | |
3640 vis_padd16(TMP18, TMP22, TMP18); | |
3641 | |
3642 vis_mul8x16au(REF_S2_1, CONST_256, TMP32); | |
3643 vis_padd16(TMP20, TMP24, TMP20); | |
3644 | |
3645 vis_padd16(TMP8, TMP18, TMP8); | |
3646 | |
3647 vis_padd16(TMP10, TMP20, TMP10); | |
3648 | |
3649 vis_padd16(TMP8, TMP12, TMP8); | |
3650 | |
3651 vis_padd16(TMP10, TMP14, TMP10); | |
3652 vis_pack16(TMP8, DST_0); | |
3653 | |
3654 vis_pack16(TMP10, DST_1); | |
3655 vis_st64(DST_0, dest[0]); | |
3656 dest += stride; | |
3657 vis_padd16(TMP18, TMP26, TMP18); | |
3658 | |
3659 vis_padd16(TMP20, TMP28, TMP20); | |
3660 | |
3661 vis_padd16(TMP18, TMP30, TMP18); | |
3662 | |
3663 vis_padd16(TMP20, TMP32, TMP20); | |
3664 vis_pack16(TMP18, DST_2); | |
3665 | |
3666 vis_pack16(TMP20, DST_3); | |
3667 vis_st64(DST_2, dest[0]); | |
3668 dest += stride; | |
3669 } while (--height); | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
3670 } |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
3671 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
3672 static void MC_avg_no_round_xy_16_vis (uint8_t * dest, const uint8_t * _ref, |
2979 | 3673 const int stride, int height) |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
3674 { |
2979 | 3675 uint8_t *ref = (uint8_t *) _ref; |
3676 unsigned long off = (unsigned long) ref & 0x7; | |
3677 unsigned long off_plus_1 = off + 1; | |
3678 int stride_8 = stride + 8; | |
3679 int stride_16 = stride + 16; | |
3680 | |
3681 vis_set_gsr(4 << VIS_GSR_SCALEFACT_SHIFT); | |
3682 | |
3683 ref = vis_alignaddr(ref); | |
3684 | |
3685 vis_ld64(ref[ 0], TMP0); | |
3686 vis_fzero(ZERO); | |
3687 | |
3688 vis_ld64(ref[ 8], TMP2); | |
3689 | |
3690 vis_ld64(ref[16], TMP4); | |
3691 | |
3692 vis_ld64(constants6[0], CONST_6); | |
3693 vis_faligndata(TMP0, TMP2, REF_S0); | |
3694 | |
3695 vis_ld64(constants256_1024[0], CONST_256); | |
3696 vis_faligndata(TMP2, TMP4, REF_S4); | |
3697 | |
3698 if (off != 0x7) { | |
3699 vis_alignaddr_g0((void *)off_plus_1); | |
3700 vis_faligndata(TMP0, TMP2, REF_S2); | |
3701 vis_faligndata(TMP2, TMP4, REF_S6); | |
3702 } else { | |
3703 vis_src1(TMP2, REF_S2); | |
3704 vis_src1(TMP4, REF_S6); | |
3705 } | |
3706 | |
3707 height >>= 1; | |
3708 do { /* 55 cycles */ | |
3709 vis_ld64_2(ref, stride, TMP0); | |
3710 vis_mul8x16au(REF_S0, CONST_256, TMP12); | |
3711 vis_pmerge(ZERO, REF_S0_1, TMP14); | |
3712 | |
3713 vis_alignaddr_g0((void *)off); | |
3714 | |
3715 vis_ld64_2(ref, stride_8, TMP2); | |
3716 vis_mul8x16au(REF_S2, CONST_256, TMP16); | |
3717 vis_pmerge(ZERO, REF_S2_1, TMP18); | |
3718 | |
3719 vis_ld64_2(ref, stride_16, TMP4); | |
3720 ref += stride; | |
3721 vis_mul8x16au(REF_S4, CONST_256, TMP20); | |
3722 vis_pmerge(ZERO, REF_S4_1, TMP22); | |
3723 | |
3724 vis_ld64_2(ref, stride, TMP6); | |
3725 vis_mul8x16au(REF_S6, CONST_256, TMP24); | |
3726 vis_pmerge(ZERO, REF_S6_1, TMP26); | |
3727 | |
3728 vis_ld64_2(ref, stride_8, TMP8); | |
3729 vis_faligndata(TMP0, TMP2, REF_0); | |
3730 | |
3731 vis_ld64_2(ref, stride_16, TMP10); | |
3732 ref += stride; | |
3733 vis_faligndata(TMP2, TMP4, REF_4); | |
3734 | |
3735 vis_ld64(dest[0], DST_0); | |
3736 vis_faligndata(TMP6, TMP8, REF_S0); | |
3737 | |
3738 vis_ld64_2(dest, 8, DST_2); | |
3739 vis_faligndata(TMP8, TMP10, REF_S4); | |
3740 | |
3741 if (off != 0x7) { | |
3742 vis_alignaddr_g0((void *)off_plus_1); | |
3743 vis_faligndata(TMP0, TMP2, REF_2); | |
3744 vis_faligndata(TMP2, TMP4, REF_6); | |
3745 vis_faligndata(TMP6, TMP8, REF_S2); | |
3746 vis_faligndata(TMP8, TMP10, REF_S6); | |
3747 } else { | |
3748 vis_src1(TMP2, REF_2); | |
3749 vis_src1(TMP4, REF_6); | |
3750 vis_src1(TMP8, REF_S2); | |
3751 vis_src1(TMP10, REF_S6); | |
3752 } | |
3753 | |
3754 vis_mul8x16al(DST_0, CONST_1024, TMP30); | |
3755 vis_pmerge(ZERO, REF_0, TMP0); | |
3756 | |
3757 vis_mul8x16al(DST_1, CONST_1024, TMP32); | |
3758 vis_pmerge(ZERO, REF_0_1, TMP2); | |
3759 | |
3760 vis_mul8x16au(REF_2, CONST_256, TMP4); | |
3761 vis_pmerge(ZERO, REF_2_1, TMP6); | |
3762 | |
3763 vis_mul8x16al(DST_2, CONST_1024, REF_0); | |
3764 vis_padd16(TMP0, CONST_6, TMP0); | |
3765 | |
3766 vis_mul8x16al(DST_3, CONST_1024, REF_2); | |
3767 vis_padd16(TMP2, CONST_6, TMP2); | |
3768 | |
3769 vis_padd16(TMP0, TMP4, TMP0); | |
3770 vis_mul8x16au(REF_4, CONST_256, TMP4); | |
3771 | |
3772 vis_padd16(TMP2, TMP6, TMP2); | |
3773 vis_mul8x16au(REF_4_1, CONST_256, TMP6); | |
3774 | |
3775 vis_padd16(TMP12, TMP0, TMP12); | |
3776 vis_mul8x16au(REF_6, CONST_256, TMP8); | |
3777 | |
3778 vis_padd16(TMP14, TMP2, TMP14); | |
3779 vis_mul8x16au(REF_6_1, CONST_256, TMP10); | |
3780 | |
3781 vis_padd16(TMP12, TMP16, TMP12); | |
3782 vis_mul8x16au(REF_S0, CONST_256, REF_4); | |
3783 | |
3784 vis_padd16(TMP14, TMP18, TMP14); | |
3785 vis_mul8x16au(REF_S0_1, CONST_256, REF_6); | |
3786 | |
3787 vis_padd16(TMP12, TMP30, TMP12); | |
3788 | |
3789 vis_padd16(TMP14, TMP32, TMP14); | |
3790 vis_pack16(TMP12, DST_0); | |
3791 | |
3792 vis_pack16(TMP14, DST_1); | |
3793 vis_st64(DST_0, dest[0]); | |
3794 vis_padd16(TMP4, CONST_6, TMP4); | |
3795 | |
3796 vis_ld64_2(dest, stride, DST_0); | |
3797 vis_padd16(TMP6, CONST_6, TMP6); | |
3798 vis_mul8x16au(REF_S2, CONST_256, TMP12); | |
3799 | |
3800 vis_padd16(TMP4, TMP8, TMP4); | |
3801 vis_mul8x16au(REF_S2_1, CONST_256, TMP14); | |
3802 | |
3803 vis_padd16(TMP6, TMP10, TMP6); | |
3804 | |
3805 vis_padd16(TMP20, TMP4, TMP20); | |
3806 | |
3807 vis_padd16(TMP22, TMP6, TMP22); | |
3808 | |
3809 vis_padd16(TMP20, TMP24, TMP20); | |
3810 | |
3811 vis_padd16(TMP22, TMP26, TMP22); | |
3812 | |
3813 vis_padd16(TMP20, REF_0, TMP20); | |
3814 vis_mul8x16au(REF_S4, CONST_256, REF_0); | |
3815 | |
3816 vis_padd16(TMP22, REF_2, TMP22); | |
3817 vis_pack16(TMP20, DST_2); | |
3818 | |
3819 vis_pack16(TMP22, DST_3); | |
3820 vis_st64_2(DST_2, dest, 8); | |
3821 dest += stride; | |
3822 | |
3823 vis_ld64_2(dest, 8, DST_2); | |
3824 vis_mul8x16al(DST_0, CONST_1024, TMP30); | |
3825 vis_pmerge(ZERO, REF_S4_1, REF_2); | |
3826 | |
3827 vis_mul8x16al(DST_1, CONST_1024, TMP32); | |
3828 vis_padd16(REF_4, TMP0, TMP8); | |
3829 | |
3830 vis_mul8x16au(REF_S6, CONST_256, REF_4); | |
3831 vis_padd16(REF_6, TMP2, TMP10); | |
3832 | |
3833 vis_mul8x16au(REF_S6_1, CONST_256, REF_6); | |
3834 vis_padd16(TMP8, TMP12, TMP8); | |
3835 | |
3836 vis_padd16(TMP10, TMP14, TMP10); | |
3837 | |
3838 vis_padd16(TMP8, TMP30, TMP8); | |
3839 | |
3840 vis_padd16(TMP10, TMP32, TMP10); | |
3841 vis_pack16(TMP8, DST_0); | |
3842 | |
3843 vis_pack16(TMP10, DST_1); | |
3844 vis_st64(DST_0, dest[0]); | |
3845 | |
3846 vis_padd16(REF_0, TMP4, REF_0); | |
3847 | |
3848 vis_mul8x16al(DST_2, CONST_1024, TMP30); | |
3849 vis_padd16(REF_2, TMP6, REF_2); | |
3850 | |
3851 vis_mul8x16al(DST_3, CONST_1024, TMP32); | |
3852 vis_padd16(REF_0, REF_4, REF_0); | |
3853 | |
3854 vis_padd16(REF_2, REF_6, REF_2); | |
3855 | |
3856 vis_padd16(REF_0, TMP30, REF_0); | |
3857 | |
3858 /* stall */ | |
3859 | |
3860 vis_padd16(REF_2, TMP32, REF_2); | |
3861 vis_pack16(REF_0, DST_2); | |
3862 | |
3863 vis_pack16(REF_2, DST_3); | |
3864 vis_st64_2(DST_2, dest, 8); | |
3865 dest += stride; | |
3866 } while (--height); | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
3867 } |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
3868 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
3869 static void MC_avg_no_round_xy_8_vis (uint8_t * dest, const uint8_t * _ref, |
2979 | 3870 const int stride, int height) |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
3871 { |
2979 | 3872 uint8_t *ref = (uint8_t *) _ref; |
3873 unsigned long off = (unsigned long) ref & 0x7; | |
3874 unsigned long off_plus_1 = off + 1; | |
3875 int stride_8 = stride + 8; | |
3876 | |
3877 vis_set_gsr(4 << VIS_GSR_SCALEFACT_SHIFT); | |
3878 | |
3879 ref = vis_alignaddr(ref); | |
3880 | |
3881 vis_ld64(ref[0], TMP0); | |
3882 vis_fzero(ZERO); | |
3883 | |
3884 vis_ld64_2(ref, 8, TMP2); | |
3885 | |
3886 vis_ld64(constants6[0], CONST_6); | |
3887 | |
3888 vis_ld64(constants256_1024[0], CONST_256); | |
3889 vis_faligndata(TMP0, TMP2, REF_S0); | |
3890 | |
3891 if (off != 0x7) { | |
3892 vis_alignaddr_g0((void *)off_plus_1); | |
3893 vis_faligndata(TMP0, TMP2, REF_S2); | |
3894 } else { | |
3895 vis_src1(TMP2, REF_S2); | |
3896 } | |
3897 | |
3898 height >>= 1; | |
3899 do { /* 31 cycles */ | |
3900 vis_ld64_2(ref, stride, TMP0); | |
3901 vis_mul8x16au(REF_S0, CONST_256, TMP8); | |
3902 vis_pmerge(ZERO, REF_S0_1, TMP10); | |
3903 | |
3904 vis_ld64_2(ref, stride_8, TMP2); | |
3905 ref += stride; | |
3906 vis_mul8x16au(REF_S2, CONST_256, TMP12); | |
3907 vis_pmerge(ZERO, REF_S2_1, TMP14); | |
3908 | |
3909 vis_alignaddr_g0((void *)off); | |
3910 | |
3911 vis_ld64_2(ref, stride, TMP4); | |
3912 vis_faligndata(TMP0, TMP2, REF_S4); | |
3913 | |
3914 vis_ld64_2(ref, stride_8, TMP6); | |
3915 ref += stride; | |
3916 | |
3917 vis_ld64(dest[0], DST_0); | |
3918 vis_faligndata(TMP4, TMP6, REF_S0); | |
3919 | |
3920 vis_ld64_2(dest, stride, DST_2); | |
3921 | |
3922 if (off != 0x7) { | |
3923 vis_alignaddr_g0((void *)off_plus_1); | |
3924 vis_faligndata(TMP0, TMP2, REF_S6); | |
3925 vis_faligndata(TMP4, TMP6, REF_S2); | |
3926 } else { | |
3927 vis_src1(TMP2, REF_S6); | |
3928 vis_src1(TMP6, REF_S2); | |
3929 } | |
3930 | |
3931 vis_mul8x16al(DST_0, CONST_1024, TMP30); | |
3932 vis_pmerge(ZERO, REF_S4, TMP22); | |
3933 | |
3934 vis_mul8x16al(DST_1, CONST_1024, TMP32); | |
3935 vis_pmerge(ZERO, REF_S4_1, TMP24); | |
3936 | |
3937 vis_mul8x16au(REF_S6, CONST_256, TMP26); | |
3938 vis_pmerge(ZERO, REF_S6_1, TMP28); | |
3939 | |
3940 vis_mul8x16au(REF_S0, CONST_256, REF_S4); | |
3941 vis_padd16(TMP22, CONST_6, TMP22); | |
3942 | |
3943 vis_mul8x16au(REF_S0_1, CONST_256, REF_S6); | |
3944 vis_padd16(TMP24, CONST_6, TMP24); | |
3945 | |
3946 vis_mul8x16al(DST_2, CONST_1024, REF_0); | |
3947 vis_padd16(TMP22, TMP26, TMP22); | |
3948 | |
3949 vis_mul8x16al(DST_3, CONST_1024, REF_2); | |
3950 vis_padd16(TMP24, TMP28, TMP24); | |
3951 | |
3952 vis_mul8x16au(REF_S2, CONST_256, TMP26); | |
3953 vis_padd16(TMP8, TMP22, TMP8); | |
3954 | |
3955 vis_mul8x16au(REF_S2_1, CONST_256, TMP28); | |
3956 vis_padd16(TMP10, TMP24, TMP10); | |
3957 | |
3958 vis_padd16(TMP8, TMP12, TMP8); | |
3959 | |
3960 vis_padd16(TMP10, TMP14, TMP10); | |
3961 | |
3962 vis_padd16(TMP8, TMP30, TMP8); | |
3963 | |
3964 vis_padd16(TMP10, TMP32, TMP10); | |
3965 vis_pack16(TMP8, DST_0); | |
3966 | |
3967 vis_pack16(TMP10, DST_1); | |
3968 vis_st64(DST_0, dest[0]); | |
3969 dest += stride; | |
3970 | |
3971 vis_padd16(REF_S4, TMP22, TMP12); | |
3972 | |
3973 vis_padd16(REF_S6, TMP24, TMP14); | |
3974 | |
3975 vis_padd16(TMP12, TMP26, TMP12); | |
3976 | |
3977 vis_padd16(TMP14, TMP28, TMP14); | |
3978 | |
3979 vis_padd16(TMP12, REF_0, TMP12); | |
3980 | |
3981 vis_padd16(TMP14, REF_2, TMP14); | |
3982 vis_pack16(TMP12, DST_2); | |
3983 | |
3984 vis_pack16(TMP14, DST_3); | |
3985 vis_st64(DST_2, dest[0]); | |
3986 dest += stride; | |
3987 } while (--height); | |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
3988 } |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
3989 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
3990 /* End of no rounding code */ |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
3991 |
1966
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
3992 static sigjmp_buf jmpbuf; |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
3993 static volatile sig_atomic_t canjump = 0; |
2967 | 3994 |
1966
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
3995 static void sigill_handler (int sig) |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
3996 { |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
3997 if (!canjump) { |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
3998 signal (sig, SIG_DFL); |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
3999 raise (sig); |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4000 } |
2361
8616fd2dd2ef
whitespace cleanup patch by (James A. Morrison <ja2morri>@<csclub>dot<uwaterloo>point<ca>)
michael
parents:
2136
diff
changeset
|
4001 |
1966
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4002 canjump = 0; |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4003 siglongjmp (jmpbuf, 1); |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4004 } |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4005 |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4006 #define ACCEL_SPARC_VIS 1 |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4007 #define ACCEL_SPARC_VIS2 2 |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4008 |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4009 static int vis_level () |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4010 { |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4011 int accel = 0; |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4012 |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4013 signal (SIGILL, sigill_handler); |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4014 if (sigsetjmp (jmpbuf, 1)) { |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4015 signal (SIGILL, SIG_DFL); |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4016 return accel; |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4017 } |
2967 | 4018 |
1966
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4019 canjump = 1; |
2967 | 4020 |
1966
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4021 /* pdist %f0, %f0, %f0 */ |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4022 __asm__ __volatile__(".word\t0x81b007c0"); |
2361
8616fd2dd2ef
whitespace cleanup patch by (James A. Morrison <ja2morri>@<csclub>dot<uwaterloo>point<ca>)
michael
parents:
2136
diff
changeset
|
4023 |
1966
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4024 canjump = 0; |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4025 accel |= ACCEL_SPARC_VIS; |
2361
8616fd2dd2ef
whitespace cleanup patch by (James A. Morrison <ja2morri>@<csclub>dot<uwaterloo>point<ca>)
michael
parents:
2136
diff
changeset
|
4026 |
1966
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4027 if (sigsetjmp (jmpbuf, 1)) { |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4028 signal (SIGILL, SIG_DFL); |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4029 return accel; |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4030 } |
2361
8616fd2dd2ef
whitespace cleanup patch by (James A. Morrison <ja2morri>@<csclub>dot<uwaterloo>point<ca>)
michael
parents:
2136
diff
changeset
|
4031 |
1966
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4032 canjump = 1; |
2361
8616fd2dd2ef
whitespace cleanup patch by (James A. Morrison <ja2morri>@<csclub>dot<uwaterloo>point<ca>)
michael
parents:
2136
diff
changeset
|
4033 |
1966
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4034 /* edge8n %g0, %g0, %g0 */ |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4035 __asm__ __volatile__(".word\t0x81b00020"); |
2361
8616fd2dd2ef
whitespace cleanup patch by (James A. Morrison <ja2morri>@<csclub>dot<uwaterloo>point<ca>)
michael
parents:
2136
diff
changeset
|
4036 |
1966
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4037 canjump = 0; |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4038 accel |= ACCEL_SPARC_VIS2; |
2361
8616fd2dd2ef
whitespace cleanup patch by (James A. Morrison <ja2morri>@<csclub>dot<uwaterloo>point<ca>)
michael
parents:
2136
diff
changeset
|
4039 |
1966
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4040 signal (SIGILL, SIG_DFL); |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4041 |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4042 return accel; |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4043 } |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4044 |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
4045 /* libavcodec initialization code */ |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
4046 void dsputil_init_vis(DSPContext* c, AVCodecContext *avctx) |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
4047 { |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
4048 /* VIS specific optimisations */ |
1966
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4049 int accel = vis_level (); |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4050 |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4051 if (accel & ACCEL_SPARC_VIS) { |
5618 | 4052 if(avctx->idct_algo==FF_IDCT_SIMPLEVIS){ |
4053 c->idct_put = ff_simple_idct_put_vis; | |
4054 c->idct_add = ff_simple_idct_add_vis; | |
4055 c->idct = ff_simple_idct_vis; | |
4056 c->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM; | |
4057 } | |
4058 | |
1966
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4059 c->put_pixels_tab[0][0] = MC_put_o_16_vis; |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4060 c->put_pixels_tab[0][1] = MC_put_x_16_vis; |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4061 c->put_pixels_tab[0][2] = MC_put_y_16_vis; |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4062 c->put_pixels_tab[0][3] = MC_put_xy_16_vis; |
2967 | 4063 |
1966
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4064 c->put_pixels_tab[1][0] = MC_put_o_8_vis; |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4065 c->put_pixels_tab[1][1] = MC_put_x_8_vis; |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4066 c->put_pixels_tab[1][2] = MC_put_y_8_vis; |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4067 c->put_pixels_tab[1][3] = MC_put_xy_8_vis; |
2967 | 4068 |
1966
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4069 c->avg_pixels_tab[0][0] = MC_avg_o_16_vis; |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4070 c->avg_pixels_tab[0][1] = MC_avg_x_16_vis; |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4071 c->avg_pixels_tab[0][2] = MC_avg_y_16_vis; |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4072 c->avg_pixels_tab[0][3] = MC_avg_xy_16_vis; |
2967 | 4073 |
1966
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4074 c->avg_pixels_tab[1][0] = MC_avg_o_8_vis; |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4075 c->avg_pixels_tab[1][1] = MC_avg_x_8_vis; |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4076 c->avg_pixels_tab[1][2] = MC_avg_y_8_vis; |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4077 c->avg_pixels_tab[1][3] = MC_avg_xy_8_vis; |
2967 | 4078 |
1966
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4079 c->put_no_rnd_pixels_tab[0][0] = MC_put_no_round_o_16_vis; |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4080 c->put_no_rnd_pixels_tab[0][1] = MC_put_no_round_x_16_vis; |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4081 c->put_no_rnd_pixels_tab[0][2] = MC_put_no_round_y_16_vis; |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4082 c->put_no_rnd_pixels_tab[0][3] = MC_put_no_round_xy_16_vis; |
2967 | 4083 |
1966
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4084 c->put_no_rnd_pixels_tab[1][0] = MC_put_no_round_o_8_vis; |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4085 c->put_no_rnd_pixels_tab[1][1] = MC_put_no_round_x_8_vis; |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4086 c->put_no_rnd_pixels_tab[1][2] = MC_put_no_round_y_8_vis; |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4087 c->put_no_rnd_pixels_tab[1][3] = MC_put_no_round_xy_8_vis; |
2967 | 4088 |
1966
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4089 c->avg_no_rnd_pixels_tab[0][0] = MC_avg_no_round_o_16_vis; |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4090 c->avg_no_rnd_pixels_tab[0][1] = MC_avg_no_round_x_16_vis; |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4091 c->avg_no_rnd_pixels_tab[0][2] = MC_avg_no_round_y_16_vis; |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4092 c->avg_no_rnd_pixels_tab[0][3] = MC_avg_no_round_xy_16_vis; |
2967 | 4093 |
1966
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4094 c->avg_no_rnd_pixels_tab[1][0] = MC_avg_no_round_o_8_vis; |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4095 c->avg_no_rnd_pixels_tab[1][1] = MC_avg_no_round_x_8_vis; |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4096 c->avg_no_rnd_pixels_tab[1][2] = MC_avg_no_round_y_8_vis; |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4097 c->avg_no_rnd_pixels_tab[1][3] = MC_avg_no_round_xy_8_vis; |
e1fc7c598558
License change and cpu detection patch by (James Morrison <ja2morri at csclub dot uwaterloo dot ca>)
michael
parents:
1959
diff
changeset
|
4098 } |
1959
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
4099 } |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
4100 |
55b7435c59b8
VIS optimized motion compensation code. by (David S. Miller <davem at redhat dot com>)
michael
parents:
diff
changeset
|
4101 #endif /* !(ARCH_SPARC) */ |