From 0f931b29f7e969a3c6159cb7173226e806f26f39 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 4 Jan 2015 04:15:01 +0100 Subject: Factorize avpriv_mirror() out Signed-off-by: Michael Niedermayer --- libavfilter/transform.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'libavfilter/transform.c') diff --git a/libavfilter/transform.c b/libavfilter/transform.c index 3fc547e08a..f92fc4d42f 100644 --- a/libavfilter/transform.c +++ b/libavfilter/transform.c @@ -136,16 +136,6 @@ void avfilter_mul_matrix(const float *m1, float scalar, float *result) result[i] = m1[i] * scalar; } -static inline int mirror(int v, int m) -{ - while ((unsigned)v > (unsigned)m) { - v = -v; - if (v < 0) - v += 2 * m; - } - return v; -} - int avfilter_transform(const uint8_t *src, uint8_t *dst, int src_stride, int dst_stride, int width, int height, const float *matrix, @@ -186,8 +176,8 @@ int avfilter_transform(const uint8_t *src, uint8_t *dst, def = src[(int)y_s * src_stride + (int)x_s]; break; case FILL_MIRROR: - x_s = mirror(x_s, width-1); - y_s = mirror(y_s, height-1); + x_s = avpriv_mirror(x_s, width-1); + y_s = avpriv_mirror(y_s, height-1); av_assert2(x_s >= 0 && y_s >= 0); av_assert2(x_s < width && y_s < height); -- cgit v1.2.3