30 vector
signed int vo1, vo2, vo3, vo4;
31 vector
unsigned short vs1, vs2;
32 vector
unsigned char vf;
33 vector
unsigned int altivec_vectorShiftInt19 =
34 vec_add(vec_splat_u32(10), vec_splat_u32(9));
36 for (
i = 0;
i < 16;
i++)
40 vo2 = vec_ld(16,
val);
41 vo3 = vec_ld(32,
val);
42 vo4 = vec_ld(48,
val);
44 for (j = 0; j < filterSize; j++) {
45 unsigned int joffset=j<<1;
46 unsigned int xoffset=x<<1;
48 vector
signed short l1,vLumFilter;
49 LOAD_FILTER(vLumFilter,
filter);
50 vLumFilter = vec_splat(vLumFilter, 0);
52 yuv2planeX_8(vo1, vo2, l1,
src[j], x,
perm, vLumFilter);
53 yuv2planeX_8(vo3, vo4, l1,
src[j], x + 8,
perm, vLumFilter);
56 vo1 = vec_sra(vo1, altivec_vectorShiftInt19);
57 vo2 = vec_sra(vo2, altivec_vectorShiftInt19);
58 vo3 = vec_sra(vo3, altivec_vectorShiftInt19);
59 vo4 = vec_sra(vo4, altivec_vectorShiftInt19);
60 vs1 = vec_packsu(vo1, vo2);
61 vs2 = vec_packsu(vo3, vo4);
62 vf = vec_packsu(vs1, vs2);
73 for (
i = x;
i < dstW;
i++) {
75 for (j = 0; j < filterSize; j++)
77 dest[
i] = av_clip_uint8(t >> 19);
85 int dst_u = -(uintptr_t)dest & 15;
90 for (
i = dst_u;
i < dstW - 15;
i += 16)
99 const int32_t *filterPos,
int filterSize)
104 if (filterSize % 4) {
105 for (
i = 0;
i < dstW;
i++) {
107 register int srcPos = filterPos[
i];
108 register int val = 0;
109 for (j = 0; j < filterSize; j++)
114 switch (filterSize) {
116 for (
i = 0;
i < dstW;
i++) {
117 register int srcPos = filterPos[
i];
119 vector
unsigned char src_vF = unaligned_load(srcPos,
src);
120 vector
signed short src_v, filter_v;
121 vector
signed int val_vEven, val_s;
123 (vector
signed short)(VEC_MERGEH((vector
unsigned char)vzero, src_vF));
125 src_v = vec_mergeh(src_v, (vector
signed short)vzero);
127 val_vEven = vec_mule(src_v, filter_v);
128 val_s = vec_sums(val_vEven, vzero);
129 vec_st(val_s, 0, tempo);
130 dst[
i] =
FFMIN(tempo[3] >> 7, (1 << 15) - 1);
134 for (
i = 0;
i < dstW;
i++) {
135 register int srcPos = filterPos[
i];
138 vector
signed short src_v, filter_v;
139 vector
signed int val_v, val_s;
140 FIRST_LOAD(src_v0, srcPos,
src, permS);
141 LOAD_SRCV8(srcPos, 0,
src, permS, src_v0, src_v1, src_vF);
143 (vector
signed short)(VEC_MERGEH((vector
unsigned char)vzero, src_vF));
144 filter_v = vec_ld(
i << 4,
filter);
145 val_v = vec_msums(src_v, filter_v, (vector
signed int)vzero);
146 val_s = vec_sums(val_v, vzero);
147 vec_st(val_s, 0, tempo);
148 dst[
i] =
FFMIN(tempo[3] >> 7, (1 << 15) - 1);
153 for (
i = 0;
i < dstW;
i++) {
154 register int srcPos = filterPos[
i];
156 vector
unsigned char src_vF = unaligned_load(srcPos,
src);
157 vector
signed short src_vA =
158 (vector
signed short)(VEC_MERGEH((vector
unsigned char)vzero, src_vF));
159 vector
signed short src_vB =
160 (vector
signed short)(VEC_MERGEL((vector
unsigned char)vzero, src_vF));
161 vector
signed short filter_v0 = vec_ld(
i << 5,
filter);
162 vector
signed short filter_v1 = vec_ld((
i << 5) + 16,
filter);
164 vector
signed int val_acc = vec_msums(src_vA, filter_v0, (vector
signed int)vzero);
165 vector
signed int val_v = vec_msums(src_vB, filter_v1, val_acc);
167 vector
signed int val_s = vec_sums(val_v, vzero);
169 VEC_ST(val_s, 0, tempo);
170 dst[
i] =
FFMIN(tempo[3] >> 7, (1 << 15) - 1);
175 for (
i = 0;
i < dstW;
i++) {
177 register int srcPos = filterPos[
i];
179 vector
signed int val_s, val_v = (vector
signed int)vzero;
180 vector
signed short av_unused filter_v0R;
183 FIRST_LOAD(src_v0, srcPos,
src, permS);
185 for (j = 0; j < filterSize - 15; j += 16) {
186 vector
unsigned char av_unused src_v1, src_vF;
188 filter_v0, filter_v1, src_vA, src_vB;
189 vector
signed int val_acc;
190 LOAD_SRCV(srcPos, j,
src, permS, src_v0, src_v1, src_vF);
192 (vector
signed short)(VEC_MERGEH((vector
unsigned char)vzero, src_vF));
194 (vector
signed short)(VEC_MERGEL((vector
unsigned char)vzero, src_vF));
195 GET_VFD(
i, j,
filter, filter_v0R, filter_v1R, permF, filter_v0, 0);
196 GET_VFD(
i, j,
filter, filter_v1R, filter_v2R, permF, filter_v1, 16);
198 val_acc = vec_msums(src_vA, filter_v0, val_v);
199 val_v = vec_msums(src_vB, filter_v1, val_acc);
200 UPDATE_PTR(filter_v2R, filter_v0R, src_v1, src_v0);
203 if (j < filterSize - 7) {
205 vector
unsigned char av_unused src_v1, src_vF;
206 vector
signed short src_v,
av_unused filter_v1R, filter_v;
207 LOAD_SRCV8(srcPos, j,
src, permS, src_v0, src_v1, src_vF);
209 (vector
signed short)(VEC_MERGEH((vector
unsigned char)vzero, src_vF));
210 GET_VFD(
i, j,
filter, filter_v0R, filter_v1R, permF, filter_v, 0);
211 val_v = vec_msums(src_v, filter_v, val_v);
213 val_s = vec_sums(val_v, vzero);
215 VEC_ST(val_s, 0, tempo);
216 dst[
i] =
FFMIN(tempo[3] >> 7, (1 << 15) - 1);