ppc: Add convolve8_avg_vert_vsx

Only the generic one again, speedups for 8x8 and larger blocks to
come later.

Change-Id: I90d481d3a602d1e277ead8f3934eca126b86b72d
This commit is contained in:
Luca Barbato 2017-05-01 15:53:44 +00:00 committed by James Zern
parent a65f1771ad
commit e6ca81ee67
3 changed files with 38 additions and 2 deletions

View File

@ -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) };

View File

@ -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);
}

View File

@ -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/;