Commit f931b1ef authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '696141e8'

* commit '696141e8':
  vf_interlace: use image width rather than linesize

Conflicts:
	libavfilter/vf_interlace.c

See: f043965cMerged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 30cf7555 696141e8
...@@ -132,16 +132,17 @@ static void copy_picture_field(InterlaceContext *s, ...@@ -132,16 +132,17 @@ static void copy_picture_field(InterlaceContext *s,
int lowpass) int lowpass)
{ {
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
int hsub = desc->log2_chroma_w;
int vsub = desc->log2_chroma_h; int vsub = desc->log2_chroma_h;
int plane, j; int plane, j;
for (plane = 0; plane < desc->nb_components; plane++) { 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; 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]; uint8_t *dstp = dst_frame->data[plane];
const uint8_t *srcp = src_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; lines = (lines + (field_type == FIELD_UPPER)) / 2;
if (field_type == FIELD_LOWER) if (field_type == FIELD_LOWER)
...@@ -158,14 +159,14 @@ static void copy_picture_field(InterlaceContext *s, ...@@ -158,14 +159,14 @@ static void copy_picture_field(InterlaceContext *s,
srcp_above = srcp; // there is no line above srcp_above = srcp; // there is no line above
if (j == 1) if (j == 1)
srcp_below = srcp; // there is no line below 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; dstp += dstp_linesize;
srcp += srcp_linesize; srcp += srcp_linesize;
} }
} else { } else {
av_image_copy_plane(dstp, dst_frame->linesize[plane] * 2, av_image_copy_plane(dstp, dst_frame->linesize[plane] * 2,
srcp, src_frame->linesize[plane] * 2, srcp, src_frame->linesize[plane] * 2,
linesize, lines); cols, lines);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment