From e6ca81ee6706e3c151cdc9b5b33ea695f35e062d Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Mon, 1 May 2017 15:53:44 +0000 Subject: [PATCH] ppc: Add convolve8_avg_vert_vsx Only the generic one again, speedups for 8x8 and larger blocks to come later. Change-Id: I90d481d3a602d1e277ead8f3934eca126b86b72d --- test/convolve_test.cc | 2 +- vpx_dsp/ppc/vpx_convolve_vsx.c | 36 ++++++++++++++++++++++++++++++++++ vpx_dsp/vpx_dsp_rtcd_defs.pl | 2 +- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/test/convolve_test.cc b/test/convolve_test.cc index 085d2a27c..a5b4b3c23 100644 --- a/test/convolve_test.cc +++ b/test/convolve_test.cc @@ -1226,7 +1226,7 @@ INSTANTIATE_TEST_CASE_P(MSA, ConvolveTest, const ConvolveFunctions convolve8_vsx( vpx_convolve_copy_vsx, vpx_convolve_avg_vsx, vpx_convolve8_horiz_vsx, vpx_convolve8_avg_horiz_vsx, vpx_convolve8_vert_vsx, - vpx_convolve8_avg_vert_c, vpx_convolve8_c, vpx_convolve8_avg_c, + vpx_convolve8_avg_vert_vsx, vpx_convolve8_c, vpx_convolve8_avg_c, vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c, vpx_scaled_vert_c, vpx_scaled_avg_vert_c, vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0); const ConvolveParam kArrayConvolve_vsx[] = { ALL_SIZES(convolve8_vsx) }; diff --git a/vpx_dsp/ppc/vpx_convolve_vsx.c b/vpx_dsp/ppc/vpx_convolve_vsx.c index 5a789c768..f0de3eb3b 100644 --- a/vpx_dsp/ppc/vpx_convolve_vsx.c +++ b/vpx_dsp/ppc/vpx_convolve_vsx.c @@ -275,6 +275,27 @@ static inline void convolve_vert(const uint8_t *src, ptrdiff_t src_stride, } } +static inline void convolve_avg_vert(const uint8_t *src, ptrdiff_t src_stride, + uint8_t *dst, ptrdiff_t dst_stride, + const InterpKernel *y_filters, int y0_q4, + int y_step_q4, int w, int h) { + int x, y; + src -= src_stride * (SUBPEL_TAPS / 2 - 1); + + for (x = 0; x < w; ++x) { + int y_q4 = y0_q4; + for (y = 0; y < h; ++y) { + uint8_t v; + convolve_line_v(&v, &src[(y_q4 >> SUBPEL_BITS) * src_stride], src_stride, + y_filters[y_q4 & SUBPEL_MASK]); + dst[y * dst_stride] = ROUND_POWER_OF_TWO(dst[y * dst_stride] + v, 1); + y_q4 += y_step_q4; + } + ++src; + ++dst; + } +} + void vpx_convolve8_horiz_vsx(const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, @@ -319,3 +340,18 @@ void vpx_convolve8_vert_vsx(const uint8_t *src, ptrdiff_t src_stride, convolve_vert(src, src_stride, dst, dst_stride, filters_y, y0_q4, y_step_q4, w, h); } + +void vpx_convolve8_avg_vert_vsx(const uint8_t *src, ptrdiff_t src_stride, + uint8_t *dst, ptrdiff_t dst_stride, + const int16_t *filter_x, int x_step_q4, + const int16_t *filter_y, int y_step_q4, int w, + int h) { + const InterpKernel *const filters_y = get_filter_base(filter_y); + const int y0_q4 = get_filter_offset(filter_y, filters_y); + + (void)filter_x; + (void)x_step_q4; + + convolve_avg_vert(src, src_stride, dst, dst_stride, filters_y, y0_q4, + y_step_q4, w, h); +} diff --git a/vpx_dsp/vpx_dsp_rtcd_defs.pl b/vpx_dsp/vpx_dsp_rtcd_defs.pl index 7282671c1..3488e5eb3 100644 --- a/vpx_dsp/vpx_dsp_rtcd_defs.pl +++ b/vpx_dsp/vpx_dsp_rtcd_defs.pl @@ -353,7 +353,7 @@ add_proto qw/void vpx_convolve8_avg_horiz/, "const uint8_t *src, ptrdiff_t src_s specialize qw/vpx_convolve8_avg_horiz sse2 ssse3 neon dspr2 msa vsx/; add_proto qw/void vpx_convolve8_avg_vert/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h"; -specialize qw/vpx_convolve8_avg_vert sse2 ssse3 neon dspr2 msa/; +specialize qw/vpx_convolve8_avg_vert sse2 ssse3 neon dspr2 msa vsx/; add_proto qw/void vpx_scaled_2d/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h"; specialize qw/vpx_scaled_2d ssse3/;