26 #define VP9_DCT_CONST_BITS 14
27 #define ROUND_POWER_OF_TWO(value, n) (((value) + (1 << ((n) - 1))) >> (n))
67 #define VP9_DOTP_CONST_PAIR(reg0, reg1, cnst0, cnst1, out0, out1) \
69 v8i16 k0_m = __msa_fill_h(cnst0); \
70 v4i32 s0_m, s1_m, s2_m, s3_m; \
72 s0_m = (v4i32) __msa_fill_h(cnst1); \
73 k0_m = __msa_ilvev_h((v8i16) s0_m, k0_m); \
75 ILVRL_H2_SW((-reg1), reg0, s1_m, s0_m); \
76 ILVRL_H2_SW(reg0, reg1, s3_m, s2_m); \
77 DOTP_SH2_SW(s1_m, s0_m, k0_m, k0_m, s1_m, s0_m); \
78 SRARI_W2_SW(s1_m, s0_m, VP9_DCT_CONST_BITS); \
79 out0 = __msa_pckev_h((v8i16) s0_m, (v8i16) s1_m); \
81 DOTP_SH2_SW(s3_m, s2_m, k0_m, k0_m, s1_m, s0_m); \
82 SRARI_W2_SW(s1_m, s0_m, VP9_DCT_CONST_BITS); \
83 out1 = __msa_pckev_h((v8i16) s0_m, (v8i16) s1_m); \
86 #define VP9_DOT_ADD_SUB_SRARI_PCK(in0, in1, in2, in3, in4, in5, in6, in7, \
87 dst0, dst1, dst2, dst3) \
89 v4i32 tp0_m, tp1_m, tp2_m, tp3_m, tp4_m; \
90 v4i32 tp5_m, tp6_m, tp7_m, tp8_m, tp9_m; \
92 DOTP_SH4_SW(in0, in1, in0, in1, in4, in4, in5, in5, \
93 tp0_m, tp2_m, tp3_m, tp4_m); \
94 DOTP_SH4_SW(in2, in3, in2, in3, in6, in6, in7, in7, \
95 tp5_m, tp6_m, tp7_m, tp8_m); \
96 BUTTERFLY_4(tp0_m, tp3_m, tp7_m, tp5_m, tp1_m, tp9_m, tp7_m, tp5_m); \
97 BUTTERFLY_4(tp2_m, tp4_m, tp8_m, tp6_m, tp3_m, tp0_m, tp4_m, tp2_m); \
98 SRARI_W4_SW(tp1_m, tp9_m, tp7_m, tp5_m, VP9_DCT_CONST_BITS); \
99 SRARI_W4_SW(tp3_m, tp0_m, tp4_m, tp2_m, VP9_DCT_CONST_BITS); \
100 PCKEV_H4_SH(tp1_m, tp3_m, tp9_m, tp0_m, tp7_m, tp4_m, tp5_m, tp2_m, \
101 dst0, dst1, dst2, dst3); \
104 #define VP9_DOT_SHIFT_RIGHT_PCK_H(in0, in1, in2) \
107 v4i32 tp0_m, tp1_m; \
109 DOTP_SH2_SW(in0, in1, in2, in2, tp1_m, tp0_m); \
110 SRARI_W2_SW(tp1_m, tp0_m, VP9_DCT_CONST_BITS); \
111 dst_m = __msa_pckev_h((v8i16) tp1_m, (v8i16) tp0_m); \
116 #define VP9_ADST8(in0, in1, in2, in3, in4, in5, in6, in7, \
117 out0, out1, out2, out3, out4, out5, out6, out7) \
119 v8i16 cnst0_m, cnst1_m, cnst2_m, cnst3_m, cnst4_m; \
120 v8i16 vec0_m, vec1_m, vec2_m, vec3_m, s0_m, s1_m; \
121 v8i16 coeff0_m = { cospi_2_64, cospi_6_64, cospi_10_64, cospi_14_64, \
122 cospi_18_64, cospi_22_64, cospi_26_64, cospi_30_64 }; \
123 v8i16 coeff1_m = { cospi_8_64, -cospi_8_64, cospi_16_64, \
124 -cospi_16_64, cospi_24_64, -cospi_24_64, 0, 0 }; \
126 SPLATI_H2_SH(coeff0_m, 0, 7, cnst0_m, cnst1_m); \
127 cnst2_m = -cnst0_m; \
128 ILVEV_H2_SH(cnst0_m, cnst1_m, cnst1_m, cnst2_m, cnst0_m, cnst1_m); \
129 SPLATI_H2_SH(coeff0_m, 4, 3, cnst2_m, cnst3_m); \
130 cnst4_m = -cnst2_m; \
131 ILVEV_H2_SH(cnst2_m, cnst3_m, cnst3_m, cnst4_m, cnst2_m, cnst3_m); \
133 ILVRL_H2_SH(in0, in7, vec1_m, vec0_m); \
134 ILVRL_H2_SH(in4, in3, vec3_m, vec2_m); \
135 VP9_DOT_ADD_SUB_SRARI_PCK(vec0_m, vec1_m, vec2_m, vec3_m, cnst0_m, \
136 cnst1_m, cnst2_m, cnst3_m, in7, in0, \
139 SPLATI_H2_SH(coeff0_m, 2, 5, cnst0_m, cnst1_m); \
140 cnst2_m = -cnst0_m; \
141 ILVEV_H2_SH(cnst0_m, cnst1_m, cnst1_m, cnst2_m, cnst0_m, cnst1_m); \
142 SPLATI_H2_SH(coeff0_m, 6, 1, cnst2_m, cnst3_m); \
143 cnst4_m = -cnst2_m; \
144 ILVEV_H2_SH(cnst2_m, cnst3_m, cnst3_m, cnst4_m, cnst2_m, cnst3_m); \
146 ILVRL_H2_SH(in2, in5, vec1_m, vec0_m); \
147 ILVRL_H2_SH(in6, in1, vec3_m, vec2_m); \
149 VP9_DOT_ADD_SUB_SRARI_PCK(vec0_m, vec1_m, vec2_m, vec3_m, cnst0_m, \
150 cnst1_m, cnst2_m, cnst3_m, in5, in2, \
152 BUTTERFLY_4(in7, in0, in2, in5, s1_m, s0_m, in2, in5); \
156 SPLATI_H4_SH(coeff1_m, 0, 4, 1, 5, \
157 cnst0_m, cnst1_m, cnst2_m, cnst3_m); \
159 ILVEV_H2_SH(cnst3_m, cnst0_m, cnst1_m, cnst2_m, cnst3_m, cnst2_m); \
160 cnst0_m = __msa_ilvev_h(cnst1_m, cnst0_m); \
163 ILVRL_H2_SH(in4, in3, vec1_m, vec0_m); \
164 ILVRL_H2_SH(in6, in1, vec3_m, vec2_m); \
165 VP9_DOT_ADD_SUB_SRARI_PCK(vec0_m, vec1_m, vec2_m, vec3_m, cnst0_m, \
166 cnst2_m, cnst3_m, cnst1_m, out1, out6, \
169 SPLATI_H2_SH(coeff1_m, 2, 3, cnst0_m, cnst1_m); \
170 cnst1_m = __msa_ilvev_h(cnst1_m, cnst0_m); \
172 ILVRL_H2_SH(in2, in5, vec1_m, vec0_m); \
173 ILVRL_H2_SH(s0_m, s1_m, vec3_m, vec2_m); \
174 out3 = VP9_DOT_SHIFT_RIGHT_PCK_H(vec0_m, vec1_m, cnst0_m); \
175 out4 = VP9_DOT_SHIFT_RIGHT_PCK_H(vec0_m, vec1_m, cnst1_m); \
176 out2 = VP9_DOT_SHIFT_RIGHT_PCK_H(vec2_m, vec3_m, cnst0_m); \
177 out5 = VP9_DOT_SHIFT_RIGHT_PCK_H(vec2_m, vec3_m, cnst1_m); \
184 #define VP9_MADD_SHORT(m0, m1, c0, c1, res0, res1) \
186 v4i32 madd0_m, madd1_m, madd2_m, madd3_m; \
187 v8i16 madd_s0_m, madd_s1_m; \
189 ILVRL_H2_SH(m1, m0, madd_s0_m, madd_s1_m); \
190 DOTP_SH4_SW(madd_s0_m, madd_s1_m, madd_s0_m, madd_s1_m, \
191 c0, c0, c1, c1, madd0_m, madd1_m, madd2_m, madd3_m); \
192 SRARI_W4_SW(madd0_m, madd1_m, madd2_m, madd3_m, VP9_DCT_CONST_BITS); \
193 PCKEV_H2_SH(madd1_m, madd0_m, madd3_m, madd2_m, res0, res1); \
196 #define VP9_MADD_BF(inp0, inp1, inp2, inp3, cst0, cst1, cst2, cst3, \
197 out0, out1, out2, out3) \
199 v8i16 madd_s0_m, madd_s1_m, madd_s2_m, madd_s3_m; \
200 v4i32 tmp0_m, tmp1_m, tmp2_m, tmp3_m, m4_m, m5_m; \
202 ILVRL_H2_SH(inp1, inp0, madd_s0_m, madd_s1_m); \
203 ILVRL_H2_SH(inp3, inp2, madd_s2_m, madd_s3_m); \
204 DOTP_SH4_SW(madd_s0_m, madd_s1_m, madd_s2_m, madd_s3_m, \
205 cst0, cst0, cst2, cst2, tmp0_m, tmp1_m, tmp2_m, tmp3_m); \
206 BUTTERFLY_4(tmp0_m, tmp1_m, tmp3_m, tmp2_m, \
207 m4_m, m5_m, tmp3_m, tmp2_m); \
208 SRARI_W4_SW(m4_m, m5_m, tmp2_m, tmp3_m, VP9_DCT_CONST_BITS); \
209 PCKEV_H2_SH(m5_m, m4_m, tmp3_m, tmp2_m, out0, out1); \
210 DOTP_SH4_SW(madd_s0_m, madd_s1_m, madd_s2_m, madd_s3_m, \
211 cst1, cst1, cst3, cst3, tmp0_m, tmp1_m, tmp2_m, tmp3_m); \
212 BUTTERFLY_4(tmp0_m, tmp1_m, tmp3_m, tmp2_m, \
213 m4_m, m5_m, tmp3_m, tmp2_m); \
214 SRARI_W4_SW(m4_m, m5_m, tmp2_m, tmp3_m, VP9_DCT_CONST_BITS); \
215 PCKEV_H2_SH(m5_m, m4_m, tmp3_m, tmp2_m, out2, out3); \
218 #define VP9_SET_COSPI_PAIR(c0_h, c1_h) \
220 v8i16 out0_m, r0_m, r1_m; \
222 r0_m = __msa_fill_h(c0_h); \
223 r1_m = __msa_fill_h(c1_h); \
224 out0_m = __msa_ilvev_h(r1_m, r0_m); \
229 #define VP9_ADDBLK_ST8x4_UB(dst, dst_stride, in0, in1, in2, in3) \
231 uint8_t *dst_m = (uint8_t *) (dst); \
232 v16u8 dst0_m, dst1_m, dst2_m, dst3_m; \
233 v16i8 tmp0_m, tmp1_m; \
234 v16i8 zero_m = { 0 }; \
235 v8i16 res0_m, res1_m, res2_m, res3_m; \
237 LD_UB4(dst_m, dst_stride, dst0_m, dst1_m, dst2_m, dst3_m); \
238 ILVR_B4_SH(zero_m, dst0_m, zero_m, dst1_m, zero_m, dst2_m, \
239 zero_m, dst3_m, res0_m, res1_m, res2_m, res3_m); \
240 ADD4(res0_m, in0, res1_m, in1, res2_m, in2, res3_m, in3, \
241 res0_m, res1_m, res2_m, res3_m); \
242 CLIP_SH4_0_255(res0_m, res1_m, res2_m, res3_m); \
243 PCKEV_B2_SB(res1_m, res0_m, res3_m, res2_m, tmp0_m, tmp1_m); \
244 ST8x4_UB(tmp0_m, tmp1_m, dst_m, dst_stride); \
247 #define VP9_IDCT4x4(in0, in1, in2, in3, out0, out1, out2, out3) \
249 v8i16 c0_m, c1_m, c2_m, c3_m; \
250 v8i16 step0_m, step1_m; \
251 v4i32 tmp0_m, tmp1_m, tmp2_m, tmp3_m; \
253 c0_m = VP9_SET_COSPI_PAIR(cospi_16_64, cospi_16_64); \
254 c1_m = VP9_SET_COSPI_PAIR(cospi_16_64, -cospi_16_64); \
255 step0_m = __msa_ilvr_h(in2, in0); \
256 DOTP_SH2_SW(step0_m, step0_m, c0_m, c1_m, tmp0_m, tmp1_m); \
258 c2_m = VP9_SET_COSPI_PAIR(cospi_24_64, -cospi_8_64); \
259 c3_m = VP9_SET_COSPI_PAIR(cospi_8_64, cospi_24_64); \
260 step1_m = __msa_ilvr_h(in3, in1); \
261 DOTP_SH2_SW(step1_m, step1_m, c2_m, c3_m, tmp2_m, tmp3_m); \
262 SRARI_W4_SW(tmp0_m, tmp1_m, tmp2_m, tmp3_m, VP9_DCT_CONST_BITS); \
264 PCKEV_H2_SW(tmp1_m, tmp0_m, tmp3_m, tmp2_m, tmp0_m, tmp2_m); \
265 SLDI_B2_0_SW(tmp0_m, tmp2_m, tmp1_m, tmp3_m, 8); \
266 BUTTERFLY_4((v8i16) tmp0_m, (v8i16) tmp1_m, \
267 (v8i16) tmp2_m, (v8i16) tmp3_m, \
268 out0, out1, out2, out3); \
271 #define VP9_IADST4x4(in0, in1, in2, in3, out0, out1, out2, out3) \
273 v8i16 res0_m, res1_m, c0_m, c1_m; \
274 v8i16 k1_m, k2_m, k3_m, k4_m; \
275 v8i16 zero_m = { 0 }; \
276 v4i32 tmp0_m, tmp1_m, tmp2_m, tmp3_m; \
277 v4i32 int0_m, int1_m, int2_m, int3_m; \
278 v8i16 mask_m = { sinpi_1_9, sinpi_2_9, sinpi_3_9, \
279 sinpi_4_9, -sinpi_1_9, -sinpi_2_9, -sinpi_3_9, \
282 SPLATI_H4_SH(mask_m, 3, 0, 1, 2, c0_m, c1_m, k1_m, k2_m); \
283 ILVEV_H2_SH(c0_m, c1_m, k1_m, k2_m, c0_m, c1_m); \
284 ILVR_H2_SH(in0, in2, in1, in3, res0_m, res1_m); \
285 DOTP_SH2_SW(res0_m, res1_m, c0_m, c1_m, tmp2_m, tmp1_m); \
286 int0_m = tmp2_m + tmp1_m; \
288 SPLATI_H2_SH(mask_m, 4, 7, k4_m, k3_m); \
289 ILVEV_H2_SH(k4_m, k1_m, k3_m, k2_m, c0_m, c1_m); \
290 DOTP_SH2_SW(res0_m, res1_m, c0_m, c1_m, tmp0_m, tmp1_m); \
291 int1_m = tmp0_m + tmp1_m; \
293 c0_m = __msa_splati_h(mask_m, 6); \
294 ILVL_H2_SH(k2_m, c0_m, zero_m, k2_m, c0_m, c1_m); \
295 ILVR_H2_SH(in0, in2, in1, in3, res0_m, res1_m); \
296 DOTP_SH2_SW(res0_m, res1_m, c0_m, c1_m, tmp0_m, tmp1_m); \
297 int2_m = tmp0_m + tmp1_m; \
299 c0_m = __msa_splati_h(mask_m, 6); \
300 c0_m = __msa_ilvev_h(c0_m, k1_m); \
302 res0_m = __msa_ilvr_h((in1), (in3)); \
303 tmp0_m = __msa_dotp_s_w(res0_m, c0_m); \
304 int3_m = tmp2_m + tmp0_m; \
306 res0_m = __msa_ilvr_h((in2), (in3)); \
307 c1_m = __msa_ilvev_h(k4_m, k3_m); \
309 tmp2_m = __msa_dotp_s_w(res0_m, c1_m); \
310 res1_m = __msa_ilvr_h((in0), (in2)); \
311 c1_m = __msa_ilvev_h(k1_m, zero_m); \
313 tmp3_m = __msa_dotp_s_w(res1_m, c1_m); \
317 SRARI_W4_SW(int0_m, int1_m, int2_m, int3_m, VP9_DCT_CONST_BITS); \
318 PCKEV_H2_SH(int0_m, int0_m, int1_m, int1_m, out0, out1); \
319 PCKEV_H2_SH(int2_m, int2_m, int3_m, int3_m, out2, out3); \
322 #define TRANSPOSE4X8_SH_SH(in0, in1, in2, in3, in4, in5, in6, in7, \
323 out0, out1, out2, out3, out4, out5, out6, out7) \
325 v8i16 tmp0_m, tmp1_m, tmp2_m, tmp3_m; \
326 v8i16 tmp0_n, tmp1_n, tmp2_n, tmp3_n; \
327 v8i16 zero_m = { 0 }; \
329 ILVR_H4_SH(in1, in0, in3, in2, in5, in4, in7, in6, \
330 tmp0_n, tmp1_n, tmp2_n, tmp3_n); \
331 ILVRL_W2_SH(tmp1_n, tmp0_n, tmp0_m, tmp2_m); \
332 ILVRL_W2_SH(tmp3_n, tmp2_n, tmp1_m, tmp3_m); \
334 out0 = (v8i16) __msa_ilvr_d((v2i64) tmp1_m, (v2i64) tmp0_m); \
335 out1 = (v8i16) __msa_ilvl_d((v2i64) tmp1_m, (v2i64) tmp0_m); \
336 out2 = (v8i16) __msa_ilvr_d((v2i64) tmp3_m, (v2i64) tmp2_m); \
337 out3 = (v8i16) __msa_ilvl_d((v2i64) tmp3_m, (v2i64) tmp2_m); \
354 vec = __msa_fill_h(out);
362 v8i16 in0, in1, in2, in3;
365 LD4x4_SH(input, in0, in1, in2, in3);
367 VP9_IDCT4x4(in0, in1, in2, in3, in0, in1, in2, in3);
370 VP9_IDCT4x4(in0, in1, in2, in3, in0, in1, in2, in3);
379 v8i16 in0, in1, in2, in3;
382 LD4x4_SH(input, in0, in1, in2, in3);
396 v8i16 in0, in1, in2, in3;
399 LD4x4_SH(input, in0, in1, in2, in3);
404 VP9_IDCT4x4(in0, in1, in2, in3, in0, in1, in2, in3);
413 v8i16 in0, in1, in2, in3;
416 LD4x4_SH(input, in0, in1, in2, in3);
418 VP9_IDCT4x4(in0, in1, in2, in3, in0, in1, in2, in3);
427 #define VP9_SET_CONST_PAIR(mask_h, idx1_h, idx2_h) \
431 SPLATI_H2_SH(mask_h, idx1_h, idx2_h, c0_m, c1_m); \
432 c0_m = __msa_ilvev_h(c1_m, c0_m); \
438 #define VP9_MADD(inp0, inp1, inp2, inp3, cst0, cst1, cst2, cst3, \
439 out0, out1, out2, out3) \
441 v8i16 madd_s0_m, madd_s1_m, madd_s2_m, madd_s3_m; \
442 v4i32 tmp0_m, tmp1_m, tmp2_m, tmp3_m; \
444 ILVRL_H2_SH(inp1, inp0, madd_s1_m, madd_s0_m); \
445 ILVRL_H2_SH(inp3, inp2, madd_s3_m, madd_s2_m); \
446 DOTP_SH4_SW(madd_s1_m, madd_s0_m, madd_s1_m, madd_s0_m, \
447 cst0, cst0, cst1, cst1, tmp0_m, tmp1_m, tmp2_m, tmp3_m); \
448 SRARI_W4_SW(tmp0_m, tmp1_m, tmp2_m, tmp3_m, VP9_DCT_CONST_BITS); \
449 PCKEV_H2_SH(tmp1_m, tmp0_m, tmp3_m, tmp2_m, out0, out1); \
450 DOTP_SH4_SW(madd_s3_m, madd_s2_m, madd_s3_m, madd_s2_m, \
451 cst2, cst2, cst3, cst3, tmp0_m, tmp1_m, tmp2_m, tmp3_m); \
452 SRARI_W4_SW(tmp0_m, tmp1_m, tmp2_m, tmp3_m, VP9_DCT_CONST_BITS); \
453 PCKEV_H2_SH(tmp1_m, tmp0_m, tmp3_m, tmp2_m, out2, out3); \
457 #define VP9_IDCT8x8_1D(in0, in1, in2, in3, in4, in5, in6, in7, \
458 out0, out1, out2, out3, out4, out5, out6, out7) \
460 v8i16 tp0_m, tp1_m, tp2_m, tp3_m, tp4_m, tp5_m, tp6_m, tp7_m; \
461 v8i16 k0_m, k1_m, k2_m, k3_m, res0_m, res1_m, res2_m, res3_m; \
462 v4i32 tmp0_m, tmp1_m, tmp2_m, tmp3_m; \
463 v8i16 mask_m = { cospi_28_64, cospi_4_64, cospi_20_64, cospi_12_64, \
464 cospi_16_64, -cospi_4_64, -cospi_20_64, -cospi_16_64 }; \
466 k0_m = VP9_SET_CONST_PAIR(mask_m, 0, 5); \
467 k1_m = VP9_SET_CONST_PAIR(mask_m, 1, 0); \
468 k2_m = VP9_SET_CONST_PAIR(mask_m, 6, 3); \
469 k3_m = VP9_SET_CONST_PAIR(mask_m, 3, 2); \
470 VP9_MADD(in1, in7, in3, in5, k0_m, k1_m, k2_m, k3_m, in1, in7, in3, in5); \
471 SUB2(in1, in3, in7, in5, res0_m, res1_m); \
472 k0_m = VP9_SET_CONST_PAIR(mask_m, 4, 7); \
473 k1_m = __msa_splati_h(mask_m, 4); \
475 ILVRL_H2_SH(res0_m, res1_m, res2_m, res3_m); \
476 DOTP_SH4_SW(res2_m, res3_m, res2_m, res3_m, k0_m, k0_m, k1_m, k1_m, \
477 tmp0_m, tmp1_m, tmp2_m, tmp3_m); \
478 SRARI_W4_SW(tmp0_m, tmp1_m, tmp2_m, tmp3_m, VP9_DCT_CONST_BITS); \
480 PCKEV_H2_SH(tmp1_m, tmp0_m, tmp3_m, tmp2_m, tp5_m, tp6_m); \
482 k2_m = VP9_SET_COSPI_PAIR(cospi_24_64, -cospi_8_64); \
483 k3_m = VP9_SET_COSPI_PAIR(cospi_8_64, cospi_24_64); \
484 VP9_MADD(in0, in4, in2, in6, k1_m, k0_m, k2_m, k3_m, \
485 in0, in4, in2, in6); \
486 BUTTERFLY_4(in0, in4, in2, in6, tp0_m, tp1_m, tp2_m, tp3_m); \
487 BUTTERFLY_8(tp0_m, tp1_m, tp2_m, tp3_m, tp4_m, tp5_m, tp6_m, tp7_m, \
488 out0, out1, out2, out3, out4, out5, out6, out7); \
491 #define VP9_IADST8x8_1D(in0, in1, in2, in3, in4, in5, in6, in7, \
492 out0, out1, out2, out3, out4, out5, out6, out7) \
494 v4i32 r0_m, r1_m, r2_m, r3_m, r4_m, r5_m, r6_m, r7_m; \
495 v4i32 m0_m, m1_m, m2_m, m3_m, t0_m, t1_m; \
496 v8i16 res0_m, res1_m, res2_m, res3_m, k0_m, k1_m, in_s0, in_s1; \
497 v8i16 mask1_m = { cospi_2_64, cospi_30_64, -cospi_2_64, \
498 cospi_10_64, cospi_22_64, -cospi_10_64, cospi_18_64, cospi_14_64 }; \
499 v8i16 mask2_m = { cospi_14_64, -cospi_18_64, cospi_26_64, \
500 cospi_6_64, -cospi_26_64, cospi_8_64, cospi_24_64, -cospi_8_64 }; \
501 v8i16 mask3_m = { -cospi_24_64, cospi_8_64, cospi_16_64, \
502 -cospi_16_64, 0, 0, 0, 0 }; \
504 k0_m = VP9_SET_CONST_PAIR(mask1_m, 0, 1); \
505 k1_m = VP9_SET_CONST_PAIR(mask1_m, 1, 2); \
506 ILVRL_H2_SH(in1, in0, in_s1, in_s0); \
507 DOTP_SH4_SW(in_s1, in_s0, in_s1, in_s0, k0_m, k0_m, k1_m, k1_m, \
508 r0_m, r1_m, r2_m, r3_m); \
509 k0_m = VP9_SET_CONST_PAIR(mask1_m, 6, 7); \
510 k1_m = VP9_SET_CONST_PAIR(mask2_m, 0, 1); \
511 ILVRL_H2_SH(in5, in4, in_s1, in_s0); \
512 DOTP_SH4_SW(in_s1, in_s0, in_s1, in_s0, k0_m, k0_m, k1_m, k1_m, \
513 r4_m, r5_m, r6_m, r7_m); \
514 ADD4(r0_m, r4_m, r1_m, r5_m, r2_m, r6_m, r3_m, r7_m, \
515 m0_m, m1_m, m2_m, m3_m); \
516 SRARI_W4_SW(m0_m, m1_m, m2_m, m3_m, VP9_DCT_CONST_BITS); \
517 PCKEV_H2_SH(m1_m, m0_m, m3_m, m2_m, res0_m, res1_m); \
518 SUB4(r0_m, r4_m, r1_m, r5_m, r2_m, r6_m, r3_m, r7_m, \
519 m0_m, m1_m, m2_m, m3_m); \
520 SRARI_W4_SW(m0_m, m1_m, m2_m, m3_m, VP9_DCT_CONST_BITS); \
521 PCKEV_H2_SW(m1_m, m0_m, m3_m, m2_m, t0_m, t1_m); \
522 k0_m = VP9_SET_CONST_PAIR(mask1_m, 3, 4); \
523 k1_m = VP9_SET_CONST_PAIR(mask1_m, 4, 5); \
524 ILVRL_H2_SH(in3, in2, in_s1, in_s0); \
525 DOTP_SH4_SW(in_s1, in_s0, in_s1, in_s0, k0_m, k0_m, k1_m, k1_m, \
526 r0_m, r1_m, r2_m, r3_m); \
527 k0_m = VP9_SET_CONST_PAIR(mask2_m, 2, 3); \
528 k1_m = VP9_SET_CONST_PAIR(mask2_m, 3, 4); \
529 ILVRL_H2_SH(in7, in6, in_s1, in_s0); \
530 DOTP_SH4_SW(in_s1, in_s0, in_s1, in_s0, k0_m, k0_m, k1_m, k1_m, \
531 r4_m, r5_m, r6_m, r7_m); \
532 ADD4(r0_m, r4_m, r1_m, r5_m, r2_m, r6_m, r3_m, r7_m, \
533 m0_m, m1_m, m2_m, m3_m); \
534 SRARI_W4_SW(m0_m, m1_m, m2_m, m3_m, VP9_DCT_CONST_BITS); \
535 PCKEV_H2_SH(m1_m, m0_m, m3_m, m2_m, res2_m, res3_m); \
536 SUB4(r0_m, r4_m, r1_m, r5_m, r2_m, r6_m, r3_m, r7_m, \
537 m0_m, m1_m, m2_m, m3_m); \
538 SRARI_W4_SW(m0_m, m1_m, m2_m, m3_m, VP9_DCT_CONST_BITS); \
539 PCKEV_H2_SW(m1_m, m0_m, m3_m, m2_m, r2_m, r3_m); \
540 ILVRL_H2_SW(r3_m, r2_m, m2_m, m3_m); \
541 BUTTERFLY_4(res0_m, res1_m, res3_m, res2_m, out0, in7, in4, in3); \
542 k0_m = VP9_SET_CONST_PAIR(mask2_m, 5, 6); \
543 k1_m = VP9_SET_CONST_PAIR(mask2_m, 6, 7); \
544 ILVRL_H2_SH(t1_m, t0_m, in_s1, in_s0); \
545 DOTP_SH4_SW(in_s1, in_s0, in_s1, in_s0, k0_m, k0_m, k1_m, k1_m, \
546 r0_m, r1_m, r2_m, r3_m); \
547 k1_m = VP9_SET_CONST_PAIR(mask3_m, 0, 1); \
548 DOTP_SH4_SW(m2_m, m3_m, m2_m, m3_m, k0_m, k0_m, k1_m, k1_m, \
549 r4_m, r5_m, r6_m, r7_m); \
550 ADD4(r0_m, r6_m, r1_m, r7_m, r2_m, r4_m, r3_m, r5_m, \
551 m0_m, m1_m, m2_m, m3_m); \
552 SRARI_W4_SW(m0_m, m1_m, m2_m, m3_m, VP9_DCT_CONST_BITS); \
553 PCKEV_H2_SH(m1_m, m0_m, m3_m, m2_m, in1, out6); \
554 SUB4(r0_m, r6_m, r1_m, r7_m, r2_m, r4_m, r3_m, r5_m, \
555 m0_m, m1_m, m2_m, m3_m); \
556 SRARI_W4_SW(m0_m, m1_m, m2_m, m3_m, VP9_DCT_CONST_BITS); \
557 PCKEV_H2_SH(m1_m, m0_m, m3_m, m2_m, in2, in5); \
558 k0_m = VP9_SET_CONST_PAIR(mask3_m, 2, 2); \
559 k1_m = VP9_SET_CONST_PAIR(mask3_m, 2, 3); \
560 ILVRL_H2_SH(in4, in3, in_s1, in_s0); \
561 DOTP_SH4_SW(in_s1, in_s0, in_s1, in_s0, k0_m, k0_m, k1_m, k1_m, \
562 m0_m, m1_m, m2_m, m3_m); \
563 SRARI_W4_SW(m0_m, m1_m, m2_m, m3_m, VP9_DCT_CONST_BITS); \
564 PCKEV_H2_SH(m1_m, m0_m, m3_m, m2_m, in3, out4); \
565 ILVRL_H2_SW(in5, in2, m2_m, m3_m); \
566 DOTP_SH4_SW(m2_m, m3_m, m2_m, m3_m, k0_m, k0_m, k1_m, k1_m, \
567 m0_m, m1_m, m2_m, m3_m); \
568 SRARI_W4_SW(m0_m, m1_m, m2_m, m3_m, VP9_DCT_CONST_BITS); \
569 PCKEV_H2_SH(m1_m, m0_m, m3_m, m2_m, out2, in5); \
587 vec = __msa_fill_h(val);
590 dst += (4 * dst_stride);
597 v8i16 in0, in1, in2, in3, in4, in5, in6, in7;
598 v8i16
s0,
s1,
s2,
s3,
s4,
s5,
s6, s7, k0, k1, k2, k3, m0, m1, m2, m3;
599 v4i32 tmp0, tmp1, tmp2, tmp3;
603 LD_SH8(input, 8, in0, in1, in2, in3, in4, in5, in6, in7);
614 DOTP_SH4_SW(s0, s0, s1, s1, k0, k1, k2, k3, tmp0, tmp1, tmp2, tmp3);
626 DOTP_SH4_SW(s0, s0, s1, s1, k0, k1, k2, k3, tmp0, tmp1, tmp2, tmp3);
633 s0 = __msa_ilvr_h(s6, s5);
642 in0, in1, in2, in3, in4, in5, in6, in7);
644 in0, in1, in2, in3, in4, in5, in6, in7);
646 in0, in1, in2, in3, in4, in5, in6, in7);
654 dst += (4 * dst_stride);
661 v8i16 in0, in1, in2, in3, in4, in5, in6, in7;
664 LD_SH8(input, 8, in0, in1, in2, in3, in4, in5, in6, in7);
667 in0, in1, in2, in3, in4, in5, in6, in7);
670 in0, in1, in2, in3, in4, in5, in6, in7);
673 in0, in1, in2, in3, in4, in5, in6, in7);
679 dst += (4 * dst_stride);
686 v8i16 in0, in1, in2, in3, in4, in5, in6, in7;
687 v8i16 res0, res1, res2, res3, res4, res5, res6, res7;
688 v16u8 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7;
689 v8i16 out0, out1, out2, out3, out4, out5, out6, out7;
690 v8i16 cnst0, cnst1, cnst2, cnst3, cnst4;
691 v8i16 temp0, temp1, temp2, temp3,
s0,
s1;
695 LD_SH8(input, 8, in0, in1, in2, in3, in4, in5, in6, in7);
698 VP9_ADST8(in0, in1, in2, in3, in4, in5, in6, in7,
699 in0, in1, in2, in3, in4, in5, in6, in7);
703 in0, in1, in2, in3, in4, in5, in6, in7);
708 ILVEV_H2_SH(cnst0, cnst1, cnst1, cnst2, cnst0, cnst1);
712 ILVEV_H2_SH(cnst2, cnst3, cnst3, cnst4, cnst2, cnst3);
717 cnst3, in7, in0, in4, in3);
722 ILVEV_H2_SH(cnst0, cnst1, cnst1, cnst2, cnst0, cnst1);
726 ILVEV_H2_SH(cnst2, cnst3, cnst3, cnst4, cnst2, cnst3);
731 cnst3, in5, in2, in6, in1);
736 dst0 =
LD_UB(dst + 0 * dst_stride);
737 dst7 =
LD_UB(dst + 7 * dst_stride);
739 res0 = (v8i16) __msa_ilvr_b(zero, (v16i8) dst0);
742 res0 = (v8i16) __msa_pckev_b((v16i8) res0, (v16i8) res0);
745 res7 = (v8i16) __msa_ilvr_b(zero, (v16i8) dst7);
748 res7 = (v8i16) __msa_pckev_b((v16i8) res7, (v16i8) res7);
749 ST8x1_UB(res7, dst + 7 * dst_stride);
756 ILVEV_H2_SH(cnst3, cnst0, cnst1, cnst2, cnst3, cnst2);
757 cnst0 = __msa_ilvev_h(cnst1, cnst0);
763 cnst1, out1, out6, s0, s1);
766 dst1 =
LD_UB(dst + 1 * dst_stride);
767 dst6 =
LD_UB(dst + 6 * dst_stride);
768 ILVR_B2_SH(zero, dst1, zero, dst6, res1, res6);
769 ADD2(res1, out1, res6, out6, res1, res6);
773 ST8x1_UB(res6, dst + 6 * dst_stride);
777 cnst1 = __msa_ilvev_h(cnst1, cnst0);
785 dst3 =
LD_UB(dst + 3 * dst_stride);
786 dst4 =
LD_UB(dst + 4 * dst_stride);
787 ILVR_B2_SH(zero, dst3, zero, dst4, res3, res4);
788 ADD2(res3, out3, res4, out4, res3, res4);
791 ST8x1_UB(res3, dst + 3 * dst_stride);
792 ST8x1_UB(res4, dst + 4 * dst_stride);
798 dst2 =
LD_UB(dst + 2 * dst_stride);
799 dst5 =
LD_UB(dst + 5 * dst_stride);
800 ILVR_B2_SH(zero, dst2, zero, dst5, res2, res5);
801 ADD2(res2, out2, res5, out5, res2, res5);
804 ST8x1_UB(res2, dst + 2 * dst_stride);
805 ST8x1_UB(res5, dst + 5 * dst_stride);
811 v8i16 in0, in1, in2, in3, in4, in5, in6, in7;
814 LD_SH8(input, 8, in1, in6, in3, in4, in5, in2, in7, in0);
817 in0, in1, in2, in3, in4, in5, in6, in7);
820 in0, in1, in2, in3, in4, in5, in6, in7);
823 in0, in1, in2, in3, in4, in5, in6, in7);
829 dst += (4 * dst_stride);
836 v8i16 in0, in1, in2, in3, in4, in5, in6, in7;
839 LD_SH8(input, 8, in0, in1, in2, in3, in4, in5, in6, in7);
843 in0, in1, in2, in3, in4, in5, in6, in7);
846 in1, in6, in3, in4, in5, in2, in7, in0);
849 in0, in1, in2, in3, in4, in5, in6, in7);
855 dst += (4 * dst_stride);
859 #define VP9_IADST8x16_1D(r0, r1, r2, r3, r4, r5, r6, r7, r8, \
860 r9, r10, r11, r12, r13, r14, r15, \
861 out0, out1, out2, out3, out4, out5, \
862 out6, out7, out8, out9, out10, out11, \
863 out12, out13, out14, out15) \
865 v8i16 g0_m, g1_m, g2_m, g3_m, g4_m, g5_m, g6_m, g7_m; \
866 v8i16 g8_m, g9_m, g10_m, g11_m, g12_m, g13_m, g14_m, g15_m; \
867 v8i16 h0_m, h1_m, h2_m, h3_m, h4_m, h5_m, h6_m, h7_m; \
868 v8i16 h8_m, h9_m, h10_m, h11_m; \
869 v8i16 k0_m, k1_m, k2_m, k3_m; \
872 k0_m = VP9_SET_COSPI_PAIR(cospi_1_64, cospi_31_64); \
873 k1_m = VP9_SET_COSPI_PAIR(cospi_31_64, -cospi_1_64); \
874 k2_m = VP9_SET_COSPI_PAIR(cospi_17_64, cospi_15_64); \
875 k3_m = VP9_SET_COSPI_PAIR(cospi_15_64, -cospi_17_64); \
876 VP9_MADD_BF(r15, r0, r7, r8, k0_m, k1_m, k2_m, k3_m, \
877 g0_m, g1_m, g2_m, g3_m); \
878 k0_m = VP9_SET_COSPI_PAIR(cospi_5_64, cospi_27_64); \
879 k1_m = VP9_SET_COSPI_PAIR(cospi_27_64, -cospi_5_64); \
880 k2_m = VP9_SET_COSPI_PAIR(cospi_21_64, cospi_11_64); \
881 k3_m = VP9_SET_COSPI_PAIR(cospi_11_64, -cospi_21_64); \
882 VP9_MADD_BF(r13, r2, r5, r10, k0_m, k1_m, k2_m, k3_m, \
883 g4_m, g5_m, g6_m, g7_m); \
884 k0_m = VP9_SET_COSPI_PAIR(cospi_9_64, cospi_23_64); \
885 k1_m = VP9_SET_COSPI_PAIR(cospi_23_64, -cospi_9_64); \
886 k2_m = VP9_SET_COSPI_PAIR(cospi_25_64, cospi_7_64); \
887 k3_m = VP9_SET_COSPI_PAIR(cospi_7_64, -cospi_25_64); \
888 VP9_MADD_BF(r11, r4, r3, r12, k0_m, k1_m, k2_m, k3_m, \
889 g8_m, g9_m, g10_m, g11_m); \
890 k0_m = VP9_SET_COSPI_PAIR(cospi_13_64, cospi_19_64); \
891 k1_m = VP9_SET_COSPI_PAIR(cospi_19_64, -cospi_13_64); \
892 k2_m = VP9_SET_COSPI_PAIR(cospi_29_64, cospi_3_64); \
893 k3_m = VP9_SET_COSPI_PAIR(cospi_3_64, -cospi_29_64); \
894 VP9_MADD_BF(r9, r6, r1, r14, k0_m, k1_m, k2_m, k3_m, \
895 g12_m, g13_m, g14_m, g15_m); \
898 k0_m = VP9_SET_COSPI_PAIR(cospi_4_64, cospi_28_64); \
899 k1_m = VP9_SET_COSPI_PAIR(cospi_28_64, -cospi_4_64); \
900 k2_m = VP9_SET_COSPI_PAIR(-cospi_28_64, cospi_4_64); \
901 VP9_MADD_BF(g1_m, g3_m, g9_m, g11_m, k0_m, k1_m, k2_m, k0_m, \
902 h0_m, h1_m, h2_m, h3_m); \
903 k0_m = VP9_SET_COSPI_PAIR(cospi_12_64, cospi_20_64); \
904 k1_m = VP9_SET_COSPI_PAIR(-cospi_20_64, cospi_12_64); \
905 k2_m = VP9_SET_COSPI_PAIR(cospi_20_64, -cospi_12_64); \
906 VP9_MADD_BF(g7_m, g5_m, g15_m, g13_m, k0_m, k1_m, k2_m, k0_m, \
907 h4_m, h5_m, h6_m, h7_m); \
908 BUTTERFLY_4(h0_m, h2_m, h6_m, h4_m, out8, out9, out11, out10); \
909 BUTTERFLY_8(g0_m, g2_m, g4_m, g6_m, g14_m, g12_m, g10_m, g8_m, \
910 h8_m, h9_m, h10_m, h11_m, h6_m, h4_m, h2_m, h0_m); \
913 BUTTERFLY_4(h8_m, h9_m, h11_m, h10_m, out0, out1, h11_m, h10_m); \
914 k0_m = VP9_SET_COSPI_PAIR(cospi_8_64, cospi_24_64); \
915 k1_m = VP9_SET_COSPI_PAIR(cospi_24_64, -cospi_8_64); \
916 k2_m = VP9_SET_COSPI_PAIR(-cospi_24_64, cospi_8_64); \
917 VP9_MADD_BF(h0_m, h2_m, h4_m, h6_m, k0_m, k1_m, k2_m, k0_m, \
918 out4, out6, out5, out7); \
919 VP9_MADD_BF(h1_m, h3_m, h5_m, h7_m, k0_m, k1_m, k2_m, k0_m, \
920 out12, out14, out13, out15); \
923 k0_m = VP9_SET_COSPI_PAIR(cospi_16_64, cospi_16_64); \
924 k1_m = VP9_SET_COSPI_PAIR(-cospi_16_64, -cospi_16_64); \
925 k2_m = VP9_SET_COSPI_PAIR(cospi_16_64, -cospi_16_64); \
926 k3_m = VP9_SET_COSPI_PAIR(-cospi_16_64, cospi_16_64); \
927 VP9_MADD_SHORT(h10_m, h11_m, k1_m, k2_m, out2, out3); \
928 VP9_MADD_SHORT(out6, out7, k0_m, k3_m, out6, out7); \
929 VP9_MADD_SHORT(out10, out11, k0_m, k3_m, out10, out11); \
930 VP9_MADD_SHORT(out14, out15, k1_m, k2_m, out14, out15); \
936 v8i16 loc0, loc1, loc2, loc3;
937 v8i16 reg0, reg2, reg4, reg6, reg8, reg10, reg12, reg14;
938 v8i16 reg3, reg13, reg11, reg5, reg7, reg9, reg1, reg15;
939 v8i16 tmp5, tmp6, tmp7;
942 LD_SH8(input, 16, reg0, reg1, reg2, reg3, reg4, reg5, reg6, reg7);
945 LD_SH8(input, 16, reg8, reg9, reg10, reg11, reg12, reg13, reg14, reg15);
949 BUTTERFLY_4(reg2, reg14, reg6, reg10, loc0, loc1, reg14, reg2);
953 BUTTERFLY_4(reg8, reg0, reg4, reg12, reg2, reg6, reg10, reg14);
957 reg12 = reg14 - loc0;
958 reg14 = reg14 + loc0;
962 reg10 = reg10 + loc2;
971 reg15 = reg15 + loc3;
975 BUTTERFLY_4(loc0, loc1, reg11, reg5, reg13, reg3, reg11, reg5);
983 reg13 = reg1 - reg13;
1000 reg11 = reg7 - reg11;
1006 BUTTERFLY_4(reg8, reg10, reg11, reg5, loc0, reg4, reg9, loc1);
1012 BUTTERFLY_4(reg12, reg14, reg13, reg3, reg8, reg6, reg7, reg5);
1022 dst += (4 * dst_stride);
1025 dst += (4 * dst_stride);
1028 dst += (4 * dst_stride);
1035 v8i16 loc0, loc1, loc2, loc3;
1036 v8i16 reg0, reg2, reg4, reg6, reg8, reg10, reg12, reg14;
1037 v8i16 reg3, reg13, reg11, reg5, reg7, reg9, reg1, reg15;
1038 v8i16 tmp5, tmp6, tmp7;
1041 LD_SH8(input, 16, reg0, reg1, reg2, reg3, reg4, reg5, reg6, reg7);
1044 LD_SH8(input, 16, reg8, reg9, reg10, reg11, reg12, reg13, reg14, reg15);
1048 BUTTERFLY_4(reg2, reg14, reg6, reg10, loc0, loc1, reg14, reg2);
1052 BUTTERFLY_4(reg8, reg0, reg4, reg12, reg2, reg6, reg10, reg14);
1056 reg12 = reg14 - loc0;
1057 reg14 = reg14 + loc0;
1060 reg8 = reg10 - loc2;
1061 reg10 = reg10 + loc2;
1069 reg7 = reg15 - loc3;
1070 reg15 = reg15 + loc3;
1074 BUTTERFLY_4(loc0, loc1, reg11, reg5, reg13, reg3, reg11, reg5);
1076 loc1 = reg15 + reg3;
1077 reg3 = reg15 - reg3;
1079 reg15 = reg2 - loc1;
1081 loc1 = reg1 + reg13;
1082 reg13 = reg1 - reg13;
1098 loc0 = reg7 + reg11;
1099 reg11 = reg7 - reg11;
1106 BUTTERFLY_4(reg8, reg10, reg11, reg5, loc0, reg4, reg9, loc1);
1112 BUTTERFLY_4(reg12, reg14, reg13, reg3, reg8, reg6, reg7, reg5);
1122 reg0, reg2, reg4, reg6, reg8, reg10, reg12, reg14);
1123 ST_SH4(reg0, reg2, reg4, reg6, output, 16);
1124 ST_SH4(reg8, reg10, reg12, reg14, (output + 4 * 16), 16);
1128 reg3, reg13, reg11, reg5, reg7, reg9, reg1, reg15);
1129 ST_SH4(reg3, reg13, reg11, reg5, (output + 8), 16);
1130 ST_SH4(reg7, reg9, reg1, reg15, (output + 8 + 4 * 16), 16);
1138 v8i16 vec, res0, res1, res2, res3, res4, res5, res6, res7;
1139 v16u8 dst0, dst1, dst2, dst3, tmp0, tmp1, tmp2, tmp3;
1145 vec = __msa_fill_h(out);
1149 LD_UB4(dst, dst_stride, dst0, dst1, dst2, dst3);
1154 ADD4(res0, vec, res1, vec, res2, vec, res3, vec, res0, res1, res2,
1156 ADD4(res4, vec, res5, vec, res6, vec, res7, vec, res4, res5, res6,
1160 PCKEV_B4_UB(res4, res0, res5, res1, res6, res2, res7, res3,
1161 tmp0, tmp1, tmp2, tmp3);
1162 ST_UB4(tmp0, tmp1, tmp2, tmp3, dst, dst_stride);
1163 dst += (4 * dst_stride);
1172 int16_t *
out = out_arr;
1179 for (i = 12; i--;) {
1181 "sw $zero, 0(%[out]) \n\t"
1182 "sw $zero, 4(%[out]) \n\t"
1183 "sw $zero, 8(%[out]) \n\t"
1184 "sw $zero, 12(%[out]) \n\t"
1185 "sw $zero, 16(%[out]) \n\t"
1186 "sw $zero, 20(%[out]) \n\t"
1187 "sw $zero, 24(%[out]) \n\t"
1188 "sw $zero, 28(%[out]) \n\t"
1200 for (i = 0; i < 2; i++) {
1212 int16_t *
out = out_arr;
1215 for (i = 0; i < 2; i++) {
1221 for (i = 0; i < 2; i++) {
1230 v8i16 r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15;
1231 v8i16 l0, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, l13, l14, l15;
1235 l0, l1, l2, l3, l4, l5, l6, l7,
1236 l8, l9, l10, l11, l12, l13, l14, l15);
1240 l8, l9, l10, l11, l12, l13, l14, l15,
1241 r0, r1, r2, r3, r4, r5, r6, r7,
1242 r8, r9, r10, r11, r12, r13, r14, r15);
1250 l0, l1, l2, l3, l4, l5, l6, l7);
1251 ST_SH8(l0, l1, l2, l3, l4, l5, l6, l7, output, 16);
1253 l8, l9, l10, l11, l12, l13, l14, l15);
1254 ST_SH8(l8, l9, l10, l11, l12, l13, l14, l15, (output + 8), 16);
1260 v8i16
v0, v2, v4, v6, k0, k1, k2, k3;
1261 v8i16 r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15;
1262 v8i16 out0, out1, out2, out3, out4, out5, out6, out7;
1263 v8i16 out8, out9, out10, out11, out12, out13, out14, out15;
1264 v8i16 g0, g1, g2, g3, g4, g5, g6, g7, g8, g9, g10, g11, g12, g13, g14, g15;
1265 v8i16 h0, h1, h2, h3, h4, h5, h6, h7, h8, h9, h10, h11;
1266 v8i16 res0, res1, res2, res3, res4, res5, res6, res7;
1267 v8i16 res8, res9, res10, res11, res12, res13, res14, res15;
1268 v16u8 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7;
1269 v16u8 dst8, dst9, dst10, dst11, dst12, dst13, dst14, dst15;
1272 r0 =
LD_SH(input + 0 * 16);
1273 r3 =
LD_SH(input + 3 * 16);
1274 r4 =
LD_SH(input + 4 * 16);
1275 r7 =
LD_SH(input + 7 * 16);
1276 r8 =
LD_SH(input + 8 * 16);
1277 r11 =
LD_SH(input + 11 * 16);
1278 r12 =
LD_SH(input + 12 * 16);
1279 r15 =
LD_SH(input + 15 * 16);
1286 VP9_MADD_BF(r15, r0, r7, r8, k0, k1, k2, k3, g0, g1, g2, g3);
1291 VP9_MADD_BF(r11, r4, r3, r12, k0, k1, k2, k3, g8, g9, g10, g11);
1296 VP9_MADD_BF(g1, g3, g9, g11, k0, k1, k2, k0, h0, h1, h2, h3);
1298 r1 =
LD_SH(input + 1 * 16);
1299 r2 =
LD_SH(input + 2 * 16);
1300 r5 =
LD_SH(input + 5 * 16);
1301 r6 =
LD_SH(input + 6 * 16);
1302 r9 =
LD_SH(input + 9 * 16);
1303 r10 =
LD_SH(input + 10 * 16);
1304 r13 =
LD_SH(input + 13 * 16);
1305 r14 =
LD_SH(input + 14 * 16);
1311 VP9_MADD_BF(r13, r2, r5, r10, k0, k1, k2, k3, g4, g5, g6, g7);
1316 VP9_MADD_BF(r9, r6, r1, r14, k0, k1, k2, k3, g12, g13, g14, g15);
1318 BUTTERFLY_4(h8, h9, h11, h10, out0, out1, h11, h10);
1321 dst0 =
LD_UB(dst + 0 * dst_stride);
1322 dst1 =
LD_UB(dst + 15 * dst_stride);
1323 ILVR_B2_SH(zero, dst0, zero, dst1, res0, res1);
1324 ADD2(res0, out0, res1, out1, res0, res1);
1328 ST8x1_UB(res1, dst + 15 * dst_stride);
1333 VP9_MADD_BF(g7, g5, g15, g13, k0, k1, k2, k0, h4, h5, h6, h7);
1334 BUTTERFLY_4(h0, h2, h6, h4, out8, out9, out11, out10);
1338 dst8 =
LD_UB(dst + 1 * dst_stride);
1339 dst9 =
LD_UB(dst + 14 * dst_stride);
1340 ILVR_B2_SH(zero, dst8, zero, dst9, res8, res9);
1341 ADD2(res8, out8, res9, out9, res8, res9);
1345 ST8x1_UB(res9, dst + 14 * dst_stride);
1350 VP9_MADD_BF(v0, v2, v4, v6, k0, k1, k2, k0, out4, out6, out5, out7);
1353 dst4 =
LD_UB(dst + 3 * dst_stride);
1354 dst5 =
LD_UB(dst + 12 * dst_stride);
1355 ILVR_B2_SH(zero, dst4, zero, dst5, res4, res5);
1356 ADD2(res4, out4, res5, out5, res4, res5);
1359 ST8x1_UB(res4, dst + 3 * dst_stride);
1360 ST8x1_UB(res5, dst + 12 * dst_stride);
1362 VP9_MADD_BF(h1, h3, h5, h7, k0, k1, k2, k0, out12, out14, out13, out15);
1365 dst12 =
LD_UB(dst + 2 * dst_stride);
1366 dst13 =
LD_UB(dst + 13 * dst_stride);
1367 ILVR_B2_SH(zero, dst12, zero, dst13, res12, res13);
1368 ADD2(res12, out12, res13, out13, res12, res13);
1370 PCKEV_B2_SH(res12, res12, res13, res13, res12, res13);
1371 ST8x1_UB(res12, dst + 2 * dst_stride);
1372 ST8x1_UB(res13, dst + 13 * dst_stride);
1378 dst6 =
LD_UB(dst + 4 * dst_stride);
1379 dst7 =
LD_UB(dst + 11 * dst_stride);
1380 ILVR_B2_SH(zero, dst6, zero, dst7, res6, res7);
1381 ADD2(res6, out6, res7, out7, res6, res7);
1384 ST8x1_UB(res6, dst + 4 * dst_stride);
1385 ST8x1_UB(res7, dst + 11 * dst_stride);
1389 dst10 =
LD_UB(dst + 6 * dst_stride);
1390 dst11 =
LD_UB(dst + 9 * dst_stride);
1391 ILVR_B2_SH(zero, dst10, zero, dst11, res10, res11);
1392 ADD2(res10, out10, res11, out11, res10, res11);
1394 PCKEV_B2_SH(res10, res10, res11, res11, res10, res11);
1395 ST8x1_UB(res10, dst + 6 * dst_stride);
1396 ST8x1_UB(res11, dst + 9 * dst_stride);
1402 dst2 =
LD_UB(dst + 7 * dst_stride);
1403 dst3 =
LD_UB(dst + 8 * dst_stride);
1404 ILVR_B2_SH(zero, dst2, zero, dst3, res2, res3);
1405 ADD2(res2, out2, res3, out3, res2, res3);
1408 ST8x1_UB(res2, dst + 7 * dst_stride);
1409 ST8x1_UB(res3, dst + 8 * dst_stride);
1413 dst14 =
LD_UB(dst + 5 * dst_stride);
1414 dst15 =
LD_UB(dst + 10 * dst_stride);
1415 ILVR_B2_SH(zero, dst14, zero, dst15, res14, res15);
1416 ADD2(res14, out14, res15, out15, res14, res15);
1418 PCKEV_B2_SH(res14, res14, res15, res15, res14, res15);
1419 ST8x1_UB(res14, dst + 5 * dst_stride);
1420 ST8x1_UB(res15, dst + 10 * dst_stride);
1427 int16_t *
out = out_arr;
1431 for (i = 0; i < 2; i++) {
1437 for (i = 0; i < 2; i++) {
1448 int16_t
out[16 * 16];
1449 int16_t *out_ptr = &out[0];
1452 for (i = 0; i < 2; i++) {
1458 for (i = 0; i < 2; i++) {
1461 (dst + (i << 3)), dst_stride);
1469 int16_t
out[16 * 16];
1470 int16_t *out_ptr = &out[0];
1473 for (i = 0; i < 2; i++) {
1479 for (i = 0; i < 2; i++) {
1482 (dst + (i << 3)), dst_stride);
1487 int16_t *tmp_eve_buf,
1488 int16_t *tmp_odd_buf,
1491 v8i16 vec0, vec1, vec2, vec3, loc0, loc1, loc2, loc3;
1492 v8i16 m0, m1, m2, m3, m4, m5, m6, m7, n0, n1, n2, n3, n4, n5, n6, n7;
1495 vec0 =
LD_SH(tmp_odd_buf);
1496 vec1 =
LD_SH(tmp_odd_buf + 9 * 8);
1497 vec2 =
LD_SH(tmp_odd_buf + 14 * 8);
1498 vec3 =
LD_SH(tmp_odd_buf + 6 * 8);
1499 loc0 =
LD_SH(tmp_eve_buf);
1500 loc1 =
LD_SH(tmp_eve_buf + 8 * 8);
1501 loc2 =
LD_SH(tmp_eve_buf + 4 * 8);
1502 loc3 =
LD_SH(tmp_eve_buf + 12 * 8);
1504 ADD4(loc0, vec3, loc1, vec2, loc2, vec1, loc3, vec0, m0, m4, m2, m6);
1506 ST_SH((loc0 - vec3), (tmp_buf + 31 * 8));
1507 ST_SH((loc1 - vec2), (tmp_buf + 23 * 8));
1508 ST_SH((loc2 - vec1), (tmp_buf + 27 * 8));
1509 ST_SH((loc3 - vec0), (tmp_buf + 19 * 8));
1512 vec0 =
LD_SH(tmp_odd_buf + 4 * 8);
1513 vec1 =
LD_SH(tmp_odd_buf + 13 * 8);
1514 vec2 =
LD_SH(tmp_odd_buf + 10 * 8);
1515 vec3 =
LD_SH(tmp_odd_buf + 3 * 8);
1516 loc0 =
LD_SH(tmp_eve_buf + 2 * 8);
1517 loc1 =
LD_SH(tmp_eve_buf + 10 * 8);
1518 loc2 =
LD_SH(tmp_eve_buf + 6 * 8);
1519 loc3 =
LD_SH(tmp_eve_buf + 14 * 8);
1521 ADD4(loc0, vec3, loc1, vec2, loc2, vec1, loc3, vec0, m1, m5, m3, m7);
1523 ST_SH((loc0 - vec3), (tmp_buf + 29 * 8));
1524 ST_SH((loc1 - vec2), (tmp_buf + 21 * 8));
1525 ST_SH((loc2 - vec1), (tmp_buf + 25 * 8));
1526 ST_SH((loc3 - vec0), (tmp_buf + 17 * 8));
1529 vec0 =
LD_SH(tmp_odd_buf + 2 * 8);
1530 vec1 =
LD_SH(tmp_odd_buf + 11 * 8);
1531 vec2 =
LD_SH(tmp_odd_buf + 12 * 8);
1532 vec3 =
LD_SH(tmp_odd_buf + 7 * 8);
1533 loc0 =
LD_SH(tmp_eve_buf + 1 * 8);
1534 loc1 =
LD_SH(tmp_eve_buf + 9 * 8);
1535 loc2 =
LD_SH(tmp_eve_buf + 5 * 8);
1536 loc3 =
LD_SH(tmp_eve_buf + 13 * 8);
1538 ADD4(loc0, vec3, loc1, vec2, loc2, vec1, loc3, vec0, n0, n4, n2, n6);
1540 ST_SH((loc0 - vec3), (tmp_buf + 30 * 8));
1541 ST_SH((loc1 - vec2), (tmp_buf + 22 * 8));
1542 ST_SH((loc2 - vec1), (tmp_buf + 26 * 8));
1543 ST_SH((loc3 - vec0), (tmp_buf + 18 * 8));
1546 vec0 =
LD_SH(tmp_odd_buf + 5 * 8);
1547 vec1 =
LD_SH(tmp_odd_buf + 15 * 8);
1548 vec2 =
LD_SH(tmp_odd_buf + 8 * 8);
1549 vec3 =
LD_SH(tmp_odd_buf + 1 * 8);
1550 loc0 =
LD_SH(tmp_eve_buf + 3 * 8);
1551 loc1 =
LD_SH(tmp_eve_buf + 11 * 8);
1552 loc2 =
LD_SH(tmp_eve_buf + 7 * 8);
1553 loc3 =
LD_SH(tmp_eve_buf + 15 * 8);
1555 ADD4(loc0, vec3, loc1, vec2, loc2, vec1, loc3, vec0, n1, n5, n3, n7);
1557 ST_SH((loc0 - vec3), (tmp_buf + 28 * 8));
1558 ST_SH((loc1 - vec2), (tmp_buf + 20 * 8));
1559 ST_SH((loc2 - vec1), (tmp_buf + 24 * 8));
1560 ST_SH((loc3 - vec0), (tmp_buf + 16 * 8));
1565 m0, n0, m1, n1, m2, n2, m3, n3);
1566 ST_SH4(m0, n0, m1, n1, (dst + 0), 32);
1567 ST_SH4(m2, n2, m3, n3, (dst + 4 * 32), 32);
1570 m4, n4, m5, n5, m6, n6, m7, n7);
1571 ST_SH4(m4, n4, m5, n5, (dst + 8), 32);
1572 ST_SH4(m6, n6, m7, n7, (dst + 8 + 4 * 32), 32);
1575 LD_SH8((tmp_buf + 8 * 16), 8, m0, n0, m1, n1, m2, n2, m3, n3);
1576 LD_SH8((tmp_buf + 12 * 16), 8, m4, n4, m5, n5, m6, n6, m7, n7);
1578 m0, n0, m1, n1, m2, n2, m3, n3);
1579 ST_SH4(m0, n0, m1, n1, (dst + 16), 32);
1580 ST_SH4(m2, n2, m3, n3, (dst + 16 + 4 * 32), 32);
1583 m4, n4, m5, n5, m6, n6, m7, n7);
1584 ST_SH4(m4, n4, m5, n5, (dst + 24), 32);
1585 ST_SH4(m6, n6, m7, n7, (dst + 24 + 4 * 32), 32);
1589 int16_t *tmp_eve_buf)
1591 v8i16 vec0, vec1, vec2, vec3, loc0, loc1, loc2, loc3;
1592 v8i16 reg0, reg1, reg2, reg3, reg4, reg5, reg6, reg7;
1593 v8i16 stp0, stp1, stp2, stp3, stp4, stp5, stp6, stp7;
1596 LD_SH8(tmp_buf, (4 * 32), reg0, reg1, reg2, reg3, reg4, reg5, reg6, reg7);
1597 tmp_buf += (2 * 32);
1601 BUTTERFLY_4(reg1, reg7, reg3, reg5, vec1, vec3, vec2, vec0);
1609 BUTTERFLY_4(reg4, reg0, reg2, reg6, vec1, vec3, vec2, vec0);
1610 BUTTERFLY_4(vec0, vec1, loc1, loc0, stp3, stp0, stp7, stp4);
1611 BUTTERFLY_4(vec2, vec3, loc3, loc2, stp2, stp1, stp6, stp5);
1615 LD_SH8(tmp_buf, (4 * 32), reg0, reg1, reg2, reg3, reg4, reg5, reg6, reg7);
1651 BUTTERFLY_4(stp0, stp1, reg7, reg5, loc1, loc3, loc2, loc0);
1652 ST_SH2(loc1, loc3, tmp_eve_buf, 8);
1653 ST_SH2(loc2, loc0, (tmp_eve_buf + 14 * 8), 8);
1655 BUTTERFLY_4(stp2, stp3, reg4, reg1, loc1, loc3, loc2, loc0);
1656 ST_SH2(loc1, loc3, (tmp_eve_buf + 2 * 8), 8);
1657 ST_SH2(loc2, loc0, (tmp_eve_buf + 12 * 8), 8);
1660 BUTTERFLY_4(stp4, stp5, reg6, reg3, loc1, loc3, loc2, loc0);
1661 ST_SH2(loc1, loc3, (tmp_eve_buf + 4 * 8), 8);
1662 ST_SH2(loc2, loc0, (tmp_eve_buf + 10 * 8), 8);
1664 BUTTERFLY_4(stp6, stp7, reg2, reg0, loc1, loc3, loc2, loc0);
1665 ST_SH2(loc1, loc3, (tmp_eve_buf + 6 * 8), 8);
1666 ST_SH2(loc2, loc0, (tmp_eve_buf + 8 * 8), 8);
1670 int16_t *tmp_odd_buf)
1672 v8i16 vec0, vec1, vec2, vec3, loc0, loc1, loc2, loc3;
1673 v8i16 reg0, reg1, reg2, reg3, reg4, reg5, reg6, reg7;
1676 reg0 =
LD_SH(tmp_buf + 32);
1677 reg1 =
LD_SH(tmp_buf + 7 * 32);
1678 reg2 =
LD_SH(tmp_buf + 9 * 32);
1679 reg3 =
LD_SH(tmp_buf + 15 * 32);
1680 reg4 =
LD_SH(tmp_buf + 17 * 32);
1681 reg5 =
LD_SH(tmp_buf + 23 * 32);
1682 reg6 =
LD_SH(tmp_buf + 25 * 32);
1683 reg7 =
LD_SH(tmp_buf + 31 * 32);
1701 ADD2(reg5, reg4, reg3, reg2, vec0, vec1);
1702 ST_SH2(vec0, vec1, (tmp_odd_buf + 4 * 8), 8);
1703 SUB2(reg5, reg4, reg3, reg2, vec0, vec1);
1705 ST_SH2(vec0, vec1, tmp_odd_buf, 8);
1710 BUTTERFLY_4(reg0, reg7, reg6, reg1, vec0, vec1, vec2, vec3);
1711 ST_SH2(vec0, vec1, (tmp_odd_buf + 6 * 8), 8);
1713 ST_SH2(vec2, vec3, (tmp_odd_buf + 2 * 8), 8);
1717 reg0 =
LD_SH(tmp_buf + 3 * 32);
1718 reg1 =
LD_SH(tmp_buf + 5 * 32);
1719 reg2 =
LD_SH(tmp_buf + 11 * 32);
1720 reg3 =
LD_SH(tmp_buf + 13 * 32);
1721 reg4 =
LD_SH(tmp_buf + 19 * 32);
1722 reg5 =
LD_SH(tmp_buf + 21 * 32);
1723 reg6 =
LD_SH(tmp_buf + 27 * 32);
1724 reg7 =
LD_SH(tmp_buf + 29 * 32);
1732 SUB4(reg1, reg2, reg6, reg5, reg0, reg3, reg7, reg4,
1733 vec0, vec1, vec2, vec3);
1736 BUTTERFLY_4(loc2, loc3, loc1, loc0, vec0, vec1, vec3, vec2);
1737 ST_SH2(vec0, vec1, (tmp_odd_buf + 12 * 8), 3 * 8);
1739 ST_SH2(vec0, vec1, (tmp_odd_buf + 10 * 8), 8);
1742 ADD4(reg0, reg3, reg1, reg2, reg5, reg6, reg4, reg7,
1743 vec0, vec1, vec2, vec3);
1744 BUTTERFLY_4(vec0, vec3, vec2, vec1, reg0, reg1, reg3, reg2);
1745 ST_SH2(reg0, reg1, (tmp_odd_buf + 13 * 8), 8);
1747 ST_SH2(reg0, reg1, (tmp_odd_buf + 8 * 8), 8);
1751 LD_SH4(tmp_odd_buf, 8, reg0, reg1, reg2, reg3);
1752 LD_SH4((tmp_odd_buf + 8 * 8), 8, reg4, reg5, reg6, reg7);
1754 ADD4(reg0, reg4, reg1, reg5, reg2, reg6, reg3, reg7,
1755 loc0, loc1, loc2, loc3);
1756 ST_SH4(loc0, loc1, loc2, loc3, tmp_odd_buf, 8);
1758 SUB2(reg0, reg4, reg1, reg5, vec0, vec1);
1761 SUB2(reg2, reg6, reg3, reg7, vec0, vec1);
1763 ST_SH4(loc0, loc1, loc2, loc3, (tmp_odd_buf + 8 * 8), 8);
1766 LD_SH4((tmp_odd_buf + 4 * 8), 8, reg1, reg2, reg0, reg3);
1767 LD_SH4((tmp_odd_buf + 12 * 8), 8, reg4, reg5, reg6, reg7);
1769 ADD4(reg0, reg4, reg1, reg5, reg2, reg6, reg3, reg7,
1770 loc0, loc1, loc2, loc3);
1771 ST_SH4(loc0, loc1, loc2, loc3, (tmp_odd_buf + 4 * 8), 8);
1773 SUB2(reg0, reg4, reg3, reg7, vec0, vec1);
1776 SUB2(reg1, reg5, reg2, reg6, vec0, vec1);
1778 ST_SH4(loc0, loc1, loc2, loc3, (tmp_odd_buf + 12 * 8), 8);
1782 int16_t *tmp_odd_buf,
1786 v8i16 vec0, vec1, vec2, vec3, loc0, loc1, loc2, loc3;
1787 v8i16 m0, m1, m2, m3, m4, m5, m6, m7, n0, n1, n2, n3, n4, n5, n6, n7;
1790 vec0 =
LD_SH(tmp_odd_buf);
1791 vec1 =
LD_SH(tmp_odd_buf + 9 * 8);
1792 vec2 =
LD_SH(tmp_odd_buf + 14 * 8);
1793 vec3 =
LD_SH(tmp_odd_buf + 6 * 8);
1794 loc0 =
LD_SH(tmp_eve_buf);
1795 loc1 =
LD_SH(tmp_eve_buf + 8 * 8);
1796 loc2 =
LD_SH(tmp_eve_buf + 4 * 8);
1797 loc3 =
LD_SH(tmp_eve_buf + 12 * 8);
1799 ADD4(loc0, vec3, loc1, vec2, loc2, vec1, loc3, vec0, m0, m4, m2, m6);
1803 SUB4(loc0, vec3, loc1, vec2, loc2, vec1, loc3, vec0, m6, m2, m4, m0);
1809 vec0 =
LD_SH(tmp_odd_buf + 4 * 8);
1810 vec1 =
LD_SH(tmp_odd_buf + 13 * 8);
1811 vec2 =
LD_SH(tmp_odd_buf + 10 * 8);
1812 vec3 =
LD_SH(tmp_odd_buf + 3 * 8);
1813 loc0 =
LD_SH(tmp_eve_buf + 2 * 8);
1814 loc1 =
LD_SH(tmp_eve_buf + 10 * 8);
1815 loc2 =
LD_SH(tmp_eve_buf + 6 * 8);
1816 loc3 =
LD_SH(tmp_eve_buf + 14 * 8);
1818 ADD4(loc0, vec3, loc1, vec2, loc2, vec1, loc3, vec0, m1, m5, m3, m7);
1823 SUB4(loc0, vec3, loc1, vec2, loc2, vec1, loc3, vec0, m7, m3, m5, m1);
1829 vec0 =
LD_SH(tmp_odd_buf + 2 * 8);
1830 vec1 =
LD_SH(tmp_odd_buf + 11 * 8);
1831 vec2 =
LD_SH(tmp_odd_buf + 12 * 8);
1832 vec3 =
LD_SH(tmp_odd_buf + 7 * 8);
1833 loc0 =
LD_SH(tmp_eve_buf + 1 * 8);
1834 loc1 =
LD_SH(tmp_eve_buf + 9 * 8);
1835 loc2 =
LD_SH(tmp_eve_buf + 5 * 8);
1836 loc3 =
LD_SH(tmp_eve_buf + 13 * 8);
1838 ADD4(loc0, vec3, loc1, vec2, loc2, vec1, loc3, vec0, n0, n4, n2, n6);
1843 SUB4(loc0, vec3, loc1, vec2, loc2, vec1, loc3, vec0, n6, n2, n4, n0);
1849 vec0 =
LD_SH(tmp_odd_buf + 5 * 8);
1850 vec1 =
LD_SH(tmp_odd_buf + 15 * 8);
1851 vec2 =
LD_SH(tmp_odd_buf + 8 * 8);
1852 vec3 =
LD_SH(tmp_odd_buf + 1 * 8);
1853 loc0 =
LD_SH(tmp_eve_buf + 3 * 8);
1854 loc1 =
LD_SH(tmp_eve_buf + 11 * 8);
1855 loc2 =
LD_SH(tmp_eve_buf + 7 * 8);
1856 loc3 =
LD_SH(tmp_eve_buf + 15 * 8);
1858 ADD4(loc0, vec3, loc1, vec2, loc2, vec1, loc3, vec0, n1, n5, n3, n7);
1863 SUB4(loc0, vec3, loc1, vec2, loc2, vec1, loc3, vec0, n7, n3, n5, n1);
1890 &tmp_odd_buf[0], output);
1898 v16u8 dst0, dst1, dst2, dst3, tmp0, tmp1, tmp2, tmp3;
1899 v8i16 res0, res1, res2, res3, res4, res5, res6, res7, vec;
1905 vec = __msa_fill_h(out);
1909 LD_UB2(dst, 16, dst0, dst1);
1910 LD_UB2(dst + dst_stride, 16, dst2, dst3);
1916 ADD4(res0, vec, res1, vec, res2, vec, res3, vec, res0, res1, res2,
1918 ADD4(res4, vec, res5, vec, res6, vec, res7, vec, res4, res5, res6,
1922 PCKEV_B4_UB(res4, res0, res5, res1, res6, res2, res7, res3,
1923 tmp0, tmp1, tmp2, tmp3);
1925 ST_UB2(tmp0, tmp1, dst, 16);
1927 ST_UB2(tmp2, tmp3, dst, 16);
1937 int16_t *out_ptr = out_arr;
1940 for (i = 32; i--;) {
1942 "sw $zero, (%[out_ptr]) \n\t"
1943 "sw $zero, 4(%[out_ptr]) \n\t"
1944 "sw $zero, 8(%[out_ptr]) \n\t"
1945 "sw $zero, 12(%[out_ptr]) \n\t"
1946 "sw $zero, 16(%[out_ptr]) \n\t"
1947 "sw $zero, 20(%[out_ptr]) \n\t"
1948 "sw $zero, 24(%[out_ptr]) \n\t"
1949 "sw $zero, 28(%[out_ptr]) \n\t"
1950 "sw $zero, 32(%[out_ptr]) \n\t"
1951 "sw $zero, 36(%[out_ptr]) \n\t"
1952 "sw $zero, 40(%[out_ptr]) \n\t"
1953 "sw $zero, 44(%[out_ptr]) \n\t"
1954 "sw $zero, 48(%[out_ptr]) \n\t"
1955 "sw $zero, 52(%[out_ptr]) \n\t"
1956 "sw $zero, 56(%[out_ptr]) \n\t"
1957 "sw $zero, 60(%[out_ptr]) \n\t"
1960 : [out_ptr]
"r" (out_ptr)
1972 for (i = 0; i < 4; i++) {
1975 (dst + (i << 3)), dst_stride);
1984 int16_t *out_ptr = out_arr;
1988 for (i = 0; i < 4; i++) {
1995 for (i = 0; i < 4; i++) {
1998 (dst + (i << 3)), dst_stride);
2003 int16_t *
block,
int eob)
2007 memset(block, 0, 4 * 4 *
sizeof(*block));
2016 int16_t *
block,
int eob)
2022 else if (eob <= 12) {
2024 memset(block, 0, 4 * 8 *
sizeof(*block));
2028 memset(block, 0, 8 * 8 *
sizeof(*block));
2033 int16_t *
block,
int eob)
2042 else if (eob <= 10) {
2044 for (i = 0; i < 4; ++i) {
2045 memset(block, 0, 4 *
sizeof(*block));
2051 memset(block, 0, 16 * 16 *
sizeof(*block));
2056 int16_t *
block,
int eob)
2064 else if (eob <= 34) {
2066 for (i = 0; i < 8; ++i) {
2067 memset(block, 0, 8 *
sizeof(*block));
2073 memset(block, 0, 32 * 32 *
sizeof(*block));
2078 int16_t *
block,
int eob)
2081 memset(block, 0, 4 * 4 *
sizeof(*block));
2085 int16_t *
block,
int eob)
2088 memset(block, 0, 8 * 8 *
sizeof(*block));
2092 int16_t *
block,
int eob)
2095 memset(block, 0, 16 * 16 *
sizeof(*block));
2099 int16_t *
block,
int eob)
2102 memset(block, 0, 4 * 4 *
sizeof(*block));
2106 int16_t *
block,
int eob)
2109 memset(block, 0, 8 * 8 *
sizeof(*block));
2113 int16_t *
block,
int eob)
2116 memset(block, 0, 16 * 16 *
sizeof(*block));
2120 int16_t *
block,
int eob)
2123 memset(block, 0, 4 * 4 *
sizeof(*block));
2127 int16_t *
block,
int eob)
2130 memset(block, 0, 8 * 8 *
sizeof(*block));
2134 int16_t *
block,
int eob)
2137 memset(block, 0, 16 * 16 *
sizeof(*block));
#define VP9_DOT_SHIFT_RIGHT_PCK_H(in0, in1, in2)
void ff_idct_iadst_16x16_add_msa(uint8_t *dst, ptrdiff_t stride, int16_t *block, int eob)
#define ADDBLK_ST4x4_UB(in0, in1, in2, in3, pdst, stride)
void ff_idct_iadst_4x4_add_msa(uint8_t *dst, ptrdiff_t stride, int16_t *block, int eob)
const char const char void * val
static const int32_t cospi_17_64
static const int32_t sinpi_4_9
void ff_iadst_iadst_8x8_add_msa(uint8_t *dst, ptrdiff_t stride, int16_t *block, int eob)
static const int32_t cospi_2_64
static const int32_t cospi_24_64
#define VP9_SET_COSPI_PAIR(c0_h, c1_h)
static const int32_t cospi_11_64
void ff_iadst_idct_16x16_add_msa(uint8_t *dst, ptrdiff_t stride, int16_t *block, int eob)
#define VP9_IADST8x16_1D(r0, r1, r2, r3, r4, r5, r6, r7, r8,r9, r10, r11, r12, r13, r14, r15,out0, out1, out2, out3, out4, out5,out6, out7, out8, out9, out10, out11,out12, out13, out14, out15)
void ff_idct_idct_8x8_add_msa(uint8_t *dst, ptrdiff_t stride, int16_t *block, int eob)
void ff_idct_idct_4x4_add_msa(uint8_t *dst, ptrdiff_t stride, int16_t *block, int eob)
static void vp9_idct8x32_column_odd_process_store(int16_t *tmp_buf, int16_t *tmp_odd_buf)
static const int32_t cospi_30_64
static void vp9_idct4x4_1_add_msa(int16_t *input, uint8_t *dst, int32_t dst_stride)
static const int32_t sinpi_1_9
static const int32_t cospi_4_64
static const int32_t sinpi_2_9
void ff_iadst_iadst_16x16_add_msa(uint8_t *dst, ptrdiff_t stride, int16_t *block, int eob)
static const int32_t cospi_7_64
#define VP9_DCT_CONST_BITS
static const int32_t cospi_28_64
#define VP9_ADST8(in0, in1, in2, in3, in4, in5, in6, in7,out0, out1, out2, out3, out4, out5, out6, out7)
static const int32_t cospi_20_64
#define UNPCK_UB_SH(in, out0, out1)
static const int32_t sinpi_3_9
#define VP9_DOT_ADD_SUB_SRARI_PCK(in0, in1, in2, in3, in4, in5, in6, in7,dst0, dst1, dst2, dst3)
#define CLIP_SH_0_255(in)
void ff_idct_iadst_8x8_add_msa(uint8_t *dst, ptrdiff_t stride, int16_t *block, int eob)
static void vp9_iadst4x4_colcol_addblk_msa(int16_t *input, uint8_t *dst, int32_t dst_stride)
static void vp9_idct32x32_colcol_addblk_msa(int16_t *input, uint8_t *dst, int32_t dst_stride)
static void vp9_idct8x8_12_colcol_addblk_msa(int16_t *input, uint8_t *dst, int32_t dst_stride)
#define ROUND_POWER_OF_TWO(value, n)
#define SUB4(in0, in1, in2, in3, in4, in5, in6, in7, out0, out1, out2, out3)
static void vp9_idct8x32_1d_columns_addblk_msa(int16_t *input, uint8_t *dst, int32_t dst_stride)
#define CLIP_SH2_0_255(in0, in1)
#define BUTTERFLY_4(in0, in1, in2, in3, out0, out1, out2, out3)
void ff_idct_idct_32x32_add_msa(uint8_t *dst, ptrdiff_t stride, int16_t *block, int eob)
static const int32_t cospi_14_64
#define ADD4(in0, in1, in2, in3, in4, in5, in6, in7, out0, out1, out2, out3)
static const int32_t cospi_18_64
static const int32_t cospi_22_64
static void vp9_idct_iadst_8x8_add_msa(int16_t *input, uint8_t *dst, int32_t dst_stride, int32_t eob)
static void vp9_idct_butterfly_transpose_store(int16_t *tmp_buf, int16_t *tmp_eve_buf, int16_t *tmp_odd_buf, int16_t *dst)
void ff_iadst_idct_4x4_add_msa(uint8_t *dst, ptrdiff_t stride, int16_t *block, int eob)
static const int32_t cospi_9_64
#define LD4x4_SH(psrc, out0, out1, out2, out3)
#define TRANSPOSE8x8_SH_SH(...)
static void vp9_idct32x32_34_colcol_addblk_msa(int16_t *input, uint8_t *dst, int32_t dst_stride)
static const int32_t cospi_5_64
static const int32_t cospi_27_64
#define CLIP_SH4_0_255(in0, in1, in2, in3)
#define VP9_IADST8x8_1D(in0, in1, in2, in3, in4, in5, in6, in7,out0, out1, out2, out3, out4, out5, out6, out7)
static const int32_t cospi_13_64
static void vp9_idct16x16_colcol_addblk_msa(int16_t *input, uint8_t *dst, int32_t dst_stride)
static void vp9_idct_iadst_4x4_add_msa(int16_t *input, uint8_t *dst, int32_t dst_stride, int32_t eob)
static const int32_t cospi_26_64
static void vp9_idct8x32_column_butterfly_addblk(int16_t *tmp_eve_buf, int16_t *tmp_odd_buf, uint8_t *dst, int32_t dst_stride)
static const int32_t cospi_21_64
#define BUTTERFLY_8(in0, in1, in2, in3, in4, in5, in6, in7,out0, out1, out2, out3, out4, out5, out6, out7)
#define VP9_ADDBLK_ST8x4_UB(dst, dst_stride, in0, in1, in2, in3)
#define TRANSPOSE4X8_SH_SH(in0, in1, in2, in3, in4, in5, in6, in7,out0, out1, out2, out3, out4, out5, out6, out7)
static const int32_t cospi_6_64
#define VP9_IDCT4x4(in0, in1, in2, in3, out0, out1, out2, out3)
static const int32_t cospi_19_64
static const int32_t cospi_23_64
static const int32_t cospi_25_64
static void vp9_iadst_idct_16x16_add_msa(int16_t *input, uint8_t *dst, int32_t dst_stride, int32_t eob)
static const int32_t cospi_8_64
static void vp9_idct4x4_colcol_addblk_msa(int16_t *input, uint8_t *dst, int32_t dst_stride)
static void vp9_iadst16x16_colcol_addblk_msa(int16_t *input, uint8_t *dst, int32_t dst_stride)
static void vp9_idct8x32_column_even_process_store(int16_t *tmp_buf, int16_t *tmp_eve_buf)
static void vp9_idct16_1d_columns_addblk_msa(int16_t *input, uint8_t *dst, int32_t dst_stride)
static void vp9_idct32x32_1_add_msa(int16_t *input, uint8_t *dst, int32_t dst_stride)
static const int32_t cospi_3_64
static void vp9_iadst_idct_8x8_add_msa(int16_t *input, uint8_t *dst, int32_t dst_stride, int32_t eob)
static void vp9_iadst16_1d_columns_addblk_msa(int16_t *input, uint8_t *dst, int32_t dst_stride)
#define VP9_DOTP_CONST_PAIR(reg0, reg1, cnst0, cnst1, out0, out1)
static void vp9_iadst8x8_colcol_addblk_msa(int16_t *input, uint8_t *dst, int32_t dst_stride)
static const int32_t cospi_16_64
static const int32_t cospi_1_64
#define ADD2(in0, in1, in2, in3, out0, out1)
static const int32_t cospi_31_64
static void vp9_idct8x8_colcol_addblk_msa(int16_t *input, uint8_t *dst, int32_t dst_stride)
static const int32_t cospi_10_64
static void vp9_idct16x16_1_add_msa(int16_t *input, uint8_t *dst, int32_t dst_stride)
static void vp9_idct_iadst_16x16_add_msa(int16_t *input, uint8_t *dst, int32_t dst_stride, int32_t eob)
GLint GLenum GLboolean GLsizei stride
#define SUB2(in0, in1, in2, in3, out0, out1)
void ff_idct_idct_16x16_add_msa(uint8_t *dst, ptrdiff_t stride, int16_t *block, int eob)
static const int32_t cospi_15_64
#define ALLOC_ALIGNED(align)
static const int32_t cospi_29_64
void ff_iadst_iadst_4x4_add_msa(uint8_t *dst, ptrdiff_t stride, int16_t *block, int eob)
static void vp9_iadst16_1d_columns_msa(int16_t *input, int16_t *output)
static void vp9_idct16_1d_columns_msa(int16_t *input, int16_t *output)
static void vp9_idct16x16_10_colcol_addblk_msa(int16_t *input, uint8_t *dst, int32_t dst_stride)
#define VP9_MADD_SHORT(m0, m1, c0, c1, res0, res1)
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(constint16_t *) pi >>8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(constint32_t *) pi >>24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(constfloat *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(constfloat *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(constfloat *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(constdouble *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(constdouble *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(constdouble *) pi *(1U<< 31))))#defineSET_CONV_FUNC_GROUP(ofmt, ifmt) staticvoidset_generic_function(AudioConvert *ac){}voidff_audio_convert_free(AudioConvert **ac){if(!*ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);}AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enumAVSampleFormatout_fmt, enumAVSampleFormatin_fmt, intchannels, intsample_rate, intapply_map){AudioConvert *ac;intin_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) returnNULL;ac->avr=avr;ac->out_fmt=out_fmt;ac->in_fmt=in_fmt;ac->channels=channels;ac->apply_map=apply_map;if(avr->dither_method!=AV_RESAMPLE_DITHER_NONE &&av_get_packed_sample_fmt(out_fmt)==AV_SAMPLE_FMT_S16 &&av_get_bytes_per_sample(in_fmt)>2){ac->dc=ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate, apply_map);if(!ac->dc){av_free(ac);returnNULL;}returnac;}in_planar=ff_sample_fmt_is_planar(in_fmt, channels);out_planar=ff_sample_fmt_is_planar(out_fmt, channels);if(in_planar==out_planar){ac->func_type=CONV_FUNC_TYPE_FLAT;ac->planes=in_planar?ac->channels:1;}elseif(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;elseac->func_type=CONV_FUNC_TYPE_DEINTERLEAVE;set_generic_function(ac);if(ARCH_AARCH64) ff_audio_convert_init_aarch64(ac);if(ARCH_ARM) ff_audio_convert_init_arm(ac);if(ARCH_X86) ff_audio_convert_init_x86(ac);returnac;}intff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in){intuse_generic=1;intlen=in->nb_samples;intp;if(ac->dc){av_log(ac->avr, AV_LOG_TRACE,"%dsamples-audio_convert:%sto%s(dithered)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));returnff_convert_dither(ac-> out
#define TRANSPOSE4x4_SH_SH(in0, in1, in2, in3, out0, out1, out2, out3)
#define VP9_IDCT8x8_1D(in0, in1, in2, in3, in4, in5, in6, in7,out0, out1, out2, out3, out4, out5, out6, out7)
#define ST8x1_UB(in, pdst)
static void vp9_idct8x8_1_add_msa(int16_t *input, uint8_t *dst, int32_t dst_stride)
static const int32_t cospi_12_64
static void vp9_iadst_idct_4x4_add_msa(int16_t *input, uint8_t *dst, int32_t dst_stride, int32_t eob)
static void vp9_idct8x32_1d_columns_msa(int16_t *input, int16_t *output, int16_t *tmp_buf)
#define VP9_MADD_BF(inp0, inp1, inp2, inp3, cst0, cst1, cst2, cst3,out0, out1, out2, out3)
void ff_iadst_idct_8x8_add_msa(uint8_t *dst, ptrdiff_t stride, int16_t *block, int eob)
#define VP9_IADST4x4(in0, in1, in2, in3, out0, out1, out2, out3)