summaryrefslogtreecommitdiff
path: root/libavfilter/vf_yadif.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavfilter/vf_yadif.c')
-rw-r--r--libavfilter/vf_yadif.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c
index b498ab9d39..a0a5e05526 100644
--- a/libavfilter/vf_yadif.c
+++ b/libavfilter/vf_yadif.c
@@ -1,24 +1,23 @@
/*
- * Copyright (C) 2006-2010 Michael Niedermayer <michaelni@gmx.at>
+ * Copyright (C) 2006-2011 Michael Niedermayer <michaelni@gmx.at>
* 2010 James Darnley <james.darnley@gmail.com>
*
- * This file is part of Libav.
- *
- * Libav is free software; you can redistribute it and/or modify
+ * FFmpeg is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
- * Libav is distributed in the hope that it will be useful,
+ * FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
- * with Libav; if not, write to the Free Software Foundation, Inc.,
+ * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#include "libavutil/avassert.h"
#include "libavutil/cpu.h"
#include "libavutil/common.h"
#include "libavutil/pixdesc.h"
@@ -217,7 +216,7 @@ static void return_frame(AVFilterContext *ctx, int is_second)
if (!yadif->csp)
yadif->csp = &av_pix_fmt_descriptors[link->format];
if (yadif->csp->comp[0].depth_minus1 / 8 == 1)
- yadif->filter_line = filter_line_c_16bit;
+ yadif->filter_line = (void*)filter_line_c_16bit;
filter(ctx, yadif->out, tff ^ !is_second, tff);
@@ -243,6 +242,8 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
AVFilterContext *ctx = link->dst;
YADIFContext *yadif = ctx->priv;
+ av_assert0(picref);
+
if (yadif->frame_pending)
return_frame(ctx, 1);
@@ -313,7 +314,7 @@ static int request_frame(AVFilterLink *link)
ret = ff_request_frame(link->src->inputs[0]);
- if (ret == AVERROR_EOF && yadif->next) {
+ if (ret == AVERROR_EOF && yadif->cur) {
AVFilterBufferRef *next = avfilter_ref_buffer(yadif->next, AV_PERM_READ);
next->pts = yadif->next->pts * 2 - yadif->cur->pts;
@@ -340,7 +341,7 @@ static int poll_frame(AVFilterLink *link)
if (val <= 0)
return val;
- if (val==1 && !yadif->next) { //FIXME change API to not requre this red tape
+ if (val >= 1 && !yadif->next) { //FIXME change API to not requre this red tape
if ((ret = ff_request_frame(link->src->inputs[0])) < 0)
return ret;
val = ff_poll_frame(link->src->inputs[0]);
@@ -386,6 +387,8 @@ static int query_formats(AVFilterContext *ctx)
AV_NE( PIX_FMT_YUV422P16BE, PIX_FMT_YUV422P16LE ),
AV_NE( PIX_FMT_YUV444P16BE, PIX_FMT_YUV444P16LE ),
PIX_FMT_YUVA420P,
+ PIX_FMT_YUVA422P,
+ PIX_FMT_YUVA444P,
PIX_FMT_NONE
};
@@ -433,22 +436,23 @@ static int config_props(AVFilterLink *link)
AVFilter avfilter_vf_yadif = {
.name = "yadif",
- .description = NULL_IF_CONFIG_SMALL("Deinterlace the input image"),
+ .description = NULL_IF_CONFIG_SMALL("Deinterlace the input image."),
.priv_size = sizeof(YADIFContext),
.init = init,
.uninit = uninit,
.query_formats = query_formats,
- .inputs = (AVFilterPad[]) {{ .name = "default",
+ .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO,
.start_frame = start_frame,
.get_video_buffer = get_video_buffer,
.draw_slice = null_draw_slice,
- .end_frame = end_frame, },
+ .end_frame = end_frame,
+ .rej_perms = AV_PERM_REUSE2, },
{ .name = NULL}},
- .outputs = (AVFilterPad[]) {{ .name = "default",
+ .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO,
.poll_frame = poll_frame,
.request_frame = request_frame,