27 uint64_t
out =
LD(src);
29 SD4(out, out, out, out, dst, dst_stride);
30 dst += (4 * dst_stride);
31 SD4(out, out, out, out, dst, dst_stride);
39 ST_UB8(out, out, out, out, out, out, out, out, dst, dst_stride);
40 dst += (8 * dst_stride);
41 ST_UB8(out, out, out, out, out, out, out, out, dst, dst_stride);
47 uint64_t out0, out1, out2, out3, out4, out5, out6, out7;
49 out0 = src[0 * src_stride] * 0x0101010101010101;
50 out1 = src[1 * src_stride] * 0x0101010101010101;
51 out2 = src[2 * src_stride] * 0x0101010101010101;
52 out3 = src[3 * src_stride] * 0x0101010101010101;
53 out4 = src[4 * src_stride] * 0x0101010101010101;
54 out5 = src[5 * src_stride] * 0x0101010101010101;
55 out6 = src[6 * src_stride] * 0x0101010101010101;
56 out7 = src[7 * src_stride] * 0x0101010101010101;
58 SD4(out0, out1, out2, out3, dst, dst_stride);
59 dst += (4 * dst_stride);
60 SD4(out4, out5, out6, out7, dst, dst_stride);
67 v16u8
src0,
src1, src2, src3, src4, src5, src6, src7;
68 v16u8 src8, src9, src10, src11, src12, src13, src14, src15;
70 inp0 = src[0 * src_stride];
71 inp1 = src[1 * src_stride];
72 inp2 = src[2 * src_stride];
73 inp3 = src[3 * src_stride];
74 src0 = (v16u8) __msa_fill_b(inp0);
75 src1 = (v16u8) __msa_fill_b(inp1);
76 src2 = (v16u8) __msa_fill_b(inp2);
77 src3 = (v16u8) __msa_fill_b(inp3);
78 inp0 = src[4 * src_stride];
79 inp1 = src[5 * src_stride];
80 inp2 = src[6 * src_stride];
81 inp3 = src[7 * src_stride];
82 src4 = (v16u8) __msa_fill_b(inp0);
83 src5 = (v16u8) __msa_fill_b(inp1);
84 src6 = (v16u8) __msa_fill_b(inp2);
85 src7 = (v16u8) __msa_fill_b(inp3);
86 inp0 = src[ 8 * src_stride];
87 inp1 = src[ 9 * src_stride];
88 inp2 = src[10 * src_stride];
89 inp3 = src[11 * src_stride];
90 src8 = (v16u8) __msa_fill_b(inp0);
91 src9 = (v16u8) __msa_fill_b(inp1);
92 src10 = (v16u8) __msa_fill_b(inp2);
93 src11 = (v16u8) __msa_fill_b(inp3);
94 inp0 = src[12 * src_stride];
95 inp1 = src[13 * src_stride];
96 inp2 = src[14 * src_stride];
97 inp3 = src[15 * src_stride];
98 src12 = (v16u8) __msa_fill_b(inp0);
99 src13 = (v16u8) __msa_fill_b(inp1);
100 src14 = (v16u8) __msa_fill_b(inp2);
101 src15 = (v16u8) __msa_fill_b(inp3);
103 ST_UB8(src0, src1, src2, src3, src4, src5, src6, src7, dst, dst_stride);
104 dst += (8 * dst_stride);
105 ST_UB8(src8, src9, src10, src11, src12, src13, src14, src15,
109 #define INTRA_PREDICT_VALDC_8X8_MSA(val) \ 110 static void intra_predict_##val##dc_8x8_msa(uint8_t *dst, int32_t dst_stride) \ 112 v16i8 store = __msa_fill_b(val); \ 113 uint64_t out = __msa_copy_u_d((v2i64) store, 0); \ 115 SD4(out, out, out, out, dst, dst_stride); \ 116 dst += (4 * dst_stride); \ 117 SD4(out, out, out, out, dst, dst_stride); \ 123 #define INTRA_PREDICT_VALDC_16X16_MSA(val) \ 124 static void intra_predict_##val##dc_16x16_msa(uint8_t *dst, \ 125 int32_t dst_stride) \ 127 v16u8 out = (v16u8) __msa_fill_b(val); \ 129 ST_UB8(out, out, out, out, out, out, out, out, dst, dst_stride); \ 130 dst += (8 * dst_stride); \ 131 ST_UB8(out, out, out, out, out, out, out, out, dst, dst_stride); \ 140 int32_t res, res0, res1, res2, res3;
142 v16i8 shf_mask = { 3, 5, 2, 6, 1, 7, 0, 8, 3, 5, 2, 6, 1, 7, 0, 8 };
143 v8i16 short_multiplier = { 1, 2, 3, 4, 1, 2, 3, 4 };
144 v4i32 int_multiplier = { 0, 1, 2, 3 };
146 v8i16 vec9, vec10, vec11;
147 v4i32 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7, vec8;
150 src_top =
LD_UB(src - (stride + 1));
151 src_top = (v16u8) __msa_vshf_b(shf_mask, (v16i8) src_top, (v16i8) src_top);
153 vec9 = __msa_hsub_u_h(src_top, src_top);
154 vec9 *= short_multiplier;
155 vec8 = __msa_hadd_s_w(vec9, vec9);
156 sum = __msa_hadd_s_d(vec8, vec8);
158 res0 = __msa_copy_s_w((v4i32) sum, 0);
160 res1 = (src[4 * stride - 1] - src[2 * stride - 1]) +
161 2 * (src[5 * stride - 1] - src[stride - 1]) +
162 3 * (src[6 * stride - 1] - src[-1]) +
163 4 * (src[7 * stride - 1] - src[-stride - 1]);
167 res0 = (res0 + 16) >> 5;
168 res1 = (res1 + 16) >> 5;
170 res3 = 3 * (res0 + res1);
171 res2 = 16 * (src[7 * stride - 1] + src[-stride + 7] + 1);
174 vec8 = __msa_fill_w(res0);
175 vec4 = __msa_fill_w(res);
176 vec2 = __msa_fill_w(res1);
177 vec5 = vec8 * int_multiplier;
180 for (lpcnt = 4; lpcnt--;) {
189 SRA_4V(vec0, vec1, vec6, vec7, 5);
192 PCKEV_B2_SH(vec10, vec10, vec11, vec11, vec10, vec11);
194 out0 = __msa_copy_s_d((v2i64) vec10, 0);
195 out1 = __msa_copy_s_d((v2i64) vec11, 0);
208 int32_t res0, res1, res2, res3;
209 uint64_t load0, load1;
210 v16i8 shf_mask = { 7, 8, 6, 9, 5, 10, 4, 11, 3, 12, 2, 13, 1, 14, 0, 15 };
211 v8i16 short_multiplier = { 1, 2, 3, 4, 5, 6, 7, 8 };
212 v4i32 int_multiplier = { 0, 1, 2, 3 };
213 v16u8 src_top = { 0 };
214 v16u8 store0, store1;
215 v8i16 vec9, vec10, vec11, vec12;
216 v4i32 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7, vec8, res_add;
217 v4i32 reg0, reg1, reg2, reg3;
219 load0 =
LD(src - (stride + 1));
220 load1 =
LD(src - (stride + 1) + 9);
224 src_top = (v16u8) __msa_vshf_b(shf_mask, (v16i8) src_top, (v16i8) src_top);
226 vec9 = __msa_hsub_u_h(src_top, src_top);
227 vec9 *= short_multiplier;
228 vec8 = __msa_hadd_s_w(vec9, vec9);
229 res_add = (v4i32) __msa_hadd_s_d(vec8, vec8);
231 res0 = __msa_copy_s_w(res_add, 0) + __msa_copy_s_w(res_add, 2);
233 res1 = (src[8 * stride - 1] - src[6 * stride - 1]) +
234 2 * (src[9 * stride - 1] - src[5 * stride - 1]) +
235 3 * (src[10 * stride - 1] - src[4 * stride - 1]) +
236 4 * (src[11 * stride - 1] - src[3 * stride - 1]) +
237 5 * (src[12 * stride - 1] - src[2 * stride - 1]) +
238 6 * (src[13 * stride - 1] - src[stride - 1]) +
239 7 * (src[14 * stride - 1] - src[-1]) +
240 8 * (src[15 * stride - 1] - src[-1 * stride - 1]);
244 res0 = (res0 + 32) >> 6;
245 res1 = (res1 + 32) >> 6;
247 res3 = 7 * (res0 + res1);
248 res2 = 16 * (src[15 * stride - 1] + src[-stride + 15] + 1);
251 vec8 = __msa_fill_w(res0);
252 vec4 = __msa_fill_w(res2);
253 vec5 = __msa_fill_w(res1);
255 vec7 = vec8 * int_multiplier;
257 for (lpcnt = 8; lpcnt--;) {
270 SRA_4V(vec0, vec1, vec2, vec3, 5);
271 SRA_4V(reg0, reg1, reg2, reg3, 5);
276 PCKEV_B2_UB(vec10, vec9, vec12, vec11, store0, store1);
277 ST_UB2(store0, store1, src, stride);
287 uint32_t out0, out1, out2, out3;
288 uint64_t store0, store1;
293 src_top =
LD_UB(src - stride);
294 add = __msa_hadd_u_h((v16u8) src_top, (v16u8) src_top);
295 sum = __msa_hadd_u_w(add, add);
296 src0 = __msa_copy_u_w((v4i32) sum, 0);
297 src1 = __msa_copy_u_w((v4i32) sum, 1);
298 src0 += src[0 * stride - 1];
299 src0 += src[1 * stride - 1];
300 src0 += src[2 * stride - 1];
301 src0 += src[3 * stride - 1];
302 src2 = src[4 * stride - 1];
303 src2 += src[5 * stride - 1];
304 src2 += src[6 * stride - 1];
305 src2 += src[7 * stride - 1];
306 src0 = (src0 + 4) >> 3;
307 src3 = (src1 + src2 + 4) >> 3;
308 src1 = (src1 + 2) >> 2;
309 src2 = (src2 + 2) >> 2;
310 out0 = src0 * 0x01010101;
311 out1 = src1 * 0x01010101;
312 out2 = src2 * 0x01010101;
313 out3 = src3 * 0x01010101;
314 store0 = ((uint64_t) out1 << 32) | out0;
315 store1 = ((uint64_t) out3 << 32) | out2;
317 SD4(store0, store0, store0, store0, src, stride);
319 SD4(store1, store1, store1, store1, src, stride);
327 src0 = src[0 * stride - 1];
328 src0 += src[1 * stride - 1];
329 src0 += src[2 * stride - 1];
330 src0 += src[3 * stride - 1];
331 src1 = src[4 * stride - 1];
332 src1 += src[5 * stride - 1];
333 src1 += src[6 * stride - 1];
334 src1 += src[7 * stride - 1];
335 src0 = (src0 + 2) >> 2;
336 src1 = (src1 + 2) >> 2;
337 out0 = src0 * 0x0101010101010101;
338 out1 = src1 * 0x0101010101010101;
340 SD4(out0, out0, out0, out0, src, stride);
342 SD4(out1, out1, out1, out1, src, stride);
348 v16i8
mask = { 0, 0, 0, 0, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0 };
353 src_top =
LD_UB(src - stride);
354 add = __msa_hadd_u_h(src_top, src_top);
355 sum = __msa_hadd_u_w(add, add);
356 sum = (v4u32) __msa_srari_w((v4i32) sum, 2);
357 res0 = (v16u8) __msa_vshf_b(mask, (v16i8) sum, (v16i8) sum);
358 out0 = __msa_copy_u_d((v2i64) res0, 0);
360 SD4(out0, out0, out0, out0, src, stride);
362 SD4(out0, out0, out0, out0, src, stride);
368 uint32_t out0, out1, out2;
369 uint64_t store0, store1;
374 src_top =
LD_UB(src - stride);
375 add = __msa_hadd_u_h(src_top, src_top);
376 sum = __msa_hadd_u_w(add, add);
377 src0 = __msa_copy_u_w((v4i32) sum, 0);
378 src1 = __msa_copy_u_w((v4i32) sum, 1);
380 src2 = src[0 * stride - 1];
381 src2 += src[1 * stride - 1];
382 src2 += src[2 * stride - 1];
383 src2 += src[3 * stride - 1];
384 src2 = (src0 + src2 + 4) >> 3;
385 src0 = (src0 + 2) >> 2;
386 src1 = (src1 + 2) >> 2;
387 out0 = src0 * 0x01010101;
388 out1 = src1 * 0x01010101;
389 out2 = src2 * 0x01010101;
390 store1 = ((uint64_t) out1 << 32);
391 store0 = store1 | ((uint64_t) out2);
392 store1 = store1 | ((uint64_t) out0);
394 SD4(store0, store0, store0, store0, src, stride);
396 SD4(store1, store1, store1, store1, src, stride);
402 uint32_t out0, out1, out2, out3;
403 uint64_t store0, store1;
408 src_top =
LD_UB(src - stride);
409 add = __msa_hadd_u_h(src_top, src_top);
410 sum = __msa_hadd_u_w(add, add);
411 src0 = __msa_copy_u_w((v4i32) sum, 0);
412 src1 = __msa_copy_u_w((v4i32) sum, 1);
414 src2 = src[4 * stride - 1];
415 src2 += src[5 * stride - 1];
416 src2 += src[6 * stride - 1];
417 src2 += src[7 * stride - 1];
418 src0 = (src0 + 2) >> 2;
419 src3 = (src1 + src2 + 4) >> 3;
420 src1 = (src1 + 2) >> 2;
421 src2 = (src2 + 2) >> 2;
423 out0 = src0 * 0x01010101;
424 out1 = src1 * 0x01010101;
425 out2 = src2 * 0x01010101;
426 out3 = src3 * 0x01010101;
427 store0 = ((uint64_t) out1 << 32) | out0;
428 store1 = ((uint64_t) out3 << 32) | out2;
430 SD4(store0, store0, store0, store0, src, stride);
432 SD4(store1, store1, store1, store1, src, stride);
440 src0 = src[0 * stride - 1];
441 src0 += src[1 * stride - 1];
442 src0 += src[2 * stride - 1];
443 src0 += src[3 * stride - 1];
444 src0 = (src0 + 2) >> 2;
445 out0 = src0 * 0x0101010101010101;
446 out1 = 0x8080808080808080;
448 SD4(out0, out0, out0, out0, src, stride);
450 SD4(out1, out1, out1, out1, src, stride);
458 src0 = src[4 * stride - 1];
459 src0 += src[5 * stride - 1];
460 src0 += src[6 * stride - 1];
461 src0 += src[7 * stride - 1];
462 src0 = (src0 + 2) >> 2;
464 out0 = 0x8080808080808080;
465 out1 = src0 * 0x0101010101010101;
467 SD4(out0, out0, out0, out0, src, stride);
469 SD4(out1, out1, out1, out1, src, stride);
540 uint32_t addition = 0;
541 v16u8 src_above,
out;
546 src_above =
LD_UB(src_top);
548 sum_above = __msa_hadd_u_h(src_above, src_above);
549 sum_top = __msa_hadd_u_w(sum_above, sum_above);
550 sum = __msa_hadd_u_d(sum_top, sum_top);
551 sum_top = (v4u32) __msa_pckev_w((v4i32) sum, (v4i32) sum);
552 sum = __msa_hadd_u_d(sum_top, sum_top);
553 addition = __msa_copy_u_w((v4i32) sum, 0);
554 addition += src_left[ 0 *
stride];
555 addition += src_left[ 1 *
stride];
556 addition += src_left[ 2 *
stride];
557 addition += src_left[ 3 *
stride];
558 addition += src_left[ 4 *
stride];
559 addition += src_left[ 5 *
stride];
560 addition += src_left[ 6 *
stride];
561 addition += src_left[ 7 *
stride];
562 addition += src_left[ 8 *
stride];
563 addition += src_left[ 9 *
stride];
564 addition += src_left[10 *
stride];
565 addition += src_left[11 *
stride];
566 addition += src_left[12 *
stride];
567 addition += src_left[13 *
stride];
568 addition += src_left[14 *
stride];
569 addition += src_left[15 *
stride];
570 addition = (addition + 16) >> 5;
571 out = (v16u8) __msa_fill_b(addition);
573 ST_UB8(out, out, out, out, out, out, out, out, dst, stride);
575 ST_UB8(out, out, out, out, out, out, out, out, dst, stride);
599 addition = src_left[ 0 *
stride];
600 addition += src_left[ 1 *
stride];
601 addition += src_left[ 2 *
stride];
602 addition += src_left[ 3 *
stride];
603 addition += src_left[ 4 *
stride];
604 addition += src_left[ 5 *
stride];
605 addition += src_left[ 6 *
stride];
606 addition += src_left[ 7 *
stride];
607 addition += src_left[ 8 *
stride];
608 addition += src_left[ 9 *
stride];
609 addition += src_left[10 *
stride];
610 addition += src_left[11 *
stride];
611 addition += src_left[12 *
stride];
612 addition += src_left[13 *
stride];
613 addition += src_left[14 *
stride];
614 addition += src_left[15 *
stride];
616 addition = (addition + 8) >> 4;
617 out = (v16u8) __msa_fill_b(addition);
619 ST_UB8(out, out, out, out, out, out, out, out, dst, stride);
621 ST_UB8(out, out, out, out, out, out, out, out, dst, stride);
628 v16u8 src_above,
out;
633 src_above =
LD_UB(src_top);
635 sum_above = __msa_hadd_u_h(src_above, src_above);
636 sum_top = __msa_hadd_u_w(sum_above, sum_above);
637 sum = __msa_hadd_u_d(sum_top, sum_top);
638 sum_top = (v4u32) __msa_pckev_w((v4i32) sum, (v4i32) sum);
639 sum = __msa_hadd_u_d(sum_top, sum_top);
640 sum = (v2u64) __msa_srari_d((v2i64) sum, 4);
641 out = (v16u8) __msa_splati_b((v16i8) sum, 0);
643 ST_UB8(out, out, out, out, out, out, out, out, dst, stride);
645 ST_UB8(out, out, out, out, out, out, out, out, dst, stride);
653 store = (v16u8) __msa_fill_b(128);
654 out = __msa_copy_u_d((v2i64) store, 0);
656 SD4(out, out, out, out, src, stride);
658 SD4(out, out, out, out, src, stride);
665 out = (v16u8) __msa_fill_b(128);
667 ST_UB8(out, out, out, out, out, out, out, out, src, stride);
669 ST_UB8(out, out, out, out, out, out, out, out, src, stride);
674 intra_predict_127dc_8x8_msa(src, stride);
679 intra_predict_129dc_8x8_msa(src, stride);
684 intra_predict_127dc_16x16_msa(src, stride);
689 intra_predict_129dc_16x16_msa(src, stride);
void ff_h264_intra_predict_plane_16x16_msa(uint8_t *src, ptrdiff_t stride)
static void intra_predict_vert_dc_8x8_msa(uint8_t *src, int32_t stride)
static void intra_predict_plane_8x8_msa(uint8_t *src, int32_t stride)
void ff_h264_intra_pred_dc_128_16x16_msa(uint8_t *src, ptrdiff_t stride)
#define INTRA_PREDICT_VALDC_16X16_MSA(val)
static void intra_predict_dc_4blk_8x8_msa(uint8_t *src, int32_t stride)
void ff_h264_intra_pred_horiz_16x16_msa(uint8_t *src, ptrdiff_t stride)
static void intra_predict_hor_dc_8x8_msa(uint8_t *src, int32_t stride)
void ff_h264_intra_predict_vert_dc_8x8_msa(uint8_t *src, ptrdiff_t stride)
#define SRA_4V(in0, in1, in2, in3, shift)
void ff_h264_intra_pred_vert_8x8_msa(uint8_t *src, ptrdiff_t stride)
void ff_h264_intra_pred_dc_16x16_msa(uint8_t *src, ptrdiff_t stride)
void ff_h264_intra_pred_dc_128_8x8_msa(uint8_t *src, ptrdiff_t stride)
void ff_h264_intra_predict_mad_cow_dc_l0t_8x8_msa(uint8_t *src, ptrdiff_t stride)
void ff_h264_intra_predict_mad_cow_dc_0l0_8x8_msa(uint8_t *src, ptrdiff_t stride)
#define CLIP_SH2_0_255(in0, in1)
void ff_h264_intra_pred_dc_left_16x16_msa(uint8_t *src, ptrdiff_t stride)
static void intra_predict_vert_8x8_msa(uint8_t *src, uint8_t *dst, int32_t dst_stride)
static void intra_predict_mad_cow_dc_0l0_8x8_msa(uint8_t *src, int32_t stride)
static const uint16_t mask[17]
void ff_h264_intra_pred_dc_top_16x16_msa(uint8_t *src, ptrdiff_t stride)
static void intra_predict_horiz_8x8_msa(uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride)
#define INTRA_PREDICT_VALDC_8X8_MSA(val)
void ff_h264_intra_predict_mad_cow_dc_0lt_8x8_msa(uint8_t *src, ptrdiff_t stride)
void ff_h264_intra_predict_plane_8x8_msa(uint8_t *src, ptrdiff_t stride)
void ff_h264_intra_predict_dc_4blk_8x8_msa(uint8_t *src, ptrdiff_t stride)
static void intra_predict_mad_cow_dc_l0t_8x8_msa(uint8_t *src, int32_t stride)
void ff_h264_intra_pred_horiz_8x8_msa(uint8_t *src, ptrdiff_t stride)
void ff_h264_intra_predict_hor_dc_8x8_msa(uint8_t *src, ptrdiff_t stride)
static void intra_predict_plane_16x16_msa(uint8_t *src, int32_t stride)
static void intra_predict_mad_cow_dc_l00_8x8_msa(uint8_t *src, int32_t stride)
#define SD4(in0, in1, in2, in3, pdst, stride)
void ff_vp8_pred8x8_129_dc_8_msa(uint8_t *src, ptrdiff_t stride)
static void intra_predict_horiz_16x16_msa(uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride)
#define INSERT_D2_UB(...)
void ff_h264_intra_predict_mad_cow_dc_l00_8x8_msa(uint8_t *src, ptrdiff_t stride)
void ff_h264_intra_pred_vert_16x16_msa(uint8_t *src, ptrdiff_t stride)
void ff_vp8_pred8x8_127_dc_8_msa(uint8_t *src, ptrdiff_t stride)
static void intra_predict_vert_16x16_msa(uint8_t *src, uint8_t *dst, int32_t dst_stride)
void ff_vp8_pred16x16_127_dc_8_msa(uint8_t *src, ptrdiff_t stride)
static void intra_predict_mad_cow_dc_0lt_8x8_msa(uint8_t *src, int32_t stride)
void ff_vp8_pred16x16_129_dc_8_msa(uint8_t *src, ptrdiff_t stride)