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