vf_yadif: expose interlaced frame mode

Also remove the enabled suboption, which did nothing. (It was probably
broken at some point.)
This commit is contained in:
wm4 2015-07-07 15:18:56 +02:00
parent 92727e7332
commit 25755f5fe7
2 changed files with 9 additions and 14 deletions

View File

@ -518,7 +518,7 @@ Available filters are:
video. The main purpose of setting ``mp`` to a chroma plane is to reduce video. The main purpose of setting ``mp`` to a chroma plane is to reduce
CPU load and make pullup usable in realtime on slow machines. CPU load and make pullup usable in realtime on slow machines.
``yadif=[mode[:enabled=yes|no]]`` ``yadif=[mode:interlaced-only]``
Yet another deinterlacing filter Yet another deinterlacing filter
``<mode>`` ``<mode>``
@ -527,10 +527,9 @@ Available filters are:
:frame-nospatial: Like ``frame`` but skips spatial interlacing check. :frame-nospatial: Like ``frame`` but skips spatial interlacing check.
:field-nospatial: Like ``field`` but skips spatial interlacing check. :field-nospatial: Like ``field`` but skips spatial interlacing check.
``<enabled>`` ``<interlaced-only>``
:yes: Filter is active (default). :no: Deinterlace all frames (default).
:no: Filter is not active, but can be activated with the ``D`` key :yes: Only deinterlace frames marked as interlaced.
(or any other key that toggles the ``deinterlace`` property).
This filter, is automatically inserted when using the ``D`` key (or any This filter, is automatically inserted when using the ``D`` key (or any
other key that toggles the ``deinterlace`` property or when using the other key that toggles the ``deinterlace`` property or when using the

View File

@ -28,14 +28,10 @@
struct vf_priv_s { struct vf_priv_s {
int mode; int mode;
int do_deinterlace; int interlaced_only;
struct vf_lw_opts *lw_opts; struct vf_lw_opts *lw_opts;
}; };
static const struct vf_priv_s vf_priv_default = {
.do_deinterlace = 1,
};
static int vf_open(vf_instance_t *vf) static int vf_open(vf_instance_t *vf)
{ {
struct vf_priv_s *p = vf->priv; struct vf_priv_s *p = vf->priv;
@ -43,10 +39,11 @@ static int vf_open(vf_instance_t *vf)
// Earlier libavfilter yadif versions used pure integers for the first // Earlier libavfilter yadif versions used pure integers for the first
// option. We can't/don't handle this, but at least allow usage of the // option. We can't/don't handle this, but at least allow usage of the
// filter with default settings. So use an empty string for "send_frame". // filter with default settings. So use an empty string for "send_frame".
const char *mode[] = {"", "send_field", "send_frame_nospatial", const char *mode[] = {"send_frame", "send_field", "send_frame_nospatial",
"send_field_nospatial"}; "send_field_nospatial"};
if (vf_lw_set_graph(vf, p->lw_opts, "yadif", "%s", mode[p->mode]) >= 0) if (vf_lw_set_graph(vf, p->lw_opts, "yadif", "mode=%s:deint=%s", mode[p->mode],
p->interlaced_only ? "interlaced" : "all") >= 0)
{ {
return 1; return 1;
} }
@ -62,7 +59,7 @@ static const m_option_t vf_opts_fields[] = {
{"field", 1}, {"field", 1},
{"frame-nospatial", 2}, {"frame-nospatial", 2},
{"field-nospatial", 3})), {"field-nospatial", 3})),
OPT_FLAG("enabled", do_deinterlace, 0), OPT_FLAG("interlaced-only", interlaced_only, 0),
OPT_SUBSTRUCT("", lw_opts, vf_lw_conf, 0), OPT_SUBSTRUCT("", lw_opts, vf_lw_conf, 0),
{0} {0}
}; };
@ -72,6 +69,5 @@ const vf_info_t vf_info_yadif = {
.name = "yadif", .name = "yadif",
.open = vf_open, .open = vf_open,
.priv_size = sizeof(struct vf_priv_s), .priv_size = sizeof(struct vf_priv_s),
.priv_defaults = &vf_priv_default,
.options = vf_opts_fields, .options = vf_opts_fields,
}; };