| 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_avg_horiz_4_dspr2(const uint8_t *src, | 21 static void convolve_bi_avg_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 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 761 src_ptr += src_stride; | 761 src_ptr += src_stride; |
| 762 dst_ptr += dst_stride; | 762 dst_ptr += dst_stride; |
| 763 } | 763 } |
| 764 } | 764 } |
| 765 | 765 |
| 766 void vpx_convolve2_avg_horiz_dspr2(const uint8_t *src, ptrdiff_t src_stride, | 766 void vpx_convolve2_avg_horiz_dspr2(const uint8_t *src, ptrdiff_t src_stride, |
| 767 uint8_t *dst, ptrdiff_t dst_stride, | 767 uint8_t *dst, ptrdiff_t dst_stride, |
| 768 const int16_t *filter_x, int x_step_q4, | 768 const int16_t *filter_x, int x_step_q4, |
| 769 const int16_t *filter_y, int y_step_q4, | 769 const int16_t *filter_y, int y_step_q4, |
| 770 int w, int h) { | 770 int w, int h) { |
| 771 if (16 == x_step_q4) { | 771 uint32_t pos = 38; |
| 772 uint32_t pos = 38; | |
| 773 | 772 |
| 774 /* bit positon for extract from acc */ | 773 assert(x_step_q4 == 16); |
| 775 __asm__ __volatile__ ( | |
| 776 "wrdsp %[pos], 1 \n\t" | |
| 777 : | |
| 778 : [pos] "r" (pos) | |
| 779 ); | |
| 780 | 774 |
| 781 /* prefetch data to cache memory */ | 775 /* bit positon for extract from acc */ |
| 782 prefetch_load(src); | 776 __asm__ __volatile__ ( |
| 783 prefetch_load(src + 32); | 777 "wrdsp %[pos], 1 \n\t" |
| 784 prefetch_store(dst); | 778 : |
| 779 : [pos] "r" (pos) |
| 780 ); |
| 785 | 781 |
| 786 switch (w) { | 782 /* prefetch data to cache memory */ |
| 787 case 4: | 783 prefetch_load(src); |
| 788 convolve_bi_avg_horiz_4_dspr2(src, src_stride, | 784 prefetch_load(src + 32); |
| 789 dst, dst_stride, | 785 prefetch_store(dst); |
| 790 filter_x, h); | |
| 791 break; | |
| 792 case 8: | |
| 793 convolve_bi_avg_horiz_8_dspr2(src, src_stride, | |
| 794 dst, dst_stride, | |
| 795 filter_x, h); | |
| 796 break; | |
| 797 case 16: | |
| 798 convolve_bi_avg_horiz_16_dspr2(src, src_stride, | |
| 799 dst, dst_stride, | |
| 800 filter_x, h, 1); | |
| 801 break; | |
| 802 case 32: | |
| 803 convolve_bi_avg_horiz_16_dspr2(src, src_stride, | |
| 804 dst, dst_stride, | |
| 805 filter_x, h, 2); | |
| 806 break; | |
| 807 case 64: | |
| 808 prefetch_load(src + 64); | |
| 809 prefetch_store(dst + 32); | |
| 810 | 786 |
| 811 convolve_bi_avg_horiz_64_dspr2(src, src_stride, | 787 switch (w) { |
| 812 dst, dst_stride, | 788 case 4: |
| 813 filter_x, h); | 789 convolve_bi_avg_horiz_4_dspr2(src, src_stride, |
| 814 break; | 790 dst, dst_stride, |
| 815 default: | 791 filter_x, h); |
| 816 vpx_convolve8_avg_horiz_c(src, src_stride, | 792 break; |
| 817 dst, dst_stride, | 793 case 8: |
| 818 filter_x, x_step_q4, | 794 convolve_bi_avg_horiz_8_dspr2(src, src_stride, |
| 819 filter_y, y_step_q4, | 795 dst, dst_stride, |
| 820 w, h); | 796 filter_x, h); |
| 821 break; | 797 break; |
| 822 } | 798 case 16: |
| 823 } else { | 799 convolve_bi_avg_horiz_16_dspr2(src, src_stride, |
| 824 vpx_convolve8_avg_horiz_c(src, src_stride, | 800 dst, dst_stride, |
| 825 dst, dst_stride, | 801 filter_x, h, 1); |
| 826 filter_x, x_step_q4, | 802 break; |
| 827 filter_y, y_step_q4, | 803 case 32: |
| 828 w, h); | 804 convolve_bi_avg_horiz_16_dspr2(src, src_stride, |
| 805 dst, dst_stride, |
| 806 filter_x, h, 2); |
| 807 break; |
| 808 case 64: |
| 809 prefetch_load(src + 64); |
| 810 prefetch_store(dst + 32); |
| 811 |
| 812 convolve_bi_avg_horiz_64_dspr2(src, src_stride, |
| 813 dst, dst_stride, |
| 814 filter_x, h); |
| 815 break; |
| 816 default: |
| 817 vpx_convolve8_avg_horiz_c(src, src_stride, |
| 818 dst, dst_stride, |
| 819 filter_x, x_step_q4, |
| 820 filter_y, y_step_q4, |
| 821 w, h); |
| 822 break; |
| 829 } | 823 } |
| 830 } | 824 } |
| 831 #endif | 825 #endif |
| OLD | NEW |