OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebM project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #include <assert.h> | 11 #include <assert.h> |
12 #include <stdio.h> | 12 #include <stdio.h> |
13 | 13 |
14 #include "./vpx_dsp_rtcd.h" | 14 #include "./vpx_dsp_rtcd.h" |
15 #include "vpx_dsp/mips/vpx_common_dspr2.h" | 15 #include "vpx_dsp/mips/convolve_common_dspr2.h" |
16 #include "vpx_dsp/vpx_convolve.h" | 16 #include "vpx_dsp/vpx_convolve.h" |
17 #include "vpx_dsp/vpx_dsp_common.h" | 17 #include "vpx_dsp/vpx_dsp_common.h" |
18 #include "vpx_ports/mem.h" | 18 #include "vpx_ports/mem.h" |
19 | 19 |
20 #if HAVE_DSPR2 | 20 #if HAVE_DSPR2 |
21 static void convolve_bi_horiz_4_dspr2(const uint8_t *src, | 21 static void convolve_bi_horiz_4_dspr2(const uint8_t *src, |
22 int32_t src_stride, | 22 int32_t src_stride, |
23 uint8_t *dst, | 23 uint8_t *dst, |
24 int32_t dst_stride, | 24 int32_t dst_stride, |
25 const int16_t *filter_x0, | 25 const int16_t *filter_x0, |
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 src_ptr += src_stride; | 639 src_ptr += src_stride; |
640 dst_ptr += dst_stride; | 640 dst_ptr += dst_stride; |
641 } | 641 } |
642 } | 642 } |
643 | 643 |
644 void vpx_convolve2_horiz_dspr2(const uint8_t *src, ptrdiff_t src_stride, | 644 void vpx_convolve2_horiz_dspr2(const uint8_t *src, ptrdiff_t src_stride, |
645 uint8_t *dst, ptrdiff_t dst_stride, | 645 uint8_t *dst, ptrdiff_t dst_stride, |
646 const int16_t *filter_x, int x_step_q4, | 646 const int16_t *filter_x, int x_step_q4, |
647 const int16_t *filter_y, int y_step_q4, | 647 const int16_t *filter_y, int y_step_q4, |
648 int w, int h) { | 648 int w, int h) { |
649 if (16 == x_step_q4) { | 649 uint32_t pos = 38; |
650 uint32_t pos = 38; | |
651 | 650 |
652 prefetch_load((const uint8_t *)filter_x); | 651 assert(x_step_q4 == 16); |
653 | 652 |
654 /* bit positon for extract from acc */ | 653 prefetch_load((const uint8_t *)filter_x); |
655 __asm__ __volatile__ ( | |
656 "wrdsp %[pos], 1 \n\t" | |
657 : | |
658 : [pos] "r" (pos) | |
659 ); | |
660 | 654 |
661 /* prefetch data to cache memory */ | 655 /* bit positon for extract from acc */ |
662 prefetch_load(src); | 656 __asm__ __volatile__ ( |
663 prefetch_load(src + 32); | 657 "wrdsp %[pos], 1 \n\t" |
664 prefetch_store(dst); | 658 : |
| 659 : [pos] "r" (pos) |
| 660 ); |
665 | 661 |
666 switch (w) { | 662 /* prefetch data to cache memory */ |
667 case 4: | 663 prefetch_load(src); |
668 convolve_bi_horiz_4_dspr2(src, (int32_t)src_stride, | 664 prefetch_load(src + 32); |
669 dst, (int32_t)dst_stride, | 665 prefetch_store(dst); |
670 filter_x, (int32_t)h); | |
671 break; | |
672 case 8: | |
673 convolve_bi_horiz_8_dspr2(src, (int32_t)src_stride, | |
674 dst, (int32_t)dst_stride, | |
675 filter_x, (int32_t)h); | |
676 break; | |
677 case 16: | |
678 convolve_bi_horiz_16_dspr2(src, (int32_t)src_stride, | |
679 dst, (int32_t)dst_stride, | |
680 filter_x, (int32_t)h, 1); | |
681 break; | |
682 case 32: | |
683 convolve_bi_horiz_16_dspr2(src, (int32_t)src_stride, | |
684 dst, (int32_t)dst_stride, | |
685 filter_x, (int32_t)h, 2); | |
686 break; | |
687 case 64: | |
688 prefetch_load(src + 64); | |
689 prefetch_store(dst + 32); | |
690 | 666 |
691 convolve_bi_horiz_64_dspr2(src, (int32_t)src_stride, | 667 switch (w) { |
692 dst, (int32_t)dst_stride, | 668 case 4: |
693 filter_x, (int32_t)h); | 669 convolve_bi_horiz_4_dspr2(src, (int32_t)src_stride, |
694 break; | 670 dst, (int32_t)dst_stride, |
695 default: | 671 filter_x, (int32_t)h); |
696 vpx_convolve8_horiz_c(src, src_stride, | 672 break; |
697 dst, dst_stride, | 673 case 8: |
698 filter_x, x_step_q4, | 674 convolve_bi_horiz_8_dspr2(src, (int32_t)src_stride, |
699 filter_y, y_step_q4, | 675 dst, (int32_t)dst_stride, |
700 w, h); | 676 filter_x, (int32_t)h); |
701 break; | 677 break; |
702 } | 678 case 16: |
703 } else { | 679 convolve_bi_horiz_16_dspr2(src, (int32_t)src_stride, |
704 vpx_convolve8_horiz_c(src, src_stride, | 680 dst, (int32_t)dst_stride, |
705 dst, dst_stride, | 681 filter_x, (int32_t)h, 1); |
706 filter_x, x_step_q4, | 682 break; |
707 filter_y, y_step_q4, | 683 case 32: |
708 w, h); | 684 convolve_bi_horiz_16_dspr2(src, (int32_t)src_stride, |
| 685 dst, (int32_t)dst_stride, |
| 686 filter_x, (int32_t)h, 2); |
| 687 break; |
| 688 case 64: |
| 689 prefetch_load(src + 64); |
| 690 prefetch_store(dst + 32); |
| 691 |
| 692 convolve_bi_horiz_64_dspr2(src, (int32_t)src_stride, |
| 693 dst, (int32_t)dst_stride, |
| 694 filter_x, (int32_t)h); |
| 695 break; |
| 696 default: |
| 697 vpx_convolve8_horiz_c(src, src_stride, |
| 698 dst, dst_stride, |
| 699 filter_x, x_step_q4, |
| 700 filter_y, y_step_q4, |
| 701 w, h); |
| 702 break; |
709 } | 703 } |
710 } | 704 } |
711 #endif | 705 #endif |
OLD | NEW |