1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-08 13:22:53 +02:00

avfilter/vf_perspective: factor u cliping code

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-08-08 23:24:31 +02:00
parent c11c180132
commit 3b2e99fe9e

View File

@ -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