Browse Source

avfilter/vf_perspective: factor u cliping code

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.1
Michael Niedermayer 12 years ago
parent
commit
3b2e99fe9e
1 changed files with 4 additions and 8 deletions
  1. +4
    -8
      libavfilter/vf_perspective.c

+ 4
- 8
libavfilter/vf_perspective.c 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


Loading…
Cancel
Save