summaryrefslogtreecommitdiff
path: root/libavfilter/transform.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-01-04 04:15:01 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-01-05 01:45:49 +0100
commit0f931b29f7e969a3c6159cb7173226e806f26f39 (patch)
treeb20f19d7697738fe415025c17afce7c926af07ec /libavfilter/transform.c
parent9bff052b51f27f6cce04e8d7d8b405c710d7ad67 (diff)
Factorize avpriv_mirror() out
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/transform.c')
-rw-r--r--libavfilter/transform.c14
1 files changed, 2 insertions, 12 deletions
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);