aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-04-29 12:26:15 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-04-29 12:26:15 +0200
commite92862e75f3174bffac8ed81ee0d20ce5feb9c4e (patch)
tree123e556ba67d28a654205e012b605ef679727b56
parentb691bc424f53f76c0d3aef36b4c7acc15b3dc3e9 (diff)
downloadffmpeg-e92862e75f3174bffac8ed81ee0d20ce5feb9c4e.tar.gz
avfilter/vf_tinterlace: fix handling of not so even sizes
Fixes green bottom line Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavfilter/vf_tinterlace.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavfilter/vf_tinterlace.c b/libavfilter/vf_tinterlace.c
index 13b8ce286a..598e3147b9 100644
--- a/libavfilter/vf_tinterlace.c
+++ b/libavfilter/vf_tinterlace.c
@@ -175,7 +175,7 @@ void copy_picture_field(uint8_t *dst[4], int dst_linesize[4],
int h, i;
for (plane = 0; plane < desc->nb_components; plane++) {
- int lines = plane == 1 || plane == 2 ? src_h >> vsub : src_h;
+ int lines = plane == 1 || plane == 2 ? -((-src_h) >> vsub) : src_h;
int linesize = av_image_get_linesize(format, w, plane);
uint8_t *dstp = dst[plane];
const uint8_t *srcp = src[plane];
@@ -183,7 +183,7 @@ void copy_picture_field(uint8_t *dst[4], int dst_linesize[4],
if (linesize < 0)
return;
- lines /= k;
+ lines = (lines + (src_field == FIELD_UPPER)) / k;
if (src_field == FIELD_LOWER)
srcp += src_linesize[plane];
if (interleave && dst_field == FIELD_LOWER)