summaryrefslogtreecommitdiff
path: root/libavfilter/vf_tinterlace.c
diff options
context:
space:
mode:
authorThomas Mundt <tmundt75@gmail.com>2017-04-20 23:26:59 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-04-22 20:12:15 +0200
commit207e6debf866ae4f8bdf864a5f389ef42660324d (patch)
tree87e4bb430785c39207f690ac9a1284e604f808d6 /libavfilter/vf_tinterlace.c
parent362f6c91e466b2114d0827c6d58e26e121ed11e8 (diff)
avfilter/interlace: change lowpass_line function prototype
Signed-off-by: Thomas Mundt <tmundt75@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavfilter/vf_tinterlace.c')
-rw-r--r--libavfilter/vf_tinterlace.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/libavfilter/vf_tinterlace.c b/libavfilter/vf_tinterlace.c
index 80146a9480..09ca4d30ee 100644
--- a/libavfilter/vf_tinterlace.c
+++ b/libavfilter/vf_tinterlace.c
@@ -89,8 +89,10 @@ static int query_formats(AVFilterContext *ctx)
}
static void lowpass_line_c(uint8_t *dstp, ptrdiff_t width, const uint8_t *srcp,
- const uint8_t *srcp_above, const uint8_t *srcp_below)
+ ptrdiff_t mref, ptrdiff_t pref)
{
+ const uint8_t *srcp_above = srcp + mref;
+ const uint8_t *srcp_below = srcp + pref;
int i;
for (i = 0; i < width; i++) {
// this calculation is an integer representation of
@@ -228,12 +230,12 @@ void copy_picture_field(TInterlaceContext *tinterlace,
int srcp_linesize = src_linesize[plane] * k;
int dstp_linesize = dst_linesize[plane] * (interleave ? 2 : 1);
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
+ ptrdiff_t pref = src_linesize[plane];
+ ptrdiff_t mref = -pref;
+ if (h == lines) mref = 0; // there is no line above
+ else if (h == 1) pref = 0; // there is no line below
- tinterlace->lowpass_line(dstp, cols, srcp, srcp_above, srcp_below);
+ tinterlace->lowpass_line(dstp, cols, srcp, mref, pref);
dstp += dstp_linesize;
srcp += srcp_linesize;
}