28 const int16_t **
src, uint8_t *dest,
33 vector
signed int vo1, vo2, vo3, vo4;
34 vector
unsigned short vs1, vs2;
35 vector
unsigned char vf;
36 vector
unsigned int altivec_vectorShiftInt19 =
37 vec_add(vec_splat_u32(10), vec_splat_u32(9));
39 for (
i = 0;
i < 16;
i++)
43 vo2 = vec_ld(16,
val);
44 vo3 = vec_ld(32,
val);
45 vo4 = vec_ld(48,
val);
47 for (j = 0; j < filterSize; j++) {
48 unsigned int joffset=j<<1;
49 unsigned int xoffset=x<<1;
51 vector
signed short l1,vLumFilter;
52 LOAD_FILTER(vLumFilter,
filter);
53 vLumFilter = vec_splat(vLumFilter, 0);
55 yuv2planeX_8(vo1, vo2, l1,
src[j], x,
perm, vLumFilter);
56 yuv2planeX_8(vo3, vo4, l1,
src[j], x + 8,
perm, vLumFilter);
59 vo1 = vec_sra(vo1, altivec_vectorShiftInt19);
60 vo2 = vec_sra(vo2, altivec_vectorShiftInt19);
61 vo3 = vec_sra(vo3, altivec_vectorShiftInt19);
62 vo4 = vec_sra(vo4, altivec_vectorShiftInt19);
63 vs1 = vec_packsu(vo1, vo2);
64 vs2 = vec_packsu(vo3, vo4);
65 vf = vec_packsu(vs1, vs2);
71 const int16_t **
src, uint8_t *dest,
int dstW,
76 for (
i = x;
i < dstW;
i++) {
78 for (j = 0; j < filterSize; j++)
85 const int16_t **
src, uint8_t *dest,
int dstW,
88 int dst_u = -(uintptr_t)dest & 15;
93 for (
i = dst_u;
i < dstW - 15;
i += 16)
101 const uint8_t *
src,
const int16_t *
filter,
102 const int32_t *filterPos,
int filterSize)
106 switch (filterSize) {
108 for (
register int i = 0;
i < dstW;
i++) {
109 register int srcPos = filterPos[
i];
111 vector
unsigned char src_vF = unaligned_load(srcPos,
src);
112 vector
signed short src_v, filter_v;
113 vector
signed int val_vEven, val_s;
115 (vector
signed short)(VEC_MERGEH((vector
unsigned char)vzero, src_vF));
117 src_v = vec_mergeh(src_v, (vector
signed short)vzero);
119 val_vEven = vec_mule(src_v, filter_v);
120 val_s = vec_sums(val_vEven, vzero);
121 vec_st(val_s, 0, tempo);
122 dst[
i] =
FFMIN(tempo[3] >> 7, (1 << 15) - 1);
126 for (
register int i = 0;
i < dstW;
i++) {
127 register int srcPos = filterPos[
i];
130 vector
signed short src_v, filter_v;
131 vector
signed int val_v, val_s;
132 FIRST_LOAD(src_v0, srcPos,
src, permS);
133 LOAD_SRCV8(srcPos, 0,
src, permS, src_v0, src_v1, src_vF);
135 (vector
signed short)(VEC_MERGEH((vector
unsigned char)vzero, src_vF));
136 filter_v = vec_ld(
i << 4,
filter);
137 val_v = vec_msums(src_v, filter_v, (vector
signed int)vzero);
138 val_s = vec_sums(val_v, vzero);
139 vec_st(val_s, 0, tempo);
140 dst[
i] =
FFMIN(tempo[3] >> 7, (1 << 15) - 1);
145 for (
register int i = 0;
i < dstW;
i++) {
146 register int srcPos = filterPos[
i];
148 vector
unsigned char src_vF = unaligned_load(srcPos,
src);
149 vector
signed short src_vA =
150 (vector
signed short)(VEC_MERGEH((vector
unsigned char)vzero, src_vF));
151 vector
signed short src_vB =
152 (vector
signed short)(VEC_MERGEL((vector
unsigned char)vzero, src_vF));
153 vector
signed short filter_v0 = vec_ld(
i << 5,
filter);
154 vector
signed short filter_v1 = vec_ld((
i << 5) + 16,
filter);
156 vector
signed int val_acc = vec_msums(src_vA, filter_v0, (vector
signed int)vzero);
157 vector
signed int val_v = vec_msums(src_vB, filter_v1, val_acc);
159 vector
signed int val_s = vec_sums(val_v, vzero);
161 VEC_ST(val_s, 0, tempo);
162 dst[
i] =
FFMIN(tempo[3] >> 7, (1 << 15) - 1);
167 for (
register int i = 0;
i < dstW;
i++) {
169 register int srcPos = filterPos[
i];
170 register int val = 0;
171 for (j = 0; j < filterSize; j++)