Commit eeb5b62d authored by Parag Salasakar's avatar Parag Salasakar

mips dsp-ase r2 vp9 decoder bilinear convolve optimizations

Change-Id: Ic31b4ef85e65070b4f8b9f26e068ccfaae00c4f0
parent b4148c3a
......@@ -81,5 +81,34 @@ static INLINE void vp9_prefetch_store_streamed(unsigned char *dst) {
);
}
void vp9_convolve2_horiz_dspr2(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);
void vp9_convolve2_avg_horiz_dspr2(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);
void vp9_convolve2_avg_vert_dspr2(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);
void vp9_convolve2_dspr2(const uint8_t *src, ptrdiff_t src_stride,
uint8_t *dst, ptrdiff_t dst_stride,
const int16_t *filter,
int w, int h);
void vp9_convolve2_vert_dspr2(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);
#endif // #if HAVE_DSPR2
#endif // VP9_COMMON_VP9_COMMON_DSPR2_H_
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -355,6 +355,12 @@ void vp9_convolve8_avg_vert_dspr2(const uint8_t *src, ptrdiff_t src_stride,
filter_x, x_step_q4,
filter_y, y_step_q4,
w, h);
} else if (((const int32_t *)filter_y)[0] == 0) {
vp9_convolve2_avg_vert_dspr2(src, src_stride,
dst, dst_stride,
filter_x, x_step_q4,
filter_y, y_step_q4,
w, h);
} else {
if (16 == y_step_q4) {
uint32_t pos = 38;
......
......@@ -965,6 +965,12 @@ void vp9_convolve8_avg_horiz_dspr2(const uint8_t *src, ptrdiff_t src_stride,
filter_x, x_step_q4,
filter_y, y_step_q4,
w, h);
} else if (((const int32_t *)filter_x)[0] == 0) {
vp9_convolve2_avg_horiz_dspr2(src, src_stride,
dst, dst_stride,
filter_x, x_step_q4,
filter_y, y_step_q4,
w, h);
} else {
if (16 == x_step_q4) {
uint32_t pos = 38;
......
......@@ -930,6 +930,21 @@ void convolve_horiz_transposed(const uint8_t *src, ptrdiff_t src_stride,
}
}
void copy_horiz_transposed(const uint8_t *src, ptrdiff_t src_stride,
uint8_t *dst, ptrdiff_t dst_stride,
int w, int h) {
int x, y;
for (y = 0; y < h; ++y) {
for (x = 0; x < w; ++x) {
dst[x * dst_stride] = src[x];
}
src += src_stride;
dst += 1;
}
}
void vp9_convolve8_dspr2(const uint8_t *src, ptrdiff_t src_stride,
uint8_t *dst, ptrdiff_t dst_stride,
const int16_t *filter_x, int x_step_q4,
......@@ -966,20 +981,14 @@ void vp9_convolve8_dspr2(const uint8_t *src, ptrdiff_t src_stride,
/* copy the src to dst */
if (filter_x[3] == 0x80) {
int32_t y;
int32_t c;
const uint8_t *src_ptr = src - src_stride * 3;
uint8_t *dst_ptr = temp;
for (y = intermediate_height; y--;) {
for (c = 0; c < w; c++) {
dst_ptr[c * intermediate_height] = src_ptr[c];
}
/* next row... */
src_ptr += src_stride;
dst_ptr += 1;
}
copy_horiz_transposed(src - src_stride * 3, src_stride,
temp, intermediate_height,
w, intermediate_height);
} else if (((const int32_t *)filter_x)[0] == 0) {
vp9_convolve2_dspr2(src - src_stride * 3, src_stride,
temp, intermediate_height,
filter_x,
w, intermediate_height);
} else {
src -= (src_stride * 3 + 3);
......@@ -1021,20 +1030,14 @@ void vp9_convolve8_dspr2(const uint8_t *src, ptrdiff_t src_stride,
/* copy the src to dst */
if (filter_y[3] == 0x80) {
int32_t y;
int32_t c;
uint8_t *src_ptr = temp + 3;
uint8_t *dst_ptr = dst;
for (y = w; y--;) {
for (c = 0; c < h; c++) {
dst_ptr[c * dst_stride] = src_ptr[c];
}
/* next row... */
src_ptr += intermediate_height;
dst_ptr += 1;
}
copy_horiz_transposed(temp + 3, intermediate_height,
dst, dst_stride,
h, w);
} else if (((const int32_t *)filter_y)[0] == 0) {
vp9_convolve2_dspr2(temp + 3, intermediate_height,
dst, dst_stride,
filter_y,
h, w);
} else {
switch (h) {
case 4:
......
......@@ -849,6 +849,12 @@ void vp9_convolve8_horiz_dspr2(const uint8_t *src, ptrdiff_t src_stride,
filter_x, x_step_q4,
filter_y, y_step_q4,
w, h);
} else if (((const int32_t *)filter_x)[0] == 0) {
vp9_convolve2_horiz_dspr2(src, src_stride,
dst, dst_stride,
filter_x, x_step_q4,
filter_y, y_step_q4,
w, h);
} else {
if (16 == x_step_q4) {
uint32_t pos = 38;
......
......@@ -341,6 +341,12 @@ void vp9_convolve8_vert_dspr2(const uint8_t *src, ptrdiff_t src_stride,
filter_x, x_step_q4,
filter_y, y_step_q4,
w, h);
} else if (((const int32_t *)filter_y)[0] == 0) {
vp9_convolve2_vert_dspr2(src, src_stride,
dst, dst_stride,
filter_x, x_step_q4,
filter_y, y_step_q4,
w, h);
} else {
if (16 == y_step_q4) {
uint32_t pos = 38;
......
......@@ -89,6 +89,11 @@ endif
# common (c)
VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_common_dspr2.h
VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_convolve2_avg_dspr2.c
VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_convolve2_avg_horiz_dspr2.c
VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_convolve2_dspr2.c
VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_convolve2_horiz_dspr2.c
VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_convolve2_vert_dspr2.c
VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_convolve8_avg_dspr2.c
VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_convolve8_avg_horiz_dspr2.c
VP9_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/vp9_convolve8_dspr2.c
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment