28 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8,
30 0, 1, 1, 2, 2, 3, 3, 4, 16, 17, 17, 18, 18, 19, 19, 20
35 int16_t *dst,
int32_t dst_stride,
38 int32_t src_stride_2x = (src_stride << 1);
39 int32_t dst_stride_2x = (dst_stride << 1);
40 int32_t src_stride_4x = (src_stride << 2);
41 int32_t dst_stride_4x = (dst_stride << 2);
42 int32_t src_stride_3x = src_stride_2x + src_stride;
43 int32_t dst_stride_3x = dst_stride_2x + dst_stride;
48 __m128i in0, in1, in2, in3;
53 src3 = __lsx_vldx(
src, src_stride_3x);
55 src4 = __lsx_vld(
src, 0);
58 src7 = __lsx_vldx(
src, src_stride_3x);
66 __lsx_vstelm_d(in0, dst, 0, 0);
67 __lsx_vstelm_d(in0, dst + dst_stride, 0, 1);
68 __lsx_vstelm_d(in1, dst + dst_stride_2x, 0, 0);
69 __lsx_vstelm_d(in1, dst + dst_stride_3x, 0, 1);
71 __lsx_vstelm_d(in2, dst, 0, 0);
72 __lsx_vstelm_d(in2, dst + dst_stride, 0, 1);
73 __lsx_vstelm_d(in3, dst + dst_stride_2x, 0, 0);
74 __lsx_vstelm_d(in3, dst + dst_stride_3x, 0, 1);
79 in0 = __lsx_vsllwil_hu_bu(
src0, 6);
80 __lsx_vstelm_d(in0, dst, 0, 0);
87 int16_t *dst,
int32_t dst_stride,
92 int32_t src_stride_2x = (src_stride << 1);
93 int32_t src_stride_4x = (src_stride << 2);
94 int32_t src_stride_3x = src_stride_2x + src_stride;
97 __m128i in0, in1, in2, in3, in4, in5, in6, in7;
99 for (loop_cnt = (
height >> 3); loop_cnt--;) {
102 src3 = __lsx_vldx(
src, src_stride_3x);
103 src += src_stride_4x;
104 src4 = __lsx_vld(
src, 0);
105 DUP2_ARG2(__lsx_vldx,
src, src_stride,
src, src_stride_2x, src5, src6);
106 src7 = __lsx_vldx(
src, src_stride_3x);
107 src += src_stride_4x;
111 DUP4_ARG2(__lsx_vsllwil_hu_bu, src4, 6, src5, 6, src6, 6, src7, 6,
114 __lsx_vstelm_d(in0, dst, 0, 0);
115 __lsx_vstelm_w(in0, dst, 8, 2);
117 __lsx_vstelm_d(in1, dst, 0, 0);
118 __lsx_vstelm_w(in1, dst, 8, 2);
120 __lsx_vstelm_d(in2, dst, 0, 0);
121 __lsx_vstelm_w(in2, dst, 8, 2);
123 __lsx_vstelm_d(in3, dst, 0, 0);
124 __lsx_vstelm_w(in3, dst, 8, 2);
126 __lsx_vstelm_d(in4, dst, 0, 0);
127 __lsx_vstelm_w(in4, dst, 8, 2);
129 __lsx_vstelm_d(in5, dst, 0, 0);
130 __lsx_vstelm_w(in5, dst, 8, 2);
132 __lsx_vstelm_d(in6, dst, 0, 0);
133 __lsx_vstelm_w(in6, dst, 8, 2);
135 __lsx_vstelm_d(in7, dst, 0, 0);
136 __lsx_vstelm_w(in7, dst, 8, 2);
141 in0 = __lsx_vsllwil_hu_bu(
src0, 6);
143 __lsx_vstelm_d(in0, dst, 0, 0);
144 __lsx_vstelm_w(in0, dst, 8, 2);
150 int16_t *dst,
int32_t dst_stride,
153 int32_t src_stride_2x = (src_stride << 1);
154 int32_t dst_stride_x = (dst_stride << 1);
155 int32_t src_stride_4x = (src_stride << 2);
156 int32_t dst_stride_2x = (dst_stride_x << 1);
157 int32_t src_stride_3x = src_stride_2x + src_stride;
158 int32_t dst_stride_3x = dst_stride_2x + dst_stride_x;
162 __m128i in0, in1, in2, in3, in4, in5, in6, in7;
164 for (loop_cnt = (
height >> 3); loop_cnt--;) {
168 src3 = __lsx_vldx(
src, src_stride_3x);
169 src += src_stride_4x;
170 src4 = __lsx_vld(
src, 0);
173 src7 = __lsx_vldx(
src, src_stride_3x);
174 src += src_stride_4x;
178 DUP4_ARG2(__lsx_vsllwil_hu_bu, src4, 6, src5, 6, src6, 6, src7, 6,
180 __lsx_vst(in0, dst, 0);
181 __lsx_vstx(in1, dst, dst_stride_x);
182 __lsx_vstx(in2, dst, dst_stride_2x);
183 __lsx_vstx(in3, dst, dst_stride_3x);
184 dst += dst_stride_2x;
185 __lsx_vst(in4, dst, 0);
186 __lsx_vstx(in5, dst, dst_stride_x);
187 __lsx_vstx(in6, dst, dst_stride_2x);
188 __lsx_vstx(in7, dst, dst_stride_3x);
189 dst += dst_stride_2x;
193 in0 = __lsx_vsllwil_hu_bu(
src0, 6);
194 __lsx_vst(in0, dst, 0);
201 int16_t *dst,
int32_t dst_stride,
205 uint32_t res =
height & 0x07;
206 int32_t src_stride_2x = (src_stride << 1);
207 int32_t dst_stride_x = (dst_stride << 1);
208 int32_t src_stride_4x = (src_stride << 2);
209 int32_t dst_stride_2x = (dst_stride_x << 1);
210 int32_t src_stride_3x = src_stride_2x + src_stride;
211 int32_t dst_stride_3x = dst_stride_2x + dst_stride_x;
212 __m128i
zero = __lsx_vldi(0);
214 __m128i in0, in1, in0_r, in1_r, in2_r, in3_r;
216 for (loop_cnt = (
height >> 3); loop_cnt--;) {
219 src3 = __lsx_vldx(
src, src_stride_3x);
220 src += src_stride_4x;
221 src4 = __lsx_vld(
src, 0);
222 DUP2_ARG2(__lsx_vldx,
src, src_stride,
src, src_stride_2x, src5, src6);
223 src7 = __lsx_vldx(
src, src_stride_3x);
224 src += src_stride_4x;
227 in0_r, in1_r, in2_r, in3_r);
230 __lsx_vst(in0_r, dst, 0);
231 __lsx_vstx(in1_r, dst, dst_stride_x);
232 __lsx_vstx(in2_r, dst, dst_stride_2x);
233 __lsx_vstx(in3_r, dst, dst_stride_3x);
234 __lsx_vstelm_d(in0, dst, 16, 0);
236 __lsx_vstelm_d(in0, dst, 16, 1);
238 __lsx_vstelm_d(in1, dst, 16, 0);
240 __lsx_vstelm_d(in1, dst, 16, 1);
243 DUP4_ARG2(__lsx_vsllwil_hu_bu, src4, 6, src5, 6, src6, 6, src7, 6,
244 in0_r, in1_r, in2_r, in3_r);
247 __lsx_vst(in0_r, dst, 0);
248 __lsx_vstx(in1_r, dst, dst_stride_x);
249 __lsx_vstx(in2_r, dst, dst_stride_2x);
250 __lsx_vstx(in3_r, dst, dst_stride_3x);
251 __lsx_vstelm_d(in0, dst, 16, 0);
253 __lsx_vstelm_d(in0, dst, 16, 1);
255 __lsx_vstelm_d(in1, dst, 16, 0);
257 __lsx_vstelm_d(in1, dst, 16, 1);
262 in0 = __lsx_vsllwil_hu_bu(
src0, 6);
264 in1 = __lsx_vslli_h(
src1, 6);
265 __lsx_vst(in0, dst, 0);
266 __lsx_vstelm_d(in1, dst, 16, 0);
273 int16_t *dst,
int32_t dst_stride,
276 __m128i
zero = __lsx_vldi(0);
277 int32_t src_stride_2x = (src_stride << 1);
278 int32_t dst_stride_x = (dst_stride << 1);
279 int32_t src_stride_4x = (src_stride << 2);
280 int32_t dst_stride_2x = (dst_stride << 2);
281 int32_t src_stride_3x = src_stride_2x + src_stride;
282 int32_t dst_stride_3x = dst_stride_2x + dst_stride_x;
285 int16_t* dst1 = dst + 8;
287 __m128i in0_r, in1_r, in2_r, in3_r, in0_l, in1_l, in2_l, in3_l;
289 for (loop_cnt = (
height >> 3); loop_cnt--;) {
293 src3 = __lsx_vldx(
src, src_stride_3x);
294 src += src_stride_4x;
295 src4 = __lsx_vld(
src, 0);
298 src7 = __lsx_vldx(
src, src_stride_3x);
299 src += src_stride_4x;
301 in0_l, in1_l, in2_l, in3_l);
303 in0_r, in1_r, in2_r, in3_r);
304 DUP4_ARG2(__lsx_vslli_h, in0_l, 6, in1_l, 6, in2_l, 6, in3_l, 6, in0_l,
305 in1_l, in2_l, in3_l);
306 __lsx_vst(in0_r, dst, 0);
307 __lsx_vstx(in1_r, dst, dst_stride_x);
308 __lsx_vstx(in2_r, dst, dst_stride_2x);
309 __lsx_vstx(in3_r, dst, dst_stride_3x);
310 __lsx_vst(in0_l, dst1, 0);
311 __lsx_vstx(in1_l, dst1, dst_stride_x);
312 __lsx_vstx(in2_l, dst1, dst_stride_2x);
313 __lsx_vstx(in3_l, dst1, dst_stride_3x);
314 dst += dst_stride_2x;
315 dst1 += dst_stride_2x;
318 in0_l, in1_l, in2_l, in3_l);
319 DUP4_ARG2(__lsx_vsllwil_hu_bu, src4, 6, src5, 6, src6, 6, src7, 6,
320 in0_r, in1_r, in2_r, in3_r);
321 DUP4_ARG2(__lsx_vslli_h, in0_l, 6, in1_l, 6, in2_l, 6, in3_l, 6, in0_l,
322 in1_l, in2_l, in3_l);
323 __lsx_vst(in0_r, dst, 0);
324 __lsx_vstx(in1_r, dst, dst_stride_x);
325 __lsx_vstx(in2_r, dst, dst_stride_2x);
326 __lsx_vstx(in3_r, dst, dst_stride_3x);
327 __lsx_vst(in0_l, dst1, 0);
328 __lsx_vstx(in1_l, dst1, dst_stride_x);
329 __lsx_vstx(in2_l, dst1, dst_stride_2x);
330 __lsx_vstx(in3_l, dst1, dst_stride_3x);
331 dst += dst_stride_2x;
332 dst1 += dst_stride_2x;
337 src3 = __lsx_vldx(
src, src_stride_3x);
340 in0_l, in1_l, in2_l, in3_l);
342 in0_r, in1_r, in2_r, in3_r);
343 DUP4_ARG2(__lsx_vslli_h, in0_l, 6, in1_l, 6, in2_l, 6, in3_l, 6, in0_l,
344 in1_l, in2_l, in3_l);
345 __lsx_vst(in0_r, dst, 0);
346 __lsx_vstx(in1_r, dst, dst_stride_x);
347 __lsx_vstx(in2_r, dst, dst_stride_2x);
348 __lsx_vstx(in3_r, dst, dst_stride_3x);
350 __lsx_vst(in0_l, dst, 0);
351 __lsx_vstx(in1_l, dst, dst_stride_x);
352 __lsx_vstx(in2_l, dst, dst_stride_2x);
353 __lsx_vstx(in3_l, dst, dst_stride_3x);
358 int16_t *dst,
int32_t dst_stride,
362 int32_t src_stride_2x = (src_stride << 1);
363 int32_t dst_stride_x = (dst_stride << 1);
364 int32_t src_stride_4x = (src_stride << 2);
365 int32_t dst_stride_2x = (dst_stride << 2);
366 int32_t src_stride_3x = src_stride_2x + src_stride;
367 int32_t dst_stride_3x = dst_stride_2x + dst_stride_x;
368 const uint8_t *_src =
src + 16;
370 __m128i
zero = __lsx_vldi(0);
372 __m128i in0_r, in1_r, in2_r, in3_r, in0_l, in1_l, in2_l, in3_l;
374 for (loop_cnt = (
height >> 2); loop_cnt--;) {
377 src3 = __lsx_vldx(
src, src_stride_3x);
378 src += src_stride_4x;
379 src4 = __lsx_vld(_src, 0);
380 DUP2_ARG2(__lsx_vldx, _src, src_stride, _src, src_stride_2x,
382 src7 = __lsx_vldx(_src, src_stride_3x);
383 _src += src_stride_4x;
386 src3, in0_l, in1_l, in2_l, in3_l);
388 in0_r, in1_r, in2_r, in3_r);
389 DUP4_ARG2(__lsx_vslli_h, in0_l, 6, in1_l, 6, in2_l, 6, in3_l, 6,
390 in0_l, in1_l, in2_l, in3_l);
391 __lsx_vst(in0_r, dst, 0);
392 __lsx_vstx(in1_r, dst, dst_stride_x);
393 __lsx_vstx(in2_r, dst, dst_stride_2x);
394 __lsx_vstx(in3_r, dst, dst_stride_3x);
396 __lsx_vst(in0_l, dst1, 0);
397 __lsx_vstx(in1_l, dst1, dst_stride_x);
398 __lsx_vstx(in2_l, dst1, dst_stride_2x);
399 __lsx_vstx(in3_l, dst1, dst_stride_3x);
400 DUP4_ARG2(__lsx_vsllwil_hu_bu, src4, 6, src5, 6, src6, 6, src7, 6,
401 in0_r, in1_r, in2_r, in3_r);
403 __lsx_vst(in0_r, dst1, 0);
404 __lsx_vstx(in1_r, dst1, dst_stride_x);
405 __lsx_vstx(in2_r, dst1, dst_stride_2x);
406 __lsx_vstx(in3_r, dst1, dst_stride_3x);
407 dst += dst_stride_2x;
412 int16_t *dst,
int32_t dst_stride,
416 int32_t src_stride_2x = (src_stride << 1);
417 int32_t src_stride_4x = (src_stride << 2);
418 int32_t src_stride_3x = src_stride_2x + src_stride;
419 const uint8_t *_src =
src + 16;
422 __m128i in0_r, in1_r, in2_r, in3_r, in0_l, in1_l, in2_l, in3_l;
424 for (loop_cnt = (
height >> 2); loop_cnt--;) {
427 src6 = __lsx_vldx(
src, src_stride_3x);
428 src += src_stride_4x;
429 src1 = __lsx_vld(_src, 0);
430 DUP2_ARG2(__lsx_vldx, _src, src_stride, _src, src_stride_2x,
432 src7 = __lsx_vldx(_src, src_stride_3x);
433 _src += src_stride_4x;
436 src3, in0_l, in1_l, in2_l, in3_l);
438 in0_r, in1_r, in2_r, in3_r);
439 DUP4_ARG2(__lsx_vslli_h, in0_l, 6, in1_l, 6, in2_l, 6, in3_l, 6,
440 in0_l, in1_l, in2_l, in3_l);
441 __lsx_vst(in0_r, dst, 0);
442 __lsx_vst(in0_l, dst, 16);
443 __lsx_vst(in1_r, dst, 32);
444 __lsx_vst(in1_l, dst, 48);
446 __lsx_vst(in2_r, dst, 0);
447 __lsx_vst(in2_l, dst, 16);
448 __lsx_vst(in3_r, dst, 32);
449 __lsx_vst(in3_l, dst, 48);
453 in0_l, in1_l, in2_l, in3_l);
454 DUP4_ARG2(__lsx_vsllwil_hu_bu, src4, 6, src5, 6, src6, 6, src7, 6,
455 in0_r, in1_r, in2_r, in3_r);
456 DUP4_ARG2(__lsx_vslli_h, in0_l, 6, in1_l, 6, in2_l, 6, in3_l, 6, in0_l,
457 in1_l, in2_l, in3_l);
458 __lsx_vst(in0_r, dst, 0);
459 __lsx_vst(in0_l, dst, 16);
460 __lsx_vst(in1_r, dst, 32);
461 __lsx_vst(in1_l, dst, 48);
463 __lsx_vst(in2_r, dst, 0);
464 __lsx_vst(in2_l, dst, 16);
465 __lsx_vst(in3_r, dst, 32);
466 __lsx_vst(in3_l, dst, 48);
472 int16_t *dst,
int32_t dst_stride,
478 __m128i src8, src9, src10, src11;
479 __m128i in0_r, in1_r, in2_r, in3_r, in4_r, in5_r;
480 __m128i in0_l, in1_l, in2_l, in3_l, in4_l, in5_l;
482 for (loop_cnt = (
height >> 2); loop_cnt--;) {
487 src5 = __lsx_vld(
src, 32);
490 src8 = __lsx_vld(
src, 32);
493 src11 = __lsx_vld(
src, 32);
497 src3, in0_l, in1_l, in2_l, in3_l);
500 in0_r, in1_r, in2_r, in3_r);
501 DUP4_ARG2(__lsx_vslli_h, in0_l, 6, in1_l, 6, in2_l, 6, in3_l, 6, in0_l,
502 in1_l, in2_l, in3_l);
503 DUP2_ARG2(__lsx_vsllwil_hu_bu, src4, 6, src5, 6, in4_r, in5_r);
504 DUP2_ARG2(__lsx_vslli_h, in4_l, 6, in5_l, 6, in4_l, in5_l);
505 __lsx_vst(in0_r, dst, 0);
506 __lsx_vst(in0_l, dst, 16);
507 __lsx_vst(in1_r, dst, 32);
508 __lsx_vst(in1_l, dst, 48);
509 __lsx_vst(in2_r, dst, 64);
510 __lsx_vst(in2_l, dst, 80);
512 __lsx_vst(in3_r, dst, 0);
513 __lsx_vst(in3_l, dst, 16);
514 __lsx_vst(in4_r, dst, 32);
515 __lsx_vst(in4_l, dst, 48);
516 __lsx_vst(in5_r, dst, 64);
517 __lsx_vst(in5_l, dst, 80);
521 in0_l, in1_l, in2_l, in3_l);
523 DUP4_ARG2(__lsx_vsllwil_hu_bu, src6, 6, src7, 6, src8, 6, src9, 6,
524 in0_r, in1_r, in2_r, in3_r);
525 DUP4_ARG2(__lsx_vslli_h, in0_l, 6, in1_l, 6, in2_l, 6, in3_l, 6, in0_l,
526 in1_l, in2_l, in3_l);
527 DUP2_ARG2(__lsx_vsllwil_hu_bu, src10, 6, src11, 6, in4_r, in5_r);
528 DUP2_ARG2(__lsx_vslli_h, in4_l, 6, in5_l, 6, in4_l, in5_l);
529 __lsx_vst(in0_r, dst, 0);
530 __lsx_vst(in0_l, dst, 16);
531 __lsx_vst(in1_r, dst, 32);
532 __lsx_vst(in1_l, dst, 48);
533 __lsx_vst(in2_r, dst, 64);
534 __lsx_vst(in2_l, dst, 80);
536 __lsx_vst(in3_r, dst, 0);
537 __lsx_vst(in3_l, dst, 16);
538 __lsx_vst(in4_r, dst, 32);
539 __lsx_vst(in4_l, dst, 48);
540 __lsx_vst(in5_r, dst, 64);
541 __lsx_vst(in5_l, dst, 80);
547 int16_t *dst,
int32_t dst_stride,
553 __m128i in0_r, in1_r, in2_r, in3_r, in0_l, in1_l, in2_l, in3_l;
556 for (loop_cnt = (
height >> 1); loop_cnt--;) {
561 src4, src5, src6, src7);
565 src3, in0_l, in1_l, in2_l, in3_l);
567 in0_r, in1_r, in2_r, in3_r);
568 DUP4_ARG2(__lsx_vslli_h, in0_l, 6, in1_l, 6, in2_l, 6, in3_l, 6,
569 in0_l, in1_l, in2_l, in3_l);
570 __lsx_vst(in0_r, dst, 0);
571 __lsx_vst(in0_l, dst, 16);
572 __lsx_vst(in1_r, dst, 32);
573 __lsx_vst(in1_l, dst, 48);
574 __lsx_vst(in2_r, dst, 64);
575 __lsx_vst(in2_l, dst, 80);
576 __lsx_vst(in3_r, dst, 96);
577 __lsx_vst(in3_l, dst, 112);
581 src7, in0_l, in1_l, in2_l, in3_l);
582 DUP4_ARG2(__lsx_vsllwil_hu_bu, src4, 6, src5, 6, src6, 6, src7, 6,
583 in0_r, in1_r, in2_r, in3_r);
584 DUP4_ARG2(__lsx_vslli_h, in0_l, 6, in1_l, 6, in2_l, 6, in3_l, 6, in0_l,
585 in1_l, in2_l, in3_l);
586 __lsx_vst(in0_r, dst, 0);
587 __lsx_vst(in0_l, dst, 16);
588 __lsx_vst(in1_r, dst, 32);
589 __lsx_vst(in1_l, dst, 48);
590 __lsx_vst(in2_r, dst, 64);
591 __lsx_vst(in2_l, dst, 80);
592 __lsx_vst(in3_r, dst, 96);
593 __lsx_vst(in3_l, dst, 112);
599 int16_t *dst,
int32_t dst_stride,
602 uint32_t loop_cnt =
height >> 3;
603 uint32_t res = (
height & 0x7) >> 1;
604 int32_t src_stride_2x = (src_stride << 1);
605 int32_t dst_stride_2x = (dst_stride << 1);
606 int32_t src_stride_4x = (src_stride << 2);
607 int32_t dst_stride_4x = (dst_stride << 2);
608 int32_t src_stride_3x = src_stride_2x + src_stride;
609 int32_t dst_stride_3x = dst_stride_2x + dst_stride;
611 __m128i filt0, filt1, filt2, filt3;
612 __m128i mask1, mask2, mask3;
613 __m128i vec0, vec1, vec2, vec3;
614 __m128i dst0, dst1, dst2, dst3;
619 filt0, filt1, filt2, filt3);
621 DUP2_ARG2(__lsx_vaddi_bu, mask0, 2, mask0, 4, mask1, mask2);
622 mask3 = __lsx_vaddi_bu(mask0, 6);
627 src3 = __lsx_vldx(
src, src_stride_3x);
628 src += src_stride_4x;
629 src4 = __lsx_vld(
src, 0);
630 DUP2_ARG2(__lsx_vldx,
src, src_stride,
src, src_stride_2x, src5, src6);
631 src7 = __lsx_vldx(
src, src_stride_3x);
632 src += src_stride_4x;
634 src0, mask2,
src1,
src0, mask3, vec0, vec1, vec2, vec3);
635 dst0 = __lsx_vdp2_h_bu_b(vec0, filt0);
636 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst0, vec1, filt1, dst0, vec2, filt2,
638 dst0 = __lsx_vdp2add_h_bu_b(dst0, vec3, filt3);
640 src2, mask2, src3,
src2, mask3, vec0, vec1, vec2, vec3);
641 dst1 = __lsx_vdp2_h_bu_b(vec0, filt0);
642 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst1, vec1, filt1, dst1, vec2, filt2,
644 dst1 = __lsx_vdp2add_h_bu_b(dst1, vec3, filt3);
645 DUP4_ARG3(__lsx_vshuf_b, src5, src4, mask0, src5, src4, mask1, src5,
646 src4, mask2, src5, src4, mask3, vec0, vec1, vec2, vec3);
647 dst2 = __lsx_vdp2_h_bu_b(vec0, filt0);
648 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst2, vec1, filt1, dst2, vec2, filt2,
650 dst2 = __lsx_vdp2add_h_bu_b(dst2, vec3, filt3);
651 DUP4_ARG3(__lsx_vshuf_b, src7, src6, mask0, src7, src6, mask1, src7,
652 src6, mask2, src7, src6, mask3, vec0, vec1, vec2, vec3);
653 dst3 = __lsx_vdp2_h_bu_b(vec0, filt0);
654 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst3, vec1, filt1, dst3, vec2, filt2,
656 dst3 = __lsx_vdp2add_h_bu_b(dst3, vec3, filt3);
658 __lsx_vstelm_d(dst0, dst, 0, 0);
659 __lsx_vstelm_d(dst0, dst + dst_stride, 0, 1);
660 __lsx_vstelm_d(dst1, dst + dst_stride_2x, 0, 0);
661 __lsx_vstelm_d(dst1, dst + dst_stride_3x, 0, 1);
662 dst += dst_stride_4x;
663 __lsx_vstelm_d(dst2, dst, 0, 0);
664 __lsx_vstelm_d(dst2, dst + dst_stride, 0, 1);
665 __lsx_vstelm_d(dst3, dst + dst_stride_2x, 0, 0);
666 __lsx_vstelm_d(dst3, dst + dst_stride_3x, 0, 1);
667 dst += dst_stride_4x;
671 src1 = __lsx_vldx(
src, src_stride);
673 src0, mask2,
src1,
src0, mask3, vec0, vec1, vec2, vec3);
674 dst0 = __lsx_vdp2_h_bu_b(vec0, filt0);
675 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst0, vec1, filt1, dst0, vec2, filt2,
677 dst0 = __lsx_vdp2add_h_bu_b(dst0, vec3, filt3);
678 __lsx_vstelm_d(dst0, dst, 0, 0);
679 __lsx_vstelm_d(dst0, dst + dst_stride, 0, 1);
680 src += src_stride_2x;
681 dst += dst_stride_2x;
686 int16_t *dst,
int32_t dst_stride,
690 int32_t src_stride_2x = (src_stride << 1);
691 int32_t dst_stride_x = (dst_stride << 1);
692 int32_t src_stride_4x = (src_stride << 2);
693 int32_t dst_stride_2x = (dst_stride << 2);
694 int32_t src_stride_3x = src_stride_2x + src_stride;
695 int32_t dst_stride_3x = dst_stride_2x + dst_stride_x;
697 __m128i filt0, filt1, filt2, filt3;
698 __m128i mask1, mask2, mask3;
699 __m128i vec0, vec1, vec2, vec3;
700 __m128i dst0, dst1, dst2, dst3;
705 filt0, filt1, filt2, filt3);
707 DUP2_ARG2(__lsx_vaddi_bu, mask0, 2, mask0, 4, mask1, mask2);
708 mask3 = __lsx_vaddi_bu(mask0, 6);
710 for (loop_cnt = (
height >> 2); loop_cnt--;) {
713 src3 = __lsx_vldx(
src, src_stride_3x);
714 src += src_stride_4x;
717 src0, mask2,
src0,
src0, mask3, vec0, vec1, vec2, vec3);
718 dst0 = __lsx_vdp2_h_bu_b(vec0, filt0);
719 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst0, vec1, filt1, dst0, vec2, filt2,
721 dst0 = __lsx_vdp2add_h_bu_b(dst0, vec3, filt3);
723 src1, mask2,
src1,
src1, mask3, vec0, vec1, vec2, vec3);
724 dst1 = __lsx_vdp2_h_bu_b(vec0, filt0);
725 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst1, vec1, filt1, dst1, vec2, filt2,
727 dst1 = __lsx_vdp2add_h_bu_b(dst1, vec3, filt3);
729 src2, mask2,
src2,
src2, mask3, vec0, vec1, vec2, vec3);
730 dst2 = __lsx_vdp2_h_bu_b(vec0, filt0);
731 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst2, vec1, filt1, dst2, vec2, filt2,
733 dst2 = __lsx_vdp2add_h_bu_b(dst2, vec3, filt3);
734 DUP4_ARG3(__lsx_vshuf_b, src3, src3, mask0, src3, src3, mask1, src3,
735 src3, mask2, src3, src3, mask3, vec0, vec1, vec2, vec3);
736 dst3 = __lsx_vdp2_h_bu_b(vec0, filt0);
737 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst3, vec1, filt1, dst3, vec2, filt2,
739 dst3 = __lsx_vdp2add_h_bu_b(dst3, vec3, filt3);
741 __lsx_vst(dst0, dst, 0);
742 __lsx_vstx(dst1, dst, dst_stride_x);
743 __lsx_vstx(dst2, dst, dst_stride_2x);
744 __lsx_vstx(dst3, dst, dst_stride_3x);
745 dst += dst_stride_2x;
750 int16_t *dst,
int32_t dst_stride,
754 int32_t src_stride_2x = (src_stride << 1);
755 int32_t src_stride_4x = (src_stride << 2);
756 int32_t src_stride_3x = src_stride_2x + src_stride;
759 __m128i mask0, mask1, mask2, mask3, mask4, mask5, mask6, mask7;
760 __m128i vec0, vec1, vec2, vec3, vec4, vec5;
761 __m128i filt0, filt1, filt2, filt3, dst0, dst1, dst2, dst3, dst4, dst5;
766 filt0, filt1, filt2, filt3);
769 DUP2_ARG2(__lsx_vaddi_bu, mask0, 2, mask0, 4, mask1, mask2);
770 mask3 = __lsx_vaddi_bu(mask0, 6);
772 DUP2_ARG2(__lsx_vaddi_bu, mask4, 2, mask4, 4, mask5, mask6);
773 mask7 = __lsx_vaddi_bu(mask4, 6);
775 for (loop_cnt = 4; loop_cnt--;) {
778 src3 = __lsx_vldx(
src, src_stride_3x);
779 src4 = __lsx_vld(_src, 0);
780 DUP2_ARG2(__lsx_vldx, _src, src_stride, _src, src_stride_2x,
782 src7 = __lsx_vldx(_src, src_stride_3x);
783 src += src_stride_4x;
784 _src += src_stride_4x;
790 DUP2_ARG3(__lsx_vshuf_b, src5, src4, mask4, src7, src6, mask4,
792 DUP4_ARG2(__lsx_vdp2_h_bu_b, vec0, filt0, vec1, filt0, vec2, filt0,
793 vec3, filt0, dst0, dst1, dst2, dst3);
794 DUP2_ARG2(__lsx_vdp2_h_bu_b, vec4, filt0, vec5, filt0, dst4, dst5);
799 DUP2_ARG3(__lsx_vshuf_b, src5, src4, mask5, src7, src6, mask5,
801 DUP4_ARG3(__lsx_vdp2add_h_bu_b, dst0, vec0, filt1, dst1, vec1, filt1,
802 dst2, vec2, filt1, dst3, vec3, filt1, dst0, dst1, dst2, dst3);
803 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst4, vec4, filt1, dst5, vec5, filt1,
809 DUP2_ARG3(__lsx_vshuf_b, src5, src4, mask6, src7, src6, mask6,
811 DUP4_ARG3(__lsx_vdp2add_h_bu_b, dst0, vec0, filt2, dst1, vec1, filt2,
812 dst2, vec2, filt2, dst3, vec3, filt2, dst0, dst1, dst2, dst3);
813 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst4, vec4, filt2, dst5, vec5, filt2,
819 DUP2_ARG3(__lsx_vshuf_b, src5, src4, mask7, src7, src6, mask7,
821 DUP4_ARG3(__lsx_vdp2add_h_bu_b, dst0, vec0, filt3, dst1, vec1, filt3,
822 dst2, vec2, filt3, dst3, vec3, filt3, dst0, dst1, dst2, dst3);
823 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst4, vec4, filt3, dst5, vec5, filt3,
826 __lsx_vst(dst0, dst, 0);
827 __lsx_vstelm_d(dst4, dst, 16, 0);
829 __lsx_vst(dst1, dst, 0);
830 __lsx_vstelm_d(dst4, dst, 16, 1);
832 __lsx_vst(dst2, dst, 0);
833 __lsx_vstelm_d(dst5, dst, 16, 0);
835 __lsx_vst(dst3, dst, 0);
836 __lsx_vstelm_d(dst5, dst, 16, 1);
842 int16_t *dst,
int32_t dst_stride,
847 __m128i filt0, filt1, filt2, filt3;
848 __m128i mask1, mask2, mask3;
849 __m128i vec0, vec1, vec2, vec3;
850 __m128i dst0, dst1, dst2, dst3;
856 filt0, filt1, filt2, filt3);
858 DUP2_ARG2(__lsx_vaddi_bu, mask0, 2, mask0, 4, mask1, mask2);
859 mask3 = __lsx_vaddi_bu(mask0, 6);
861 for (loop_cnt = (
height >> 1); loop_cnt--;) {
871 DUP4_ARG2(__lsx_vdp2_h_bu_b, vec0, filt0, vec1, filt0, vec2, filt0,
872 vec3, filt0, dst0, dst1, dst2, dst3);
877 DUP4_ARG3(__lsx_vdp2add_h_bu_b, dst0, vec0, filt1, dst1, vec1, filt1,
878 dst2, vec2, filt1, dst3, vec3, filt1, dst0, dst1, dst2, dst3);
883 DUP4_ARG3(__lsx_vdp2add_h_bu_b, dst0, vec0, filt2, dst1, vec1, filt2,
884 dst2, vec2, filt2, dst3, vec3, filt2, dst0, dst1, dst2, dst3);
889 DUP4_ARG3(__lsx_vdp2add_h_bu_b, dst0, vec0, filt3, dst1, vec1, filt3,
890 dst2, vec2, filt3, dst3, vec3, filt3, dst0, dst1, dst2, dst3);
892 __lsx_vst(dst0, dst, 0);
893 __lsx_vst(dst1, dst, 16);
895 __lsx_vst(dst2, dst, 0);
896 __lsx_vst(dst3, dst, 16);
902 int16_t *dst,
int32_t dst_stride,
907 __m128i filt0, filt1, filt2, filt3;
908 __m128i mask1, mask2, mask3, mask4, mask5, mask6, mask7;
909 __m128i vec0, vec1, vec2, vec3, vec4, vec5;
910 __m128i dst0, dst1, dst2, dst3, dst4, dst5;
915 filt0, filt1, filt2, filt3);
917 DUP4_ARG2(__lsx_vaddi_bu, mask0, 2, mask0, 4, mask0, 6, mask0, 8, mask1,
918 mask2, mask3, mask4);
919 DUP2_ARG2(__lsx_vaddi_bu, mask0, 10, mask0, 12, mask5, mask6);
920 mask7 = __lsx_vaddi_bu(mask0, 14);
922 for (loop_cnt = (
height >> 1); loop_cnt--;) {
929 src1, mask0,
src2,
src2, mask0, vec0, vec1, vec2, vec3);
930 DUP2_ARG3(__lsx_vshuf_b, src3,
src2, mask4, src3, src3, mask0,
932 DUP4_ARG2(__lsx_vdp2_h_bu_b, vec0, filt0, vec1, filt0, vec2, filt0,
933 vec3, filt0, dst0, dst1, dst2, dst3);
934 DUP2_ARG2(__lsx_vdp2_h_bu_b, vec4, filt0, vec5, filt0, dst4, dst5);
936 src1, mask1,
src2,
src2, mask1, vec0, vec1, vec2, vec3);
937 DUP2_ARG3(__lsx_vshuf_b, src3,
src2, mask5, src3, src3, mask1,
939 DUP4_ARG3(__lsx_vdp2add_h_bu_b, dst0, vec0, filt1, dst1, vec1, filt1,
940 dst2, vec2, filt1, dst3, vec3, filt1, dst0, dst1, dst2, dst3);
941 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst4, vec4, filt1, dst5, vec5, filt1,
944 src1, mask2,
src2,
src2, mask2, vec0, vec1, vec2, vec3);
945 DUP2_ARG3(__lsx_vshuf_b, src3,
src2, mask6, src3, src3, mask2,
947 DUP4_ARG3(__lsx_vdp2add_h_bu_b, dst0, vec0, filt2, dst1, vec1, filt2,
948 dst2, vec2, filt2, dst3, vec3, filt2, dst0, dst1, dst2, dst3);
949 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst4, vec4, filt2, dst5, vec5, filt2,
952 src1, mask3,
src2,
src2, mask3, vec0, vec1, vec2, vec3);
953 DUP2_ARG3(__lsx_vshuf_b, src3,
src2, mask7, src3, src3, mask3,
955 DUP4_ARG3(__lsx_vdp2add_h_bu_b, dst0, vec0, filt3, dst1, vec1, filt3,
956 dst2, vec2, filt3, dst3, vec3, filt3, dst0, dst1, dst2, dst3);
957 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst4, vec4, filt3, dst5, vec5, filt3,
960 __lsx_vst(dst0, dst, 0);
961 __lsx_vst(dst1, dst, 16);
962 __lsx_vst(dst2, dst, 32);
964 __lsx_vst(dst3, dst, 0);
965 __lsx_vst(dst4, dst, 16);
966 __lsx_vst(dst5, dst, 32);
972 int16_t *dst,
int32_t dst_stride,
977 __m128i filt0, filt1, filt2, filt3;
978 __m128i mask1, mask2, mask3, mask4, mask5, mask6, mask7;
979 __m128i vec0, vec1, vec2, vec3;
980 __m128i dst0, dst1, dst2, dst3;
985 filt0, filt1, filt2, filt3);
987 DUP4_ARG2(__lsx_vaddi_bu, mask0, 2, mask0, 4, mask0, 6, mask0, 8,
988 mask1, mask2, mask3, mask4);
989 DUP2_ARG2(__lsx_vaddi_bu, mask0, 10, mask0, 12, mask5, mask6);
990 mask7 = __lsx_vaddi_bu(mask0, 14);
992 for (loop_cnt =
height; loop_cnt--;) {
998 src0, mask2,
src0,
src0, mask3, vec0, vec1, vec2, vec3);
999 dst0 = __lsx_vdp2_h_bu_b(vec0, filt0);
1000 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst0, vec1, filt1, dst0, vec2, filt2,
1002 dst0 = __lsx_vdp2add_h_bu_b(dst0, vec3, filt3);
1005 src0, mask6,
src1,
src0, mask7, vec0, vec1, vec2, vec3);
1006 dst1 = __lsx_vdp2_h_bu_b(vec0, filt0);
1007 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst1, vec1, filt1, dst1, vec2, filt2,
1009 dst1 = __lsx_vdp2add_h_bu_b(dst1, vec3, filt3);
1011 mask2,
src1,
src1, mask3, vec0, vec1, vec2, vec3);
1012 dst2 = __lsx_vdp2_h_bu_b(vec0, filt0);
1013 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst2, vec1, filt1, dst2, vec2, filt2,
1015 dst2 = __lsx_vdp2add_h_bu_b(dst2, vec3, filt3);
1017 mask2,
src2,
src2, mask3, vec0, vec1, vec2, vec3);
1018 dst3 = __lsx_vdp2_h_bu_b(vec0, filt0);
1019 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst3, vec1, filt1, dst3, vec2, filt2,
1021 dst3 = __lsx_vdp2add_h_bu_b(dst3, vec3, filt3);
1023 __lsx_vst(dst0, dst, 0);
1024 __lsx_vst(dst1, dst, 16);
1025 __lsx_vst(dst2, dst, 32);
1026 __lsx_vst(dst3, dst, 48);
1032 int16_t *dst,
int32_t dst_stride,
1037 __m128i filt0, filt1, filt2, filt3;
1038 __m128i mask1, mask2, mask3, mask4, mask5, mask6, mask7;
1039 __m128i vec0, vec1, vec2, vec3, vec4, vec5;
1040 __m128i dst0, dst1, dst2, dst3, dst4, dst5;
1045 filt0, filt1, filt2, filt3);
1047 DUP4_ARG2(__lsx_vaddi_bu, mask0, 2, mask0, 4, mask0, 6, mask0, 8, mask1,
1048 mask2, mask3, mask4);
1049 DUP2_ARG2(__lsx_vaddi_bu, mask0, 10, mask0, 12, mask5, mask6);
1050 mask7 = __lsx_vaddi_bu(mask0, 14);
1052 for (loop_cnt =
height; loop_cnt--;) {
1055 src3 = __lsx_vld(
src, 40);
1059 mask0,
src2,
src1, mask4, vec0, vec1, vec2, vec3);
1060 DUP4_ARG2(__lsx_vdp2_h_bu_b, vec0, filt0, vec1, filt0, vec2, filt0,
1061 vec3, filt0, dst0, dst1, dst2, dst3);
1063 src1, mask1,
src2,
src1, mask5, vec0, vec1, vec2, vec3);
1064 DUP4_ARG3(__lsx_vdp2add_h_bu_b, dst0, vec0, filt1, dst1, vec1, filt1,
1065 dst2, vec2, filt1, dst3, vec3, filt1, dst0, dst1, dst2, dst3);
1067 src1, mask2,
src2,
src1, mask6, vec0, vec1, vec2, vec3);
1068 DUP4_ARG3(__lsx_vdp2add_h_bu_b, dst0, vec0, filt2, dst1, vec1, filt2,
1069 dst2, vec2, filt2, dst3, vec3, filt2, dst0, dst1, dst2, dst3);
1071 src1, mask3,
src2,
src1, mask7, vec0, vec1, vec2, vec3);
1072 DUP4_ARG3(__lsx_vdp2add_h_bu_b, dst0, vec0, filt3, dst1, vec1, filt3,
1073 dst2, vec2, filt3, dst3, vec3, filt3, dst0, dst1, dst2, dst3);
1074 __lsx_vst(dst0, dst, 0);
1075 __lsx_vst(dst1, dst, 16);
1076 __lsx_vst(dst2, dst, 32);
1077 __lsx_vst(dst3, dst, 48);
1081 DUP2_ARG2(__lsx_vdp2_h_bu_b, vec4, filt0, vec5, filt0, dst4, dst5);
1084 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst4, vec4, filt1, dst5, vec5, filt1,
1088 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst4, vec4, filt2, dst5, vec5, filt2,
1092 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst4, vec4, filt3, dst5, vec5, filt3,
1094 __lsx_vst(dst4, dst, 64);
1095 __lsx_vst(dst5, dst, 80);
1101 int16_t *dst,
int32_t dst_stride,
1106 __m128i filt0, filt1, filt2, filt3;
1107 __m128i mask1, mask2, mask3, mask4, mask5, mask6, mask7;
1108 __m128i vec0, vec1, vec2, vec3;
1109 __m128i dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7;
1114 filt0, filt1, filt2, filt3);
1116 DUP4_ARG2(__lsx_vaddi_bu, mask0, 2, mask0, 4, mask0, 6, mask0, 8, mask1,
1117 mask2, mask3, mask4);
1118 DUP2_ARG2(__lsx_vaddi_bu, mask0, 10, mask0, 12, mask5, mask6)
1119 mask7 = __lsx_vaddi_bu(mask0, 14);
1121 for (loop_cnt =
height; loop_cnt--;) {
1124 src4 = __lsx_vld(
src, 56);
1128 src0, mask2,
src0,
src0, mask3, vec0, vec1, vec2, vec3);
1129 dst0 = __lsx_vdp2_h_bu_b(vec0, filt0);
1130 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst0, vec1, filt1, dst0, vec2, filt2,
1132 dst0 = __lsx_vdp2add_h_bu_b(dst0, vec3, filt3);
1133 __lsx_vst(dst0, dst, 0);
1136 src0, mask6,
src1,
src0, mask7, vec0, vec1, vec2, vec3);
1137 dst1 = __lsx_vdp2_h_bu_b(vec0, filt0);
1138 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst1, vec1, filt1, dst1, vec2, filt2,
1140 dst1 = __lsx_vdp2add_h_bu_b(dst1, vec3, filt3);
1141 __lsx_vst(dst1, dst, 16);
1144 src1, mask2,
src1,
src1, mask3, vec0, vec1, vec2, vec3);
1145 dst2 = __lsx_vdp2_h_bu_b(vec0, filt0);
1146 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst2, vec1, filt1, dst2, vec2, filt2,
1148 dst2 = __lsx_vdp2add_h_bu_b(dst2, vec3, filt3);
1149 __lsx_vst(dst2, dst, 32);
1152 src1, mask6,
src2,
src1, mask7, vec0, vec1, vec2, vec3);
1153 dst3 = __lsx_vdp2_h_bu_b(vec0, filt0);
1154 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst3, vec1, filt1, dst3, vec2, filt2,
1156 dst3 = __lsx_vdp2add_h_bu_b(dst3, vec3, filt3);
1157 __lsx_vst(dst3, dst, 48);
1160 src2, mask2,
src2,
src2, mask3, vec0, vec1, vec2, vec3);
1161 dst4 = __lsx_vdp2_h_bu_b(vec0, filt0);
1162 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst4, vec1, filt1, dst4, vec2, filt2,
1164 dst4 = __lsx_vdp2add_h_bu_b(dst4, vec3, filt3);
1165 __lsx_vst(dst4, dst, 64);
1168 src2, mask6, src3,
src2, mask7, vec0, vec1, vec2, vec3);
1169 dst5 = __lsx_vdp2_h_bu_b(vec0, filt0);
1170 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst5, vec1, filt1, dst5, vec2, filt2,
1172 dst5 = __lsx_vdp2add_h_bu_b(dst5, vec3, filt3);
1173 __lsx_vst(dst5, dst, 80);
1175 DUP4_ARG3(__lsx_vshuf_b, src3, src3, mask0, src3, src3, mask1, src3,
1176 src3, mask2, src3, src3, mask3, vec0, vec1, vec2, vec3);
1177 dst6 = __lsx_vdp2_h_bu_b(vec0, filt0);
1178 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst6, vec1, filt1, dst6, vec2, filt2,
1180 dst6 = __lsx_vdp2add_h_bu_b(dst6, vec3, filt3);
1181 __lsx_vst(dst6, dst, 96);
1183 DUP4_ARG3(__lsx_vshuf_b, src4, src4, mask0, src4, src4, mask1, src4,
1184 src4, mask2, src4, src4, mask3, vec0, vec1, vec2, vec3);
1185 dst7 = __lsx_vdp2_h_bu_b(vec0, filt0);
1186 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst7, vec1, filt1, dst7, vec2, filt2,
1188 dst7 = __lsx_vdp2add_h_bu_b(dst7, vec3, filt3);
1189 __lsx_vst(dst7, dst, 112);
1195 int16_t *dst,
int32_t dst_stride,
1200 int32_t src_stride_2x = (src_stride << 1);
1201 int32_t src_stride_4x = (src_stride << 2);
1202 int32_t src_stride_3x = src_stride_2x + src_stride;
1203 __m128i
src0,
src1,
src2, src3, src4, src5, src6, src7, src8;
1204 __m128i src9, src10, src11, src12, src13, src14;
1205 __m128i src10_r, src32_r, src54_r, src76_r, src98_r;
1206 __m128i src21_r, src43_r, src65_r, src87_r, src109_r;
1207 __m128i src1110_r, src1211_r, src1312_r, src1413_r;
1208 __m128i src2110, src4332, src6554, src8776, src10998;
1209 __m128i src12111110, src14131312;
1210 __m128i dst10, dst32, dst54, dst76;
1211 __m128i filt0, filt1, filt2, filt3;
1213 src -= src_stride_3x;
1216 filt0, filt1, filt2, filt3);
1220 src3 = __lsx_vldx(
src, src_stride_3x);
1221 src += src_stride_4x;
1222 src4 = __lsx_vld(
src, 0);
1223 DUP2_ARG2(__lsx_vldx,
src, src_stride,
src, src_stride_2x, src5, src6);
1224 src += src_stride_3x;
1226 src10_r, src32_r, src54_r, src21_r);
1227 DUP2_ARG2(__lsx_vilvl_b, src4, src3, src6, src5, src43_r, src65_r);
1228 DUP2_ARG2(__lsx_vilvl_d, src21_r, src10_r, src43_r, src32_r,
1230 src6554 = __lsx_vilvl_d(src65_r, src54_r);
1232 for (loop_cnt = (
height >> 3); loop_cnt--;) {
1233 src7 = __lsx_vld(
src, 0);
1234 DUP2_ARG2(__lsx_vldx,
src, src_stride,
src, src_stride_2x, src8, src9);
1235 src10 = __lsx_vldx(
src, src_stride_3x);
1236 src += src_stride_4x;
1237 src11 = __lsx_vld(
src, 0);
1240 src14 = __lsx_vldx(
src, src_stride_3x);
1241 src += src_stride_4x;
1243 DUP4_ARG2(__lsx_vilvl_b, src7, src6, src8, src7, src9, src8, src10, src9,
1244 src76_r, src87_r, src98_r, src109_r);
1245 DUP4_ARG2(__lsx_vilvl_b, src11, src10, src12, src11, src13, src12, src14,
1246 src13, src1110_r, src1211_r, src1312_r, src1413_r);
1247 DUP4_ARG2(__lsx_vilvl_d, src87_r, src76_r, src109_r, src98_r, src1211_r,
1248 src1110_r, src1413_r, src1312_r, src8776, src10998,
1249 src12111110, src14131312);
1251 dst10 = __lsx_vdp2_h_bu_b(src2110, filt0);
1252 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst10, src4332, filt1, dst10, src6554,
1253 filt2, dst10, dst10);
1254 dst10 = __lsx_vdp2add_h_bu_b(dst10, src8776, filt3);
1255 dst32 = __lsx_vdp2_h_bu_b(src4332, filt0);
1256 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst32, src6554, filt1, dst32, src8776,
1257 filt2, dst32, dst32);
1258 dst32 = __lsx_vdp2add_h_bu_b(dst32, src10998, filt3);
1259 dst54 = __lsx_vdp2_h_bu_b(src6554, filt0);
1260 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst54, src8776, filt1,
1261 dst54, src10998, filt2, dst54, dst54);
1262 dst54 = __lsx_vdp2add_h_bu_b(dst54, src12111110, filt3);
1263 dst76 = __lsx_vdp2_h_bu_b(src8776, filt0);
1264 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst76, src10998, filt1, dst76,
1265 src12111110, filt2, dst76, dst76);
1266 dst76 = __lsx_vdp2add_h_bu_b(dst76, src14131312, filt3);
1268 __lsx_vstelm_d(dst10, dst, 0, 0);
1270 __lsx_vstelm_d(dst10, dst, 0, 1);
1272 __lsx_vstelm_d(dst32, dst, 0, 0);
1274 __lsx_vstelm_d(dst32, dst, 0, 1);
1276 __lsx_vstelm_d(dst54, dst, 0, 0);
1278 __lsx_vstelm_d(dst54, dst, 0, 1);
1280 __lsx_vstelm_d(dst76, dst, 0, 0);
1282 __lsx_vstelm_d(dst76, dst, 0, 1);
1286 src4332 = src12111110;
1287 src6554 = src14131312;
1291 src7 = __lsx_vld(
src, 0);
1292 src8 = __lsx_vldx(
src, src_stride);
1293 DUP2_ARG2(__lsx_vilvl_b, src7, src6, src8, src7, src76_r, src87_r);
1294 src += src_stride_2x;
1295 src8776 = __lsx_vilvl_d(src87_r, src76_r);
1297 dst10 = __lsx_vdp2_h_bu_b(src2110, filt0);
1298 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst10, src4332, filt1, dst10, src6554,
1299 filt2, dst10, dst10);
1300 dst10 = __lsx_vdp2add_h_bu_b(dst10, src8776, filt3);
1302 __lsx_vstelm_d(dst10, dst, 0, 0);
1304 __lsx_vstelm_d(dst10, dst, 0, 1);
1315 int16_t *dst,
int32_t dst_stride,
1319 int32_t src_stride_2x = (src_stride << 1);
1320 int32_t dst_stride_x = (dst_stride << 1);
1321 int32_t src_stride_4x = (src_stride << 2);
1322 int32_t dst_stride_2x = (dst_stride << 2);
1323 int32_t src_stride_3x = src_stride_2x + src_stride;
1324 int32_t dst_stride_3x = dst_stride_2x + dst_stride_x;
1325 __m128i
src0,
src1,
src2, src3, src4, src5, src6, src7, src8, src9, src10;
1326 __m128i src10_r, src32_r, src54_r, src76_r, src98_r;
1327 __m128i src21_r, src43_r, src65_r, src87_r, src109_r;
1328 __m128i dst0_r, dst1_r, dst2_r, dst3_r;
1329 __m128i filt0, filt1, filt2, filt3;
1331 src -= src_stride_3x;
1334 filt0, filt1, filt2, filt3);
1338 src3 = __lsx_vldx(
src, src_stride_3x);
1339 src += src_stride_4x;
1340 src4 = __lsx_vld(
src, 0);
1341 DUP2_ARG2(__lsx_vldx,
src, src_stride,
src, src_stride_2x, src5, src6);
1342 src += src_stride_3x;
1344 src10_r, src32_r, src54_r, src21_r);
1345 DUP2_ARG2(__lsx_vilvl_b, src4, src3, src6, src5, src43_r, src65_r);
1347 for (loop_cnt = (
height >> 2); loop_cnt--;) {
1348 src7 = __lsx_vld(
src, 0);
1349 DUP2_ARG2(__lsx_vldx,
src, src_stride,
src, src_stride_2x, src8, src9);
1350 src10 = __lsx_vldx(
src, src_stride_3x);
1351 src += src_stride_4x;
1352 DUP4_ARG2(__lsx_vilvl_b, src7, src6, src8, src7, src9, src8, src10,
1353 src9, src76_r, src87_r, src98_r, src109_r);
1355 dst0_r = __lsx_vdp2_h_bu_b(src10_r, filt0);
1356 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst0_r, src32_r, filt1, dst0_r,
1357 src54_r, filt2, dst0_r, dst0_r);
1358 dst0_r = __lsx_vdp2add_h_bu_b(dst0_r, src76_r, filt3);
1359 dst1_r = __lsx_vdp2_h_bu_b(src21_r, filt0);
1360 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst1_r, src43_r, filt1, dst1_r,
1361 src65_r, filt2, dst1_r, dst1_r);
1362 dst1_r = __lsx_vdp2add_h_bu_b(dst1_r, src87_r, filt3);
1363 dst2_r = __lsx_vdp2_h_bu_b(src32_r, filt0);
1364 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst2_r, src54_r, filt1, dst2_r,
1365 src76_r, filt2, dst2_r, dst2_r);
1366 dst2_r = __lsx_vdp2add_h_bu_b(dst2_r, src98_r, filt3);
1367 dst3_r = __lsx_vdp2_h_bu_b(src43_r, filt0);
1368 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst3_r, src65_r, filt1, dst3_r,
1369 src87_r, filt2, dst3_r, dst3_r);
1370 dst3_r = __lsx_vdp2add_h_bu_b(dst3_r, src109_r, filt3);
1372 __lsx_vst(dst0_r, dst, 0);
1373 __lsx_vstx(dst1_r, dst, dst_stride_x);
1374 __lsx_vstx(dst2_r, dst, dst_stride_2x);
1375 __lsx_vstx(dst3_r, dst, dst_stride_3x);
1376 dst += dst_stride_2x;
1389 int16_t *dst,
int32_t dst_stride,
1393 int32_t src_stride_2x = (src_stride << 1);
1394 int32_t src_stride_4x = (src_stride << 2);
1395 int32_t src_stride_3x = src_stride_2x + src_stride;
1396 __m128i
src0,
src1,
src2, src3, src4, src5, src6, src7, src8, src9, src10;
1397 __m128i src10_r, src32_r, src54_r, src76_r, src98_r;
1398 __m128i src21_r, src43_r, src65_r, src87_r, src109_r;
1399 __m128i dst0_r, dst1_r, dst2_r, dst3_r;
1400 __m128i src10_l, src32_l, src54_l, src76_l, src98_l;
1401 __m128i src21_l, src43_l, src65_l, src87_l, src109_l;
1402 __m128i src2110, src4332, src6554, src8776, src10998;
1403 __m128i dst0_l, dst1_l;
1404 __m128i filt0, filt1, filt2, filt3;
1406 src -= src_stride_3x;
1409 filt0, filt1, filt2, filt3);
1412 src3 = __lsx_vldx(
src, src_stride_3x);
1413 src += src_stride_4x;
1414 src4 = __lsx_vld(
src, 0);
1415 DUP2_ARG2(__lsx_vldx,
src, src_stride,
src, src_stride_2x, src5, src6);
1416 src += src_stride_3x;
1418 src10_r, src32_r, src54_r, src21_r);
1419 DUP2_ARG2(__lsx_vilvl_b, src4, src3, src6, src5, src43_r, src65_r);
1421 src10_l, src32_l, src54_l, src21_l);
1422 DUP2_ARG2(__lsx_vilvh_b, src4, src3, src6, src5, src43_l, src65_l);
1423 DUP2_ARG2(__lsx_vilvl_d, src21_l, src10_l, src43_l, src32_l,
1425 src6554 = __lsx_vilvl_d(src65_l, src54_l);
1427 for (loop_cnt = (
height >> 2); loop_cnt--;) {
1428 src7 = __lsx_vld(
src, 0);
1429 DUP2_ARG2(__lsx_vldx,
src, src_stride,
src, src_stride_2x, src8, src9);
1430 src10 = __lsx_vldx(
src, src_stride_3x);
1431 src += src_stride_4x;
1432 DUP4_ARG2(__lsx_vilvl_b, src7, src6, src8, src7, src9, src8, src10,
1433 src9, src76_r, src87_r, src98_r, src109_r);
1434 DUP4_ARG2(__lsx_vilvh_b, src7, src6, src8, src7, src9, src8, src10,
1435 src9, src76_l, src87_l, src98_l, src109_l);
1436 DUP2_ARG2(__lsx_vilvl_d, src87_l, src76_l, src109_l, src98_l,
1439 dst0_r = __lsx_vdp2_h_bu_b(src10_r, filt0);
1440 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst0_r, src32_r, filt1, dst0_r,
1441 src54_r, filt2, dst0_r, dst0_r);
1442 dst0_r = __lsx_vdp2add_h_bu_b(dst0_r, src76_r, filt3);
1443 dst1_r = __lsx_vdp2_h_bu_b(src21_r, filt0);
1444 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst1_r, src43_r, filt1, dst1_r,
1445 src65_r, filt2, dst1_r, dst1_r);
1446 dst1_r = __lsx_vdp2add_h_bu_b(dst1_r, src87_r, filt3);
1447 dst2_r = __lsx_vdp2_h_bu_b(src32_r, filt0);
1448 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst2_r, src54_r, filt1, dst2_r,
1449 src76_r, filt2, dst2_r, dst2_r);
1450 dst2_r = __lsx_vdp2add_h_bu_b(dst2_r, src98_r, filt3);
1451 dst3_r = __lsx_vdp2_h_bu_b(src43_r, filt0);
1452 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst3_r, src65_r, filt1, dst3_r,
1453 src87_r, filt2, dst3_r, dst3_r);
1454 dst3_r = __lsx_vdp2add_h_bu_b(dst3_r, src109_r, filt3);
1455 dst0_l = __lsx_vdp2_h_bu_b(src2110, filt0);
1456 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst0_l, src4332, filt1, dst0_l,
1457 src6554, filt2, dst0_l, dst0_l);
1458 dst0_l = __lsx_vdp2add_h_bu_b(dst0_l, src8776, filt3);
1459 dst1_l = __lsx_vdp2_h_bu_b(src4332, filt0);
1460 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst1_l, src6554, filt1, dst1_l,
1461 src8776, filt2, dst1_l, dst1_l);
1462 dst1_l = __lsx_vdp2add_h_bu_b(dst1_l, src10998, filt3);
1464 __lsx_vst(dst0_r, dst, 0);
1465 __lsx_vstelm_d(dst0_l, dst, 16, 0);
1467 __lsx_vst(dst1_r, dst, 0);
1468 __lsx_vstelm_d(dst0_l, dst, 16, 1);
1470 __lsx_vst(dst2_r, dst, 0);
1471 __lsx_vstelm_d(dst1_l, dst, 16, 0);
1473 __lsx_vst(dst3_r, dst, 0);
1474 __lsx_vstelm_d(dst1_l, dst, 16, 1);
1498 const uint8_t *src_tmp;
1501 int32_t src_stride_2x = (src_stride << 1);
1502 int32_t src_stride_4x = (src_stride << 2);
1503 int32_t src_stride_3x = src_stride_2x + src_stride;
1504 __m128i
src0,
src1,
src2, src3, src4, src5, src6, src7, src8, src9, src10;
1505 __m128i src10_r, src32_r, src54_r, src76_r, src98_r;
1506 __m128i src21_r, src43_r, src65_r, src87_r, src109_r;
1507 __m128i dst0_r, dst1_r, dst2_r, dst3_r;
1508 __m128i src10_l, src32_l, src54_l, src76_l, src98_l;
1509 __m128i src21_l, src43_l, src65_l, src87_l, src109_l;
1510 __m128i dst0_l, dst1_l, dst2_l, dst3_l;
1511 __m128i filt0, filt1, filt2, filt3;
1513 src -= src_stride_3x;
1516 filt0, filt1, filt2, filt3);
1518 for (cnt =
width >> 4; cnt--;) {
1522 src0 = __lsx_vld(src_tmp, 0);
1523 DUP2_ARG2(__lsx_vldx, src_tmp, src_stride, src_tmp, src_stride_2x,
1525 src3 = __lsx_vldx(src_tmp, src_stride_3x);
1526 src_tmp += src_stride_4x;
1527 src4 = __lsx_vld(src_tmp, 0);
1528 DUP2_ARG2(__lsx_vldx, src_tmp, src_stride, src_tmp, src_stride_2x,
1530 src_tmp += src_stride_3x;
1532 src10_r, src32_r, src54_r, src21_r);
1533 DUP2_ARG2(__lsx_vilvl_b, src4, src3, src6, src5, src43_r, src65_r);
1535 src10_l, src32_l, src54_l, src21_l);
1536 DUP2_ARG2(__lsx_vilvh_b, src4, src3, src6, src5, src43_l, src65_l);
1538 for (loop_cnt = (
height >> 2); loop_cnt--;) {
1539 src7 = __lsx_vld(src_tmp, 0);
1540 DUP2_ARG2(__lsx_vldx, src_tmp, src_stride, src_tmp, src_stride_2x,
1542 src10 = __lsx_vldx(src_tmp, src_stride_3x);
1543 src_tmp += src_stride_4x;
1544 DUP4_ARG2(__lsx_vilvl_b, src7, src6, src8, src7, src9, src8,
1545 src10, src9, src76_r, src87_r, src98_r, src109_r);
1546 DUP4_ARG2(__lsx_vilvh_b, src7, src6, src8, src7, src9, src8,
1547 src10, src9, src76_l, src87_l, src98_l, src109_l);
1549 dst0_r = __lsx_vdp2_h_bu_b(src10_r, filt0);
1550 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst0_r, src32_r, filt1, dst0_r,
1551 src54_r, filt2, dst0_r, dst0_r);
1552 dst0_r = __lsx_vdp2add_h_bu_b(dst0_r, src76_r, filt3);
1553 dst1_r = __lsx_vdp2_h_bu_b(src21_r, filt0);
1554 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst1_r, src43_r, filt1, dst1_r,
1555 src65_r, filt2, dst1_r, dst1_r);
1556 dst1_r = __lsx_vdp2add_h_bu_b(dst1_r, src87_r, filt3);
1557 dst2_r = __lsx_vdp2_h_bu_b(src32_r, filt0);
1558 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst2_r, src54_r, filt1, dst2_r,
1559 src76_r, filt2, dst2_r, dst2_r);
1560 dst2_r = __lsx_vdp2add_h_bu_b(dst2_r, src98_r, filt3);
1561 dst3_r = __lsx_vdp2_h_bu_b(src43_r, filt0);
1562 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst3_r, src65_r, filt1, dst3_r,
1563 src87_r, filt2, dst3_r, dst3_r);
1564 dst3_r = __lsx_vdp2add_h_bu_b(dst3_r, src109_r, filt3);
1565 dst0_l = __lsx_vdp2_h_bu_b(src10_l, filt0);
1566 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst0_l, src32_l, filt1, dst0_l,
1567 src54_l, filt2, dst0_l, dst0_l);
1568 dst0_l = __lsx_vdp2add_h_bu_b(dst0_l, src76_l, filt3);
1569 dst1_l = __lsx_vdp2_h_bu_b(src21_l, filt0);
1570 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst1_l, src43_l, filt1, dst1_l,
1571 src65_l, filt2, dst1_l, dst1_l);
1572 dst1_l = __lsx_vdp2add_h_bu_b(dst1_l, src87_l, filt3);
1573 dst2_l = __lsx_vdp2_h_bu_b(src32_l, filt0);
1574 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst2_l, src54_l, filt1, dst2_l,
1575 src76_l, filt2, dst2_l, dst2_l);
1576 dst2_l = __lsx_vdp2add_h_bu_b(dst2_l, src98_l, filt3);
1577 dst3_l = __lsx_vdp2_h_bu_b(src43_l, filt0);
1578 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst3_l, src65_l, filt1, dst3_l,
1579 src87_l, filt2, dst3_l, dst3_l);
1580 dst3_l = __lsx_vdp2add_h_bu_b(dst3_l, src109_l, filt3);
1582 __lsx_vst(dst0_r, dst_tmp, 0);
1583 __lsx_vst(dst0_l, dst_tmp, 16);
1584 dst_tmp += dst_stride;
1585 __lsx_vst(dst1_r, dst_tmp, 0);
1586 __lsx_vst(dst1_l, dst_tmp, 16);
1587 dst_tmp += dst_stride;
1588 __lsx_vst(dst2_r, dst_tmp, 0);
1589 __lsx_vst(dst2_l, dst_tmp, 16);
1590 dst_tmp += dst_stride;
1591 __lsx_vst(dst3_r, dst_tmp, 0);
1592 __lsx_vst(dst3_l, dst_tmp, 16);
1593 dst_tmp += dst_stride;
1615 int16_t *dst,
int32_t dst_stride,
1623 int16_t *dst,
int32_t dst_stride,
1633 int16_t *dst,
int32_t dst_stride,
1641 int16_t *dst,
int32_t dst_stride,
1649 int16_t *dst,
int32_t dst_stride,
1657 int16_t *dst,
int32_t dst_stride,
1658 const int8_t *filter_x,
const int8_t *filter_y,
1662 int32_t src_stride_2x = (src_stride << 1);
1663 int32_t src_stride_4x = (src_stride << 2);
1664 int32_t src_stride_3x = src_stride_2x + src_stride;
1665 __m128i
src0,
src1,
src2, src3, src4, src5, src6, src7, src8, src9, src10;
1666 __m128i filt0, filt1, filt2, filt3;
1667 __m128i filt_h0, filt_h1, filt_h2, filt_h3;
1668 __m128i mask1, mask2, mask3;
1670 __m128i vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7;
1671 __m128i vec8, vec9, vec10, vec11, vec12, vec13, vec14, vec15;
1672 __m128i dst30, dst41, dst52, dst63, dst66, dst97, dst108;
1673 __m128i dst0_r, dst1_r, dst2_r, dst3_r;
1674 __m128i dst10_r, dst32_r, dst54_r, dst76_r, dst98_r;
1675 __m128i dst21_r, dst43_r, dst65_r, dst87_r, dst109_r;
1680 src -= src_stride_3x + 3;
1681 DUP4_ARG2(__lsx_vldrepl_h, filter_x, 0, filter_x, 2, filter_x, 4,
1682 filter_x, 6, filt0, filt1, filt2, filt3);
1683 filter_vec = __lsx_vld(filter_y, 0);
1684 filter_vec = __lsx_vsllwil_h_b(filter_vec, 0);
1686 DUP4_ARG2(__lsx_vreplvei_w, filter_vec, 0, filter_vec, 1, filter_vec, 2,
1687 filter_vec, 3, filt_h0, filt_h1, filt_h2, filt_h3);
1688 DUP2_ARG2(__lsx_vaddi_bu, mask0, 2, mask0, 4, mask1, mask2);
1689 mask3 = __lsx_vaddi_bu(mask0, 6);
1693 src3 = __lsx_vldx(
src, src_stride_3x);
1694 src += src_stride_4x;
1695 src4 = __lsx_vld(
src, 0);
1696 DUP2_ARG2(__lsx_vldx,
src, src_stride,
src, src_stride_2x, src5, src6);
1697 src += src_stride_3x;
1700 mask2, src3,
src0, mask3, vec0, vec1, vec2, vec3);
1702 mask2, src4,
src1, mask3, vec4, vec5, vec6, vec7);
1704 mask2, src5,
src2, mask3, vec8, vec9, vec10, vec11);
1705 DUP4_ARG3(__lsx_vshuf_b, src6, src3, mask0, src6, src3, mask1, src6, src3,
1706 mask2, src6, src3, mask3, vec12, vec13, vec14, vec15);
1707 dst30 = __lsx_vdp2_h_bu_b(vec0, filt0);
1708 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst30, vec1, filt1, dst30, vec2, filt2,
1710 dst30 = __lsx_vdp2add_h_bu_b(dst30, vec3, filt3);
1711 dst41 = __lsx_vdp2_h_bu_b(vec4, filt0);
1712 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst41, vec5, filt1, dst41, vec6, filt2,
1714 dst41 = __lsx_vdp2add_h_bu_b(dst41, vec7, filt3);
1715 dst52 = __lsx_vdp2_h_bu_b(vec8, filt0);
1716 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst52, vec9, filt1, dst52, vec10, filt2,
1718 dst52 = __lsx_vdp2add_h_bu_b(dst52, vec11, filt3);
1719 dst63 = __lsx_vdp2_h_bu_b(vec12, filt0);
1720 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst63, vec13, filt1, dst63, vec14, filt2,
1722 dst63 = __lsx_vdp2add_h_bu_b(dst63, vec15, filt3);
1724 DUP2_ARG2(__lsx_vilvl_h, dst41, dst30, dst52, dst41, dst10_r, dst21_r);
1725 DUP2_ARG2(__lsx_vilvh_h, dst41, dst30, dst52, dst41, dst43_r, dst54_r);
1726 dst32_r = __lsx_vilvl_h(dst63, dst52);
1727 dst65_r = __lsx_vilvh_h(dst63, dst52);
1728 dst66 = __lsx_vreplvei_d(dst63, 1);
1730 for (loop_cnt =
height >> 2; loop_cnt--;) {
1731 src7 = __lsx_vld(
src, 0);
1732 DUP2_ARG2(__lsx_vldx,
src, src_stride,
src, src_stride_2x, src8, src9);
1733 src10 = __lsx_vldx(
src, src_stride_3x);
1734 src += src_stride_4x;
1736 DUP4_ARG3(__lsx_vshuf_b, src9, src7, mask0, src9, src7, mask1, src9, src7,
1737 mask2, src9, src7, mask3, vec0, vec1, vec2, vec3);
1738 DUP4_ARG3(__lsx_vshuf_b, src10, src8, mask0, src10, src8, mask1, src10, src8,
1739 mask2, src10, src8, mask3, vec4, vec5, vec6, vec7);
1741 dst97 = __lsx_vdp2_h_bu_b(vec0, filt0);
1742 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst97, vec1, filt1, dst97, vec2, filt2,
1744 dst97 = __lsx_vdp2add_h_bu_b(dst97, vec3, filt3);
1745 dst108 = __lsx_vdp2_h_bu_b(vec4, filt0);
1746 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst108, vec5, filt1, dst108, vec6,
1747 filt2, dst108, dst108);
1748 dst108 = __lsx_vdp2add_h_bu_b(dst108, vec7, filt3);
1750 DUP2_ARG2(__lsx_vilvl_h, dst97, dst66, dst108, dst97, dst76_r, dst87_r);
1751 dst109_r = __lsx_vilvh_h(dst108, dst97);
1752 dst66 = __lsx_vreplvei_d(dst97, 1);
1753 dst98_r = __lsx_vilvl_h(dst66, dst108);
1755 DUP4_ARG2(__lsx_vdp2_w_h, dst10_r, filt_h0, dst21_r, filt_h0, dst32_r,
1756 filt_h0, dst43_r, filt_h0, dst0_r, dst1_r, dst2_r, dst3_r);
1757 DUP4_ARG3(__lsx_vdp2add_w_h, dst0_r, dst32_r, filt_h1, dst1_r, dst43_r,
1758 filt_h1, dst2_r, dst54_r, filt_h1, dst3_r, dst65_r, filt_h1,
1759 dst0_r, dst1_r, dst2_r, dst3_r);
1760 DUP4_ARG3(__lsx_vdp2add_w_h, dst0_r, dst54_r, filt_h2, dst1_r, dst65_r,
1761 filt_h2, dst2_r, dst76_r, filt_h2, dst3_r, dst87_r, filt_h2,
1762 dst0_r, dst1_r, dst2_r, dst3_r);
1763 DUP4_ARG3(__lsx_vdp2add_w_h, dst0_r, dst76_r, filt_h3, dst1_r, dst87_r,
1764 filt_h3, dst2_r, dst98_r, filt_h3, dst3_r, dst109_r, filt_h3,
1765 dst0_r, dst1_r, dst2_r, dst3_r);
1766 DUP4_ARG2(__lsx_vsrai_w, dst0_r, 6, dst1_r, 6, dst2_r, 6, dst3_r, 6,
1767 dst0_r, dst1_r, dst2_r, dst3_r);
1768 DUP2_ARG2(__lsx_vpickev_h, dst1_r, dst0_r, dst3_r, dst2_r, dst0_r, dst2_r);
1769 __lsx_vstelm_d(dst0_r, dst, 0, 0);
1771 __lsx_vstelm_d(dst0_r, dst, 0, 1);
1773 __lsx_vstelm_d(dst2_r, dst, 0, 0);
1775 __lsx_vstelm_d(dst2_r, dst, 0, 1);
1784 dst66 = __lsx_vreplvei_d(dst108, 1);
1792 const int8_t *filter_x,
1793 const int8_t *filter_y,
1797 uint32_t loop_cnt, cnt;
1798 const uint8_t *src_tmp;
1800 int32_t src_stride_2x = (src_stride << 1);
1801 int32_t src_stride_4x = (src_stride << 2);
1802 int32_t src_stride_3x = src_stride_2x + src_stride;
1803 __m128i
src0,
src1,
src2, src3, src4, src5, src6, src7;
1804 __m128i filt0, filt1, filt2, filt3;
1805 __m128i filt_h0, filt_h1, filt_h2, filt_h3;
1806 __m128i mask1, mask2, mask3;
1808 __m128i vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7;
1809 __m128i vec8, vec9, vec10, vec11, vec12, vec13, vec14, vec15;
1810 __m128i dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7;
1811 __m128i dst0_r, dst0_l;
1812 __m128i dst10_r, dst32_r, dst54_r, dst76_r;
1813 __m128i dst10_l, dst32_l, dst54_l, dst76_l;
1814 __m128i mask0 = {0x403030202010100, 0x807070606050504};
1816 src -= src_stride_3x + 3;
1817 DUP4_ARG2(__lsx_vldrepl_h, filter_x, 0, filter_x, 2, filter_x, 4,
1818 filter_x, 6, filt0, filt1, filt2, filt3);
1820 filter_vec = __lsx_vld(filter_y, 0);
1821 filter_vec = __lsx_vsllwil_h_b(filter_vec, 0);
1823 DUP4_ARG2(__lsx_vreplvei_w, filter_vec, 0, filter_vec, 1, filter_vec, 2,
1824 filter_vec, 3, filt_h0, filt_h1, filt_h2, filt_h3);
1826 DUP2_ARG2(__lsx_vaddi_bu, mask0, 2, mask0, 4, mask1, mask2);
1827 mask3 = __lsx_vaddi_bu(mask0, 6);
1829 for (cnt =
width >> 3; cnt--;) {
1832 src0 = __lsx_vld(src_tmp, 0);
1833 DUP2_ARG2(__lsx_vldx, src_tmp, src_stride, src_tmp, src_stride_2x,
1835 src3 = __lsx_vldx(src_tmp, src_stride_3x);
1836 src_tmp += src_stride_4x;
1837 src4 = __lsx_vld(src_tmp, 0);
1838 DUP2_ARG2(__lsx_vldx, src_tmp, src_stride, src_tmp, src_stride_2x,
1840 src_tmp += src_stride_3x;
1844 src0, mask2,
src0,
src0, mask3, vec0, vec1, vec2, vec3);
1846 src1, mask2,
src1,
src1, mask3, vec4, vec5, vec6, vec7);
1848 src2, mask2,
src2,
src2, mask3, vec8, vec9, vec10, vec11);
1849 DUP4_ARG3(__lsx_vshuf_b, src3, src3, mask0, src3, src3, mask1, src3,
1850 src3, mask2, src3, src3, mask3, vec12, vec13, vec14, vec15);
1851 dst0 = __lsx_vdp2_h_bu_b(vec0, filt0);
1852 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst0, vec1, filt1, dst0, vec2, filt2,
1854 dst0 = __lsx_vdp2add_h_bu_b(dst0, vec3, filt3);
1855 dst1 = __lsx_vdp2_h_bu_b(vec4, filt0);
1856 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst1, vec5, filt1, dst1, vec6, filt2,
1858 dst1 = __lsx_vdp2add_h_bu_b(dst1, vec7, filt3);
1859 dst2 = __lsx_vdp2_h_bu_b(vec8, filt0);
1860 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst2, vec9, filt1, dst2, vec10, filt2,
1862 dst2 = __lsx_vdp2add_h_bu_b(dst2, vec11, filt3);
1863 dst3 = __lsx_vdp2_h_bu_b(vec12, filt0);
1864 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst3, vec13, filt1, dst3, vec14, filt2,
1866 dst3 = __lsx_vdp2add_h_bu_b(dst3, vec15, filt3);
1869 DUP4_ARG3(__lsx_vshuf_b, src4, src4, mask0, src4, src4, mask1, src4,
1870 src4, mask2, src4, src4, mask3, vec0, vec1, vec2, vec3);
1871 DUP4_ARG3(__lsx_vshuf_b, src5, src5, mask0, src5, src5, mask1, src5,
1872 src5, mask2, src5, src5, mask3, vec4, vec5, vec6, vec7);
1873 DUP4_ARG3(__lsx_vshuf_b, src6, src6, mask0, src6, src6, mask1, src6,
1874 src6, mask2, src6, src6, mask3, vec8, vec9, vec10, vec11);
1875 dst4 = __lsx_vdp2_h_bu_b(vec0, filt0);
1876 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst4, vec1, filt1, dst4, vec2, filt2,
1878 dst4 = __lsx_vdp2add_h_bu_b(dst4, vec3, filt3);
1879 dst5 = __lsx_vdp2_h_bu_b(vec4, filt0);
1880 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst5, vec5, filt1, dst5, vec6, filt2,
1882 dst5 = __lsx_vdp2add_h_bu_b(dst5, vec7, filt3);
1883 dst6 = __lsx_vdp2_h_bu_b(vec8, filt0);
1884 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst6, vec9, filt1, dst6, vec10, filt2,
1886 dst6 = __lsx_vdp2add_h_bu_b(dst6, vec11, filt3);
1888 for (loop_cnt =
height; loop_cnt--;) {
1889 src7 = __lsx_vld(src_tmp, 0);
1890 src_tmp += src_stride;
1892 DUP4_ARG3(__lsx_vshuf_b, src7, src7, mask0, src7, src7, mask1, src7,
1893 src7, mask2, src7, src7, mask3, vec0, vec1, vec2, vec3);
1894 dst7 = __lsx_vdp2_h_bu_b(vec0, filt0);
1895 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst7, vec1, filt1, dst7, vec2,
1897 dst7 = __lsx_vdp2add_h_bu_b(dst7, vec3, filt3);
1899 DUP4_ARG2(__lsx_vilvl_h, dst1, dst0, dst3, dst2, dst5, dst4, dst7,
1900 dst6, dst10_r, dst32_r, dst54_r, dst76_r);
1901 DUP4_ARG2(__lsx_vilvh_h, dst1, dst0, dst3, dst2, dst5, dst4, dst7,
1902 dst6, dst10_l, dst32_l, dst54_l, dst76_l);
1904 DUP2_ARG2(__lsx_vdp2_w_h, dst10_r, filt_h0, dst10_l, filt_h0,
1906 DUP4_ARG3(__lsx_vdp2add_w_h, dst0_r, dst32_r, filt_h1, dst0_l,
1907 dst32_l, filt_h1, dst0_r, dst54_r, filt_h2, dst0_l,
1908 dst54_l, filt_h2, dst0_r, dst0_l, dst0_r, dst0_l);
1909 DUP2_ARG3(__lsx_vdp2add_w_h, dst0_r, dst76_r, filt_h3, dst0_l,
1910 dst76_l, filt_h3, dst0_r, dst0_l);
1911 dst0_r = __lsx_vsrai_w(dst0_r, 6);
1912 dst0_l = __lsx_vsrai_w(dst0_l, 6);
1914 dst0_r = __lsx_vpickev_h(dst0_l, dst0_r);
1915 __lsx_vst(dst0_r, dst_tmp, 0);
1916 dst_tmp += dst_stride;
1932 int16_t *dst,
int32_t dst_stride,
1933 const int8_t *filter_x,
const int8_t *filter_y,
1937 filter_x, filter_y,
height, 8);
1941 int16_t *dst,
int32_t dst_stride,
1942 const int8_t *filter_x,
const int8_t *filter_y,
1946 const uint8_t *src_tmp;
1948 int32_t src_stride_2x = (src_stride << 1);
1949 int32_t src_stride_4x = (src_stride << 2);
1950 int32_t src_stride_3x = src_stride_2x + src_stride;
1951 __m128i
src0,
src1,
src2, src3, src4, src5, src6, src7, src8, src9, src10;
1952 __m128i mask0, mask1, mask2, mask3, mask4, mask5, mask6, mask7;
1953 __m128i vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7;
1954 __m128i vec8, vec9, vec10, vec11, vec12, vec13, vec14, vec15;
1955 __m128i filt0, filt1, filt2, filt3, filt_h0, filt_h1, filt_h2, filt_h3;
1957 __m128i dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7;
1958 __m128i dst30, dst41, dst52, dst63, dst66, dst97, dst108;
1959 __m128i dst10_r, dst32_r, dst54_r, dst76_r, dst98_r, dst21_r, dst43_r;
1960 __m128i dst65_r, dst87_r, dst109_r, dst10_l, dst32_l, dst54_l, dst76_l;
1961 __m128i dst0_r, dst0_l, dst1_r, dst2_r, dst3_r;
1963 src -= src_stride_3x + 3;
1964 DUP4_ARG2(__lsx_vldrepl_h, filter_x, 0, filter_x, 2, filter_x, 4,
1965 filter_x, 6, filt0, filt1, filt2, filt3);
1967 filter_vec = __lsx_vld(filter_y, 0);
1968 filter_vec = __lsx_vsllwil_h_b(filter_vec, 0);
1970 DUP4_ARG2(__lsx_vreplvei_w, filter_vec, 0, filter_vec, 1, filter_vec, 2,
1971 filter_vec, 3, filt_h0, filt_h1, filt_h2, filt_h3);
1974 DUP2_ARG2(__lsx_vaddi_bu, mask0, 2, mask0, 4, mask1, mask2);
1975 mask3 = __lsx_vaddi_bu(mask0, 6);
1980 src0 = __lsx_vld(src_tmp, 0);
1981 DUP2_ARG2(__lsx_vldx, src_tmp, src_stride, src_tmp, src_stride_2x,
1983 src3 = __lsx_vldx(src_tmp, src_stride_3x);
1984 src_tmp += src_stride_4x;
1985 src4 = __lsx_vld(src_tmp, 0);
1986 DUP2_ARG2(__lsx_vldx, src_tmp, src_stride, src_tmp, src_stride_2x,
1988 src_tmp += src_stride_3x;
1992 mask2,
src0,
src0, mask3, vec0, vec1, vec2, vec3);
1994 mask2,
src1,
src1, mask3, vec4, vec5, vec6, vec7);
1996 mask2,
src2,
src2, mask3, vec8, vec9, vec10, vec11);
1997 DUP4_ARG3(__lsx_vshuf_b, src3, src3, mask0, src3, src3, mask1, src3, src3,
1998 mask2, src3, src3, mask3, vec12, vec13, vec14, vec15);
1999 dst0 = __lsx_vdp2_h_bu_b(vec0, filt0);
2000 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst0, vec1, filt1, dst0, vec2, filt2,
2002 dst0 = __lsx_vdp2add_h_bu_b(dst0, vec3, filt3);
2003 dst1 = __lsx_vdp2_h_bu_b(vec4, filt0);
2004 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst1, vec5, filt1, dst1, vec6, filt2,
2006 dst1 = __lsx_vdp2add_h_bu_b(dst1, vec7, filt3);
2007 dst2 = __lsx_vdp2_h_bu_b(vec8, filt0);
2008 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst2, vec9, filt1, dst2, vec10, filt2,
2010 dst2 = __lsx_vdp2add_h_bu_b(dst2, vec11, filt3);
2011 dst3 = __lsx_vdp2_h_bu_b(vec12, filt0);
2012 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst3, vec13, filt1, dst3, vec14, filt2,
2014 dst3 = __lsx_vdp2add_h_bu_b(dst3, vec15, filt3);
2017 DUP4_ARG3(__lsx_vshuf_b, src4, src4, mask0, src4, src4, mask1, src4, src4,
2018 mask2, src4, src4, mask3, vec0, vec1, vec2, vec3);
2019 DUP4_ARG3(__lsx_vshuf_b, src5, src5, mask0, src5, src5, mask1, src5, src5,
2020 mask2, src5, src5, mask3, vec4, vec5, vec6, vec7);
2021 DUP4_ARG3(__lsx_vshuf_b, src6, src6, mask0, src6, src6, mask1, src6, src6,
2022 mask2, src6, src6, mask3, vec8, vec9, vec10, vec11);
2023 dst4 = __lsx_vdp2_h_bu_b(vec0, filt0);
2024 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst4, vec1, filt1, dst4, vec2, filt2,
2026 dst4 = __lsx_vdp2add_h_bu_b(dst4, vec3, filt3);
2027 dst5 = __lsx_vdp2_h_bu_b(vec4, filt0);
2028 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst5, vec5, filt1, dst5, vec6, filt2,
2030 dst5 = __lsx_vdp2add_h_bu_b(dst5, vec7, filt3);
2031 dst6 = __lsx_vdp2_h_bu_b(vec8, filt0);
2032 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst6, vec9, filt1, dst6, vec10, filt2,
2034 dst6 = __lsx_vdp2add_h_bu_b(dst6, vec11, filt3);
2036 for (loop_cnt =
height; loop_cnt--;) {
2037 src7 = __lsx_vld(src_tmp, 0);
2038 src_tmp += src_stride;
2040 DUP4_ARG3(__lsx_vshuf_b, src7, src7, mask0, src7, src7, mask1, src7,
2041 src7, mask2, src7, src7, mask3, vec0, vec1, vec2, vec3);
2042 dst7 = __lsx_vdp2_h_bu_b(vec0, filt0);
2043 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst7, vec1, filt1, dst7, vec2, filt2,
2045 dst7 = __lsx_vdp2add_h_bu_b(dst7, vec3, filt3);
2046 DUP4_ARG2(__lsx_vilvl_h, dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6,
2047 dst10_r, dst32_r, dst54_r, dst76_r);
2048 DUP4_ARG2(__lsx_vilvh_h, dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6,
2049 dst10_l, dst32_l, dst54_l, dst76_l);
2050 DUP2_ARG2(__lsx_vdp2_w_h, dst10_r, filt_h0, dst10_l, filt_h0,
2052 DUP4_ARG3(__lsx_vdp2add_w_h, dst0_r, dst32_r, filt_h1, dst0_l, dst32_l,
2053 filt_h1, dst0_r, dst54_r, filt_h2, dst0_l, dst54_l, filt_h2,
2054 dst0_r, dst0_l, dst0_r, dst0_l);
2055 DUP2_ARG3(__lsx_vdp2add_w_h, dst0_r, dst76_r, filt_h3, dst0_l, dst76_l,
2056 filt_h3, dst0_r, dst0_l)
2057 dst0_r = __lsx_vsrai_w(dst0_r, 6);
2058 dst0_l = __lsx_vsrai_w(dst0_l, 6);
2060 dst0_r = __lsx_vpickev_h(dst0_l, dst0_r);
2061 __lsx_vst(dst0_r, dst_tmp, 0);
2062 dst_tmp += dst_stride;
2076 DUP2_ARG2(__lsx_vaddi_bu, mask4, 2, mask4, 4, mask5, mask6);
2077 mask7 = __lsx_vaddi_bu(mask4, 6);
2081 src3 = __lsx_vldx(
src, src_stride_3x);
2082 src += src_stride_4x;
2083 src4 = __lsx_vld(
src, 0);
2084 DUP2_ARG2(__lsx_vldx,
src, src_stride,
src, src_stride_2x, src5, src6);
2085 src += src_stride_3x;
2088 mask6, src3,
src0, mask7, vec0, vec1, vec2, vec3);
2090 mask6, src4,
src1, mask7, vec4, vec5, vec6, vec7);
2092 mask6, src5,
src2, mask7, vec8, vec9, vec10, vec11);
2093 DUP4_ARG3(__lsx_vshuf_b, src6, src3, mask4, src6, src3, mask5, src6, src3,
2094 mask6, src6, src3, mask7, vec12, vec13, vec14, vec15);
2095 dst30 = __lsx_vdp2_h_bu_b(vec0, filt0);
2096 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst30, vec1, filt1, dst30, vec2, filt2,
2098 dst30 = __lsx_vdp2add_h_bu_b(dst30, vec3, filt3);
2099 dst41 = __lsx_vdp2_h_bu_b(vec4, filt0);
2100 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst41, vec5, filt1, dst41, vec6, filt2,
2102 dst41 = __lsx_vdp2add_h_bu_b(dst41, vec7, filt3);
2103 dst52 = __lsx_vdp2_h_bu_b(vec8, filt0);
2104 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst52, vec9, filt1, dst52, vec10, filt2,
2106 dst52 = __lsx_vdp2add_h_bu_b(dst52, vec11, filt3);
2107 dst63 = __lsx_vdp2_h_bu_b(vec12, filt0);
2108 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst63, vec13, filt1, dst63, vec14, filt2,
2110 dst63 = __lsx_vdp2add_h_bu_b(dst63, vec15, filt3);
2112 DUP2_ARG2(__lsx_vilvl_h, dst41, dst30, dst52, dst41, dst10_r, dst21_r);
2113 DUP2_ARG2(__lsx_vilvh_h, dst41, dst30, dst52, dst41, dst43_r, dst54_r);
2114 dst32_r = __lsx_vilvl_h(dst63, dst52);
2115 dst65_r = __lsx_vilvh_h(dst63, dst52);
2117 dst66 = __lsx_vreplvei_d(dst63, 1);
2119 for (loop_cnt =
height >> 2; loop_cnt--;) {
2120 src7 = __lsx_vld(
src, 0);
2121 DUP2_ARG2(__lsx_vldx,
src, src_stride,
src, src_stride_2x, src8, src9);
2122 src10 = __lsx_vldx(
src, src_stride_3x);
2123 src += src_stride_4x;
2125 DUP4_ARG3(__lsx_vshuf_b, src9, src7, mask4, src9, src7, mask5, src9,
2126 src7, mask6, src9, src7, mask7, vec0, vec1, vec2, vec3);
2127 DUP4_ARG3(__lsx_vshuf_b, src10, src8, mask4, src10, src8, mask5, src10,
2128 src8, mask6, src10, src8, mask7, vec4, vec5, vec6, vec7);
2129 dst97 = __lsx_vdp2_h_bu_b(vec0, filt0);
2130 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst97, vec1, filt1, dst97, vec2, filt2,
2132 dst97 = __lsx_vdp2add_h_bu_b(dst97, vec3, filt3);
2133 dst108 = __lsx_vdp2_h_bu_b(vec4, filt0);
2134 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst108, vec5, filt1, dst108, vec6,
2135 filt2, dst108, dst108);
2136 dst108 = __lsx_vdp2add_h_bu_b(dst108, vec7, filt3);
2138 DUP2_ARG2(__lsx_vilvl_h, dst97, dst66, dst108, dst97, dst76_r, dst87_r);
2139 dst109_r = __lsx_vilvh_h(dst108, dst97);
2140 dst66 = __lsx_vreplvei_d(dst97, 1);
2141 dst98_r = __lsx_vilvl_h(dst66, dst108);
2143 DUP4_ARG2(__lsx_vdp2_w_h, dst10_r, filt_h0, dst21_r, filt_h0, dst32_r,
2144 filt_h0, dst43_r, filt_h0, dst0_r, dst1_r, dst2_r, dst3_r);
2145 DUP4_ARG3(__lsx_vdp2add_w_h, dst0_r, dst32_r, filt_h1, dst1_r, dst43_r,
2146 filt_h1, dst2_r, dst54_r, filt_h1, dst3_r, dst65_r, filt_h1,
2147 dst0_r, dst1_r, dst2_r, dst3_r);
2148 DUP4_ARG3(__lsx_vdp2add_w_h, dst0_r, dst54_r, filt_h2, dst1_r, dst65_r,
2149 filt_h2, dst2_r, dst76_r, filt_h2, dst3_r, dst87_r, filt_h2,
2150 dst0_r, dst1_r, dst2_r, dst3_r);
2151 DUP4_ARG3(__lsx_vdp2add_w_h, dst0_r, dst76_r, filt_h3, dst1_r, dst87_r,
2152 filt_h3, dst2_r, dst98_r, filt_h3, dst3_r, dst109_r, filt_h3,
2153 dst0_r, dst1_r, dst2_r, dst3_r);
2154 DUP4_ARG2(__lsx_vsrai_w, dst0_r, 6, dst1_r, 6, dst2_r, 6, dst3_r, 6,
2155 dst0_r, dst1_r, dst2_r, dst3_r);
2156 DUP2_ARG2(__lsx_vpickev_h, dst1_r, dst0_r, dst3_r, dst2_r,
2158 __lsx_vstelm_d(dst0_r, dst, 0, 0);
2160 __lsx_vstelm_d(dst0_r, dst, 0, 1);
2162 __lsx_vstelm_d(dst2_r, dst, 0, 0);
2164 __lsx_vstelm_d(dst2_r, dst, 0, 1);
2173 dst66 = __lsx_vreplvei_d(dst108, 1);
2178 int16_t *dst,
int32_t dst_stride,
2179 const int8_t *filter_x,
const int8_t *filter_y,
2183 filter_x, filter_y,
height, 16);
2187 int16_t *dst,
int32_t dst_stride,
2188 const int8_t *filter_x,
const int8_t *filter_y,
2192 filter_x, filter_y,
height, 24);
2196 int16_t *dst,
int32_t dst_stride,
2197 const int8_t *filter_x,
const int8_t *filter_y,
2201 filter_x, filter_y,
height, 32);
2205 int16_t *dst,
int32_t dst_stride,
2206 const int8_t *filter_x,
const int8_t *filter_y,
2210 filter_x, filter_y,
height, 48);
2214 int16_t *dst,
int32_t dst_stride,
2215 const int8_t *filter_x,
const int8_t *filter_y,
2219 filter_x, filter_y,
height, 64);
2231 __m128i filt0, filt1;
2233 __m128i mask1, mask2, mask3;
2234 __m128i dst0, dst1, dst2, dst3;
2235 __m128i vec0, vec1, vec2, vec3;
2240 DUP2_ARG2(__lsx_vaddi_bu, mask0, 2, mask0, 8, mask1, mask2);
2241 mask3 = __lsx_vaddi_bu(mask0, 10);
2243 for (loop_cnt =
height; loop_cnt--;) {
2252 DUP4_ARG2(__lsx_vdp2_h_bu_b, vec0, filt0, vec1, filt0, vec2, filt0,
2253 vec3, filt0, dst0, dst1, dst2, dst3);
2258 DUP4_ARG3(__lsx_vdp2add_h_bu_b, dst0, vec0, filt1, dst1, vec1, filt1,
2259 dst2, vec2, filt1, dst3, vec3, filt1, dst0, dst1, dst2, dst3);
2260 __lsx_vst(dst0, dst, 0);
2261 __lsx_vst(dst1, dst, 16);
2262 __lsx_vst(dst2, dst, 32);
2263 __lsx_vst(dst3, dst, 48);
2276 int32_t src_stride_2x = (src_stride << 1);
2277 int32_t src_stride_3x = src_stride_2x + src_stride;
2279 __m128i src10_r, src32_r, src21_r, src43_r;
2280 __m128i src10_l, src32_l, src21_l, src43_l;
2281 __m128i dst0_r, dst1_r, dst0_l, dst1_l;
2282 __m128i filt0, filt1;
2289 src += src_stride_3x;
2293 for (loop_cnt = (
height >> 2); loop_cnt--;) {
2294 src3 = __lsx_vld(
src, 0);
2295 src4 = __lsx_vldx(
src, src_stride);
2296 src += src_stride_2x;
2297 DUP2_ARG2(__lsx_vilvl_b, src3,
src2, src4, src3, src32_r, src43_r);
2298 DUP2_ARG2(__lsx_vilvh_b, src3,
src2, src4, src3, src32_l, src43_l);
2299 DUP4_ARG2(__lsx_vdp2_h_bu_b, src10_r, filt0, src10_l, filt0, src21_r,
2300 filt0, src21_l, filt0, dst0_r, dst0_l, dst1_r, dst1_l);
2301 DUP4_ARG3(__lsx_vdp2add_h_bu_b, dst0_r, src32_r, filt1, dst0_l,
2302 src32_l, filt1, dst1_r, src43_r, filt1, dst1_l, src43_l,
2303 filt1, dst0_r, dst0_l, dst1_r, dst1_l);
2304 __lsx_vst(dst0_r, dst, 0);
2305 __lsx_vst(dst0_l, dst, 16);
2307 __lsx_vst(dst1_r, dst, 0);
2308 __lsx_vst(dst1_l, dst, 16);
2311 src5 = __lsx_vld(
src, 0);
2312 src2 = __lsx_vldx(
src, src_stride);
2313 src += src_stride_2x;
2314 DUP2_ARG2(__lsx_vilvl_b, src5, src4,
src2, src5, src10_r, src21_r);
2315 DUP2_ARG2(__lsx_vilvh_b, src5, src4,
src2, src5, src10_l, src21_l);
2316 DUP4_ARG2(__lsx_vdp2_h_bu_b, src32_r, filt0, src32_l, filt0, src43_r,
2317 filt0, src43_l, filt0, dst0_r, dst0_l, dst1_r, dst1_l);
2318 DUP4_ARG3(__lsx_vdp2add_h_bu_b, dst0_r, src10_r, filt1, dst0_l,
2319 src10_l, filt1, dst1_r, src21_r, filt1, dst1_l, src21_l,
2320 filt1, dst0_r, dst0_l, dst1_r, dst1_l);
2321 __lsx_vst(dst0_r, dst, 0);
2322 __lsx_vst(dst0_l, dst, 16);
2324 __lsx_vst(dst1_r, dst, 0);
2325 __lsx_vst(dst1_l, dst, 16);
2338 int32_t src_stride_2x = (src_stride << 1);
2339 int32_t src_stride_3x = src_stride_2x + src_stride;
2340 const uint8_t *_src;
2343 __m128i src6, src7, src8, src9, src10, src11;
2344 __m128i src10_r, src32_r, src76_r, src98_r;
2345 __m128i src21_r, src43_r, src87_r, src109_r;
2346 __m128i dst0_r, dst1_r, dst2_r, dst3_r;
2347 __m128i src10_l, src32_l, src21_l, src43_l;
2348 __m128i dst0_l, dst1_l;
2349 __m128i filt0, filt1;
2360 src6 = __lsx_vld(_src, 0);
2361 DUP2_ARG2(__lsx_vldx, _src, src_stride, _src, src_stride_2x, src7, src8);
2362 src += src_stride_3x;
2363 _src += src_stride_3x;
2364 DUP2_ARG2(__lsx_vilvl_b, src7, src6, src8, src7, src76_r, src87_r);
2366 for (loop_cnt = (
height >> 2); loop_cnt--;) {
2368 DUP2_ARG2(__lsx_vldx,
src, src_stride, _src, src_stride, src4, src10);
2369 src += src_stride_2x;
2370 _src += src_stride_2x;
2371 DUP2_ARG2(__lsx_vilvl_b, src3,
src2, src4, src3, src32_r, src43_r);
2372 DUP2_ARG2(__lsx_vilvh_b, src3,
src2, src4, src3, src32_l, src43_l);
2374 DUP2_ARG2(__lsx_vilvl_b, src9, src8, src10, src9, src98_r, src109_r);
2375 DUP4_ARG2(__lsx_vdp2_h_bu_b, src10_r, filt0, src10_l, filt0, src21_r,
2376 filt0, src21_l, filt0, dst0_r, dst0_l, dst1_r, dst1_l);
2377 DUP4_ARG3(__lsx_vdp2add_h_bu_b, dst0_r, src32_r, filt1, dst0_l,
2378 src32_l, filt1, dst1_r, src43_r, filt1, dst1_l, src43_l,
2379 filt1, dst0_r, dst0_l, dst1_r, dst1_l);
2380 DUP2_ARG2(__lsx_vdp2_h_bu_b, src76_r, filt0, src87_r, filt0,
2382 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst2_r, src98_r, filt1, dst3_r,
2383 src109_r, filt1, dst2_r, dst3_r);
2385 __lsx_vst(dst0_r, dst, 0);
2386 __lsx_vst(dst0_l, dst, 16);
2387 __lsx_vst(dst2_r, dst, 32);
2389 __lsx_vst(dst1_r, dst, 0);
2390 __lsx_vst(dst1_l, dst, 16);
2391 __lsx_vst(dst3_r, dst, 32);
2396 src += src_stride_2x;
2397 _src += src_stride_2x;
2398 DUP2_ARG2(__lsx_vilvl_b, src5, src4,
src2, src5, src10_r, src21_r);
2399 DUP2_ARG2(__lsx_vilvh_b, src5, src4,
src2, src5, src10_l, src21_l);
2401 DUP2_ARG2(__lsx_vilvl_b, src11, src10, src8, src11, src76_r, src87_r);
2403 DUP4_ARG2(__lsx_vdp2_h_bu_b, src32_r, filt0, src32_l, filt0, src43_r,
2404 filt0, src43_l, filt0, dst0_r, dst0_l, dst1_r, dst1_l);
2405 DUP4_ARG3(__lsx_vdp2add_h_bu_b, dst0_r, src10_r, filt1, dst0_l, src10_l,
2406 filt1, dst1_r, src21_r, filt1, dst1_l, src21_l, filt1,
2407 dst0_r, dst0_l, dst1_r, dst1_l);
2408 DUP2_ARG2(__lsx_vdp2_h_bu_b, src98_r, filt0, src109_r, filt0,
2410 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst2_r, src76_r, filt1, dst3_r, src87_r,
2411 filt1, dst2_r, dst3_r);
2413 __lsx_vst(dst0_r, dst, 0);
2414 __lsx_vst(dst0_l, dst, 16);
2415 __lsx_vst(dst2_r, dst, 32);
2417 __lsx_vst(dst1_r, dst, 0);
2418 __lsx_vst(dst1_l, dst, 16);
2419 __lsx_vst(dst3_r, dst, 32);
2432 int32_t src_stride_2x = (src_stride << 1);
2433 int32_t src_stride_3x = src_stride_2x + src_stride;
2434 const uint8_t *_src;
2437 __m128i src6, src7, src8, src9, src10, src11;
2438 __m128i src10_r, src32_r, src76_r, src98_r;
2439 __m128i src21_r, src43_r, src87_r, src109_r;
2440 __m128i dst0_r, dst1_r, dst2_r, dst3_r;
2441 __m128i src10_l, src32_l, src76_l, src98_l;
2442 __m128i src21_l, src43_l, src87_l, src109_l;
2443 __m128i dst0_l, dst1_l, dst2_l, dst3_l;
2444 __m128i filt0, filt1;
2455 src6 = __lsx_vld(_src, 0);
2456 DUP2_ARG2(__lsx_vldx, _src, src_stride, _src, src_stride_2x, src7, src8);
2457 src += src_stride_3x;
2458 _src += src_stride_3x;
2459 DUP2_ARG2(__lsx_vilvl_b, src7, src6, src8, src7, src76_r, src87_r);
2460 DUP2_ARG2(__lsx_vilvh_b, src7, src6, src8, src7, src76_l, src87_l);
2462 for (loop_cnt = (
height >> 2); loop_cnt--;) {
2464 DUP2_ARG2(__lsx_vldx,
src, src_stride, _src, src_stride, src4, src10);
2465 src += src_stride_2x;
2466 _src += src_stride_2x;
2467 DUP2_ARG2(__lsx_vilvl_b, src3,
src2, src4, src3, src32_r, src43_r);
2468 DUP2_ARG2(__lsx_vilvh_b, src3,
src2, src4, src3, src32_l, src43_l);
2470 DUP2_ARG2(__lsx_vilvl_b, src9, src8, src10, src9, src98_r, src109_r);
2471 DUP2_ARG2(__lsx_vilvh_b, src9, src8, src10, src9, src98_l, src109_l);
2473 DUP4_ARG2(__lsx_vdp2_h_bu_b, src10_r, filt0, src10_l, filt0, src21_r,
2474 filt0, src21_l, filt0, dst0_r, dst0_l, dst1_r, dst1_l);
2475 DUP4_ARG3(__lsx_vdp2add_h_bu_b, dst0_r, src32_r, filt1, dst0_l,
2476 src32_l, filt1, dst1_r, src43_r, filt1, dst1_l,src43_l,
2477 filt1, dst0_r, dst0_l, dst1_r, dst1_l);
2478 DUP4_ARG2(__lsx_vdp2_h_bu_b, src76_r, filt0, src76_l, filt0, src87_r,
2479 filt0, src87_l, filt0, dst2_r, dst2_l, dst3_r, dst3_l);
2480 DUP4_ARG3(__lsx_vdp2add_h_bu_b, dst2_r, src98_r, filt1, dst2_l, src98_l,
2481 filt1, dst3_r, src109_r, filt1, dst3_l, src109_l, filt1,
2482 dst2_r, dst2_l, dst3_r, dst3_l);
2484 __lsx_vst(dst0_r, dst, 0);
2485 __lsx_vst(dst0_l, dst, 16);
2486 __lsx_vst(dst2_r, dst, 32);
2487 __lsx_vst(dst2_l, dst, 48);
2489 __lsx_vst(dst1_r, dst, 0);
2490 __lsx_vst(dst1_l, dst, 16);
2491 __lsx_vst(dst3_r, dst, 32);
2492 __lsx_vst(dst3_l, dst, 48);
2497 src += src_stride_2x;
2498 _src += src_stride_2x;
2499 DUP2_ARG2(__lsx_vilvl_b, src5, src4,
src2, src5, src10_r, src21_r);
2500 DUP2_ARG2(__lsx_vilvh_b, src5, src4,
src2, src5, src10_l, src21_l);
2502 DUP2_ARG2(__lsx_vilvl_b, src11, src10, src8, src11, src76_r, src87_r);
2503 DUP2_ARG2(__lsx_vilvh_b, src11, src10, src8, src11, src76_l, src87_l);
2505 DUP4_ARG2(__lsx_vdp2_h_bu_b, src32_r, filt0, src32_l, filt0, src43_r,
2506 filt0, src43_l, filt0, dst0_r, dst0_l, dst1_r, dst1_l);
2507 DUP4_ARG3(__lsx_vdp2add_h_bu_b, dst0_r, src10_r, filt1, dst0_l,
2508 src10_l, filt1, dst1_r, src21_r, filt1, dst1_l, src21_l,
2509 filt1, dst0_r, dst0_l, dst1_r, dst1_l);
2511 DUP4_ARG2(__lsx_vdp2_h_bu_b, src98_r, filt0, src98_l, filt0, src109_r,
2512 filt0, src109_l, filt0, dst2_r, dst2_l, dst3_r, dst3_l);
2513 DUP4_ARG3(__lsx_vdp2add_h_bu_b, dst2_r, src76_r, filt1, dst2_l, src76_l,
2514 filt1, dst3_r, src87_r, filt1, dst3_l, src87_l, filt1,
2515 dst2_r, dst2_l, dst3_r, dst3_l);
2517 __lsx_vst(dst0_r, dst, 0);
2518 __lsx_vst(dst0_l, dst, 16);
2519 __lsx_vst(dst2_r, dst, 32);
2520 __lsx_vst(dst2_l, dst, 48);
2522 __lsx_vst(dst1_r, dst, 0);
2523 __lsx_vst(dst1_l, dst, 16);
2524 __lsx_vst(dst3_r, dst, 32);
2525 __lsx_vst(dst3_l, dst, 48);
2534 const int8_t *filter_x,
2535 const int8_t *filter_y)
2537 int32_t src_stride_2x = (src_stride << 1);
2538 int32_t src_stride_4x = (src_stride << 2);
2539 int32_t src_stride_3x = src_stride_2x + src_stride;
2542 __m128i filt0, filt1;
2543 __m128i filt_h0, filt_h1;
2547 __m128i vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7, vec8, vec9;
2548 __m128i dst0, dst1, dst2, dst3, dst4;
2549 __m128i dst0_r, dst0_l, dst1_r, dst1_l;
2550 __m128i dst10_r, dst32_r, dst21_r, dst43_r;
2551 __m128i dst10_l, dst32_l, dst21_l, dst43_l;
2553 src -= (src_stride + 1);
2554 DUP2_ARG2(__lsx_vldrepl_h, filter_x, 0, filter_x, 2, filt0, filt1);
2556 filter_vec = __lsx_vld(filter_y, 0);
2557 filter_vec = __lsx_vsllwil_h_b(filter_vec, 0);
2558 DUP2_ARG2(__lsx_vreplvei_w, filter_vec, 0, filter_vec, 1, filt_h0, filt_h1);
2560 mask1 = __lsx_vaddi_bu(mask0, 2);
2564 src3 = __lsx_vldx(
src, src_stride_3x);
2565 src4 = __lsx_vldx(
src, src_stride_4x);
2570 DUP2_ARG3(__lsx_vshuf_b, src3, src3, mask0, src3, src3, mask1, vec6, vec7);
2571 DUP2_ARG3(__lsx_vshuf_b, src4, src4, mask0, src4, src4, mask1, vec8, vec9);
2573 DUP4_ARG2(__lsx_vdp2_h_bu_b, vec0, filt0, vec2, filt0, vec4, filt0,
2574 vec6, filt0, dst0, dst1, dst2, dst3);
2575 DUP4_ARG3(__lsx_vdp2add_h_bu_b, dst0, vec1, filt1, dst1, vec3, filt1,
2576 dst2, vec5, filt1, dst3, vec7, filt1, dst0, dst1, dst2, dst3);
2577 dst4 = __lsx_vdp2_h_bu_b(vec8, filt0);
2578 dst4 = __lsx_vdp2add_h_bu_b(dst4, vec9, filt1);
2580 DUP2_ARG2(__lsx_vilvl_h, dst1, dst0, dst2, dst1, dst10_r, dst21_r);
2581 DUP2_ARG2(__lsx_vilvh_h, dst1, dst0, dst2, dst1, dst10_l, dst21_l);
2582 DUP2_ARG2(__lsx_vilvl_h, dst3, dst2, dst4, dst3, dst32_r, dst43_r);
2583 DUP2_ARG2(__lsx_vilvh_h, dst3, dst2, dst4, dst3, dst32_l, dst43_l);
2585 DUP4_ARG2(__lsx_vdp2_w_h, dst10_r, filt_h0, dst10_l, filt_h0, dst21_r,
2586 filt_h0, dst21_l, filt_h0, dst0_r, dst0_l, dst1_r, dst1_l);
2587 DUP4_ARG3(__lsx_vdp2add_w_h, dst0_r, dst32_r, filt_h1, dst0_l, dst32_l,
2588 filt_h1, dst1_r, dst43_r, filt_h1, dst1_l, dst43_l, filt_h1,
2589 dst0_r, dst0_l, dst1_r, dst1_l);
2590 DUP4_ARG2(__lsx_vsrai_w, dst0_r, 6, dst0_l, 6, dst1_r, 6, dst1_l, 6,
2591 dst0_r, dst0_l, dst1_r, dst1_l);
2592 DUP2_ARG2(__lsx_vpickev_h, dst0_l, dst0_r, dst1_l, dst1_r, dst0_r, dst1_r);
2593 __lsx_vst(dst0_r, dst, 0);
2594 __lsx_vst(dst1_r, dst + dst_stride, 0);
2598 int16_t *dst,
int32_t dst_stride,
2599 const int8_t *filter_x,
2600 const int8_t *filter_y,
int32_t width8mult)
2603 int32_t src_stride_2x = (src_stride << 1);
2604 int32_t dst_stride_x = (dst_stride << 1);
2605 int32_t src_stride_4x = (src_stride << 2);
2606 int32_t dst_stride_2x = (dst_stride << 2);
2607 int32_t src_stride_3x = src_stride_2x + src_stride;
2608 int32_t dst_stride_3x = dst_stride_2x + dst_stride_x;
2610 __m128i
src0,
src1,
src2, src3, src4, src5, src6, mask0, mask1;
2611 __m128i vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7;
2612 __m128i filt0, filt1, filt_h0, filt_h1, filter_vec;
2613 __m128i dst0, dst1, dst2, dst3, dst4, dst5, dst6;
2614 __m128i dst10_r, dst32_r, dst54_r, dst21_r, dst43_r, dst65_r;
2615 __m128i dst10_l, dst32_l, dst54_l, dst21_l, dst43_l, dst65_l;
2616 __m128i dst0_r, dst0_l, dst1_r, dst1_l, dst2_r, dst2_l, dst3_r, dst3_l;
2618 src -= (src_stride + 1);
2619 DUP2_ARG2(__lsx_vldrepl_h, filter_x, 0, filter_x, 2, filt0, filt1);
2621 filter_vec = __lsx_vld(filter_y, 0);
2622 filter_vec = __lsx_vsllwil_h_b(filter_vec, 0);
2623 DUP2_ARG2(__lsx_vreplvei_w, filter_vec, 0, filter_vec, 1, filt_h0, filt_h1);
2626 mask1 = __lsx_vaddi_bu(mask0, 2);
2628 for (cnt = width8mult; cnt--;) {
2631 src_stride_3x,
src, src_stride_4x,
src1,
src2, src3, src4);
2632 src += src_stride_4x;
2633 DUP2_ARG2(__lsx_vldx,
src, src_stride,
src, src_stride_2x, src5, src6);
2634 src += (8 - src_stride_4x);
2643 DUP2_ARG2(__lsx_vdp2_h_bu_b, vec0, filt0, vec2, filt0, dst0, dst1);
2644 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst0, vec1, filt1, dst1, vec3, filt1,
2646 dst2 = __lsx_vdp2_h_bu_b(vec4, filt0);
2647 dst2 = __lsx_vdp2add_h_bu_b(dst2, vec5, filt1);
2649 DUP2_ARG2(__lsx_vilvl_h, dst1, dst0, dst2, dst1, dst10_r, dst21_r);
2650 DUP2_ARG2(__lsx_vilvh_h, dst1, dst0, dst2, dst1, dst10_l, dst21_l);
2652 DUP2_ARG3(__lsx_vshuf_b, src3, src3, mask0, src3, src3, mask1,
2654 DUP2_ARG3(__lsx_vshuf_b, src4, src4, mask0, src4, src4, mask1,
2656 DUP2_ARG3(__lsx_vshuf_b, src5, src5, mask0, src5, src5, mask1,
2658 DUP2_ARG3(__lsx_vshuf_b, src6, src6, mask0, src6, src6, mask1,
2660 DUP4_ARG2(__lsx_vdp2_h_bu_b, vec0, filt0, vec2, filt0, vec4, filt0,
2661 vec6, filt0, dst3, dst4, dst5, dst6);
2662 DUP4_ARG3(__lsx_vdp2add_h_bu_b, dst3, vec1, filt1, dst4, vec3, filt1,
2663 dst5, vec5, filt1, dst6, vec7, filt1, dst3, dst4, dst5, dst6);
2664 DUP2_ARG2(__lsx_vilvl_h, dst3, dst2, dst4, dst3, dst32_r, dst43_r);
2665 DUP2_ARG2(__lsx_vilvh_h, dst3, dst2, dst4, dst3, dst32_l, dst43_l);
2666 DUP2_ARG2(__lsx_vilvl_h, dst5, dst4, dst6, dst5, dst54_r, dst65_r);
2667 DUP2_ARG2(__lsx_vilvh_h, dst5, dst4, dst6, dst5, dst54_l, dst65_l);
2669 DUP4_ARG2(__lsx_vdp2_w_h, dst10_r, filt_h0, dst10_l, filt_h0, dst21_r,
2670 filt_h0, dst21_l, filt_h0, dst0_r, dst0_l, dst1_r, dst1_l);
2671 DUP4_ARG3(__lsx_vdp2add_w_h, dst0_r, dst32_r, filt_h1, dst0_l, dst32_l,
2672 filt_h1, dst1_r, dst43_r, filt_h1, dst1_l, dst43_l, filt_h1,
2673 dst0_r, dst0_l, dst1_r, dst1_l);
2675 DUP4_ARG2(__lsx_vdp2_w_h, dst32_r, filt_h0, dst32_l, filt_h0, dst43_r,
2676 filt_h0, dst43_l, filt_h0, dst2_r, dst2_l, dst3_r, dst3_l);
2677 DUP4_ARG3(__lsx_vdp2add_w_h, dst2_r, dst54_r, filt_h1, dst2_l, dst54_l,
2678 filt_h1, dst3_r, dst65_r, filt_h1, dst3_l, dst65_l, filt_h1,
2679 dst2_r, dst2_l, dst3_r, dst3_l);
2680 DUP4_ARG2(__lsx_vsrai_w, dst0_r, 6, dst0_l, 6, dst1_r, 6, dst1_l, 6,
2681 dst0_r, dst0_l, dst1_r, dst1_l);
2682 DUP4_ARG2(__lsx_vsrai_w, dst2_r, 6, dst2_l, 6, dst3_r, 6, dst3_l, 6,
2683 dst2_r, dst2_l, dst3_r, dst3_l);
2684 DUP2_ARG2(__lsx_vpickev_h, dst0_l, dst0_r, dst1_l, dst1_r,
2686 DUP2_ARG2(__lsx_vpickev_h, dst2_l, dst2_r, dst3_l, dst3_r,
2689 __lsx_vst(dst0_r, dst, 0);
2690 __lsx_vstx(dst1_r, dst, dst_stride_x);
2691 __lsx_vstx(dst2_r, dst, dst_stride_2x);
2692 __lsx_vstx(dst3_r, dst, dst_stride_3x);
2701 const int8_t *filter_x,
2702 const int8_t *filter_y)
2704 int32_t src_stride_2x = (src_stride << 1);
2705 int32_t dst_stride_2x = (dst_stride << 1);
2706 int32_t src_stride_4x = (src_stride << 2);
2707 int32_t src_stride_3x = src_stride_2x + src_stride;
2708 __m128i
src0,
src1,
src2, src3, src4, src5, src6, src7, src8;
2709 __m128i filt0, filt1;
2710 __m128i filt_h0, filt_h1;
2712 __m128i mask1, filter_vec;
2713 __m128i vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7, vec8, vec9;
2714 __m128i vec10, vec11, vec12, vec13, vec14, vec15, vec16, vec17;
2715 __m128i dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7, dst8;
2716 __m128i dst0_r, dst0_l, dst1_r, dst1_l, dst2_r, dst2_l, dst3_r, dst3_l;
2717 __m128i dst4_r, dst4_l, dst5_r, dst5_l;
2718 __m128i dst10_r, dst32_r, dst10_l, dst32_l;
2719 __m128i dst21_r, dst43_r, dst21_l, dst43_l;
2720 __m128i dst54_r, dst54_l, dst65_r, dst65_l;
2721 __m128i dst76_r, dst76_l, dst87_r, dst87_l;
2723 src -= (src_stride + 1);
2724 DUP2_ARG2(__lsx_vldrepl_h, filter_x, 0, filter_x, 2, filt0, filt1);
2726 filter_vec = __lsx_vld(filter_y, 0);
2727 filter_vec = __lsx_vsllwil_h_b(filter_vec, 0);
2728 DUP2_ARG2(__lsx_vreplvei_w, filter_vec, 0, filter_vec, 1, filt_h0, filt_h1);
2730 mask1 = __lsx_vaddi_bu(mask0, 2);
2734 src_stride_3x,
src, src_stride_4x,
src1,
src2, src3, src4);
2735 src += src_stride_4x;
2737 src_stride_3x,
src, src_stride_4x, src5, src6, src7, src8);
2740 mask0,
src1,
src1, mask1, vec0, vec1, vec2, vec3);
2742 mask0, src3, src3, mask1, vec4, vec5, vec6, vec7);
2743 DUP4_ARG3(__lsx_vshuf_b, src4, src4, mask0, src4, src4, mask1, src5, src5,
2744 mask0, src5, src5, mask1, vec8, vec9, vec10, vec11);
2745 DUP4_ARG3(__lsx_vshuf_b, src6, src6, mask0, src6, src6, mask1, src7, src7,
2746 mask0, src7, src7, mask1, vec12, vec13, vec14, vec15);
2747 DUP2_ARG3(__lsx_vshuf_b, src8, src8, mask0, src8, src8, mask1,
2750 DUP4_ARG2(__lsx_vdp2_h_bu_b, vec0, filt0, vec2, filt0, vec4, filt0, vec6,
2751 filt0, dst0, dst1, dst2, dst3);
2752 DUP4_ARG3(__lsx_vdp2add_h_bu_b, dst0, vec1, filt1, dst1, vec3, filt1,
2753 dst2, vec5, filt1, dst3, vec7, filt1, dst0, dst1, dst2, dst3);
2754 DUP4_ARG2(__lsx_vdp2_h_bu_b, vec8, filt0, vec10, filt0, vec12, filt0,
2755 vec14, filt0, dst4, dst5, dst6, dst7);
2756 DUP4_ARG3(__lsx_vdp2add_h_bu_b, dst4, vec9, filt1, dst5, vec11, filt1, dst6,
2757 vec13, filt1, dst7, vec15, filt1, dst4, dst5, dst6, dst7);
2758 dst8 = __lsx_vdp2_h_bu_b(vec16, filt0);
2759 dst8 = __lsx_vdp2add_h_bu_b(dst8, vec17, filt1);
2761 DUP4_ARG2(__lsx_vilvl_h, dst1, dst0, dst2, dst1, dst3, dst2, dst4, dst3,
2762 dst10_r, dst21_r, dst32_r, dst43_r);
2763 DUP4_ARG2(__lsx_vilvh_h, dst1, dst0, dst2, dst1, dst3, dst2, dst4, dst3,
2764 dst10_l, dst21_l, dst32_l, dst43_l);
2765 DUP4_ARG2(__lsx_vilvl_h, dst5, dst4, dst6, dst5, dst7, dst6, dst8, dst7,
2766 dst54_r, dst65_r, dst76_r, dst87_r);
2767 DUP4_ARG2(__lsx_vilvh_h, dst5, dst4, dst6, dst5, dst7, dst6, dst8, dst7,
2768 dst54_l, dst65_l, dst76_l, dst87_l);
2770 DUP4_ARG2(__lsx_vdp2_w_h, dst10_r, filt_h0, dst10_l, filt_h0, dst21_r,
2771 filt_h0, dst21_l, filt_h0, dst0_r, dst0_l, dst1_r, dst1_l);
2772 DUP4_ARG2(__lsx_vdp2_w_h, dst32_r, filt_h0, dst32_l, filt_h0, dst43_r,
2773 filt_h0, dst43_l, filt_h0, dst2_r, dst2_l, dst3_r, dst3_l);
2774 DUP4_ARG2(__lsx_vdp2_w_h, dst54_r, filt_h0, dst54_l, filt_h0, dst65_r,
2775 filt_h0, dst65_l, filt_h0, dst4_r, dst4_l, dst5_r, dst5_l);
2776 DUP4_ARG3(__lsx_vdp2add_w_h, dst0_r, dst32_r, filt_h1, dst0_l, dst32_l,
2777 filt_h1, dst1_r, dst43_r, filt_h1, dst1_l, dst43_l, filt_h1,
2778 dst0_r, dst0_l, dst1_r, dst1_l);
2779 DUP4_ARG3(__lsx_vdp2add_w_h, dst2_r, dst54_r, filt_h1, dst2_l, dst54_l,
2780 filt_h1, dst3_r, dst65_r, filt_h1, dst3_l, dst65_l, filt_h1,
2781 dst2_r, dst2_l, dst3_r, dst3_l);
2782 DUP4_ARG3(__lsx_vdp2add_w_h, dst4_r, dst76_r, filt_h1, dst4_l, dst76_l,
2783 filt_h1, dst5_r, dst87_r, filt_h1, dst5_l, dst87_l, filt_h1,
2784 dst4_r, dst4_l, dst5_r, dst5_l);
2785 DUP4_ARG2(__lsx_vsrai_w, dst0_r, 6, dst0_l, 6, dst1_r, 6, dst1_l, 6, dst0_r,
2786 dst0_l, dst1_r, dst1_l);
2787 DUP4_ARG2(__lsx_vsrai_w, dst2_r, 6, dst2_l, 6, dst3_r, 6, dst3_l, 6, dst2_r,
2788 dst2_l, dst3_r, dst3_l);
2789 DUP4_ARG2(__lsx_vsrai_w, dst4_r, 6, dst4_l, 6, dst5_r, 6, dst5_l, 6, dst4_r,
2790 dst4_l, dst5_r, dst5_l);
2792 DUP4_ARG2(__lsx_vpickev_h,dst0_l, dst0_r, dst1_l, dst1_r, dst2_l, dst2_r,
2793 dst3_l, dst3_r, dst0_r, dst1_r, dst2_r, dst3_r);
2794 DUP2_ARG2(__lsx_vpickev_h, dst4_l, dst4_r, dst5_l, dst5_r, dst4_r, dst5_r);
2796 __lsx_vst(dst0_r, dst, 0);
2797 __lsx_vstx(dst1_r, dst, dst_stride_2x);
2798 dst += dst_stride_2x;
2799 __lsx_vst(dst2_r, dst, 0);
2800 __lsx_vstx(dst3_r, dst, dst_stride_2x);
2801 dst += dst_stride_2x;
2802 __lsx_vst(dst4_r, dst, 0);
2803 __lsx_vstx(dst5_r, dst, dst_stride_2x);
2810 const int8_t *filter_x,
2811 const int8_t *filter_y,
2815 uint32_t loop_cnt, cnt;
2816 const uint8_t *src_tmp;
2818 int32_t src_stride_2x = (src_stride << 1);
2819 int32_t dst_stride_x = (dst_stride << 1);
2820 int32_t src_stride_4x = (src_stride << 2);
2821 int32_t dst_stride_2x = (dst_stride << 2);
2822 int32_t src_stride_3x = src_stride_2x + src_stride;
2823 int32_t dst_stride_3x = dst_stride_2x + dst_stride_x;
2826 __m128i filt0, filt1;
2827 __m128i filt_h0, filt_h1;
2829 __m128i mask1, filter_vec;
2830 __m128i vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7;
2831 __m128i dst0, dst1, dst2, dst3, dst4, dst5, dst6;
2832 __m128i dst0_r, dst0_l, dst1_r, dst1_l, dst2_r, dst2_l, dst3_r, dst3_l;
2833 __m128i dst10_r, dst32_r, dst54_r, dst21_r, dst43_r, dst65_r;
2834 __m128i dst10_l, dst32_l, dst54_l, dst21_l, dst43_l, dst65_l;
2836 src -= (src_stride + 1);
2837 DUP2_ARG2(__lsx_vldrepl_h, filter_x, 0, filter_x, 2, filt0, filt1);
2839 filter_vec = __lsx_vld(filter_y, 0);
2840 filter_vec = __lsx_vsllwil_h_b(filter_vec, 0);
2841 DUP2_ARG2(__lsx_vreplvei_w, filter_vec, 0, filter_vec, 1, filt_h0, filt_h1);
2843 mask1 = __lsx_vaddi_bu(mask0, 2);
2845 for (cnt = width8mult; cnt--;) {
2849 src0 = __lsx_vld(src_tmp, 0);
2850 DUP2_ARG2(__lsx_vldx, src_tmp, src_stride, src_tmp, src_stride_2x,
2852 src_tmp += src_stride_3x;
2861 DUP2_ARG2(__lsx_vdp2_h_bu_b, vec0, filt0, vec2, filt0, dst0, dst1);
2862 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst0, vec1, filt1, dst1, vec3, filt1,
2864 dst2 = __lsx_vdp2_h_bu_b(vec4, filt0);
2865 dst2 = __lsx_vdp2add_h_bu_b(dst2, vec5, filt1);
2867 DUP2_ARG2(__lsx_vilvl_h, dst1, dst0, dst2, dst1, dst10_r, dst21_r);
2868 DUP2_ARG2(__lsx_vilvh_h, dst1, dst0, dst2, dst1, dst10_l, dst21_l);
2870 for (loop_cnt =
height >> 2; loop_cnt--;) {
2871 src3 = __lsx_vld(src_tmp, 0);
2872 DUP2_ARG2(__lsx_vldx, src_tmp, src_stride, src_tmp, src_stride_2x,
2874 src6 = __lsx_vldx(src_tmp, src_stride_3x);
2875 src_tmp += src_stride_4x;
2877 DUP2_ARG3(__lsx_vshuf_b, src3, src3, mask0, src3, src3, mask1,
2879 DUP2_ARG3(__lsx_vshuf_b, src4, src4, mask0, src4, src4, mask1,
2881 DUP2_ARG3(__lsx_vshuf_b, src5, src5, mask0, src5, src5, mask1,
2883 DUP2_ARG3(__lsx_vshuf_b, src6, src6, mask0, src6, src6, mask1,
2886 DUP4_ARG2(__lsx_vdp2_h_bu_b, vec0, filt0, vec2, filt0, vec4, filt0,
2887 vec6, filt0, dst3, dst4, dst5, dst6);
2888 DUP4_ARG3(__lsx_vdp2add_h_bu_b, dst3, vec1, filt1, dst4, vec3,
2889 filt1, dst5, vec5, filt1, dst6, vec7, filt1, dst3,
2892 DUP2_ARG2(__lsx_vilvl_h, dst3, dst2, dst4, dst3, dst32_r, dst43_r);
2893 DUP2_ARG2(__lsx_vilvh_h, dst3, dst2, dst4, dst3, dst32_l, dst43_l);
2894 DUP2_ARG2(__lsx_vilvl_h, dst5, dst4, dst6, dst5, dst54_r, dst65_r);
2895 DUP2_ARG2(__lsx_vilvh_h, dst5, dst4, dst6, dst5, dst54_l, dst65_l);
2897 DUP4_ARG2(__lsx_vdp2_w_h, dst10_r, filt_h0, dst10_l, filt_h0, dst21_r,
2898 filt_h0, dst21_l, filt_h0, dst0_r, dst0_l, dst1_r, dst1_l);
2899 DUP4_ARG2(__lsx_vdp2_w_h, dst32_r, filt_h0, dst32_l, filt_h0, dst43_r,
2900 filt_h0, dst43_l, filt_h0, dst2_r, dst2_l, dst3_r, dst3_l);
2901 DUP4_ARG3(__lsx_vdp2add_w_h, dst0_r, dst32_r, filt_h1, dst0_l,
2902 dst32_l, filt_h1, dst1_r, dst43_r, filt_h1, dst1_l,
2903 dst43_l, filt_h1, dst0_r, dst0_l, dst1_r, dst1_l);
2904 DUP4_ARG3(__lsx_vdp2add_w_h, dst2_r, dst54_r, filt_h1, dst2_l,
2905 dst54_l, filt_h1, dst3_r, dst65_r, filt_h1, dst3_l,
2906 dst65_l, filt_h1, dst2_r, dst2_l, dst3_r, dst3_l);
2908 DUP4_ARG2(__lsx_vsrai_w, dst0_r, 6, dst0_l, 6, dst1_r, 6, dst1_l, 6,
2909 dst0_r, dst0_l, dst1_r, dst1_l);
2910 DUP4_ARG2(__lsx_vsrai_w, dst2_r, 6, dst2_l, 6, dst3_r, 6, dst3_l, 6,
2911 dst2_r, dst2_l, dst3_r, dst3_l);
2913 DUP4_ARG2(__lsx_vpickev_h, dst0_l, dst0_r, dst1_l, dst1_r, dst2_l,
2914 dst2_r, dst3_l, dst3_r, dst0_r, dst1_r, dst2_r, dst3_r);
2916 __lsx_vst(dst0_r, dst_tmp, 0);
2917 __lsx_vstx(dst1_r, dst_tmp, dst_stride_x);
2918 __lsx_vstx(dst2_r, dst_tmp, dst_stride_2x);
2919 __lsx_vstx(dst3_r, dst_tmp, dst_stride_3x);
2920 dst_tmp += dst_stride_2x;
2937 const int8_t *filter_x,
2938 const int8_t *filter_y,
2944 filter_x, filter_y);
2945 }
else if (4 ==
height) {
2947 filter_x, filter_y, 1);
2948 }
else if (6 ==
height) {
2950 filter_x, filter_y);
2951 }
else if (0 == (
height & 0x03)) {
2953 filter_x, filter_y,
height, 1);
2961 const int8_t *filter_x,
2962 const int8_t *filter_y,
2966 const uint8_t *src_tmp;
2968 int32_t src_stride_2x = (src_stride << 1);
2969 int32_t dst_stride_x = (dst_stride << 1);
2970 int32_t src_stride_4x = (src_stride << 2);
2971 int32_t dst_stride_2x = (dst_stride << 2);
2972 int32_t src_stride_3x = src_stride_2x + src_stride;
2973 int32_t dst_stride_3x = dst_stride_2x + dst_stride_x;
2975 __m128i
src0,
src1,
src2, src3, src4, src5, src6, src7, src8, src9, src10;
2976 __m128i vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7;
2977 __m128i mask0, mask1, mask2, mask3;
2978 __m128i filt0, filt1, filt_h0, filt_h1, filter_vec, dst0;
2979 __m128i dst1, dst2, dst3, dst4, dst5, dst6, dst10, dst21, dst22, dst73;
2980 __m128i dst84, dst95, dst106, dst76_r, dst98_r, dst87_r, dst109_r;
2981 __m128i dst10_r, dst32_r, dst54_r, dst21_r, dst43_r, dst65_r;
2982 __m128i dst10_l, dst32_l, dst54_l, dst21_l, dst43_l, dst65_l;
2983 __m128i dst0_r, dst0_l, dst1_r, dst1_l, dst2_r, dst2_l, dst3_r, dst3_l;
2984 __m128i tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
2986 src -= (src_stride + 1);
2987 DUP2_ARG2(__lsx_vldrepl_h, filter_x, 0, filter_x, 2, filt0, filt1);
2989 filter_vec = __lsx_vld(filter_y, 0);
2990 filter_vec = __lsx_vsllwil_h_b(filter_vec, 0);
2991 DUP2_ARG2(__lsx_vreplvei_w, filter_vec, 0, filter_vec, 1, filt_h0, filt_h1);
2994 mask1 = __lsx_vaddi_bu(mask0, 2);
2999 src0 = __lsx_vld(src_tmp, 0);
3000 DUP2_ARG2(__lsx_vldx, src_tmp, src_stride, src_tmp, src_stride_2x,
3002 src_tmp += src_stride_3x;
3008 DUP2_ARG2(__lsx_vdp2_h_bu_b, vec0, filt0, vec2, filt0, dst0, dst1);
3009 dst2 = __lsx_vdp2_h_bu_b(vec4, filt0);
3010 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst0, vec1, filt1, dst1, vec3, filt1,
3012 dst2 = __lsx_vdp2add_h_bu_b(dst2, vec5, filt1);
3014 DUP2_ARG2(__lsx_vilvl_h, dst1, dst0, dst2, dst1, dst10_r, dst21_r);
3015 DUP2_ARG2(__lsx_vilvh_h, dst1, dst0, dst2, dst1, dst10_l, dst21_l);
3017 for (loop_cnt = 4; loop_cnt--;) {
3018 src3 = __lsx_vld(src_tmp, 0);
3019 DUP2_ARG2(__lsx_vldx, src_tmp, src_stride, src_tmp, src_stride_2x,
3021 src6 = __lsx_vldx(src_tmp, src_stride_3x);
3022 src_tmp += src_stride_4x;
3024 DUP2_ARG3(__lsx_vshuf_b, src3, src3, mask0, src3, src3, mask1,
3026 DUP2_ARG3(__lsx_vshuf_b, src4, src4, mask0, src4, src4, mask1,
3028 DUP2_ARG3(__lsx_vshuf_b, src5, src5, mask0, src5, src5, mask1,
3030 DUP2_ARG3(__lsx_vshuf_b, src6, src6, mask0, src6, src6, mask1,
3033 DUP4_ARG2(__lsx_vdp2_h_bu_b, vec0, filt0, vec2, filt0, vec4, filt0,
3034 vec6, filt0, dst3, dst4, dst5, dst6);
3035 DUP4_ARG3(__lsx_vdp2add_h_bu_b, dst3, vec1, filt1, dst4, vec3,
3036 filt1, dst5, vec5, filt1, dst6, vec7, filt1, dst3,
3039 DUP2_ARG2(__lsx_vilvl_h, dst3, dst2, dst4, dst3, dst32_r, dst43_r);
3040 DUP2_ARG2(__lsx_vilvh_h, dst3, dst2, dst4, dst3, dst32_l, dst43_l);
3041 DUP2_ARG2(__lsx_vilvl_h, dst5, dst4, dst6, dst5, dst54_r, dst65_r);
3042 DUP2_ARG2(__lsx_vilvh_h, dst5, dst4, dst6, dst5, dst54_l, dst65_l);
3044 DUP4_ARG2(__lsx_vdp2_w_h, dst10_r, filt_h0, dst10_l, filt_h0, dst21_r,
3045 filt_h0, dst21_l, filt_h0, dst0_r, dst0_l, dst1_r, dst1_l);
3046 DUP4_ARG2(__lsx_vdp2_w_h, dst32_r, filt_h0, dst32_l, filt_h0, dst43_r,
3047 filt_h0, dst43_l, filt_h0, dst2_r, dst2_l, dst3_r, dst3_l);
3048 DUP4_ARG3(__lsx_vdp2add_w_h, dst0_r, dst32_r, filt_h1, dst0_l, dst32_l,
3049 filt_h1, dst1_r, dst43_r, filt_h1, dst1_l, dst43_l, filt_h1,
3050 dst0_r, dst0_l, dst1_r, dst1_l);
3051 DUP4_ARG3(__lsx_vdp2add_w_h, dst2_r, dst54_r, filt_h1, dst2_l, dst54_l,
3052 filt_h1, dst3_r, dst65_r, filt_h1, dst3_l, dst65_l, filt_h1,
3053 dst2_r, dst2_l, dst3_r, dst3_l);
3054 DUP4_ARG2(__lsx_vsrai_w, dst0_r, 6, dst0_l, 6, dst1_r, 6, dst1_l, 6,
3055 dst0_r, dst0_l, dst1_r, dst1_l);
3056 DUP4_ARG2(__lsx_vsrai_w, dst2_r, 6, dst2_l, 6, dst3_r, 6, dst3_l, 6,
3057 dst2_r, dst2_l, dst3_r, dst3_l);
3058 DUP4_ARG2(__lsx_vpickev_h, dst0_l, dst0_r, dst1_l, dst1_r, dst2_l, dst2_r,
3059 dst3_l, dst3_r, dst0_r, dst1_r, dst2_r, dst3_r);
3060 __lsx_vst(dst0_r, dst_tmp, 0);
3061 __lsx_vstx(dst1_r, dst_tmp, dst_stride_x);
3062 __lsx_vstx(dst2_r, dst_tmp, dst_stride_2x);
3063 __lsx_vstx(dst3_r, dst_tmp, dst_stride_3x);
3064 dst_tmp += dst_stride_2x;
3077 mask3 = __lsx_vaddi_bu(mask2, 2);
3081 src += src_stride_3x;
3084 DUP2_ARG2(__lsx_vdp2_h_bu_b, vec0, filt0, vec2, filt0, dst10, dst21);
3085 DUP2_ARG3(__lsx_vdp2add_h_bu_b, dst10, vec1, filt1, dst21, vec3, filt1,
3087 dst10_r = __lsx_vilvl_h(dst21, dst10);
3088 dst21_r = __lsx_vilvh_h(dst21, dst10);
3089 dst22 = __lsx_vreplvei_d(dst21, 1);
3091 for (loop_cnt = 2; loop_cnt--;) {
3092 src3 = __lsx_vld(
src, 0);
3093 DUP2_ARG2(__lsx_vldx,
src, src_stride,
src, src_stride_2x, src4, src5);
3094 src6 = __lsx_vldx(
src, src_stride_3x);
3095 src += src_stride_4x;
3096 src7 = __lsx_vld(
src, 0);
3097 DUP2_ARG2(__lsx_vldx,
src, src_stride,
src, src_stride_2x, src8, src9);
3098 src10 = __lsx_vldx(
src, src_stride_3x);
3099 src += src_stride_4x;
3100 DUP2_ARG3(__lsx_vshuf_b, src7, src3, mask2, src7, src3, mask3,
3102 DUP2_ARG3(__lsx_vshuf_b, src8, src4, mask2, src8, src4, mask3,
3104 DUP2_ARG3(__lsx_vshuf_b, src9, src5, mask2, src9, src5, mask3,
3106 DUP2_ARG3(__lsx_vshuf_b, src10, src6, mask2, src10, src6, mask3,
3109 DUP4_ARG2(__lsx_vdp2_h_bu_b, vec0, filt0, vec2, filt0, vec4, filt0,
3110 vec6, filt0, dst73, dst84, dst95, dst106);
3111 DUP4_ARG3(__lsx_vdp2add_h_bu_b, dst73, vec1, filt1, dst84, vec3,
3112 filt1, dst95, vec5, filt1, dst106, vec7, filt1, dst73,
3113 dst84, dst95, dst106);
3115 DUP2_ARG2(__lsx_vilvl_h, dst73, dst22, dst84, dst73, dst32_r, dst43_r);
3116 DUP2_ARG2(__lsx_vilvh_h, dst84, dst73, dst95, dst84, dst87_r, dst98_r);
3117 DUP2_ARG2(__lsx_vilvl_h, dst95, dst84, dst106, dst95, dst54_r, dst65_r);
3118 dst109_r = __lsx_vilvh_h(dst106, dst95);
3119 dst22 = __lsx_vreplvei_d(dst73, 1);
3120 dst76_r = __lsx_vilvl_h(dst22, dst106);
3122 DUP4_ARG2(__lsx_vdp2_w_h, dst10_r, filt_h0, dst21_r, filt_h0, dst32_r,
3123 filt_h0, dst43_r, filt_h0, tmp0, tmp1, tmp2, tmp3);
3124 DUP4_ARG2(__lsx_vdp2_w_h, dst54_r, filt_h0, dst65_r, filt_h0, dst76_r,
3125 filt_h0, dst87_r, filt_h0, tmp4, tmp5, tmp6, tmp7);
3126 DUP4_ARG3(__lsx_vdp2add_w_h, tmp0, dst32_r, filt_h1, tmp1, dst43_r,
3127 filt_h1, tmp2, dst54_r, filt_h1, tmp3, dst65_r, filt_h1,
3128 tmp0, tmp1, tmp2, tmp3);
3129 DUP4_ARG3(__lsx_vdp2add_w_h, tmp4, dst76_r, filt_h1, tmp5, dst87_r,
3130 filt_h1, tmp6, dst98_r, filt_h1, tmp7, dst109_r, filt_h1,
3131 tmp4, tmp5, tmp6, tmp7);
3132 DUP4_ARG2(__lsx_vsrai_w, tmp0, 6, tmp1, 6, tmp2, 6, tmp3, 6,
3133 tmp0, tmp1, tmp2, tmp3);
3134 DUP4_ARG2(__lsx_vsrai_w, tmp4, 6, tmp5, 6, tmp6, 6, tmp7, 6,
3135 tmp4, tmp5, tmp6, tmp7);
3136 DUP4_ARG2(__lsx_vpickev_h, tmp1, tmp0, tmp3, tmp2, tmp5, tmp4,
3137 tmp7, tmp6, tmp0, tmp1, tmp2, tmp3);
3139 __lsx_vstelm_d(tmp0, dst, 0, 0);
3141 __lsx_vstelm_d(tmp0, dst, 0, 1);
3143 __lsx_vstelm_d(tmp1, dst, 0, 0);
3145 __lsx_vstelm_d(tmp1, dst, 0, 1);
3147 __lsx_vstelm_d(tmp2, dst, 0, 0);
3149 __lsx_vstelm_d(tmp2, dst, 0, 1);
3151 __lsx_vstelm_d(tmp3, dst, 0, 0);
3153 __lsx_vstelm_d(tmp3, dst, 0, 1);
3158 dst22 = __lsx_vreplvei_d(dst106, 1);
3166 const int8_t *filter_x,
3167 const int8_t *filter_y,
3172 filter_x, filter_y, 2);
3175 filter_x, filter_y,
height, 2);
3183 const int8_t *filter_x,
3184 const int8_t *filter_y,
3188 filter_x, filter_y,
height, 3);
3195 const int8_t *filter_x,
3196 const int8_t *filter_y,
3200 filter_x, filter_y,
height, 4);
3203 #define MC_COPY(WIDTH) \
3204 void ff_hevc_put_hevc_pel_pixels##WIDTH##_8_lsx(int16_t *dst, \
3205 const uint8_t *src, \
3206 ptrdiff_t src_stride, \
3212 hevc_copy_##WIDTH##w_lsx(src, src_stride, dst, MAX_PB_SIZE, height); \
3227 #define MC(PEL, DIR, WIDTH, TAP, DIR1, FILT_DIR) \
3228 void ff_hevc_put_hevc_##PEL##_##DIR##WIDTH##_8_lsx(int16_t *dst, \
3229 const uint8_t *src, \
3230 ptrdiff_t src_stride, \
3236 const int8_t *filter = ff_hevc_##PEL##_filters[FILT_DIR]; \
3238 hevc_##DIR1##_##TAP##t_##WIDTH##w_lsx(src, src_stride, dst, \
3239 MAX_PB_SIZE, filter, height); \
3242 MC(qpel,
h, 4, 8, hz, mx);
3243 MC(qpel,
h, 8, 8, hz, mx);
3244 MC(qpel,
h, 12, 8, hz, mx);
3245 MC(qpel,
h, 16, 8, hz, mx);
3246 MC(qpel,
h, 24, 8, hz, mx);
3247 MC(qpel,
h, 32, 8, hz, mx);
3248 MC(qpel,
h, 48, 8, hz, mx);
3249 MC(qpel,
h, 64, 8, hz, mx);
3251 MC(qpel, v, 4, 8, vt, my);
3252 MC(qpel, v, 8, 8, vt, my);
3253 MC(qpel, v, 12, 8, vt, my);
3254 MC(qpel, v, 16, 8, vt, my);
3255 MC(qpel, v, 24, 8, vt, my);
3256 MC(qpel, v, 32, 8, vt, my);
3257 MC(qpel, v, 48, 8, vt, my);
3258 MC(qpel, v, 64, 8, vt, my);
3260 MC(epel,
h, 32, 4, hz, mx);
3262 MC(epel, v, 16, 4, vt, my);
3263 MC(epel, v, 24, 4, vt, my);
3264 MC(epel, v, 32, 4, vt, my);
3268 #define MC_HV(PEL, WIDTH, TAP) \
3269 void ff_hevc_put_hevc_##PEL##_hv##WIDTH##_8_lsx(int16_t *dst, \
3270 const uint8_t *src, \
3271 ptrdiff_t src_stride, \
3277 const int8_t *filter_x = ff_hevc_##PEL##_filters[mx]; \
3278 const int8_t *filter_y = ff_hevc_##PEL##_filters[my]; \
3280 hevc_hv_##TAP##t_##WIDTH##w_lsx(src, src_stride, dst, MAX_PB_SIZE, \
3281 filter_x, filter_y, height); \