25 #define AVC_ITRANS_H(in0, in1, in2, in3, out0, out1, out2, out3) \
27 v8i16 tmp0_m, tmp1_m, tmp2_m, tmp3_m; \
32 tmp2_m = tmp2_m - in3; \
34 tmp3_m = in1 + tmp3_m; \
36 BUTTERFLY_4(tmp0_m, tmp1_m, tmp2_m, tmp3_m, out0, out1, out2, out3); \
42 #define DC_DEST_STRIDE 16
43 int16_t out0, out1, out2, out3, out4, out5, out6, out7;
45 v8i16 vec0, vec1, vec2, vec3;
46 v8i16 tmp0, tmp1, tmp2, tmp3;
47 v8i16 hres0, hres1, hres2, hres3;
48 v8i16 vres0, vres1, vres2, vres3;
49 v4i32 vres0_r, vres1_r, vres2_r, vres3_r;
50 const v4i32 de_q_vec = __msa_fill_w(de_q_val);
56 BUTTERFLY_4(tmp0, tmp2, tmp3, tmp1, vec0, vec3, vec2, vec1);
57 BUTTERFLY_4(vec0, vec1, vec2, vec3, hres0, hres3, hres2, hres1);
59 BUTTERFLY_4(hres0, hres1, hres3, hres2, vec0, vec3, vec2, vec1);
60 BUTTERFLY_4(vec0, vec1, vec2, vec3, vres0, vres1, vres2, vres3);
72 PCKEV_H2_SH(vres1_r, vres0_r, vres3_r, vres2_r, vec0, vec1);
74 out0 = __msa_copy_s_h(vec0, 0);
75 out1 = __msa_copy_s_h(vec0, 1);
76 out2 = __msa_copy_s_h(vec0, 2);
77 out3 = __msa_copy_s_h(vec0, 3);
78 out4 = __msa_copy_s_h(vec0, 4);
79 out5 = __msa_copy_s_h(vec0, 5);
80 out6 = __msa_copy_s_h(vec0, 6);
81 out7 = __msa_copy_s_h(vec0, 7);
91 out0 = __msa_copy_s_h(vec1, 0);
92 out1 = __msa_copy_s_h(vec1, 1);
93 out2 = __msa_copy_s_h(vec1, 2);
94 out3 = __msa_copy_s_h(vec1, 3);
95 out4 = __msa_copy_s_h(vec1, 4);
96 out5 = __msa_copy_s_h(vec1, 5);
97 out6 = __msa_copy_s_h(vec1, 6);
98 out7 = __msa_copy_s_h(vec1, 7);
108 #undef DC_DEST_STRIDE
113 v8i16
src0,
src1, src2, src3, src4, src5, src6, src7;
114 v8i16 vec0, vec1, vec2, vec3;
115 v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
116 v8i16 res0, res1, res2, res3, res4, res5, res6, res7;
117 v4i32 tmp0_r, tmp1_r, tmp2_r, tmp3_r, tmp4_r, tmp5_r, tmp6_r, tmp7_r;
118 v4i32 tmp0_l, tmp1_l, tmp2_l, tmp3_l, tmp4_l, tmp5_l, tmp6_l, tmp7_l;
119 v4i32 vec0_r, vec1_r, vec2_r, vec3_r, vec0_l, vec1_l, vec2_l, vec3_l;
120 v4i32 res0_r, res1_r, res2_r, res3_r, res4_r, res5_r, res6_r, res7_r;
121 v4i32 res0_l, res1_l, res2_l, res3_l, res4_l, res5_l, res6_l, res7_l;
122 v16i8 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7;
128 ST_SH8(zeros, zeros, zeros, zeros, zeros, zeros, zeros, zeros,
src, 8);
137 BUTTERFLY_4(vec0, vec1, vec2, vec3, tmp0, tmp1, tmp2, tmp3);
140 vec0 = src5 - vec0 - src3 - src7;
142 vec1 =
src1 - vec1 + src7 - src3;
144 vec2 = vec2 -
src1 + src7 + src5;
146 vec3 = vec3 + src3 + src5 +
src1;
156 BUTTERFLY_8(tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7,
157 res0, res1, res2, res3, res4, res5, res6, res7);
159 res0, res1, res2, res3, res4, res5, res6, res7);
168 BUTTERFLY_4(tmp0_r, tmp0_l, tmp4_l, tmp4_r, vec0_r, vec0_l, vec1_l, vec1_r);
170 vec2_r = tmp2_r >> 1;
171 vec2_l = tmp2_l >> 1;
174 vec3_r = tmp6_r >> 1;
175 vec3_l = tmp6_l >> 1;
179 BUTTERFLY_4(vec0_r, vec1_r, vec2_r, vec3_r, tmp0_r, tmp2_r, tmp4_r, tmp6_r);
180 BUTTERFLY_4(vec0_l, vec1_l, vec2_l, vec3_l, tmp0_l, tmp2_l, tmp4_l, tmp6_l);
182 vec0_r = tmp7_r >> 1;
183 vec0_l = tmp7_l >> 1;
184 vec0_r = tmp5_r - vec0_r - tmp3_r - tmp7_r;
185 vec0_l = tmp5_l - vec0_l - tmp3_l - tmp7_l;
186 vec1_r = tmp3_r >> 1;
187 vec1_l = tmp3_l >> 1;
188 vec1_r = tmp1_r - vec1_r + tmp7_r - tmp3_r;
189 vec1_l = tmp1_l - vec1_l + tmp7_l - tmp3_l;
190 vec2_r = tmp5_r >> 1;
191 vec2_l = tmp5_l >> 1;
192 vec2_r = vec2_r - tmp1_r + tmp7_r + tmp5_r;
193 vec2_l = vec2_l - tmp1_l + tmp7_l + tmp5_l;
194 vec3_r = tmp1_r >> 1;
195 vec3_l = tmp1_l >> 1;
196 vec3_r = vec3_r + tmp3_r + tmp5_r + tmp1_r;
197 vec3_l = vec3_l + tmp3_l + tmp5_l + tmp1_l;
198 tmp1_r = vec3_r >> 2;
199 tmp1_l = vec3_l >> 2;
202 tmp3_r = vec2_r >> 2;
203 tmp3_l = vec2_l >> 2;
206 tmp5_r = vec1_r >> 2;
207 tmp5_l = vec1_l >> 2;
210 tmp7_r = vec0_r >> 2;
211 tmp7_l = vec0_l >> 2;
212 tmp7_r = vec3_r - tmp7_r;
213 tmp7_l = vec3_l - tmp7_l;
215 BUTTERFLY_4(tmp0_r, tmp0_l, tmp7_l, tmp7_r, res0_r, res0_l, res7_l, res7_r);
216 BUTTERFLY_4(tmp2_r, tmp2_l, tmp5_l, tmp5_r, res1_r, res1_l, res6_l, res6_r);
217 BUTTERFLY_4(tmp4_r, tmp4_l, tmp3_l, tmp3_r, res2_r, res2_l, res5_l, res5_r);
218 BUTTERFLY_4(tmp6_r, tmp6_l, tmp1_l, tmp1_r, res3_r, res3_l, res4_l, res4_r);
219 SRA_4V(res0_r, res0_l, res1_r, res1_l, 6);
220 SRA_4V(res2_r, res2_l, res3_r, res3_l, 6);
221 SRA_4V(res4_r, res4_l, res5_r, res5_l, 6);
222 SRA_4V(res6_r, res6_l, res7_r, res7_l, 6);
223 PCKEV_H4_SH(res0_l, res0_r, res1_l, res1_r, res2_l, res2_r, res3_l, res3_r,
224 res0, res1, res2, res3);
225 PCKEV_H4_SH(res4_l, res4_r, res5_l, res5_r, res6_l, res6_r, res7_l, res7_r,
226 res4, res5, res6, res7);
227 LD_SB8(dst, dst_stride, dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7);
228 ILVR_B4_SH(zeros, dst0, zeros, dst1, zeros, dst2, zeros, dst3,
229 tmp0, tmp1, tmp2, tmp3);
230 ILVR_B4_SH(zeros, dst4, zeros, dst5, zeros, dst6, zeros, dst7,
231 tmp4, tmp5, tmp6, tmp7);
232 ADD4(res0, tmp0, res1, tmp1, res2, tmp2, res3, tmp3,
233 res0, res1, res2, res3);
234 ADD4(res4, tmp4, res5, tmp5, res6, tmp6, res7, tmp7,
235 res4, res5, res6, res7);
237 PCKEV_B4_SB(res1, res0, res3, res2, res5, res4, res7, res6,
238 dst0, dst1, dst2, dst3);
239 ST_D8(dst0, dst1, dst2, dst3, 0, 1, 0, 1, 0, 1, 0, 1, dst, dst_stride)
246 v16i8 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7;
247 v8i16 dst0_r, dst1_r, dst2_r, dst3_r, dst4_r, dst5_r, dst6_r, dst7_r;
251 dc_val = (
src[0] + 32) >> 6;
252 dc = __msa_fill_h(dc_val);
256 LD_SB8(dst, dst_stride, dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7);
257 ILVR_B4_SH(zeros, dst0, zeros, dst1, zeros, dst2, zeros, dst3,
258 dst0_r, dst1_r, dst2_r, dst3_r);
259 ILVR_B4_SH(zeros, dst4, zeros, dst5, zeros, dst6, zeros, dst7,
260 dst4_r, dst5_r, dst6_r, dst7_r);
262 dst0_r, dst1_r, dst2_r, dst3_r);
264 dst4_r, dst5_r, dst6_r, dst7_r);
266 dst4_r, dst5_r, dst6_r, dst7_r);
267 PCKEV_B4_SB(dst1_r, dst0_r, dst3_r, dst2_r, dst5_r, dst4_r, dst7_r, dst6_r,
268 dst0, dst1, dst2, dst3);
269 ST_D8(dst0, dst1, dst2, dst3, 0, 1, 0, 1, 0, 1, 0, 1, dst, dst_stride)
274 uint32_t src0_m, src1_m, src2_m, src3_m, out0_m, out1_m, out2_m, out3_m;
275 v16i8 dst0_m = { 0 };
276 v16i8 dst1_m = { 0 };
277 v8i16 hres0, hres1, hres2, hres3, vres0, vres1, vres2, vres3;
278 v8i16 inp0_m, inp1_m, res0_m, res1_m,
src1, src3;
281 const v8i16
zero = { 0 };
282 const uint8_t *dst1 = dst + dst_stride;
283 const uint8_t *dst2 = dst + 2 * dst_stride;
284 const uint8_t *dst3 = dst + 3 * dst_stride;
290 AVC_ITRANS_H(hres0, hres1, hres2, hres3, vres0, vres1, vres2, vres3);
296 ILVR_D2_SH(vres1, vres0, vres3, vres2, inp0_m, inp1_m);
300 ADD2(res0_m, inp0_m, res1_m, inp1_m, res0_m, res1_m);
302 PCKEV_B2_SB(res0_m, res0_m, res1_m, res1_m, dst0_m, dst1_m);
303 out0_m = __msa_copy_u_w((v4i32) dst0_m, 0);
304 out1_m = __msa_copy_u_w((v4i32) dst0_m, 1);
305 out2_m = __msa_copy_u_w((v4i32) dst1_m, 0);
306 out3_m = __msa_copy_u_w((v4i32) dst1_m, 1);
324 v8i16 pred_r, pred_l;
325 const uint32_t
src0 =
LW(dst);
326 const uint32_t
src1 =
LW(dst + dst_stride);
327 const uint32_t src2 =
LW(dst + 2 * dst_stride);
328 const uint32_t src3 =
LW(dst + 3 * dst_stride);
329 const int16_t
dc = (
src[0] + 32) >> 6;
330 const v8i16 input_dc = __msa_fill_h(
dc);
335 ADD2(pred_r, input_dc, pred_l, input_dc, pred_r, pred_l);
337 out = __msa_pckev_b((v16i8) pred_l, (v16i8) pred_r);
338 ST_W4(
out, 0, 1, 2, 3, dst, dst_stride);
350 const uint8_t nzc[5 * 8])
354 for (
i = 0;
i < 16;
i++) {
372 const uint8_t nzc[5 * 8])
376 for (cnt = 0; cnt < 16; cnt += 4) {
395 const uint8_t nzc[15 * 8])
399 for (j = 1; j < 3; j++) {
400 for (
i = (j * 16);
i < (j * 16 + 4);
i++) {
416 const uint8_t nzc[15 * 8])
420 for (j = 1; j < 3; j++) {
421 for (
i = (j * 16);
i < (j * 16 + 4);
i++) {
433 for (j = 1; j < 3; j++) {
434 for (
i = (j * 16 + 4);
i < (j * 16 + 8);
i++) {
451 const uint8_t nzc[5 * 8])
455 for (
i = 0;
i < 16;
i++) {