annotate ppc/snow_altivec.c @ 8825:51274aff81fe libavcodec

Assert that ff_lpc_calc_coefs() is called with a valid LPC method. Patch by Patrik Kullman (patrik A yes D nu).
author jbr
date Fri, 13 Feb 2009 22:03:11 +0000
parents a8a79f5385f6
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
1 /*
5749
784dcbdc910f cosmetics: Fix AltiVec spelling.
diego
parents: 5612
diff changeset
2 * AltiVec-optimized snow DSP utils
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
3 * Copyright (c) 2006 Luca Barbato <lu_zero@gentoo.org>
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
4 *
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3577
diff changeset
5 * This file is part of FFmpeg.
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3577
diff changeset
6 *
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3577
diff changeset
7 * FFmpeg is free software; you can redistribute it and/or
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
8 * modify it under the terms of the GNU Lesser General Public
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
9 * License as published by the Free Software Foundation; either
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3577
diff changeset
10 * version 2.1 of the License, or (at your option) any later version.
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
11 *
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3577
diff changeset
12 * FFmpeg is distributed in the hope that it will be useful,
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
15 * Lesser General Public License for more details.
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
16 *
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3577
diff changeset
18 * License along with FFmpeg; if not, write to the Free Software
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
20 */
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
21
6763
f7cbb7733146 Use full path for #includes from another directory.
diego
parents: 5749
diff changeset
22 #include "libavcodec/dsputil.h"
f7cbb7733146 Use full path for #includes from another directory.
diego
parents: 5749
diff changeset
23 #include "libavcodec/snow.h"
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
24
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
25 #include "gcc_fixes.h"
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
26 #include "dsputil_altivec.h"
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
27
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
28 #undef NDEBUG
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
29 #include <assert.h>
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
30
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
31
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
32
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
33 //FIXME remove this replication
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
34 #define slice_buffer_get_line(slice_buf, line_num) ((slice_buf)->line[line_num] ? (slice_buf)->line[line_num] : slice_buffer_load_line((slice_buf), (line_num)))
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
35
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
36 static DWTELEM * slice_buffer_load_line(slice_buffer * buf, int line)
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
37 {
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
38 int offset;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
39 DWTELEM * buffer;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
40
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
41 // av_log(NULL, AV_LOG_DEBUG, "Cache hit: %d\n", line);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
42
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
43 assert(buf->data_stack_top >= 0);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
44 // assert(!buf->line[line]);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
45 if (buf->line[line])
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
46 return buf->line[line];
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
47
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
48 offset = buf->line_width * line;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
49 buffer = buf->data_stack[buf->data_stack_top];
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
50 buf->data_stack_top--;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
51 buf->line[line] = buffer;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
52
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
53 // av_log(NULL, AV_LOG_DEBUG, "slice_buffer_load_line: line: %d remaining: %d\n", line, buf->data_stack_top + 1);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
54
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
55 return buffer;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
56 }
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
57
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
58
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
59 //altivec code
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
60
5612
0ffea9729a0d snow altivec is broken
lu_zero
parents: 5409
diff changeset
61 void ff_snow_horizontal_compose97i_altivec(IDWTELEM *b, int width)
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
62 {
5612
0ffea9729a0d snow altivec is broken
lu_zero
parents: 5409
diff changeset
63 #if 0
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
64 const int w2= (width+1)>>1;
5612
0ffea9729a0d snow altivec is broken
lu_zero
parents: 5409
diff changeset
65 DECLARE_ALIGNED_16(IDWTELEM, temp[(width>>1)]);
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
66 const int w_l= (width>>1);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
67 const int w_r= w2 - 1;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
68 int i;
5612
0ffea9729a0d snow altivec is broken
lu_zero
parents: 5409
diff changeset
69 vector signed short t1, t2, x, y, tmp1, tmp2;
0ffea9729a0d snow altivec is broken
lu_zero
parents: 5409
diff changeset
70 vector signed short *vbuf, *vtmp;
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
71 vector unsigned char align;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
72
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
73 { // Lift 0
5612
0ffea9729a0d snow altivec is broken
lu_zero
parents: 5409
diff changeset
74 IDWTELEM * const ref = b + w2 - 1;
0ffea9729a0d snow altivec is broken
lu_zero
parents: 5409
diff changeset
75 IDWTELEM b_0 = b[0];
0ffea9729a0d snow altivec is broken
lu_zero
parents: 5409
diff changeset
76 vector signed short v7 = vec_splat_s16(7);
0ffea9729a0d snow altivec is broken
lu_zero
parents: 5409
diff changeset
77 vbuf = (vector signed short *)b;
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
78
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
79 tmp1 = vec_ld (0, ref);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
80 align = vec_lvsl (0, ref);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
81 tmp2 = vec_ld (15, ref);
5612
0ffea9729a0d snow altivec is broken
lu_zero
parents: 5409
diff changeset
82 t1 = vec_perm(tmp1, tmp2, align);
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
83
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
84 for (i=0; i<w_l-15; i+=16) {
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
85 #if 0
5612
0ffea9729a0d snow altivec is broken
lu_zero
parents: 5409
diff changeset
86 /* b[i+0] = b[i+0] - ((3 * (ref[i+0] + ref[i+1]) + 4) >> 3);
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
87 b[i+1] = b[i+1] - ((3 * (ref[i+1] + ref[i+2]) + 4) >> 3);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
88 b[i+2] = b[i+2] - ((3 * (ref[i+2] + ref[i+3]) + 4) >> 3);
5612
0ffea9729a0d snow altivec is broken
lu_zero
parents: 5409
diff changeset
89 b[i+3] = b[i+3] - ((3 * (ref[i+3] + ref[i+4]) + 4) >> 3);*/
0ffea9729a0d snow altivec is broken
lu_zero
parents: 5409
diff changeset
90 b[i+0] = b[i+0] + ((7 * (ref[i+0] + ref[i+1])-1) >> 8);
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
91 #else
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
92
5612
0ffea9729a0d snow altivec is broken
lu_zero
parents: 5409
diff changeset
93 tmp1 = vec_ld (0, ref+8+i);
0ffea9729a0d snow altivec is broken
lu_zero
parents: 5409
diff changeset
94 tmp2 = vec_ld (15, ref+8+i);
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
95
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
96 t2 = vec_perm(tmp1, tmp2, align);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
97
5612
0ffea9729a0d snow altivec is broken
lu_zero
parents: 5409
diff changeset
98 y = vec_add(t1, vec_sld(t1,t2,2));
0ffea9729a0d snow altivec is broken
lu_zero
parents: 5409
diff changeset
99 // y = vec_add(vec_add(y,y),y);
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
100
5612
0ffea9729a0d snow altivec is broken
lu_zero
parents: 5409
diff changeset
101 tmp1 = vec_ld (0, ref+12+i);
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
102
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
103 y = vec_add(y, vec_splat_s32(4));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
104 y = vec_sra(y, vec_splat_u32(3));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
105
5612
0ffea9729a0d snow altivec is broken
lu_zero
parents: 5409
diff changeset
106 tmp2 = vec_ld (15, ref+12+i);
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
107
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
108 *vbuf = vec_sub(*vbuf, y);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
109
5612
0ffea9729a0d snow altivec is broken
lu_zero
parents: 5409
diff changeset
110 t1 = t2;
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
111
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
112 vbuf++;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
113
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
114 t2 = vec_perm(tmp1, tmp2, align);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
115
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
116 y = vec_add(t1,vec_sld(t1,t2,4));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
117 y = vec_add(vec_add(y,y),y);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
118
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
119 tmp1 = vec_ld (0, ref+12+i);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
120
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
121 y = vec_add(y, vec_splat_s32(4));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
122 y = vec_sra(y, vec_splat_u32(3));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
123
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
124 tmp2 = vec_ld (15, ref+12+i);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
125
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
126 *vbuf = vec_sub(*vbuf, y);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
127
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
128 t1=t2;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
129
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
130 vbuf++;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
131
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
132 t2 = vec_perm(tmp1, tmp2, align);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
133
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
134 y = vec_add(t1,vec_sld(t1,t2,4));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
135 y = vec_add(vec_add(y,y),y);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
136
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
137 tmp1 = vec_ld (0, ref+16+i);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
138
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
139 y = vec_add(y, vec_splat_s32(4));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
140 y = vec_sra(y, vec_splat_u32(3));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
141
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
142 tmp2 = vec_ld (15, ref+16+i);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
143
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
144 *vbuf = vec_sub(*vbuf, y);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
145
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
146 t1=t2;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
147
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
148 t2 = vec_perm(tmp1, tmp2, align);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
149
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
150 y = vec_add(t1,vec_sld(t1,t2,4));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
151 y = vec_add(vec_add(y,y),y);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
152
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
153 vbuf++;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
154
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
155 y = vec_add(y, vec_splat_s32(4));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
156 y = vec_sra(y, vec_splat_u32(3));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
157 *vbuf = vec_sub(*vbuf, y);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
158
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
159 t1=t2;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
160
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
161 vbuf++;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
162
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
163 #endif
5612
0ffea9729a0d snow altivec is broken
lu_zero
parents: 5409
diff changeset
164
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
165 }
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
166
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
167 snow_horizontal_compose_lift_lead_out(i, b, b, ref, width, w_l, 0, W_DM, W_DO, W_DS);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
168 b[0] = b_0 - ((W_DM * 2 * ref[1]+W_DO)>>W_DS);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
169 }
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
170
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
171 { // Lift 1
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
172 DWTELEM * const dst = b+w2;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
173
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
174 i = 0;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
175 for(; (((long)&dst[i]) & 0xF) && i<w_r; i++){
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
176 dst[i] = dst[i] - (b[i] + b[i + 1]);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
177 }
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
178
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
179 align = vec_lvsl(0, b+i);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
180 tmp1 = vec_ld(0, b+i);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
181 vbuf = (vector signed int*) (dst + i);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
182 tmp2 = vec_ld(15, b+i);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
183
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
184 t1 = vec_perm(tmp1, tmp2, align);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
185
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
186 for (; i<w_r-3; i+=4) {
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
187
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
188 #if 0
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
189 dst[i] = dst[i] - (b[i] + b[i + 1]);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
190 dst[i+1] = dst[i+1] - (b[i+1] + b[i + 2]);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
191 dst[i+2] = dst[i+2] - (b[i+2] + b[i + 3]);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
192 dst[i+3] = dst[i+3] - (b[i+3] + b[i + 4]);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
193 #else
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
194
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
195 tmp1 = vec_ld(0, b+4+i);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
196 tmp2 = vec_ld(15, b+4+i);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
197
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
198 t2 = vec_perm(tmp1, tmp2, align);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
199
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
200 y = vec_add(t1, vec_sld(t1,t2,4));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
201 *vbuf = vec_sub (*vbuf, y);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
202
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
203 vbuf++;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
204
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
205 t1 = t2;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
206
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
207 #endif
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
208
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
209 }
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
210
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
211 snow_horizontal_compose_lift_lead_out(i, dst, dst, b, width, w_r, 1, W_CM, W_CO, W_CS);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
212 }
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
213
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
214 { // Lift 2
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
215 DWTELEM * const ref = b+w2 - 1;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
216 DWTELEM b_0 = b[0];
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
217 vbuf= (vector signed int *) b;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
218
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
219 tmp1 = vec_ld (0, ref);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
220 align = vec_lvsl (0, ref);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
221 tmp2 = vec_ld (15, ref);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
222 t1= vec_perm(tmp1, tmp2, align);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
223
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
224 i = 0;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
225 for (; i<w_l-15; i+=16) {
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
226 #if 0
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
227 b[i] = b[i] - (((8 -(ref[i] + ref[i+1])) - (b[i] <<2)) >> 4);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
228 b[i+1] = b[i+1] - (((8 -(ref[i+1] + ref[i+2])) - (b[i+1]<<2)) >> 4);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
229 b[i+2] = b[i+2] - (((8 -(ref[i+2] + ref[i+3])) - (b[i+2]<<2)) >> 4);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
230 b[i+3] = b[i+3] - (((8 -(ref[i+3] + ref[i+4])) - (b[i+3]<<2)) >> 4);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
231 #else
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
232 tmp1 = vec_ld (0, ref+4+i);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
233 tmp2 = vec_ld (15, ref+4+i);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
234
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
235 t2 = vec_perm(tmp1, tmp2, align);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
236
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
237 y = vec_add(t1,vec_sld(t1,t2,4));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
238 y = vec_sub(vec_splat_s32(8),y);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
239
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
240 tmp1 = vec_ld (0, ref+8+i);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
241
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
242 x = vec_sl(*vbuf,vec_splat_u32(2));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
243 y = vec_sra(vec_sub(y,x),vec_splat_u32(4));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
244
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
245 tmp2 = vec_ld (15, ref+8+i);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
246
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
247 *vbuf = vec_sub( *vbuf, y);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
248
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
249 t1 = t2;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
250
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
251 vbuf++;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
252
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
253 t2 = vec_perm(tmp1, tmp2, align);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
254
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
255 y = vec_add(t1,vec_sld(t1,t2,4));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
256 y = vec_sub(vec_splat_s32(8),y);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
257
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
258 tmp1 = vec_ld (0, ref+12+i);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
259
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
260 x = vec_sl(*vbuf,vec_splat_u32(2));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
261 y = vec_sra(vec_sub(y,x),vec_splat_u32(4));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
262
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
263 tmp2 = vec_ld (15, ref+12+i);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
264
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
265 *vbuf = vec_sub( *vbuf, y);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
266
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
267 t1 = t2;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
268
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
269 vbuf++;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
270
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
271 t2 = vec_perm(tmp1, tmp2, align);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
272
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
273 y = vec_add(t1,vec_sld(t1,t2,4));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
274 y = vec_sub(vec_splat_s32(8),y);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
275
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
276 tmp1 = vec_ld (0, ref+16+i);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
277
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
278 x = vec_sl(*vbuf,vec_splat_u32(2));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
279 y = vec_sra(vec_sub(y,x),vec_splat_u32(4));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
280
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
281 tmp2 = vec_ld (15, ref+16+i);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
282
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
283 *vbuf = vec_sub( *vbuf, y);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
284
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
285 t1 = t2;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
286
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
287 vbuf++;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
288
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
289 t2 = vec_perm(tmp1, tmp2, align);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
290
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
291 y = vec_add(t1,vec_sld(t1,t2,4));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
292 y = vec_sub(vec_splat_s32(8),y);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
293
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
294 t1 = t2;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
295
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
296 x = vec_sl(*vbuf,vec_splat_u32(2));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
297 y = vec_sra(vec_sub(y,x),vec_splat_u32(4));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
298 *vbuf = vec_sub( *vbuf, y);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
299
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
300 vbuf++;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
301
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
302 #endif
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
303 }
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
304
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
305 snow_horizontal_compose_liftS_lead_out(i, b, b, ref, width, w_l);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
306 b[0] = b_0 - (((-2 * ref[1] + W_BO) - 4 * b_0) >> W_BS);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
307 }
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
308
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
309 { // Lift 3
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
310 DWTELEM * const src = b+w2;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
311
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
312 vbuf = (vector signed int *)b;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
313 vtmp = (vector signed int *)temp;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
314
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
315 i = 0;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
316 align = vec_lvsl(0, src);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
317
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
318 for (; i<w_r-3; i+=4) {
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
319 #if 0
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
320 temp[i] = src[i] - ((-3*(b[i] + b[i+1]))>>1);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
321 temp[i+1] = src[i+1] - ((-3*(b[i+1] + b[i+2]))>>1);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
322 temp[i+2] = src[i+2] - ((-3*(b[i+2] + b[i+3]))>>1);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
323 temp[i+3] = src[i+3] - ((-3*(b[i+3] + b[i+4]))>>1);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
324 #else
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
325 tmp1 = vec_ld(0,src+i);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
326 t1 = vec_add(vbuf[0],vec_sld(vbuf[0],vbuf[1],4));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
327 tmp2 = vec_ld(15,src+i);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
328 t1 = vec_sub(vec_splat_s32(0),t1); //bad!
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
329 t1 = vec_add(t1,vec_add(t1,t1));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
330 t2 = vec_perm(tmp1 ,tmp2 ,align);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
331 t1 = vec_sra(t1,vec_splat_u32(1));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
332 vbuf++;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
333 *vtmp = vec_sub(t2,t1);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
334 vtmp++;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
335
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
336 #endif
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
337
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
338 }
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
339
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
340 snow_horizontal_compose_lift_lead_out(i, temp, src, b, width, w_r, 1, -3, 0, 1);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
341 }
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
342
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
343 {
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
344 //Interleave
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
345 int a;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
346 vector signed int *t = (vector signed int *)temp,
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
347 *v = (vector signed int *)b;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
348
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
349 snow_interleave_line_header(&i, width, b, temp);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
350
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
351 for (; (i & 0xE) != 0xE; i-=2){
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
352 b[i+1] = temp[i>>1];
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
353 b[i] = b[i>>1];
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
354 }
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
355 for (i-=14; i>=0; i-=16){
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
356 a=i/4;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
357
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
358 v[a+3]=vec_mergel(v[(a>>1)+1],t[(a>>1)+1]);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
359 v[a+2]=vec_mergeh(v[(a>>1)+1],t[(a>>1)+1]);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
360 v[a+1]=vec_mergel(v[a>>1],t[a>>1]);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
361 v[a]=vec_mergeh(v[a>>1],t[a>>1]);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
362
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
363 }
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
364
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
365 }
5612
0ffea9729a0d snow altivec is broken
lu_zero
parents: 5409
diff changeset
366 #endif
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
367 }
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
368
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
369 void ff_snow_vertical_compose97i_altivec(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, DWTELEM *b3, DWTELEM *b4, DWTELEM *b5, int width)
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
370 {
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
371 int i, w4 = width/4;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
372 vector signed int *v0, *v1,*v2,*v3,*v4,*v5;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
373 vector signed int t1, t2;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
374
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
375 v0=(vector signed int *)b0;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
376 v1=(vector signed int *)b1;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
377 v2=(vector signed int *)b2;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
378 v3=(vector signed int *)b3;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
379 v4=(vector signed int *)b4;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
380 v5=(vector signed int *)b5;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
381
7333
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
382 for (i=0; i< w4;i++) {
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
383
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
384 #if 0
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
385 b4[i] -= (3*(b3[i] + b5[i])+4)>>3;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
386 b3[i] -= ((b2[i] + b4[i]));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
387 b2[i] += ((b1[i] + b3[i])+4*b2[i]+8)>>4;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
388 b1[i] += (3*(b0[i] + b2[i]))>>1;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
389 #else
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
390 t1 = vec_add(v3[i], v5[i]);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
391 t2 = vec_add(t1, vec_add(t1,t1));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
392 t1 = vec_add(t2, vec_splat_s32(4));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
393 v4[i] = vec_sub(v4[i], vec_sra(t1,vec_splat_u32(3)));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
394
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
395 v3[i] = vec_sub(v3[i], vec_add(v2[i], v4[i]));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
396
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
397 t1 = vec_add(vec_splat_s32(8), vec_add(v1[i], v3[i]));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
398 t2 = vec_sl(v2[i], vec_splat_u32(2));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
399 v2[i] = vec_add(v2[i], vec_sra(vec_add(t1,t2),vec_splat_u32(4)));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
400 t1 = vec_add(v0[i], v2[i]);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
401 t2 = vec_add(t1, vec_add(t1,t1));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
402 v1[i] = vec_add(v1[i], vec_sra(t2,vec_splat_u32(1)));
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
403
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
404 #endif
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
405 }
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
406
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
407 for(i*=4; i < width; i++)
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
408 {
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
409 b4[i] -= (W_DM*(b3[i] + b5[i])+W_DO)>>W_DS;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
410 b3[i] -= (W_CM*(b2[i] + b4[i])+W_CO)>>W_CS;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
411 b2[i] += (W_BM*(b1[i] + b3[i])+4*b2[i]+W_BO)>>W_BS;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
412 b1[i] += (W_AM*(b0[i] + b2[i])+W_AO)>>W_AS;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
413 }
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
414 }
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
415
3272
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
416 #define LOAD_BLOCKS \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
417 tmp1 = vec_ld(0, &block[3][y*src_stride]);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
418 align = vec_lvsl(0, &block[3][y*src_stride]);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
419 tmp2 = vec_ld(15, &block[3][y*src_stride]);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
420 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
421 b3 = vec_perm(tmp1,tmp2,align);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
422 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
423 tmp1 = vec_ld(0, &block[2][y*src_stride]);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
424 align = vec_lvsl(0, &block[2][y*src_stride]);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
425 tmp2 = vec_ld(15, &block[2][y*src_stride]);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
426 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
427 b2 = vec_perm(tmp1,tmp2,align);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
428 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
429 tmp1 = vec_ld(0, &block[1][y*src_stride]);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
430 align = vec_lvsl(0, &block[1][y*src_stride]);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
431 tmp2 = vec_ld(15, &block[1][y*src_stride]);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
432 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
433 b1 = vec_perm(tmp1,tmp2,align);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
434 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
435 tmp1 = vec_ld(0, &block[0][y*src_stride]);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
436 align = vec_lvsl(0, &block[0][y*src_stride]);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
437 tmp2 = vec_ld(15, &block[0][y*src_stride]);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
438 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
439 b0 = vec_perm(tmp1,tmp2,align);
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
440
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
441 #define LOAD_OBMCS \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
442 tmp1 = vec_ld(0, obmc1);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
443 align = vec_lvsl(0, obmc1);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
444 tmp2 = vec_ld(15, obmc1);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
445 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
446 ob1 = vec_perm(tmp1,tmp2,align);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
447 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
448 tmp1 = vec_ld(0, obmc2);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
449 align = vec_lvsl(0, obmc2);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
450 tmp2 = vec_ld(15, obmc2);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
451 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
452 ob2 = vec_perm(tmp1,tmp2,align);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
453 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
454 tmp1 = vec_ld(0, obmc3);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
455 align = vec_lvsl(0, obmc3);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
456 tmp2 = vec_ld(15, obmc3);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
457 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
458 ob3 = vec_perm(tmp1,tmp2,align);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
459 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
460 tmp1 = vec_ld(0, obmc4);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
461 align = vec_lvsl(0, obmc4);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
462 tmp2 = vec_ld(15, obmc4);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
463 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
464 ob4 = vec_perm(tmp1,tmp2,align);
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
465
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
466 /* interleave logic
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
467 * h1 <- [ a,b,a,b, a,b,a,b, a,b,a,b, a,b,a,b ]
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
468 * h2 <- [ c,d,c,d, c,d,c,d, c,d,c,d, c,d,c,d ]
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
469 * h <- [ a,b,c,d, a,b,c,d, a,b,c,d, a,b,c,d ]
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
470 */
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
471
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
472 #define STEPS_0_1\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
473 h1 = (vector unsigned short)\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
474 vec_mergeh(ob1, ob2);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
475 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
476 h2 = (vector unsigned short)\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
477 vec_mergeh(ob3, ob4);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
478 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
479 ih = (vector unsigned char)\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
480 vec_mergeh(h1,h2);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
481 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
482 l1 = (vector unsigned short) vec_mergeh(b3, b2);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
483 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
484 ih1 = (vector unsigned char) vec_mergel(h1, h2);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
485 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
486 l2 = (vector unsigned short) vec_mergeh(b1, b0);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
487 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
488 il = (vector unsigned char) vec_mergeh(l1, l2);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
489 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
490 v[0] = (vector signed int) vec_msum(ih, il, vec_splat_u32(0));\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
491 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
492 il1 = (vector unsigned char) vec_mergel(l1, l2);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
493 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
494 v[1] = (vector signed int) vec_msum(ih1, il1, vec_splat_u32(0));
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
495
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
496 #define FINAL_STEP_SCALAR\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
497 for(x=0; x<b_w; x++)\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
498 if(add){\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
499 vbuf[x] += dst[x + src_x];\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
500 vbuf[x] = (vbuf[x] + (1<<(FRAC_BITS-1))) >> FRAC_BITS;\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
501 if(vbuf[x]&(~255)) vbuf[x]= ~(vbuf[x]>>31);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
502 dst8[x + y*src_stride] = vbuf[x];\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
503 }else{\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
504 dst[x + src_x] -= vbuf[x];\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
505 }
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
506
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
507 static void inner_add_yblock_bw_8_obmc_16_altivec(uint8_t *obmc,
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
508 const int obmc_stride,
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
509 uint8_t * * block, int b_w,
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
510 int b_h, int src_x, int src_y,
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
511 int src_stride, slice_buffer * sb,
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
512 int add, uint8_t * dst8)
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
513 {
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
514 int y, x;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
515 DWTELEM * dst;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
516 vector unsigned short h1, h2, l1, l2;
3272
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
517 vector unsigned char ih, il, ih1, il1, tmp1, tmp2, align;
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
518 vector unsigned char b0,b1,b2,b3;
3272
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
519 vector unsigned char ob1,ob2,ob3,ob4;
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
520
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
521 DECLARE_ALIGNED_16(int, vbuf[16]);
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
522 vector signed int *v = (vector signed int *)vbuf, *d;
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
523
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
524 for(y=0; y<b_h; y++){
5409
13d52b7647a0 Ahem, fix typos overlooked in last commit.
diego
parents: 5408
diff changeset
525 //FIXME ugly misuse of obmc_stride
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
526
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
527 uint8_t *obmc1= obmc + y*obmc_stride;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
528 uint8_t *obmc2= obmc1+ (obmc_stride>>1);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
529 uint8_t *obmc3= obmc1+ obmc_stride*(obmc_stride>>1);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
530 uint8_t *obmc4= obmc3+ (obmc_stride>>1);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
531
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
532 dst = slice_buffer_get_line(sb, src_y + y);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
533 d = (vector signed int *)(dst + src_x);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
534
3272
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
535 //FIXME i could avoid some loads!
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
536
3272
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
537 // load blocks
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
538 LOAD_BLOCKS
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
539
3272
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
540 // load obmcs
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
541 LOAD_OBMCS
3271
e5349b5289d4 40% faster decode
lu_zero
parents: 3237
diff changeset
542
3272
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
543 // steps 0 1
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
544 STEPS_0_1
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
545
3272
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
546 FINAL_STEP_SCALAR
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
547
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
548 }
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
549
3272
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
550 }
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
551
3272
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
552 #define STEPS_2_3\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
553 h1 = (vector unsigned short) vec_mergel(ob1, ob2);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
554 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
555 h2 = (vector unsigned short) vec_mergel(ob3, ob4);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
556 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
557 ih = (vector unsigned char) vec_mergeh(h1,h2);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
558 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
559 l1 = (vector unsigned short) vec_mergel(b3, b2);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
560 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
561 l2 = (vector unsigned short) vec_mergel(b1, b0);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
562 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
563 ih1 = (vector unsigned char) vec_mergel(h1,h2);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
564 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
565 il = (vector unsigned char) vec_mergeh(l1,l2);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
566 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
567 v[2] = (vector signed int) vec_msum(ih, il, vec_splat_u32(0));\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
568 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
569 il1 = (vector unsigned char) vec_mergel(l1,l2);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
570 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
571 v[3] = (vector signed int) vec_msum(ih1, il1, vec_splat_u32(0));
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
572
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
573
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
574 static void inner_add_yblock_bw_16_obmc_32_altivec(uint8_t *obmc,
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
575 const int obmc_stride,
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
576 uint8_t * * block, int b_w,
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
577 int b_h, int src_x, int src_y,
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
578 int src_stride, slice_buffer * sb,
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
579 int add, uint8_t * dst8)
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
580 {
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
581 int y, x;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
582 DWTELEM * dst;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
583 vector unsigned short h1, h2, l1, l2;
3272
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
584 vector unsigned char ih, il, ih1, il1, tmp1, tmp2, align;
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
585 vector unsigned char b0,b1,b2,b3;
3272
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
586 vector unsigned char ob1,ob2,ob3,ob4;
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
587 DECLARE_ALIGNED_16(int, vbuf[b_w]);
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
588 vector signed int *v = (vector signed int *)vbuf, *d;
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
589
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
590 for(y=0; y<b_h; y++){
5409
13d52b7647a0 Ahem, fix typos overlooked in last commit.
diego
parents: 5408
diff changeset
591 //FIXME ugly misuse of obmc_stride
3272
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
592
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
593 uint8_t *obmc1= obmc + y*obmc_stride;
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
594 uint8_t *obmc2= obmc1+ (obmc_stride>>1);
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
595 uint8_t *obmc3= obmc1+ obmc_stride*(obmc_stride>>1);
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
596 uint8_t *obmc4= obmc3+ (obmc_stride>>1);
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
597
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
598 dst = slice_buffer_get_line(sb, src_y + y);
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
599 d = (vector signed int *)(dst + src_x);
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
600
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
601 // load blocks
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
602 LOAD_BLOCKS
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
603
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
604 // load obmcs
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
605 LOAD_OBMCS
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
606
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
607 // steps 0 1 2 3
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
608 STEPS_0_1
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
609
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
610 STEPS_2_3
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
611
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
612 FINAL_STEP_SCALAR
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
613
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
614 }
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
615 }
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
616
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
617 #define FINAL_STEP_VEC \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
618 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
619 if(add)\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
620 {\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
621 for(x=0; x<b_w/4; x++)\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
622 {\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
623 v[x] = vec_add(v[x], d[x]);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
624 v[x] = vec_sra(vec_add(v[x],\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
625 vec_sl( vec_splat_s32(1),\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
626 vec_splat_u32(7))),\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
627 vec_splat_u32(8));\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
628 \
3288
95f50b66e0b1 Macosx fix
lu_zero
parents: 3272
diff changeset
629 mask = (vector bool int) vec_sl((vector signed int)\
3272
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
630 vec_cmpeq(v[x],v[x]),vec_splat_u32(8));\
3288
95f50b66e0b1 Macosx fix
lu_zero
parents: 3272
diff changeset
631 mask = (vector bool int) vec_and(v[x],vec_nor(mask,mask));\
3272
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
632 \
3288
95f50b66e0b1 Macosx fix
lu_zero
parents: 3272
diff changeset
633 mask = (vector bool int)\
3272
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
634 vec_cmpeq((vector signed int)mask,\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
635 (vector signed int)vec_splat_u32(0));\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
636 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
637 vs = vec_sra(v[x],vec_splat_u32(8));\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
638 vs = vec_sra(v[x],vec_splat_u32(8));\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
639 vs = vec_sra(v[x],vec_splat_u32(15));\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
640 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
641 vs = vec_nor(vs,vs);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
642 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
643 v[x]= vec_sel(v[x],vs,mask);\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
644 }\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
645 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
646 for(x=0; x<b_w; x++)\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
647 dst8[x + y*src_stride] = vbuf[x];\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
648 \
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
649 }\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
650 else\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
651 for(x=0; x<b_w/4; x++)\
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
652 d[x] = vec_sub(d[x], v[x]);
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
653
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
654 static void inner_add_yblock_a_bw_8_obmc_16_altivec(uint8_t *obmc,
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
655 const int obmc_stride,
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
656 uint8_t * * block, int b_w,
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
657 int b_h, int src_x, int src_y,
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
658 int src_stride, slice_buffer * sb,
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
659 int add, uint8_t * dst8)
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
660 {
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
661 int y, x;
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
662 DWTELEM * dst;
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
663 vector bool int mask;
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
664 vector signed int vs;
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
665 vector unsigned short h1, h2, l1, l2;
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
666 vector unsigned char ih, il, ih1, il1, tmp1, tmp2, align;
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
667 vector unsigned char b0,b1,b2,b3;
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
668 vector unsigned char ob1,ob2,ob3,ob4;
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
669
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
670 DECLARE_ALIGNED_16(int, vbuf[16]);
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
671 vector signed int *v = (vector signed int *)vbuf, *d;
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
672
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
673 for(y=0; y<b_h; y++){
5409
13d52b7647a0 Ahem, fix typos overlooked in last commit.
diego
parents: 5408
diff changeset
674 //FIXME ugly misuse of obmc_stride
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
675
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
676 uint8_t *obmc1= obmc + y*obmc_stride;
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
677 uint8_t *obmc2= obmc1+ (obmc_stride>>1);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
678 uint8_t *obmc3= obmc1+ obmc_stride*(obmc_stride>>1);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
679 uint8_t *obmc4= obmc3+ (obmc_stride>>1);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
680
3272
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
681 dst = slice_buffer_get_line(sb, src_y + y);
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
682 d = (vector signed int *)(dst + src_x);
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
683
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
684 //FIXME i could avoid some loads!
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
685
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
686 // load blocks
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
687 LOAD_BLOCKS
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
688
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
689 // load obmcs
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
690 LOAD_OBMCS
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
691
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
692 // steps 0 1
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
693 STEPS_0_1
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
694
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
695 FINAL_STEP_VEC
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
696
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
697 }
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
698
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
699 }
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
700
3272
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
701 static void inner_add_yblock_a_bw_16_obmc_32_altivec(uint8_t *obmc,
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
702 const int obmc_stride,
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
703 uint8_t * * block, int b_w,
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
704 int b_h, int src_x, int src_y,
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
705 int src_stride, slice_buffer * sb,
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
706 int add, uint8_t * dst8)
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
707 {
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
708 int y, x;
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
709 DWTELEM * dst;
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
710 vector bool int mask;
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
711 vector signed int vs;
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
712 vector unsigned short h1, h2, l1, l2;
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
713 vector unsigned char ih, il, ih1, il1, tmp1, tmp2, align;
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
714 vector unsigned char b0,b1,b2,b3;
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
715 vector unsigned char ob1,ob2,ob3,ob4;
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
716 DECLARE_ALIGNED_16(int, vbuf[b_w]);
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
717 vector signed int *v = (vector signed int *)vbuf, *d;
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
718
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
719 for(y=0; y<b_h; y++){
5409
13d52b7647a0 Ahem, fix typos overlooked in last commit.
diego
parents: 5408
diff changeset
720 //FIXME ugly misuse of obmc_stride
3272
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
721
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
722 uint8_t *obmc1= obmc + y*obmc_stride;
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
723 uint8_t *obmc2= obmc1+ (obmc_stride>>1);
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
724 uint8_t *obmc3= obmc1+ obmc_stride*(obmc_stride>>1);
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
725 uint8_t *obmc4= obmc3+ (obmc_stride>>1);
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
726
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
727 dst = slice_buffer_get_line(sb, src_y + y);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
728 d = (vector signed int *)(dst + src_x);
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
729
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
730 // load blocks
3272
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
731 LOAD_BLOCKS
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
732
3272
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
733 // load obmcs
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
734 LOAD_OBMCS
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
735
3272
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
736 // steps 0 1 2 3
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
737 STEPS_0_1
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
738
3272
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
739 STEPS_2_3
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
740
3272
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
741 FINAL_STEP_VEC
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
742
3272
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
743 }
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
744 }
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
745
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
746
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
747 void ff_snow_inner_add_yblock_altivec(uint8_t *obmc, const int obmc_stride,
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
748 uint8_t * * block, int b_w, int b_h,
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
749 int src_x, int src_y, int src_stride,
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
750 slice_buffer * sb, int add,
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
751 uint8_t * dst8)
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
752 {
3272
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
753 if (src_x&15) {
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
754 if (b_w == 16)
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
755 inner_add_yblock_bw_16_obmc_32_altivec(obmc, obmc_stride, block,
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
756 b_w, b_h, src_x, src_y,
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
757 src_stride, sb, add, dst8);
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
758 else if (b_w == 8)
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
759 inner_add_yblock_bw_8_obmc_16_altivec(obmc, obmc_stride, block,
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
760 b_w, b_h, src_x, src_y,
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
761 src_stride, sb, add, dst8);
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
762 else
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
763 ff_snow_inner_add_yblock(obmc, obmc_stride, block, b_w, b_h, src_x,
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
764 src_y, src_stride, sb, add, dst8);
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
765 } else {
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
766 if (b_w == 16)
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
767 inner_add_yblock_a_bw_16_obmc_32_altivec(obmc, obmc_stride, block,
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
768 b_w, b_h, src_x, src_y,
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
769 src_stride, sb, add, dst8);
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
770 else if (b_w == 8)
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
771 inner_add_yblock_a_bw_8_obmc_16_altivec(obmc, obmc_stride, block,
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
772 b_w, b_h, src_x, src_y,
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
773 src_stride, sb, add, dst8);
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
774 else
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
775 ff_snow_inner_add_yblock(obmc, obmc_stride, block, b_w, b_h, src_x,
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
776 src_y, src_stride, sb, add, dst8);
b2a0cb3561b3 13% faster inner_add_yblock
lu_zero
parents: 3271
diff changeset
777 }
3222
38ee2f1d386d altivec support for snow
lu_zero
parents:
diff changeset
778 }
3547
e542c9978077 standalone snow dsputil init
lu_zero
parents: 3288
diff changeset
779
e542c9978077 standalone snow dsputil init
lu_zero
parents: 3288
diff changeset
780
e542c9978077 standalone snow dsputil init
lu_zero
parents: 3288
diff changeset
781 void snow_init_altivec(DSPContext* c, AVCodecContext *avctx)
e542c9978077 standalone snow dsputil init
lu_zero
parents: 3288
diff changeset
782 {
5612
0ffea9729a0d snow altivec is broken
lu_zero
parents: 5409
diff changeset
783 #if 0
7333
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
784 c->horizontal_compose97i = ff_snow_horizontal_compose97i_altivec;
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
785 c->vertical_compose97i = ff_snow_vertical_compose97i_altivec;
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
786 c->inner_add_yblock = ff_snow_inner_add_yblock_altivec;
5612
0ffea9729a0d snow altivec is broken
lu_zero
parents: 5409
diff changeset
787 #endif
3547
e542c9978077 standalone snow dsputil init
lu_zero
parents: 3288
diff changeset
788 }