aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-08-08 23:24:31 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-08-09 00:03:43 +0200
commit3b2e99fe9ec46580165daa233c273579bde1e913 (patch)
tree3058b3868423731f8f683532a9186135726036db
parentc11c180132b3e0038143dc9ba4dfd7287d1509c7 (diff)
downloadffmpeg-3b2e99fe9ec46580165daa233c273579bde1e913.tar.gz
avfilter/vf_perspective: factor u cliping code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavfilter/vf_perspective.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/libavfilter/vf_perspective.c b/libavfilter/vf_perspective.c
index 35b4ea8c12..da8c08982c 100644
--- a/libavfilter/vf_perspective.c
+++ b/libavfilter/vf_perspective.c
@@ -301,19 +301,15 @@ static void resample_linear(PerspectiveContext *s,
sum = (sum + (1 << (SUB_PIXEL_BITS - 1))) >> SUB_PIXEL_BITS;
}
} else {
+ if (u < 0)
+ u = 0;
+ else
+ u = w - 1;
if ((unsigned)v < (unsigned)(h - 1)){
- if (u < 0)
- u = 0;
- else
- u = w - 1;
index = u + v * src_linesize;
sum = subVI * src[index] + subV * src[index + src_linesize];
sum = (sum + (1 << (SUB_PIXEL_BITS - 1))) >> SUB_PIXEL_BITS;
} else {
- if (u < 0)
- u = 0;
- else
- u = w - 1;
if (v < 0)
v = 0;
else