From b84871b8eba5370afd5f0cef0f5cbd481291be01 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 30 Dec 2012 16:59:52 +0100 Subject: [PATCH] vf_tinterlace: dont mix declarations and expressions Signed-off-by: Michael Niedermayer --- libavfilter/vf_tinterlace.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavfilter/vf_tinterlace.c b/libavfilter/vf_tinterlace.c index e34a7d2a6e..6d6f6729a2 100644 --- a/libavfilter/vf_tinterlace.c +++ b/libavfilter/vf_tinterlace.c @@ -185,6 +185,7 @@ void copy_picture_field(uint8_t *dst[4], int dst_linesize[4], const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(format); int plane, vsub = desc->log2_chroma_h; int k = src_field == FIELD_UPPER_AND_LOWER ? 1 : 2; + int h, i; for (plane = 0; plane < desc->nb_components; plane++) { int lines = plane == 1 || plane == 2 ? src_h >> vsub : src_h; @@ -206,12 +207,12 @@ void copy_picture_field(uint8_t *dst[4], int dst_linesize[4], // Filtering will reduce interlace 'twitter' and Moire patterning. int srcp_linesize = src_linesize[plane] * k; int dstp_linesize = dst_linesize[plane] * (interleave ? 2 : 1); - for (int h = lines; h > 0; h--) { + for (h = lines; h > 0; h--) { const uint8_t *srcp_above = srcp - src_linesize[plane]; const uint8_t *srcp_below = srcp + src_linesize[plane]; if (h == lines) srcp_above = srcp; // there is no line above if (h == 1) srcp_below = srcp; // there is no line below - for (int i = 0; i < linesize; i++) { + for (i = 0; i < linesize; i++) { // this calculation is an integer representation of // '0.5 * current + 0.25 * above + 0.25 + below' // '1 +' is for rounding. */