|
|
@ -251,16 +251,6 @@ static void filter(AVFilterContext *ctx, AVFrame *dstpic, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static av_cold void uninit(AVFilterContext *ctx) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
YADIFContext *yadif = ctx->priv; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
av_frame_free(&yadif->prev); |
|
|
|
|
|
|
|
av_frame_free(&yadif->cur ); |
|
|
|
|
|
|
|
av_frame_free(&yadif->next); |
|
|
|
|
|
|
|
ff_ccfifo_uninit(&yadif->cc_fifo); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static const enum AVPixelFormat pix_fmts[] = { |
|
|
|
static const enum AVPixelFormat pix_fmts[] = { |
|
|
|
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, |
|
|
|
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, |
|
|
|
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV440P, |
|
|
|
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV440P, |
|
|
@ -285,26 +275,9 @@ static int config_output(AVFilterLink *outlink) |
|
|
|
YADIFContext *s = ctx->priv; |
|
|
|
YADIFContext *s = ctx->priv; |
|
|
|
int ret; |
|
|
|
int ret; |
|
|
|
|
|
|
|
|
|
|
|
outlink->time_base = av_mul_q(ctx->inputs[0]->time_base, (AVRational){1, 2}); |
|
|
|
ret = ff_yadif_config_output_common(outlink); |
|
|
|
outlink->w = ctx->inputs[0]->w; |
|
|
|
if (ret < 0) |
|
|
|
outlink->h = ctx->inputs[0]->h; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(s->mode & 1) |
|
|
|
|
|
|
|
outlink->frame_rate = av_mul_q(ctx->inputs[0]->frame_rate, |
|
|
|
|
|
|
|
(AVRational){2, 1}); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
outlink->frame_rate = ctx->inputs[0]->frame_rate; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ret = ff_ccfifo_init(&s->cc_fifo, outlink->frame_rate, ctx); |
|
|
|
|
|
|
|
if (ret < 0) { |
|
|
|
|
|
|
|
av_log(ctx, AV_LOG_ERROR, "Failure to setup CC FIFO queue\n"); |
|
|
|
|
|
|
|
return ret; |
|
|
|
return ret; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (outlink->w < 3 || outlink->h < 3) { |
|
|
|
|
|
|
|
av_log(ctx, AV_LOG_ERROR, "Video of less than 3 columns or lines is not supported\n"); |
|
|
|
|
|
|
|
return AVERROR(EINVAL); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
s->csp = av_pix_fmt_desc_get(outlink->format); |
|
|
|
s->csp = av_pix_fmt_desc_get(outlink->format); |
|
|
|
s->filter = filter; |
|
|
|
s->filter = filter; |
|
|
@ -354,7 +327,7 @@ const AVFilter ff_vf_yadif = { |
|
|
|
.description = NULL_IF_CONFIG_SMALL("Deinterlace the input image."), |
|
|
|
.description = NULL_IF_CONFIG_SMALL("Deinterlace the input image."), |
|
|
|
.priv_size = sizeof(YADIFContext), |
|
|
|
.priv_size = sizeof(YADIFContext), |
|
|
|
.priv_class = &yadif_class, |
|
|
|
.priv_class = &yadif_class, |
|
|
|
.uninit = uninit, |
|
|
|
.uninit = ff_yadif_uninit, |
|
|
|
FILTER_INPUTS(avfilter_vf_yadif_inputs), |
|
|
|
FILTER_INPUTS(avfilter_vf_yadif_inputs), |
|
|
|
FILTER_OUTPUTS(avfilter_vf_yadif_outputs), |
|
|
|
FILTER_OUTPUTS(avfilter_vf_yadif_outputs), |
|
|
|
FILTER_PIXFMTS_ARRAY(pix_fmts), |
|
|
|
FILTER_PIXFMTS_ARRAY(pix_fmts), |
|
|
|