annotate libmpeg2/motion_comp_vis.c @ 28596:e5f8eec12e5c

Also set HAVE_EBP_AVAILABLE in debug mode. patch by Gwenole Beauchesne, gbeauchesne splitted-desktop com
author diego
date Tue, 17 Feb 2009 11:40:59 +0000
parents 25337a2147e7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12932
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1 /*
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2 * motion_comp_vis.c
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
3 * Copyright (C) 2003 David S. Miller <davem@redhat.com>
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
4 *
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
5 * This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
6 * See http://libmpeg2.sourceforge.net/ for updates.
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
7 *
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
8 * mpeg2dec is free software; you can redistribute it and/or modify
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
11 * (at your option) any later version.
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
12 *
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
13 * mpeg2dec is distributed in the hope that it will be useful,
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
16 * GNU General Public License for more details.
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
17 *
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
19 * along with this program; if not, write to the Free Software
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
21 */
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
22
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
23 #include "config.h"
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
24
28290
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 12932
diff changeset
25 #if ARCH_SPARC
12932
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
26
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
27 #include <inttypes.h>
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
28
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
29 #include "mpeg2.h"
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
30 #include "attributes.h"
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
31 #include "mpeg2_internal.h"
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
32 #include "vis.h"
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
33
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
34 /* The trick used in some of this file is the formula from the MMX
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
35 * motion comp code, which is:
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
36 *
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
37 * (x+y+1)>>1 == (x|y)-((x^y)>>1)
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
38 *
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
39 * This allows us to average 8 bytes at a time in a 64-bit FPU reg.
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
40 * We avoid overflows by masking before we do the shift, and we
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
41 * implement the shift by multiplying by 1/2 using mul8x16. So in
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
42 * VIS this is (assume 'x' is in f0, 'y' is in f2, a repeating mask
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
43 * of '0xfe' is in f4, a repeating mask of '0x7f' is in f6, and
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
44 * the value 0x80808080 is in f8):
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
45 *
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
46 * fxor f0, f2, f10
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
47 * fand f10, f4, f10
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
48 * fmul8x16 f8, f10, f10
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
49 * fand f10, f6, f10
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
50 * for f0, f2, f12
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
51 * fpsub16 f12, f10, f10
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
52 */
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
53
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
54 #define DUP4(x) {x, x, x, x}
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
55 #define DUP8(x) {x, x, x, x, x, x, x, x}
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
56 static const int16_t constants1[] ATTR_ALIGN(8) = DUP4 (1);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
57 static const int16_t constants2[] ATTR_ALIGN(8) = DUP4 (2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
58 static const int16_t constants3[] ATTR_ALIGN(8) = DUP4 (3);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
59 static const int16_t constants6[] ATTR_ALIGN(8) = DUP4 (6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
60 static const int8_t constants_fe[] ATTR_ALIGN(8) = DUP8 (0xfe);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
61 static const int8_t constants_7f[] ATTR_ALIGN(8) = DUP8 (0x7f);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
62 static const int8_t constants128[] ATTR_ALIGN(8) = DUP8 (128);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
63 static const int16_t constants256_512[] ATTR_ALIGN(8) =
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
64 {256, 512, 256, 512};
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
65 static const int16_t constants256_1024[] ATTR_ALIGN(8) =
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
66 {256, 1024, 256, 1024};
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
67
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
68 #define REF_0 0
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
69 #define REF_0_1 1
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
70 #define REF_2 2
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
71 #define REF_2_1 3
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
72 #define REF_4 4
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
73 #define REF_4_1 5
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
74 #define REF_6 6
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
75 #define REF_6_1 7
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
76 #define REF_S0 8
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
77 #define REF_S0_1 9
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
78 #define REF_S2 10
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
79 #define REF_S2_1 11
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
80 #define REF_S4 12
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
81 #define REF_S4_1 13
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
82 #define REF_S6 14
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
83 #define REF_S6_1 15
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
84 #define DST_0 16
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
85 #define DST_1 17
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
86 #define DST_2 18
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
87 #define DST_3 19
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
88 #define CONST_1 20
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
89 #define CONST_2 20
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
90 #define CONST_3 20
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
91 #define CONST_6 20
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
92 #define MASK_fe 20
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
93 #define CONST_128 22
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
94 #define CONST_256 22
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
95 #define CONST_512 22
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
96 #define CONST_1024 22
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
97 #define TMP0 24
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
98 #define TMP1 25
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
99 #define TMP2 26
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
100 #define TMP3 27
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
101 #define TMP4 28
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
102 #define TMP5 29
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
103 #define ZERO 30
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
104 #define MASK_7f 30
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
105
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
106 #define TMP6 32
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
107 #define TMP8 34
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
108 #define TMP10 36
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
109 #define TMP12 38
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
110 #define TMP14 40
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
111 #define TMP16 42
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
112 #define TMP18 44
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
113 #define TMP20 46
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
114 #define TMP22 48
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
115 #define TMP24 50
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
116 #define TMP26 52
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
117 #define TMP28 54
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
118 #define TMP30 56
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
119 #define TMP32 58
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
120
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
121 static void MC_put_o_16_vis (uint8_t * dest, const uint8_t * _ref,
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
122 const int stride, int height)
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
123 {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
124 uint8_t *ref = (uint8_t *) _ref;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
125 int offset;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
126
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
127 ref = vis_alignaddr(ref);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
128 offset = (ref != _ref) ? 16 : 0;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
129 do { /* 5 cycles */
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
130 vis_ld64(ref[0], TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
131
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
132 vis_ld64_2(ref, 8, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
133
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
134 vis_ld64_2(ref, offset, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
135 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
136
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
137 vis_faligndata(TMP0, TMP2, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
138 vis_st64(REF_0, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
139
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
140 vis_faligndata(TMP2, TMP4, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
141 vis_st64_2(REF_2, dest, 8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
142 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
143 } while (--height);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
144 }
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
145
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
146 static void MC_put_o_8_vis (uint8_t * dest, const uint8_t * _ref,
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
147 const int stride, int height)
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
148 {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
149 uint8_t *ref = (uint8_t *) _ref;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
150 int offset;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
151
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
152 ref = vis_alignaddr(ref);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
153 offset = (ref != _ref) ? 8 : 0;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
154 do { /* 4 cycles */
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
155 vis_ld64(ref[0], TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
156
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
157 vis_ld64_2(ref, offset, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
158 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
159
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
160 /* stall */
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
161
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
162 vis_faligndata(TMP0, TMP2, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
163 vis_st64(REF_0, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
164 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
165 } while (--height);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
166 }
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
167
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
168
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
169 static void MC_avg_o_16_vis (uint8_t * dest, const uint8_t * _ref,
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
170 const int stride, int height)
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
171 {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
172 uint8_t *ref = (uint8_t *) _ref;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
173 int stride_8 = stride + 8;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
174 int offset;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
175
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
176 ref = vis_alignaddr(ref);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
177 offset = (ref != _ref) ? 16 : 0;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
178
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
179 vis_ld64(ref[0], TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
180
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
181 vis_ld64(ref[8], TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
182
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
183 vis_ld64_2(ref, offset, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
184
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
185 vis_ld64(dest[0], DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
186
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
187 vis_ld64(dest[8], DST_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
188
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
189 vis_ld64(constants_fe[0], MASK_fe);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
190 vis_faligndata(TMP0, TMP2, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
191
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
192 vis_ld64(constants_7f[0], MASK_7f);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
193 vis_faligndata(TMP2, TMP4, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
194
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
195 vis_ld64(constants128[0], CONST_128);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
196
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
197 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
198 height = (height >> 1) - 1;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
199
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
200 do { /* 24 cycles */
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
201 vis_ld64(ref[0], TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
202 vis_xor(DST_0, REF_0, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
203
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
204 vis_ld64_2(ref, 8, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
205 vis_and(TMP6, MASK_fe, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
206
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
207 vis_ld64_2(ref, offset, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
208 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
209 vis_mul8x16(CONST_128, TMP6, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
210 vis_xor(DST_2, REF_2, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
211
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
212 vis_and(TMP8, MASK_fe, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
213
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
214 vis_or(DST_0, REF_0, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
215 vis_ld64_2(dest, stride, DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
216 vis_mul8x16(CONST_128, TMP8, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
217
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
218 vis_or(DST_2, REF_2, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
219 vis_ld64_2(dest, stride_8, DST_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
220
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
221 vis_ld64(ref[0], TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
222 vis_and(TMP6, MASK_7f, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
223
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
224 vis_and(TMP8, MASK_7f, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
225
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
226 vis_psub16(TMP10, TMP6, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
227 vis_st64(TMP6, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
228
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
229 vis_psub16(TMP12, TMP8, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
230 vis_st64_2(TMP8, dest, 8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
231
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
232 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
233 vis_ld64_2(ref, 8, TMP16);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
234 vis_faligndata(TMP0, TMP2, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
235
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
236 vis_ld64_2(ref, offset, TMP18);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
237 vis_faligndata(TMP2, TMP4, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
238 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
239
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
240 vis_xor(DST_0, REF_0, TMP20);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
241
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
242 vis_and(TMP20, MASK_fe, TMP20);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
243
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
244 vis_xor(DST_2, REF_2, TMP22);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
245 vis_mul8x16(CONST_128, TMP20, TMP20);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
246
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
247 vis_and(TMP22, MASK_fe, TMP22);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
248
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
249 vis_or(DST_0, REF_0, TMP24);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
250 vis_mul8x16(CONST_128, TMP22, TMP22);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
251
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
252 vis_or(DST_2, REF_2, TMP26);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
253
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
254 vis_ld64_2(dest, stride, DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
255 vis_faligndata(TMP14, TMP16, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
256
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
257 vis_ld64_2(dest, stride_8, DST_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
258 vis_faligndata(TMP16, TMP18, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
259
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
260 vis_and(TMP20, MASK_7f, TMP20);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
261
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
262 vis_and(TMP22, MASK_7f, TMP22);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
263
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
264 vis_psub16(TMP24, TMP20, TMP20);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
265 vis_st64(TMP20, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
266
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
267 vis_psub16(TMP26, TMP22, TMP22);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
268 vis_st64_2(TMP22, dest, 8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
269 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
270 } while (--height);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
271
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
272 vis_ld64(ref[0], TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
273 vis_xor(DST_0, REF_0, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
274
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
275 vis_ld64_2(ref, 8, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
276 vis_and(TMP6, MASK_fe, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
277
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
278 vis_ld64_2(ref, offset, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
279 vis_mul8x16(CONST_128, TMP6, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
280 vis_xor(DST_2, REF_2, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
281
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
282 vis_and(TMP8, MASK_fe, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
283
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
284 vis_or(DST_0, REF_0, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
285 vis_ld64_2(dest, stride, DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
286 vis_mul8x16(CONST_128, TMP8, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
287
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
288 vis_or(DST_2, REF_2, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
289 vis_ld64_2(dest, stride_8, DST_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
290
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
291 vis_ld64(ref[0], TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
292 vis_and(TMP6, MASK_7f, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
293
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
294 vis_and(TMP8, MASK_7f, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
295
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
296 vis_psub16(TMP10, TMP6, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
297 vis_st64(TMP6, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
298
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
299 vis_psub16(TMP12, TMP8, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
300 vis_st64_2(TMP8, dest, 8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
301
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
302 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
303 vis_faligndata(TMP0, TMP2, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
304
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
305 vis_faligndata(TMP2, TMP4, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
306
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
307 vis_xor(DST_0, REF_0, TMP20);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
308
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
309 vis_and(TMP20, MASK_fe, TMP20);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
310
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
311 vis_xor(DST_2, REF_2, TMP22);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
312 vis_mul8x16(CONST_128, TMP20, TMP20);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
313
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
314 vis_and(TMP22, MASK_fe, TMP22);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
315
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
316 vis_or(DST_0, REF_0, TMP24);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
317 vis_mul8x16(CONST_128, TMP22, TMP22);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
318
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
319 vis_or(DST_2, REF_2, TMP26);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
320
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
321 vis_and(TMP20, MASK_7f, TMP20);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
322
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
323 vis_and(TMP22, MASK_7f, TMP22);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
324
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
325 vis_psub16(TMP24, TMP20, TMP20);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
326 vis_st64(TMP20, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
327
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
328 vis_psub16(TMP26, TMP22, TMP22);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
329 vis_st64_2(TMP22, dest, 8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
330 }
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
331
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
332 static void MC_avg_o_8_vis (uint8_t * dest, const uint8_t * _ref,
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
333 const int stride, int height)
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
334 {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
335 uint8_t *ref = (uint8_t *) _ref;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
336 int offset;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
337
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
338 ref = vis_alignaddr(ref);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
339 offset = (ref != _ref) ? 8 : 0;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
340
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
341 vis_ld64(ref[0], TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
342
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
343 vis_ld64_2(ref, offset, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
344
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
345 vis_ld64(dest[0], DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
346
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
347 vis_ld64(constants_fe[0], MASK_fe);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
348
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
349 vis_ld64(constants_7f[0], MASK_7f);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
350 vis_faligndata(TMP0, TMP2, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
351
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
352 vis_ld64(constants128[0], CONST_128);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
353
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
354 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
355 height = (height >> 1) - 1;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
356
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
357 do { /* 12 cycles */
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
358 vis_ld64(ref[0], TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
359 vis_xor(DST_0, REF_0, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
360
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
361 vis_ld64_2(ref, offset, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
362 vis_and(TMP4, MASK_fe, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
363
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
364 vis_or(DST_0, REF_0, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
365 vis_ld64_2(dest, stride, DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
366 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
367 vis_mul8x16(CONST_128, TMP4, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
368
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
369 vis_ld64(ref[0], TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
370 vis_faligndata(TMP0, TMP2, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
371
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
372 vis_ld64_2(ref, offset, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
373 vis_xor(DST_0, REF_0, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
374 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
375
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
376 vis_and(TMP0, MASK_fe, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
377
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
378 vis_and(TMP4, MASK_7f, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
379
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
380 vis_psub16(TMP6, TMP4, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
381 vis_st64(TMP4, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
382 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
383 vis_mul8x16(CONST_128, TMP0, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
384
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
385 vis_or(DST_0, REF_0, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
386 vis_ld64_2(dest, stride, DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
387
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
388 vis_faligndata(TMP12, TMP2, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
389
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
390 vis_and(TMP0, MASK_7f, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
391
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
392 vis_psub16(TMP6, TMP0, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
393 vis_st64(TMP4, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
394 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
395 } while (--height);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
396
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
397 vis_ld64(ref[0], TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
398 vis_xor(DST_0, REF_0, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
399
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
400 vis_ld64_2(ref, offset, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
401 vis_and(TMP4, MASK_fe, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
402
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
403 vis_or(DST_0, REF_0, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
404 vis_ld64_2(dest, stride, DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
405 vis_mul8x16(CONST_128, TMP4, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
406
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
407 vis_faligndata(TMP0, TMP2, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
408
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
409 vis_xor(DST_0, REF_0, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
410
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
411 vis_and(TMP0, MASK_fe, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
412
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
413 vis_and(TMP4, MASK_7f, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
414
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
415 vis_psub16(TMP6, TMP4, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
416 vis_st64(TMP4, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
417 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
418 vis_mul8x16(CONST_128, TMP0, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
419
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
420 vis_or(DST_0, REF_0, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
421
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
422 vis_and(TMP0, MASK_7f, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
423
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
424 vis_psub16(TMP6, TMP0, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
425 vis_st64(TMP4, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
426 }
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
427
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
428 static void MC_put_x_16_vis (uint8_t * dest, const uint8_t * _ref,
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
429 const int stride, int height)
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
430 {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
431 uint8_t *ref = (uint8_t *) _ref;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
432 unsigned long off = (unsigned long) ref & 0x7;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
433 unsigned long off_plus_1 = off + 1;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
434
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
435 ref = vis_alignaddr(ref);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
436
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
437 vis_ld64(ref[0], TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
438
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
439 vis_ld64_2(ref, 8, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
440
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
441 vis_ld64_2(ref, 16, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
442
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
443 vis_ld64(constants_fe[0], MASK_fe);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
444
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
445 vis_ld64(constants_7f[0], MASK_7f);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
446 vis_faligndata(TMP0, TMP2, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
447
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
448 vis_ld64(constants128[0], CONST_128);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
449 vis_faligndata(TMP2, TMP4, REF_4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
450
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
451 if (off != 0x7) {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
452 vis_alignaddr_g0((void *)off_plus_1);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
453 vis_faligndata(TMP0, TMP2, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
454 vis_faligndata(TMP2, TMP4, REF_6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
455 } else {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
456 vis_src1(TMP2, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
457 vis_src1(TMP4, REF_6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
458 }
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
459
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
460 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
461 height = (height >> 1) - 1;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
462
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
463 do { /* 34 cycles */
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
464 vis_ld64(ref[0], TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
465 vis_xor(REF_0, REF_2, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
466
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
467 vis_ld64_2(ref, 8, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
468 vis_xor(REF_4, REF_6, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
469
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
470 vis_ld64_2(ref, 16, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
471 vis_and(TMP6, MASK_fe, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
472 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
473
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
474 vis_ld64(ref[0], TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
475 vis_mul8x16(CONST_128, TMP6, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
476 vis_and(TMP8, MASK_fe, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
477
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
478 vis_ld64_2(ref, 8, TMP16);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
479 vis_mul8x16(CONST_128, TMP8, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
480 vis_or(REF_0, REF_2, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
481
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
482 vis_ld64_2(ref, 16, TMP18);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
483 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
484 vis_or(REF_4, REF_6, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
485
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
486 vis_alignaddr_g0((void *)off);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
487
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
488 vis_faligndata(TMP0, TMP2, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
489
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
490 vis_faligndata(TMP2, TMP4, REF_4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
491
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
492 if (off != 0x7) {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
493 vis_alignaddr_g0((void *)off_plus_1);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
494 vis_faligndata(TMP0, TMP2, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
495 vis_faligndata(TMP2, TMP4, REF_6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
496 } else {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
497 vis_src1(TMP2, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
498 vis_src1(TMP4, REF_6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
499 }
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
500
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
501 vis_and(TMP6, MASK_7f, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
502
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
503 vis_and(TMP8, MASK_7f, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
504
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
505 vis_psub16(TMP10, TMP6, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
506 vis_st64(TMP6, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
507
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
508 vis_psub16(TMP12, TMP8, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
509 vis_st64_2(TMP8, dest, 8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
510 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
511
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
512 vis_xor(REF_0, REF_2, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
513
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
514 vis_xor(REF_4, REF_6, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
515
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
516 vis_and(TMP6, MASK_fe, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
517
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
518 vis_mul8x16(CONST_128, TMP6, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
519 vis_and(TMP8, MASK_fe, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
520
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
521 vis_mul8x16(CONST_128, TMP8, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
522 vis_or(REF_0, REF_2, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
523
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
524 vis_or(REF_4, REF_6, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
525
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
526 vis_alignaddr_g0((void *)off);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
527
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
528 vis_faligndata(TMP14, TMP16, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
529
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
530 vis_faligndata(TMP16, TMP18, REF_4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
531
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
532 if (off != 0x7) {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
533 vis_alignaddr_g0((void *)off_plus_1);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
534 vis_faligndata(TMP14, TMP16, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
535 vis_faligndata(TMP16, TMP18, REF_6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
536 } else {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
537 vis_src1(TMP16, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
538 vis_src1(TMP18, REF_6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
539 }
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
540
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
541 vis_and(TMP6, MASK_7f, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
542
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
543 vis_and(TMP8, MASK_7f, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
544
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
545 vis_psub16(TMP10, TMP6, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
546 vis_st64(TMP6, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
547
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
548 vis_psub16(TMP12, TMP8, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
549 vis_st64_2(TMP8, dest, 8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
550 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
551 } while (--height);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
552
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
553 vis_ld64(ref[0], TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
554 vis_xor(REF_0, REF_2, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
555
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
556 vis_ld64_2(ref, 8, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
557 vis_xor(REF_4, REF_6, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
558
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
559 vis_ld64_2(ref, 16, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
560 vis_and(TMP6, MASK_fe, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
561
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
562 vis_mul8x16(CONST_128, TMP6, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
563 vis_and(TMP8, MASK_fe, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
564
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
565 vis_mul8x16(CONST_128, TMP8, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
566 vis_or(REF_0, REF_2, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
567
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
568 vis_or(REF_4, REF_6, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
569
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
570 vis_alignaddr_g0((void *)off);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
571
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
572 vis_faligndata(TMP0, TMP2, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
573
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
574 vis_faligndata(TMP2, TMP4, REF_4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
575
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
576 if (off != 0x7) {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
577 vis_alignaddr_g0((void *)off_plus_1);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
578 vis_faligndata(TMP0, TMP2, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
579 vis_faligndata(TMP2, TMP4, REF_6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
580 } else {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
581 vis_src1(TMP2, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
582 vis_src1(TMP4, REF_6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
583 }
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
584
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
585 vis_and(TMP6, MASK_7f, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
586
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
587 vis_and(TMP8, MASK_7f, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
588
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
589 vis_psub16(TMP10, TMP6, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
590 vis_st64(TMP6, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
591
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
592 vis_psub16(TMP12, TMP8, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
593 vis_st64_2(TMP8, dest, 8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
594 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
595
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
596 vis_xor(REF_0, REF_2, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
597
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
598 vis_xor(REF_4, REF_6, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
599
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
600 vis_and(TMP6, MASK_fe, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
601
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
602 vis_mul8x16(CONST_128, TMP6, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
603 vis_and(TMP8, MASK_fe, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
604
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
605 vis_mul8x16(CONST_128, TMP8, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
606 vis_or(REF_0, REF_2, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
607
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
608 vis_or(REF_4, REF_6, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
609
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
610 vis_and(TMP6, MASK_7f, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
611
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
612 vis_and(TMP8, MASK_7f, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
613
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
614 vis_psub16(TMP10, TMP6, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
615 vis_st64(TMP6, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
616
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
617 vis_psub16(TMP12, TMP8, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
618 vis_st64_2(TMP8, dest, 8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
619 }
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
620
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
621 static void MC_put_x_8_vis (uint8_t * dest, const uint8_t * _ref,
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
622 const int stride, int height)
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
623 {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
624 uint8_t *ref = (uint8_t *) _ref;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
625 unsigned long off = (unsigned long) ref & 0x7;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
626 unsigned long off_plus_1 = off + 1;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
627
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
628 ref = vis_alignaddr(ref);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
629
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
630 vis_ld64(ref[0], TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
631
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
632 vis_ld64(ref[8], TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
633
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
634 vis_ld64(constants_fe[0], MASK_fe);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
635
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
636 vis_ld64(constants_7f[0], MASK_7f);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
637
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
638 vis_ld64(constants128[0], CONST_128);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
639 vis_faligndata(TMP0, TMP2, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
640
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
641 if (off != 0x7) {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
642 vis_alignaddr_g0((void *)off_plus_1);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
643 vis_faligndata(TMP0, TMP2, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
644 } else {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
645 vis_src1(TMP2, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
646 }
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
647
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
648 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
649 height = (height >> 1) - 1;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
650
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
651 do { /* 20 cycles */
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
652 vis_ld64(ref[0], TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
653 vis_xor(REF_0, REF_2, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
654
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
655 vis_ld64_2(ref, 8, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
656 vis_and(TMP4, MASK_fe, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
657 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
658
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
659 vis_ld64(ref[0], TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
660 vis_or(REF_0, REF_2, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
661 vis_mul8x16(CONST_128, TMP4, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
662
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
663 vis_alignaddr_g0((void *)off);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
664
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
665 vis_ld64_2(ref, 8, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
666 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
667 vis_faligndata(TMP0, TMP2, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
668
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
669 if (off != 0x7) {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
670 vis_alignaddr_g0((void *)off_plus_1);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
671 vis_faligndata(TMP0, TMP2, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
672 } else {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
673 vis_src1(TMP2, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
674 }
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
675
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
676 vis_and(TMP4, MASK_7f, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
677
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
678 vis_psub16(TMP6, TMP4, DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
679 vis_st64(DST_0, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
680 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
681
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
682 vis_xor(REF_0, REF_2, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
683
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
684 vis_and(TMP12, MASK_fe, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
685
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
686 vis_or(REF_0, REF_2, TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
687 vis_mul8x16(CONST_128, TMP12, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
688
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
689 vis_alignaddr_g0((void *)off);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
690 vis_faligndata(TMP8, TMP10, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
691 if (off != 0x7) {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
692 vis_alignaddr_g0((void *)off_plus_1);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
693 vis_faligndata(TMP8, TMP10, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
694 } else {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
695 vis_src1(TMP10, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
696 }
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
697
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
698 vis_and(TMP12, MASK_7f, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
699
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
700 vis_psub16(TMP14, TMP12, DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
701 vis_st64(DST_0, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
702 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
703 } while (--height);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
704
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
705 vis_ld64(ref[0], TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
706 vis_xor(REF_0, REF_2, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
707
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
708 vis_ld64_2(ref, 8, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
709 vis_and(TMP4, MASK_fe, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
710
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
711 vis_or(REF_0, REF_2, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
712 vis_mul8x16(CONST_128, TMP4, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
713
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
714 vis_alignaddr_g0((void *)off);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
715
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
716 vis_faligndata(TMP0, TMP2, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
717
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
718 if (off != 0x7) {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
719 vis_alignaddr_g0((void *)off_plus_1);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
720 vis_faligndata(TMP0, TMP2, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
721 } else {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
722 vis_src1(TMP2, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
723 }
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
724
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
725 vis_and(TMP4, MASK_7f, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
726
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
727 vis_psub16(TMP6, TMP4, DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
728 vis_st64(DST_0, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
729 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
730
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
731 vis_xor(REF_0, REF_2, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
732
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
733 vis_and(TMP12, MASK_fe, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
734
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
735 vis_or(REF_0, REF_2, TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
736 vis_mul8x16(CONST_128, TMP12, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
737
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
738 vis_and(TMP12, MASK_7f, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
739
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
740 vis_psub16(TMP14, TMP12, DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
741 vis_st64(DST_0, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
742 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
743 }
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
744
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
745 static void MC_avg_x_16_vis (uint8_t * dest, const uint8_t * _ref,
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
746 const int stride, int height)
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
747 {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
748 uint8_t *ref = (uint8_t *) _ref;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
749 unsigned long off = (unsigned long) ref & 0x7;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
750 unsigned long off_plus_1 = off + 1;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
751
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
752 vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
753
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
754 vis_ld64(constants3[0], CONST_3);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
755 vis_fzero(ZERO);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
756 vis_ld64(constants256_512[0], CONST_256);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
757
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
758 ref = vis_alignaddr(ref);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
759 do { /* 26 cycles */
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
760 vis_ld64(ref[0], TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
761
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
762 vis_ld64(ref[8], TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
763
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
764 vis_alignaddr_g0((void *)off);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
765
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
766 vis_ld64(ref[16], TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
767
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
768 vis_ld64(dest[0], DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
769 vis_faligndata(TMP0, TMP2, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
770
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
771 vis_ld64(dest[8], DST_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
772 vis_faligndata(TMP2, TMP4, REF_4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
773
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
774 if (off != 0x7) {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
775 vis_alignaddr_g0((void *)off_plus_1);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
776 vis_faligndata(TMP0, TMP2, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
777 vis_faligndata(TMP2, TMP4, REF_6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
778 } else {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
779 vis_src1(TMP2, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
780 vis_src1(TMP4, REF_6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
781 }
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
782
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
783 vis_mul8x16au(REF_0, CONST_256, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
784
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
785 vis_pmerge(ZERO, REF_2, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
786 vis_mul8x16au(REF_0_1, CONST_256, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
787
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
788 vis_pmerge(ZERO, REF_2_1, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
789
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
790 vis_padd16(TMP0, TMP4, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
791
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
792 vis_mul8x16al(DST_0, CONST_512, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
793 vis_padd16(TMP2, TMP6, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
794
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
795 vis_mul8x16al(DST_1, CONST_512, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
796
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
797 vis_mul8x16au(REF_6, CONST_256, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
798
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
799 vis_padd16(TMP0, TMP4, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
800 vis_mul8x16au(REF_6_1, CONST_256, TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
801
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
802 vis_padd16(TMP2, TMP6, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
803 vis_mul8x16au(REF_4, CONST_256, TMP16);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
804
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
805 vis_padd16(TMP0, CONST_3, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
806 vis_mul8x16au(REF_4_1, CONST_256, TMP18);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
807
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
808 vis_padd16(TMP2, CONST_3, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
809 vis_pack16(TMP8, DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
810
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
811 vis_pack16(TMP10, DST_1);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
812 vis_padd16(TMP16, TMP12, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
813
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
814 vis_st64(DST_0, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
815 vis_mul8x16al(DST_2, CONST_512, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
816 vis_padd16(TMP18, TMP14, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
817
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
818 vis_mul8x16al(DST_3, CONST_512, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
819 vis_padd16(TMP0, CONST_3, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
820
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
821 vis_padd16(TMP2, CONST_3, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
822
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
823 vis_padd16(TMP0, TMP4, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
824
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
825 vis_padd16(TMP2, TMP6, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
826 vis_pack16(TMP0, DST_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
827
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
828 vis_pack16(TMP2, DST_3);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
829 vis_st64(DST_2, dest[8]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
830
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
831 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
832 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
833 } while (--height);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
834 }
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
835
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
836 static void MC_avg_x_8_vis (uint8_t * dest, const uint8_t * _ref,
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
837 const int stride, int height)
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
838 {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
839 uint8_t *ref = (uint8_t *) _ref;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
840 unsigned long off = (unsigned long) ref & 0x7;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
841 unsigned long off_plus_1 = off + 1;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
842 int stride_times_2 = stride << 1;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
843
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
844 vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
845
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
846 vis_ld64(constants3[0], CONST_3);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
847 vis_fzero(ZERO);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
848 vis_ld64(constants256_512[0], CONST_256);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
849
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
850 ref = vis_alignaddr(ref);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
851 height >>= 2;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
852 do { /* 47 cycles */
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
853 vis_ld64(ref[0], TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
854
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
855 vis_ld64_2(ref, 8, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
856 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
857
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
858 vis_alignaddr_g0((void *)off);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
859
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
860 vis_ld64(ref[0], TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
861 vis_faligndata(TMP0, TMP2, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
862
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
863 vis_ld64_2(ref, 8, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
864 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
865
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
866 vis_ld64(ref[0], TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
867
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
868 vis_ld64_2(ref, 8, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
869 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
870 vis_faligndata(TMP4, TMP6, REF_4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
871
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
872 vis_ld64(ref[0], TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
873
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
874 vis_ld64_2(ref, 8, TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
875 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
876 vis_faligndata(TMP8, TMP10, REF_S0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
877
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
878 vis_faligndata(TMP12, TMP14, REF_S4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
879
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
880 if (off != 0x7) {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
881 vis_alignaddr_g0((void *)off_plus_1);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
882
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
883 vis_ld64(dest[0], DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
884 vis_faligndata(TMP0, TMP2, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
885
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
886 vis_ld64_2(dest, stride, DST_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
887 vis_faligndata(TMP4, TMP6, REF_6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
888
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
889 vis_faligndata(TMP8, TMP10, REF_S2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
890
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
891 vis_faligndata(TMP12, TMP14, REF_S6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
892 } else {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
893 vis_ld64(dest[0], DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
894 vis_src1(TMP2, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
895
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
896 vis_ld64_2(dest, stride, DST_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
897 vis_src1(TMP6, REF_6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
898
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
899 vis_src1(TMP10, REF_S2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
900
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
901 vis_src1(TMP14, REF_S6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
902 }
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
903
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
904 vis_pmerge(ZERO, REF_0, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
905 vis_mul8x16au(REF_0_1, CONST_256, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
906
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
907 vis_pmerge(ZERO, REF_2, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
908 vis_mul8x16au(REF_2_1, CONST_256, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
909
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
910 vis_padd16(TMP0, CONST_3, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
911 vis_mul8x16al(DST_0, CONST_512, TMP16);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
912
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
913 vis_padd16(TMP2, CONST_3, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
914 vis_mul8x16al(DST_1, CONST_512, TMP18);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
915
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
916 vis_padd16(TMP0, TMP4, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
917 vis_mul8x16au(REF_4, CONST_256, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
918
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
919 vis_padd16(TMP2, TMP6, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
920 vis_mul8x16au(REF_4_1, CONST_256, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
921
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
922 vis_padd16(TMP0, TMP16, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
923 vis_mul8x16au(REF_6, CONST_256, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
924
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
925 vis_padd16(TMP2, TMP18, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
926 vis_mul8x16au(REF_6_1, CONST_256, TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
927
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
928 vis_padd16(TMP8, CONST_3, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
929 vis_mul8x16al(DST_2, CONST_512, TMP16);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
930
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
931 vis_padd16(TMP8, TMP12, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
932 vis_mul8x16al(DST_3, CONST_512, TMP18);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
933
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
934 vis_padd16(TMP10, TMP14, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
935 vis_pack16(TMP0, DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
936
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
937 vis_pack16(TMP2, DST_1);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
938 vis_st64(DST_0, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
939 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
940 vis_padd16(TMP10, CONST_3, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
941
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
942 vis_ld64_2(dest, stride, DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
943 vis_padd16(TMP8, TMP16, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
944
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
945 vis_ld64_2(dest, stride_times_2, TMP4/*DST_2*/);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
946 vis_padd16(TMP10, TMP18, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
947 vis_pack16(TMP8, DST_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
948
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
949 vis_pack16(TMP10, DST_3);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
950 vis_st64(DST_2, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
951 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
952
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
953 vis_mul8x16au(REF_S0_1, CONST_256, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
954 vis_pmerge(ZERO, REF_S0, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
955
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
956 vis_pmerge(ZERO, REF_S2, TMP24);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
957 vis_mul8x16au(REF_S2_1, CONST_256, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
958
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
959 vis_padd16(TMP0, CONST_3, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
960 vis_mul8x16au(REF_S4, CONST_256, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
961
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
962 vis_padd16(TMP2, CONST_3, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
963 vis_mul8x16au(REF_S4_1, CONST_256, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
964
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
965 vis_padd16(TMP0, TMP24, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
966 vis_mul8x16au(REF_S6, CONST_256, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
967
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
968 vis_padd16(TMP2, TMP6, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
969 vis_mul8x16au(REF_S6_1, CONST_256, TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
970
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
971 vis_padd16(TMP8, CONST_3, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
972 vis_mul8x16al(DST_0, CONST_512, TMP16);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
973
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
974 vis_padd16(TMP10, CONST_3, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
975 vis_mul8x16al(DST_1, CONST_512, TMP18);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
976
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
977 vis_padd16(TMP8, TMP12, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
978 vis_mul8x16al(TMP4/*DST_2*/, CONST_512, TMP20);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
979
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
980 vis_mul8x16al(TMP5/*DST_3*/, CONST_512, TMP22);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
981 vis_padd16(TMP0, TMP16, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
982
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
983 vis_padd16(TMP2, TMP18, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
984 vis_pack16(TMP0, DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
985
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
986 vis_padd16(TMP10, TMP14, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
987 vis_pack16(TMP2, DST_1);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
988 vis_st64(DST_0, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
989 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
990
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
991 vis_padd16(TMP8, TMP20, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
992
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
993 vis_padd16(TMP10, TMP22, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
994 vis_pack16(TMP8, DST_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
995
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
996 vis_pack16(TMP10, DST_3);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
997 vis_st64(DST_2, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
998 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
999 } while (--height);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1000 }
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1001
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1002 static void MC_put_y_16_vis (uint8_t * dest, const uint8_t * _ref,
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1003 const int stride, int height)
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1004 {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1005 uint8_t *ref = (uint8_t *) _ref;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1006 int offset;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1007
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1008 ref = vis_alignaddr(ref);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1009 offset = (ref != _ref) ? 16 : 0;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1010
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1011 vis_ld64(ref[0], TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1012
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1013 vis_ld64_2(ref, 8, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1014
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1015 vis_ld64_2(ref, offset, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1016 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1017
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1018 vis_ld64(ref[0], TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1019 vis_faligndata(TMP0, TMP2, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1020
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1021 vis_ld64_2(ref, 8, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1022 vis_faligndata(TMP2, TMP4, REF_4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1023
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1024 vis_ld64_2(ref, offset, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1025 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1026
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1027 vis_ld64(constants_fe[0], MASK_fe);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1028 vis_faligndata(TMP6, TMP8, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1029
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1030 vis_ld64(constants_7f[0], MASK_7f);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1031 vis_faligndata(TMP8, TMP10, REF_6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1032
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1033 vis_ld64(constants128[0], CONST_128);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1034 height = (height >> 1) - 1;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1035 do { /* 24 cycles */
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1036 vis_ld64(ref[0], TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1037 vis_xor(REF_0, REF_2, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1038
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1039 vis_ld64_2(ref, 8, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1040 vis_xor(REF_4, REF_6, TMP16);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1041
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1042 vis_ld64_2(ref, offset, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1043 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1044 vis_or(REF_0, REF_2, TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1045
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1046 vis_ld64(ref[0], TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1047 vis_or(REF_4, REF_6, TMP18);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1048
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1049 vis_ld64_2(ref, 8, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1050 vis_faligndata(TMP0, TMP2, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1051
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1052 vis_ld64_2(ref, offset, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1053 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1054 vis_faligndata(TMP2, TMP4, REF_4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1055
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1056 vis_and(TMP12, MASK_fe, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1057
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1058 vis_and(TMP16, MASK_fe, TMP16);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1059 vis_mul8x16(CONST_128, TMP12, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1060
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1061 vis_mul8x16(CONST_128, TMP16, TMP16);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1062 vis_xor(REF_0, REF_2, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1063
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1064 vis_xor(REF_4, REF_6, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1065
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1066 vis_or(REF_0, REF_2, TMP20);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1067
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1068 vis_and(TMP12, MASK_7f, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1069
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1070 vis_and(TMP16, MASK_7f, TMP16);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1071
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1072 vis_psub16(TMP14, TMP12, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1073 vis_st64(TMP12, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1074
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1075 vis_psub16(TMP18, TMP16, TMP16);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1076 vis_st64_2(TMP16, dest, 8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1077 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1078
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1079 vis_or(REF_4, REF_6, TMP18);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1080
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1081 vis_and(TMP0, MASK_fe, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1082
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1083 vis_and(TMP2, MASK_fe, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1084 vis_mul8x16(CONST_128, TMP0, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1085
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1086 vis_faligndata(TMP6, TMP8, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1087 vis_mul8x16(CONST_128, TMP2, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1088
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1089 vis_faligndata(TMP8, TMP10, REF_6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1090
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1091 vis_and(TMP0, MASK_7f, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1092
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1093 vis_and(TMP2, MASK_7f, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1094
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1095 vis_psub16(TMP20, TMP0, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1096 vis_st64(TMP0, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1097
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1098 vis_psub16(TMP18, TMP2, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1099 vis_st64_2(TMP2, dest, 8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1100 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1101 } while (--height);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1102
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1103 vis_ld64(ref[0], TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1104 vis_xor(REF_0, REF_2, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1105
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1106 vis_ld64_2(ref, 8, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1107 vis_xor(REF_4, REF_6, TMP16);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1108
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1109 vis_ld64_2(ref, offset, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1110 vis_or(REF_0, REF_2, TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1111
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1112 vis_or(REF_4, REF_6, TMP18);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1113
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1114 vis_faligndata(TMP0, TMP2, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1115
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1116 vis_faligndata(TMP2, TMP4, REF_4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1117
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1118 vis_and(TMP12, MASK_fe, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1119
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1120 vis_and(TMP16, MASK_fe, TMP16);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1121 vis_mul8x16(CONST_128, TMP12, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1122
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1123 vis_mul8x16(CONST_128, TMP16, TMP16);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1124 vis_xor(REF_0, REF_2, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1125
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1126 vis_xor(REF_4, REF_6, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1127
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1128 vis_or(REF_0, REF_2, TMP20);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1129
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1130 vis_and(TMP12, MASK_7f, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1131
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1132 vis_and(TMP16, MASK_7f, TMP16);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1133
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1134 vis_psub16(TMP14, TMP12, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1135 vis_st64(TMP12, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1136
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1137 vis_psub16(TMP18, TMP16, TMP16);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1138 vis_st64_2(TMP16, dest, 8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1139 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1140
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1141 vis_or(REF_4, REF_6, TMP18);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1142
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1143 vis_and(TMP0, MASK_fe, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1144
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1145 vis_and(TMP2, MASK_fe, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1146 vis_mul8x16(CONST_128, TMP0, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1147
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1148 vis_mul8x16(CONST_128, TMP2, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1149
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1150 vis_and(TMP0, MASK_7f, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1151
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1152 vis_and(TMP2, MASK_7f, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1153
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1154 vis_psub16(TMP20, TMP0, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1155 vis_st64(TMP0, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1156
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1157 vis_psub16(TMP18, TMP2, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1158 vis_st64_2(TMP2, dest, 8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1159 }
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1160
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1161 static void MC_put_y_8_vis (uint8_t * dest, const uint8_t * _ref,
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1162 const int stride, int height)
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1163 {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1164 uint8_t *ref = (uint8_t *) _ref;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1165 int offset;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1166
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1167 ref = vis_alignaddr(ref);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1168 offset = (ref != _ref) ? 8 : 0;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1169
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1170 vis_ld64(ref[0], TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1171
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1172 vis_ld64_2(ref, offset, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1173 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1174
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1175 vis_ld64(ref[0], TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1176
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1177 vis_ld64_2(ref, offset, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1178 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1179
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1180 vis_ld64(constants_fe[0], MASK_fe);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1181 vis_faligndata(TMP0, TMP2, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1182
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1183 vis_ld64(constants_7f[0], MASK_7f);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1184 vis_faligndata(TMP4, TMP6, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1185
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1186 vis_ld64(constants128[0], CONST_128);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1187 height = (height >> 1) - 1;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1188 do { /* 12 cycles */
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1189 vis_ld64(ref[0], TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1190 vis_xor(REF_0, REF_2, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1191
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1192 vis_ld64_2(ref, offset, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1193 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1194 vis_and(TMP4, MASK_fe, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1195
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1196 vis_or(REF_0, REF_2, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1197 vis_mul8x16(CONST_128, TMP4, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1198
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1199 vis_faligndata(TMP0, TMP2, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1200 vis_ld64(ref[0], TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1201
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1202 vis_ld64_2(ref, offset, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1203 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1204 vis_xor(REF_0, REF_2, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1205
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1206 vis_and(TMP4, MASK_7f, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1207
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1208 vis_and(TMP12, MASK_fe, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1209
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1210 vis_mul8x16(CONST_128, TMP12, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1211 vis_or(REF_0, REF_2, TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1212
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1213 vis_psub16(TMP6, TMP4, DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1214 vis_st64(DST_0, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1215 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1216
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1217 vis_faligndata(TMP0, TMP2, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1218
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1219 vis_and(TMP12, MASK_7f, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1220
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1221 vis_psub16(TMP14, TMP12, DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1222 vis_st64(DST_0, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1223 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1224 } while (--height);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1225
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1226 vis_ld64(ref[0], TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1227 vis_xor(REF_0, REF_2, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1228
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1229 vis_ld64_2(ref, offset, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1230 vis_and(TMP4, MASK_fe, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1231
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1232 vis_or(REF_0, REF_2, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1233 vis_mul8x16(CONST_128, TMP4, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1234
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1235 vis_faligndata(TMP0, TMP2, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1236
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1237 vis_xor(REF_0, REF_2, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1238
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1239 vis_and(TMP4, MASK_7f, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1240
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1241 vis_and(TMP12, MASK_fe, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1242
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1243 vis_mul8x16(CONST_128, TMP12, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1244 vis_or(REF_0, REF_2, TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1245
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1246 vis_psub16(TMP6, TMP4, DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1247 vis_st64(DST_0, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1248 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1249
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1250 vis_and(TMP12, MASK_7f, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1251
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1252 vis_psub16(TMP14, TMP12, DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1253 vis_st64(DST_0, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1254 }
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1255
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1256 static void MC_avg_y_16_vis (uint8_t * dest, const uint8_t * _ref,
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1257 const int stride, int height)
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1258 {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1259 uint8_t *ref = (uint8_t *) _ref;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1260 int stride_8 = stride + 8;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1261 int stride_16;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1262 int offset;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1263
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1264 vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1265
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1266 ref = vis_alignaddr(ref);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1267 offset = (ref != _ref) ? 16 : 0;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1268
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1269 vis_ld64(ref[ 0], TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1270 vis_fzero(ZERO);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1271
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1272 vis_ld64(ref[ 8], TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1273
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1274 vis_ld64_2(ref, offset, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1275 stride_16 = stride + offset;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1276
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1277 vis_ld64(constants3[0], CONST_3);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1278 vis_faligndata(TMP0, TMP2, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1279
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1280 vis_ld64(constants256_512[0], CONST_256);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1281 vis_faligndata(TMP2, TMP4, REF_6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1282 height >>= 1;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1283
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1284 do { /* 31 cycles */
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1285 vis_ld64_2(ref, stride, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1286 vis_pmerge(ZERO, REF_2, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1287 vis_mul8x16au(REF_2_1, CONST_256, TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1288
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1289 vis_ld64_2(ref, stride_8, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1290 vis_pmerge(ZERO, REF_6, TMP16);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1291 vis_mul8x16au(REF_6_1, CONST_256, TMP18);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1292
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1293 vis_ld64_2(ref, stride_16, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1294 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1295
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1296 vis_ld64(dest[0], DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1297 vis_faligndata(TMP0, TMP2, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1298
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1299 vis_ld64_2(dest, 8, DST_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1300 vis_faligndata(TMP2, TMP4, REF_4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1301
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1302 vis_ld64_2(ref, stride, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1303 vis_pmerge(ZERO, REF_0, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1304 vis_mul8x16au(REF_0_1, CONST_256, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1305
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1306 vis_ld64_2(ref, stride_8, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1307 vis_pmerge(ZERO, REF_4, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1308
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1309 vis_ld64_2(ref, stride_16, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1310 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1311
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1312 vis_ld64_2(dest, stride, REF_S0/*DST_4*/);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1313 vis_faligndata(TMP6, TMP8, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1314 vis_mul8x16au(REF_4_1, CONST_256, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1315
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1316 vis_ld64_2(dest, stride_8, REF_S2/*DST_6*/);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1317 vis_faligndata(TMP8, TMP10, REF_6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1318 vis_mul8x16al(DST_0, CONST_512, TMP20);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1319
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1320 vis_padd16(TMP0, CONST_3, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1321 vis_mul8x16al(DST_1, CONST_512, TMP22);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1322
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1323 vis_padd16(TMP2, CONST_3, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1324 vis_mul8x16al(DST_2, CONST_512, TMP24);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1325
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1326 vis_padd16(TMP4, CONST_3, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1327 vis_mul8x16al(DST_3, CONST_512, TMP26);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1328
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1329 vis_padd16(TMP6, CONST_3, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1330
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1331 vis_padd16(TMP12, TMP20, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1332 vis_mul8x16al(REF_S0, CONST_512, TMP20);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1333
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1334 vis_padd16(TMP14, TMP22, TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1335 vis_mul8x16al(REF_S0_1, CONST_512, TMP22);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1336
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1337 vis_padd16(TMP16, TMP24, TMP16);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1338 vis_mul8x16al(REF_S2, CONST_512, TMP24);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1339
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1340 vis_padd16(TMP18, TMP26, TMP18);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1341 vis_mul8x16al(REF_S2_1, CONST_512, TMP26);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1342
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1343 vis_padd16(TMP12, TMP0, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1344 vis_mul8x16au(REF_2, CONST_256, TMP28);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1345
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1346 vis_padd16(TMP14, TMP2, TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1347 vis_mul8x16au(REF_2_1, CONST_256, TMP30);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1348
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1349 vis_padd16(TMP16, TMP4, TMP16);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1350 vis_mul8x16au(REF_6, CONST_256, REF_S4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1351
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1352 vis_padd16(TMP18, TMP6, TMP18);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1353 vis_mul8x16au(REF_6_1, CONST_256, REF_S6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1354
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1355 vis_pack16(TMP12, DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1356 vis_padd16(TMP28, TMP0, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1357
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1358 vis_pack16(TMP14, DST_1);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1359 vis_st64(DST_0, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1360 vis_padd16(TMP30, TMP2, TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1361
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1362 vis_pack16(TMP16, DST_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1363 vis_padd16(REF_S4, TMP4, TMP16);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1364
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1365 vis_pack16(TMP18, DST_3);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1366 vis_st64_2(DST_2, dest, 8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1367 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1368 vis_padd16(REF_S6, TMP6, TMP18);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1369
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1370 vis_padd16(TMP12, TMP20, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1371
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1372 vis_padd16(TMP14, TMP22, TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1373 vis_pack16(TMP12, DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1374
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1375 vis_padd16(TMP16, TMP24, TMP16);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1376 vis_pack16(TMP14, DST_1);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1377 vis_st64(DST_0, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1378
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1379 vis_padd16(TMP18, TMP26, TMP18);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1380 vis_pack16(TMP16, DST_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1381
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1382 vis_pack16(TMP18, DST_3);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1383 vis_st64_2(DST_2, dest, 8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1384 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1385 } while (--height);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1386 }
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1387
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1388 static void MC_avg_y_8_vis (uint8_t * dest, const uint8_t * _ref,
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1389 const int stride, int height)
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1390 {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1391 uint8_t *ref = (uint8_t *) _ref;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1392 int stride_8;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1393 int offset;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1394
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1395 vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1396
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1397 ref = vis_alignaddr(ref);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1398 offset = (ref != _ref) ? 8 : 0;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1399
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1400 vis_ld64(ref[ 0], TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1401 vis_fzero(ZERO);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1402
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1403 vis_ld64_2(ref, offset, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1404 stride_8 = stride + offset;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1405
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1406 vis_ld64(constants3[0], CONST_3);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1407 vis_faligndata(TMP0, TMP2, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1408
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1409 vis_ld64(constants256_512[0], CONST_256);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1410
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1411 height >>= 1;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1412 do { /* 20 cycles */
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1413 vis_ld64_2(ref, stride, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1414 vis_pmerge(ZERO, REF_2, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1415 vis_mul8x16au(REF_2_1, CONST_256, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1416
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1417 vis_ld64_2(ref, stride_8, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1418 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1419
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1420 vis_ld64(dest[0], DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1421
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1422 vis_ld64_2(dest, stride, DST_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1423 vis_faligndata(TMP0, TMP2, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1424
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1425 vis_ld64_2(ref, stride, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1426 vis_mul8x16al(DST_0, CONST_512, TMP16);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1427 vis_pmerge(ZERO, REF_0, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1428
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1429 vis_ld64_2(ref, stride_8, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1430 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1431 vis_mul8x16al(DST_1, CONST_512, TMP18);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1432 vis_pmerge(ZERO, REF_0_1, TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1433
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1434 vis_padd16(TMP12, CONST_3, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1435 vis_mul8x16al(DST_2, CONST_512, TMP24);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1436
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1437 vis_padd16(TMP14, CONST_3, TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1438 vis_mul8x16al(DST_3, CONST_512, TMP26);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1439
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1440 vis_faligndata(TMP4, TMP6, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1441
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1442 vis_padd16(TMP8, TMP12, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1443
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1444 vis_padd16(TMP10, TMP14, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1445 vis_mul8x16au(REF_2, CONST_256, TMP20);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1446
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1447 vis_padd16(TMP8, TMP16, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1448 vis_mul8x16au(REF_2_1, CONST_256, TMP22);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1449
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1450 vis_padd16(TMP10, TMP18, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1451 vis_pack16(TMP0, DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1452
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1453 vis_pack16(TMP2, DST_1);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1454 vis_st64(DST_0, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1455 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1456 vis_padd16(TMP12, TMP20, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1457
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1458 vis_padd16(TMP14, TMP22, TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1459
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1460 vis_padd16(TMP12, TMP24, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1461
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1462 vis_padd16(TMP14, TMP26, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1463 vis_pack16(TMP0, DST_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1464
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1465 vis_pack16(TMP2, DST_3);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1466 vis_st64(DST_2, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1467 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1468 } while (--height);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1469 }
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1470
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1471 static void MC_put_xy_16_vis (uint8_t * dest, const uint8_t * _ref,
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1472 const int stride, int height)
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1473 {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1474 uint8_t *ref = (uint8_t *) _ref;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1475 unsigned long off = (unsigned long) ref & 0x7;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1476 unsigned long off_plus_1 = off + 1;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1477 int stride_8 = stride + 8;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1478 int stride_16 = stride + 16;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1479
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1480 vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1481
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1482 ref = vis_alignaddr(ref);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1483
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1484 vis_ld64(ref[ 0], TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1485 vis_fzero(ZERO);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1486
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1487 vis_ld64(ref[ 8], TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1488
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1489 vis_ld64(ref[16], TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1490
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1491 vis_ld64(constants2[0], CONST_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1492 vis_faligndata(TMP0, TMP2, REF_S0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1493
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1494 vis_ld64(constants256_512[0], CONST_256);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1495 vis_faligndata(TMP2, TMP4, REF_S4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1496
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1497 if (off != 0x7) {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1498 vis_alignaddr_g0((void *)off_plus_1);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1499 vis_faligndata(TMP0, TMP2, REF_S2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1500 vis_faligndata(TMP2, TMP4, REF_S6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1501 } else {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1502 vis_src1(TMP2, REF_S2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1503 vis_src1(TMP4, REF_S6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1504 }
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1505
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1506 height >>= 1;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1507 do {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1508 vis_ld64_2(ref, stride, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1509 vis_mul8x16au(REF_S0, CONST_256, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1510 vis_pmerge(ZERO, REF_S0_1, TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1511
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1512 vis_alignaddr_g0((void *)off);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1513
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1514 vis_ld64_2(ref, stride_8, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1515 vis_mul8x16au(REF_S2, CONST_256, TMP16);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1516 vis_pmerge(ZERO, REF_S2_1, TMP18);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1517
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1518 vis_ld64_2(ref, stride_16, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1519 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1520 vis_mul8x16au(REF_S4, CONST_256, TMP20);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1521 vis_pmerge(ZERO, REF_S4_1, TMP22);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1522
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1523 vis_ld64_2(ref, stride, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1524 vis_mul8x16au(REF_S6, CONST_256, TMP24);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1525 vis_pmerge(ZERO, REF_S6_1, TMP26);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1526
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1527 vis_ld64_2(ref, stride_8, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1528 vis_faligndata(TMP0, TMP2, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1529
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1530 vis_ld64_2(ref, stride_16, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1531 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1532 vis_faligndata(TMP2, TMP4, REF_4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1533
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1534 vis_faligndata(TMP6, TMP8, REF_S0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1535
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1536 vis_faligndata(TMP8, TMP10, REF_S4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1537
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1538 if (off != 0x7) {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1539 vis_alignaddr_g0((void *)off_plus_1);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1540 vis_faligndata(TMP0, TMP2, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1541 vis_faligndata(TMP2, TMP4, REF_6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1542 vis_faligndata(TMP6, TMP8, REF_S2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1543 vis_faligndata(TMP8, TMP10, REF_S6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1544 } else {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1545 vis_src1(TMP2, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1546 vis_src1(TMP4, REF_6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1547 vis_src1(TMP8, REF_S2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1548 vis_src1(TMP10, REF_S6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1549 }
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1550
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1551 vis_mul8x16au(REF_0, CONST_256, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1552 vis_pmerge(ZERO, REF_0_1, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1553
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1554 vis_mul8x16au(REF_2, CONST_256, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1555 vis_pmerge(ZERO, REF_2_1, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1556
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1557 vis_padd16(TMP0, CONST_2, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1558 vis_mul8x16au(REF_4, CONST_256, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1559
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1560 vis_padd16(TMP2, CONST_2, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1561 vis_mul8x16au(REF_4_1, CONST_256, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1562
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1563 vis_padd16(TMP8, TMP4, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1564 vis_mul8x16au(REF_6, CONST_256, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1565
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1566 vis_padd16(TMP10, TMP6, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1567 vis_mul8x16au(REF_6_1, CONST_256, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1568
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1569 vis_padd16(TMP12, TMP8, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1570
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1571 vis_padd16(TMP14, TMP10, TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1572
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1573 vis_padd16(TMP12, TMP16, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1574
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1575 vis_padd16(TMP14, TMP18, TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1576 vis_pack16(TMP12, DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1577
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1578 vis_pack16(TMP14, DST_1);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1579 vis_st64(DST_0, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1580 vis_padd16(TMP0, CONST_2, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1581
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1582 vis_mul8x16au(REF_S0, CONST_256, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1583 vis_padd16(TMP2, CONST_2, TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1584
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1585 vis_mul8x16au(REF_S0_1, CONST_256, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1586 vis_padd16(TMP12, TMP4, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1587
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1588 vis_mul8x16au(REF_S2, CONST_256, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1589 vis_padd16(TMP14, TMP6, TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1590
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1591 vis_mul8x16au(REF_S2_1, CONST_256, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1592 vis_padd16(TMP20, TMP12, TMP20);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1593
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1594 vis_padd16(TMP22, TMP14, TMP22);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1595
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1596 vis_padd16(TMP20, TMP24, TMP20);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1597
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1598 vis_padd16(TMP22, TMP26, TMP22);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1599 vis_pack16(TMP20, DST_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1600
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1601 vis_pack16(TMP22, DST_3);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1602 vis_st64_2(DST_2, dest, 8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1603 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1604 vis_padd16(TMP0, TMP4, TMP24);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1605
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1606 vis_mul8x16au(REF_S4, CONST_256, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1607 vis_padd16(TMP2, TMP6, TMP26);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1608
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1609 vis_mul8x16au(REF_S4_1, CONST_256, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1610 vis_padd16(TMP24, TMP8, TMP24);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1611
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1612 vis_padd16(TMP26, TMP10, TMP26);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1613 vis_pack16(TMP24, DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1614
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1615 vis_pack16(TMP26, DST_1);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1616 vis_st64(DST_0, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1617 vis_pmerge(ZERO, REF_S6, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1618
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1619 vis_pmerge(ZERO, REF_S6_1, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1620
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1621 vis_padd16(TMP0, TMP4, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1622
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1623 vis_padd16(TMP2, TMP6, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1624
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1625 vis_padd16(TMP0, TMP12, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1626
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1627 vis_padd16(TMP2, TMP14, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1628 vis_pack16(TMP0, DST_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1629
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1630 vis_pack16(TMP2, DST_3);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1631 vis_st64_2(DST_2, dest, 8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1632 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1633 } while (--height);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1634 }
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1635
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1636 static void MC_put_xy_8_vis (uint8_t * dest, const uint8_t * _ref,
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1637 const int stride, int height)
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1638 {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1639 uint8_t *ref = (uint8_t *) _ref;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1640 unsigned long off = (unsigned long) ref & 0x7;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1641 unsigned long off_plus_1 = off + 1;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1642 int stride_8 = stride + 8;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1643
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1644 vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1645
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1646 ref = vis_alignaddr(ref);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1647
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1648 vis_ld64(ref[ 0], TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1649 vis_fzero(ZERO);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1650
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1651 vis_ld64(ref[ 8], TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1652
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1653 vis_ld64(constants2[0], CONST_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1654
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1655 vis_ld64(constants256_512[0], CONST_256);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1656 vis_faligndata(TMP0, TMP2, REF_S0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1657
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1658 if (off != 0x7) {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1659 vis_alignaddr_g0((void *)off_plus_1);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1660 vis_faligndata(TMP0, TMP2, REF_S2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1661 } else {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1662 vis_src1(TMP2, REF_S2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1663 }
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1664
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1665 height >>= 1;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1666 do { /* 26 cycles */
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1667 vis_ld64_2(ref, stride, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1668 vis_mul8x16au(REF_S0, CONST_256, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1669 vis_pmerge(ZERO, REF_S2, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1670
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1671 vis_alignaddr_g0((void *)off);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1672
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1673 vis_ld64_2(ref, stride_8, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1674 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1675 vis_mul8x16au(REF_S0_1, CONST_256, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1676 vis_pmerge(ZERO, REF_S2_1, TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1677
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1678 vis_ld64_2(ref, stride, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1679
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1680 vis_ld64_2(ref, stride_8, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1681 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1682 vis_faligndata(TMP0, TMP2, REF_S4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1683
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1684 vis_pmerge(ZERO, REF_S4, TMP18);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1685
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1686 vis_pmerge(ZERO, REF_S4_1, TMP20);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1687
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1688 vis_faligndata(TMP4, TMP6, REF_S0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1689
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1690 if (off != 0x7) {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1691 vis_alignaddr_g0((void *)off_plus_1);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1692 vis_faligndata(TMP0, TMP2, REF_S6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1693 vis_faligndata(TMP4, TMP6, REF_S2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1694 } else {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1695 vis_src1(TMP2, REF_S6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1696 vis_src1(TMP6, REF_S2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1697 }
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1698
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1699 vis_padd16(TMP18, CONST_2, TMP18);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1700 vis_mul8x16au(REF_S6, CONST_256, TMP22);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1701
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1702 vis_padd16(TMP20, CONST_2, TMP20);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1703 vis_mul8x16au(REF_S6_1, CONST_256, TMP24);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1704
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1705 vis_mul8x16au(REF_S0, CONST_256, TMP26);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1706 vis_pmerge(ZERO, REF_S0_1, TMP28);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1707
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1708 vis_mul8x16au(REF_S2, CONST_256, TMP30);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1709 vis_padd16(TMP18, TMP22, TMP18);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1710
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1711 vis_mul8x16au(REF_S2_1, CONST_256, TMP32);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1712 vis_padd16(TMP20, TMP24, TMP20);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1713
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1714 vis_padd16(TMP8, TMP18, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1715
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1716 vis_padd16(TMP10, TMP20, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1717
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1718 vis_padd16(TMP8, TMP12, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1719
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1720 vis_padd16(TMP10, TMP14, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1721 vis_pack16(TMP8, DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1722
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1723 vis_pack16(TMP10, DST_1);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1724 vis_st64(DST_0, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1725 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1726 vis_padd16(TMP18, TMP26, TMP18);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1727
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1728 vis_padd16(TMP20, TMP28, TMP20);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1729
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1730 vis_padd16(TMP18, TMP30, TMP18);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1731
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1732 vis_padd16(TMP20, TMP32, TMP20);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1733 vis_pack16(TMP18, DST_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1734
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1735 vis_pack16(TMP20, DST_3);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1736 vis_st64(DST_2, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1737 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1738 } while (--height);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1739 }
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1740
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1741 static void MC_avg_xy_16_vis (uint8_t * dest, const uint8_t * _ref,
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1742 const int stride, int height)
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1743 {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1744 uint8_t *ref = (uint8_t *) _ref;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1745 unsigned long off = (unsigned long) ref & 0x7;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1746 unsigned long off_plus_1 = off + 1;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1747 int stride_8 = stride + 8;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1748 int stride_16 = stride + 16;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1749
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1750 vis_set_gsr(4 << VIS_GSR_SCALEFACT_SHIFT);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1751
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1752 ref = vis_alignaddr(ref);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1753
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1754 vis_ld64(ref[ 0], TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1755 vis_fzero(ZERO);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1756
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1757 vis_ld64(ref[ 8], TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1758
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1759 vis_ld64(ref[16], TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1760
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1761 vis_ld64(constants6[0], CONST_6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1762 vis_faligndata(TMP0, TMP2, REF_S0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1763
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1764 vis_ld64(constants256_1024[0], CONST_256);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1765 vis_faligndata(TMP2, TMP4, REF_S4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1766
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1767 if (off != 0x7) {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1768 vis_alignaddr_g0((void *)off_plus_1);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1769 vis_faligndata(TMP0, TMP2, REF_S2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1770 vis_faligndata(TMP2, TMP4, REF_S6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1771 } else {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1772 vis_src1(TMP2, REF_S2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1773 vis_src1(TMP4, REF_S6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1774 }
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1775
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1776 height >>= 1;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1777 do { /* 55 cycles */
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1778 vis_ld64_2(ref, stride, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1779 vis_mul8x16au(REF_S0, CONST_256, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1780 vis_pmerge(ZERO, REF_S0_1, TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1781
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1782 vis_alignaddr_g0((void *)off);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1783
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1784 vis_ld64_2(ref, stride_8, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1785 vis_mul8x16au(REF_S2, CONST_256, TMP16);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1786 vis_pmerge(ZERO, REF_S2_1, TMP18);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1787
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1788 vis_ld64_2(ref, stride_16, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1789 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1790 vis_mul8x16au(REF_S4, CONST_256, TMP20);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1791 vis_pmerge(ZERO, REF_S4_1, TMP22);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1792
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1793 vis_ld64_2(ref, stride, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1794 vis_mul8x16au(REF_S6, CONST_256, TMP24);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1795 vis_pmerge(ZERO, REF_S6_1, TMP26);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1796
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1797 vis_ld64_2(ref, stride_8, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1798 vis_faligndata(TMP0, TMP2, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1799
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1800 vis_ld64_2(ref, stride_16, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1801 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1802 vis_faligndata(TMP2, TMP4, REF_4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1803
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1804 vis_ld64(dest[0], DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1805 vis_faligndata(TMP6, TMP8, REF_S0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1806
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1807 vis_ld64_2(dest, 8, DST_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1808 vis_faligndata(TMP8, TMP10, REF_S4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1809
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1810 if (off != 0x7) {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1811 vis_alignaddr_g0((void *)off_plus_1);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1812 vis_faligndata(TMP0, TMP2, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1813 vis_faligndata(TMP2, TMP4, REF_6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1814 vis_faligndata(TMP6, TMP8, REF_S2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1815 vis_faligndata(TMP8, TMP10, REF_S6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1816 } else {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1817 vis_src1(TMP2, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1818 vis_src1(TMP4, REF_6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1819 vis_src1(TMP8, REF_S2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1820 vis_src1(TMP10, REF_S6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1821 }
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1822
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1823 vis_mul8x16al(DST_0, CONST_1024, TMP30);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1824 vis_pmerge(ZERO, REF_0, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1825
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1826 vis_mul8x16al(DST_1, CONST_1024, TMP32);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1827 vis_pmerge(ZERO, REF_0_1, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1828
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1829 vis_mul8x16au(REF_2, CONST_256, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1830 vis_pmerge(ZERO, REF_2_1, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1831
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1832 vis_mul8x16al(DST_2, CONST_1024, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1833 vis_padd16(TMP0, CONST_6, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1834
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1835 vis_mul8x16al(DST_3, CONST_1024, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1836 vis_padd16(TMP2, CONST_6, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1837
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1838 vis_padd16(TMP0, TMP4, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1839 vis_mul8x16au(REF_4, CONST_256, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1840
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1841 vis_padd16(TMP2, TMP6, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1842 vis_mul8x16au(REF_4_1, CONST_256, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1843
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1844 vis_padd16(TMP12, TMP0, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1845 vis_mul8x16au(REF_6, CONST_256, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1846
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1847 vis_padd16(TMP14, TMP2, TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1848 vis_mul8x16au(REF_6_1, CONST_256, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1849
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1850 vis_padd16(TMP12, TMP16, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1851 vis_mul8x16au(REF_S0, CONST_256, REF_4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1852
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1853 vis_padd16(TMP14, TMP18, TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1854 vis_mul8x16au(REF_S0_1, CONST_256, REF_6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1855
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1856 vis_padd16(TMP12, TMP30, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1857
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1858 vis_padd16(TMP14, TMP32, TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1859 vis_pack16(TMP12, DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1860
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1861 vis_pack16(TMP14, DST_1);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1862 vis_st64(DST_0, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1863 vis_padd16(TMP4, CONST_6, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1864
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1865 vis_ld64_2(dest, stride, DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1866 vis_padd16(TMP6, CONST_6, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1867 vis_mul8x16au(REF_S2, CONST_256, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1868
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1869 vis_padd16(TMP4, TMP8, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1870 vis_mul8x16au(REF_S2_1, CONST_256, TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1871
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1872 vis_padd16(TMP6, TMP10, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1873
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1874 vis_padd16(TMP20, TMP4, TMP20);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1875
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1876 vis_padd16(TMP22, TMP6, TMP22);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1877
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1878 vis_padd16(TMP20, TMP24, TMP20);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1879
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1880 vis_padd16(TMP22, TMP26, TMP22);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1881
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1882 vis_padd16(TMP20, REF_0, TMP20);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1883 vis_mul8x16au(REF_S4, CONST_256, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1884
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1885 vis_padd16(TMP22, REF_2, TMP22);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1886 vis_pack16(TMP20, DST_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1887
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1888 vis_pack16(TMP22, DST_3);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1889 vis_st64_2(DST_2, dest, 8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1890 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1891
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1892 vis_ld64_2(dest, 8, DST_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1893 vis_mul8x16al(DST_0, CONST_1024, TMP30);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1894 vis_pmerge(ZERO, REF_S4_1, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1895
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1896 vis_mul8x16al(DST_1, CONST_1024, TMP32);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1897 vis_padd16(REF_4, TMP0, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1898
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1899 vis_mul8x16au(REF_S6, CONST_256, REF_4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1900 vis_padd16(REF_6, TMP2, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1901
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1902 vis_mul8x16au(REF_S6_1, CONST_256, REF_6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1903 vis_padd16(TMP8, TMP12, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1904
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1905 vis_padd16(TMP10, TMP14, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1906
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1907 vis_padd16(TMP8, TMP30, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1908
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1909 vis_padd16(TMP10, TMP32, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1910 vis_pack16(TMP8, DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1911
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1912 vis_pack16(TMP10, DST_1);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1913 vis_st64(DST_0, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1914
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1915 vis_padd16(REF_0, TMP4, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1916
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1917 vis_mul8x16al(DST_2, CONST_1024, TMP30);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1918 vis_padd16(REF_2, TMP6, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1919
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1920 vis_mul8x16al(DST_3, CONST_1024, TMP32);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1921 vis_padd16(REF_0, REF_4, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1922
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1923 vis_padd16(REF_2, REF_6, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1924
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1925 vis_padd16(REF_0, TMP30, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1926
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1927 /* stall */
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1928
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1929 vis_padd16(REF_2, TMP32, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1930 vis_pack16(REF_0, DST_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1931
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1932 vis_pack16(REF_2, DST_3);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1933 vis_st64_2(DST_2, dest, 8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1934 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1935 } while (--height);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1936 }
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1937
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1938 static void MC_avg_xy_8_vis (uint8_t * dest, const uint8_t * _ref,
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1939 const int stride, int height)
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1940 {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1941 uint8_t *ref = (uint8_t *) _ref;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1942 unsigned long off = (unsigned long) ref & 0x7;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1943 unsigned long off_plus_1 = off + 1;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1944 int stride_8 = stride + 8;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1945
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1946 vis_set_gsr(4 << VIS_GSR_SCALEFACT_SHIFT);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1947
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1948 ref = vis_alignaddr(ref);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1949
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1950 vis_ld64(ref[0], TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1951 vis_fzero(ZERO);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1952
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1953 vis_ld64_2(ref, 8, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1954
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1955 vis_ld64(constants6[0], CONST_6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1956
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1957 vis_ld64(constants256_1024[0], CONST_256);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1958 vis_faligndata(TMP0, TMP2, REF_S0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1959
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1960 if (off != 0x7) {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1961 vis_alignaddr_g0((void *)off_plus_1);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1962 vis_faligndata(TMP0, TMP2, REF_S2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1963 } else {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1964 vis_src1(TMP2, REF_S2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1965 }
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1966
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1967 height >>= 1;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1968 do { /* 31 cycles */
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1969 vis_ld64_2(ref, stride, TMP0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1970 vis_mul8x16au(REF_S0, CONST_256, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1971 vis_pmerge(ZERO, REF_S0_1, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1972
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1973 vis_ld64_2(ref, stride_8, TMP2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1974 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1975 vis_mul8x16au(REF_S2, CONST_256, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1976 vis_pmerge(ZERO, REF_S2_1, TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1977
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1978 vis_alignaddr_g0((void *)off);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1979
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1980 vis_ld64_2(ref, stride, TMP4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1981 vis_faligndata(TMP0, TMP2, REF_S4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1982
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1983 vis_ld64_2(ref, stride_8, TMP6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1984 ref += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1985
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1986 vis_ld64(dest[0], DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1987 vis_faligndata(TMP4, TMP6, REF_S0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1988
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1989 vis_ld64_2(dest, stride, DST_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1990
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1991 if (off != 0x7) {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1992 vis_alignaddr_g0((void *)off_plus_1);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1993 vis_faligndata(TMP0, TMP2, REF_S6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1994 vis_faligndata(TMP4, TMP6, REF_S2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1995 } else {
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1996 vis_src1(TMP2, REF_S6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1997 vis_src1(TMP6, REF_S2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1998 }
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
1999
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2000 vis_mul8x16al(DST_0, CONST_1024, TMP30);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2001 vis_pmerge(ZERO, REF_S4, TMP22);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2002
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2003 vis_mul8x16al(DST_1, CONST_1024, TMP32);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2004 vis_pmerge(ZERO, REF_S4_1, TMP24);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2005
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2006 vis_mul8x16au(REF_S6, CONST_256, TMP26);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2007 vis_pmerge(ZERO, REF_S6_1, TMP28);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2008
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2009 vis_mul8x16au(REF_S0, CONST_256, REF_S4);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2010 vis_padd16(TMP22, CONST_6, TMP22);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2011
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2012 vis_mul8x16au(REF_S0_1, CONST_256, REF_S6);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2013 vis_padd16(TMP24, CONST_6, TMP24);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2014
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2015 vis_mul8x16al(DST_2, CONST_1024, REF_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2016 vis_padd16(TMP22, TMP26, TMP22);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2017
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2018 vis_mul8x16al(DST_3, CONST_1024, REF_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2019 vis_padd16(TMP24, TMP28, TMP24);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2020
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2021 vis_mul8x16au(REF_S2, CONST_256, TMP26);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2022 vis_padd16(TMP8, TMP22, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2023
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2024 vis_mul8x16au(REF_S2_1, CONST_256, TMP28);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2025 vis_padd16(TMP10, TMP24, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2026
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2027 vis_padd16(TMP8, TMP12, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2028
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2029 vis_padd16(TMP10, TMP14, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2030
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2031 vis_padd16(TMP8, TMP30, TMP8);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2032
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2033 vis_padd16(TMP10, TMP32, TMP10);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2034 vis_pack16(TMP8, DST_0);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2035
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2036 vis_pack16(TMP10, DST_1);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2037 vis_st64(DST_0, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2038 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2039
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2040 vis_padd16(REF_S4, TMP22, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2041
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2042 vis_padd16(REF_S6, TMP24, TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2043
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2044 vis_padd16(TMP12, TMP26, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2045
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2046 vis_padd16(TMP14, TMP28, TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2047
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2048 vis_padd16(TMP12, REF_0, TMP12);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2049
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2050 vis_padd16(TMP14, REF_2, TMP14);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2051 vis_pack16(TMP12, DST_2);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2052
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2053 vis_pack16(TMP14, DST_3);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2054 vis_st64(DST_2, dest[0]);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2055 dest += stride;
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2056 } while (--height);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2057 }
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2058
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2059 MPEG2_MC_EXTERN(vis);
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2060
d0a8810e155c Importing libmpeg2 from mpeg2dec-0.4.0b
henry
parents:
diff changeset
2061 #endif /* !(ARCH_SPARC) */