diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-01-06 22:38:11 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-01-06 22:46:10 +0100 |
commit | f931b1ef450e67c211c6294788da3a1265c0af81 (patch) | |
tree | 596731cb8f9c0d46894d547de5ed5f023026e4ab | |
parent | 30cf755548a9c73753db6c405bda935016a86f49 (diff) | |
parent | 696141e898193311c994b399a8dc60713709092f (diff) | |
download | ffmpeg-f931b1ef450e67c211c6294788da3a1265c0af81.tar.gz |
Merge commit '696141e898193311c994b399a8dc60713709092f'
* commit '696141e898193311c994b399a8dc60713709092f':
vf_interlace: use image width rather than linesize
Conflicts:
libavfilter/vf_interlace.c
See: f043965cd5145d8540d55c013b0d809b6a874c53
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavfilter/vf_interlace.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libavfilter/vf_interlace.c b/libavfilter/vf_interlace.c index 2828e36680..8e3c069fa3 100644 --- a/libavfilter/vf_interlace.c +++ b/libavfilter/vf_interlace.c @@ -132,16 +132,17 @@ static void copy_picture_field(InterlaceContext *s, int lowpass) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); + int hsub = desc->log2_chroma_w; int vsub = desc->log2_chroma_h; int plane, j; for (plane = 0; plane < desc->nb_components; plane++) { + int cols = (plane == 1 || plane == 2) ? -(-inlink->w) >> hsub : inlink->w; int lines = (plane == 1 || plane == 2) ? FF_CEIL_RSHIFT(inlink->h, vsub) : inlink->h; - ptrdiff_t linesize = av_image_get_linesize(inlink->format, inlink->w, plane); uint8_t *dstp = dst_frame->data[plane]; const uint8_t *srcp = src_frame->data[plane]; - av_assert0(linesize >= 0); + av_assert0(cols >= 0); lines = (lines + (field_type == FIELD_UPPER)) / 2; if (field_type == FIELD_LOWER) @@ -158,14 +159,14 @@ static void copy_picture_field(InterlaceContext *s, srcp_above = srcp; // there is no line above if (j == 1) srcp_below = srcp; // there is no line below - s->lowpass_line(dstp, linesize, srcp, srcp_above, srcp_below); + s->lowpass_line(dstp, cols, srcp, srcp_above, srcp_below); dstp += dstp_linesize; srcp += srcp_linesize; } } else { av_image_copy_plane(dstp, dst_frame->linesize[plane] * 2, srcp, src_frame->linesize[plane] * 2, - linesize, lines); + cols, lines); } } } |