ref: a405bc2ec975400db5f5d856d1e87a0c363a4913
parent: 3dffc634c0544449f3754954706552b11a89ce07
author: Luca Barbato <lu_zero@gentoo.org>
date: Fri May 25 18:22:42 EDT 2018
force-inline the convolve functions Change-Id: I3ba75c459ed7c9591b7892e9f8f108146c04507d
--- a/vpx_dsp/ppc/vpx_convolve_vsx.c
+++ b/vpx_dsp/ppc/vpx_convolve_vsx.c
@@ -9,13 +9,16 @@
*/
#include <assert.h>
#include <string.h>
+
#include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/vpx_filter.h"
+#include "vpx/vpx_integer.h"
#include "vpx_dsp/ppc/types_vsx.h"
+#include "vpx_dsp/vpx_filter.h"
// TODO(lu_zero): unroll
-static inline void copy_w16(const uint8_t *src, ptrdiff_t src_stride,
- uint8_t *dst, ptrdiff_t dst_stride, int32_t h) {
+static VPX_FORCE_INLINE void copy_w16(const uint8_t *src, ptrdiff_t src_stride,
+ uint8_t *dst, ptrdiff_t dst_stride,
+ int32_t h) {
int i;
for (i = h; i--;) {
@@ -25,8 +28,9 @@
}
}
-static inline void copy_w32(const uint8_t *src, ptrdiff_t src_stride,
- uint8_t *dst, ptrdiff_t dst_stride, int32_t h) {
+static VPX_FORCE_INLINE void copy_w32(const uint8_t *src, ptrdiff_t src_stride,
+ uint8_t *dst, ptrdiff_t dst_stride,
+ int32_t h) {
int i;
for (i = h; i--;) {
@@ -37,8 +41,9 @@
}
}
-static inline void copy_w64(const uint8_t *src, ptrdiff_t src_stride,
- uint8_t *dst, ptrdiff_t dst_stride, int32_t h) {
+static VPX_FORCE_INLINE void copy_w64(const uint8_t *src, ptrdiff_t src_stride,
+ uint8_t *dst, ptrdiff_t dst_stride,
+ int32_t h) {
int i;
for (i = h; i--;) {
@@ -86,8 +91,9 @@
}
}
-static inline void avg_w16(const uint8_t *src, ptrdiff_t src_stride,
- uint8_t *dst, ptrdiff_t dst_stride, int32_t h) {
+static VPX_FORCE_INLINE void avg_w16(const uint8_t *src, ptrdiff_t src_stride,
+ uint8_t *dst, ptrdiff_t dst_stride,
+ int32_t h) {
int i;
for (i = h; i--;) {
@@ -98,8 +104,9 @@
}
}
-static inline void avg_w32(const uint8_t *src, ptrdiff_t src_stride,
- uint8_t *dst, ptrdiff_t dst_stride, int32_t h) {
+static VPX_FORCE_INLINE void avg_w32(const uint8_t *src, ptrdiff_t src_stride,
+ uint8_t *dst, ptrdiff_t dst_stride,
+ int32_t h) {
int i;
for (i = h; i--;) {
@@ -112,8 +119,9 @@
}
}
-static inline void avg_w64(const uint8_t *src, ptrdiff_t src_stride,
- uint8_t *dst, ptrdiff_t dst_stride, int32_t h) {
+static VPX_FORCE_INLINE void avg_w64(const uint8_t *src, ptrdiff_t src_stride,
+ uint8_t *dst, ptrdiff_t dst_stride,
+ int32_t h) {
int i;
for (i = h; i--;) {
@@ -155,8 +163,8 @@
}
}
-static inline void convolve_line(uint8_t *dst, const int16x8_t s,
- const int16x8_t f) {
+static VPX_FORCE_INLINE void convolve_line(uint8_t *dst, const int16x8_t s,
+ const int16x8_t f) {
const int32x4_t sum = vec_msum(s, f, vec_splat_s32(0));
const int32x4_t bias =
vec_sl(vec_splat_s32(1), vec_splat_u32(FILTER_BITS - 1));
@@ -166,8 +174,9 @@
vec_ste(v, 0, dst);
}
-static inline void convolve_line_h(uint8_t *dst, const uint8_t *const src_x,
- const int16_t *const x_filter) {
+static VPX_FORCE_INLINE void convolve_line_h(uint8_t *dst,
+ const uint8_t *const src_x,
+ const int16_t *const x_filter) {
const int16x8_t s = unpack_to_s16_h(vec_vsx_ld(0, src_x));
const int16x8_t f = vec_vsx_ld(0, x_filter);
@@ -175,10 +184,12 @@
}
// TODO(lu_zero): Implement 8x8 and bigger block special cases
-static inline void convolve_horiz(const uint8_t *src, ptrdiff_t src_stride,
- uint8_t *dst, ptrdiff_t dst_stride,
- const InterpKernel *x_filters, int x0_q4,
- int x_step_q4, int w, int h) {
+static VPX_FORCE_INLINE void convolve_horiz(const uint8_t *src,
+ ptrdiff_t src_stride, uint8_t *dst,
+ ptrdiff_t dst_stride,
+ const InterpKernel *x_filters,
+ int x0_q4, int x_step_q4, int w,
+ int h) {
int x, y;
src -= SUBPEL_TAPS / 2 - 1;
@@ -194,10 +205,10 @@
}
}
-static inline void convolve_avg_horiz(const uint8_t *src, ptrdiff_t src_stride,
- uint8_t *dst, ptrdiff_t dst_stride,
- const InterpKernel *x_filters, int x0_q4,
- int x_step_q4, int w, int h) {
+static VPX_FORCE_INLINE void convolve_avg_horiz(
+ const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst,
+ ptrdiff_t dst_stride, const InterpKernel *x_filters, int x0_q4,
+ int x_step_q4, int w, int h) {
int x, y;
src -= SUBPEL_TAPS / 2 - 1;
@@ -230,9 +241,10 @@
return (uint8x16_t)vec_mergeh(abcd, efgh);
}
-static inline void convolve_line_v(uint8_t *dst, const uint8_t *const src_y,
- ptrdiff_t src_stride,
- const int16_t *const y_filter) {
+static VPX_FORCE_INLINE void convolve_line_v(uint8_t *dst,
+ const uint8_t *const src_y,
+ ptrdiff_t src_stride,
+ const int16_t *const y_filter) {
uint8x16_t s0 = vec_vsx_ld(0, src_y + 0 * src_stride);
uint8x16_t s1 = vec_vsx_ld(0, src_y + 1 * src_stride);
uint8x16_t s2 = vec_vsx_ld(0, src_y + 2 * src_stride);
@@ -250,10 +262,12 @@
convolve_line(dst, unpack_to_s16_h(s), f);
}
-static inline void convolve_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) {
+static VPX_FORCE_INLINE void convolve_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);
@@ -270,10 +284,10 @@
}
}
-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) {
+static VPX_FORCE_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);
@@ -291,11 +305,11 @@
}
}
-static inline void convolve(const uint8_t *src, ptrdiff_t src_stride,
- uint8_t *dst, ptrdiff_t dst_stride,
- const InterpKernel *const filter, int x0_q4,
- int x_step_q4, int y0_q4, int y_step_q4, int w,
- int h) {
+static VPX_FORCE_INLINE void convolve(const uint8_t *src, ptrdiff_t src_stride,
+ uint8_t *dst, ptrdiff_t dst_stride,
+ const InterpKernel *const filter,
+ int x0_q4, int x_step_q4, int y0_q4,
+ int y_step_q4, int w, int h) {
// Note: Fixed size intermediate buffer, temp, places limits on parameters.
// 2d filtering proceeds in 2 steps:
// (1) Interpolate horizontally into an intermediate buffer, temp.