aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/vf_rotate.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-04-19 01:12:54 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-04-19 01:23:14 +0200
commitc9aab1ee7f3314ad9d79bc5f6f7a00ebe3f4e97f (patch)
treeba71ebe1411b3fc60d1060840d7ca9063f6d6aed /libavfilter/vf_rotate.c
parent4ebfb2c5ec7dc52cb0f46862a8d37417b8e7551d (diff)
downloadffmpeg-c9aab1ee7f3314ad9d79bc5f6f7a00ebe3f4e97f.tar.gz
avfilter/vf_rotate: fix several of by 1 errors
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/vf_rotate.c')
-rw-r--r--libavfilter/vf_rotate.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavfilter/vf_rotate.c b/libavfilter/vf_rotate.c
index 94aa7c6a42..16c4a11873 100644
--- a/libavfilter/vf_rotate.c
+++ b/libavfilter/vf_rotate.c
@@ -328,8 +328,8 @@ static int filter_slice(AVFilterContext *ctx, void *arg, int job, int nb_jobs)
int i, j, x, y;
for (j = start; j < end; j++) {
- x = xprime + xi + FIXP*inw/2;
- y = yprime + yi + FIXP*inh/2;
+ x = xprime + xi + FIXP*(inw-1)/2;
+ y = yprime + yi + FIXP*(inh-1)/2;
for (i = 0; i < outw; i++) {
int32_t v;
@@ -421,9 +421,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
.inw = FF_CEIL_RSHIFT(inlink->w, hsub),
.inh = FF_CEIL_RSHIFT(inlink->h, vsub),
.outh = outh, .outw = outw,
- .xi = -outw/2 * c, .yi = outw/2 * s,
- .xprime = -outh/2 * s,
- .yprime = -outh/2 * c,
+ .xi = -(outw-1) * c / 2, .yi = (outw-1) * s / 2,
+ .xprime = -(outh-1) * s / 2,
+ .yprime = -(outh-1) * c / 2,
.plane = plane, .c = c, .s = s };