summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-07-07 15:18:56 +0200
committerwm4 <wm4@nowhere>2015-07-07 15:18:56 +0200
commit25755f5fe75ad2a4ac9fb4ecf70f7bdf7a58a04c (patch)
treedf2a9d0d30287f0a94aa87dcadecd0c15c1f2a54
parent92727e7332cd8c9237552675fd8e8dba9b1a4127 (diff)
downloadmpv-25755f5fe75ad2a4ac9fb4ecf70f7bdf7a58a04c.tar.bz2
mpv-25755f5fe75ad2a4ac9fb4ecf70f7bdf7a58a04c.tar.xz
vf_yadif: expose interlaced frame mode
Also remove the enabled suboption, which did nothing. (It was probably broken at some point.)
-rw-r--r--DOCS/man/vf.rst9
-rw-r--r--video/filter/vf_yadif.c14
2 files changed, 9 insertions, 14 deletions
diff --git a/DOCS/man/vf.rst b/DOCS/man/vf.rst
index f1c4cf04b9..c9f080e0b4 100644
--- a/DOCS/man/vf.rst
+++ b/DOCS/man/vf.rst
@@ -518,7 +518,7 @@ Available filters are:
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.
-``yadif=[mode[:enabled=yes|no]]``
+``yadif=[mode:interlaced-only]``
Yet another deinterlacing filter
``<mode>``
@@ -527,10 +527,9 @@ Available filters are:
:frame-nospatial: Like ``frame`` but skips spatial interlacing check.
:field-nospatial: Like ``field`` but skips spatial interlacing check.
- ``<enabled>``
- :yes: Filter is active (default).
- :no: Filter is not active, but can be activated with the ``D`` key
- (or any other key that toggles the ``deinterlace`` property).
+ ``<interlaced-only>``
+ :no: Deinterlace all frames (default).
+ :yes: Only deinterlace frames marked as interlaced.
This filter, is automatically inserted when using the ``D`` key (or any
other key that toggles the ``deinterlace`` property or when using the
diff --git a/video/filter/vf_yadif.c b/video/filter/vf_yadif.c
index 6526283af1..7bfd209475 100644
--- a/video/filter/vf_yadif.c
+++ b/video/filter/vf_yadif.c
@@ -28,14 +28,10 @@
struct vf_priv_s {
int mode;
- int do_deinterlace;
+ int interlaced_only;
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)
{
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
// 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".
- const char *mode[] = {"", "send_field", "send_frame_nospatial",
+ const char *mode[] = {"send_frame", "send_field", "send_frame_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;
}
@@ -62,7 +59,7 @@ static const m_option_t vf_opts_fields[] = {
{"field", 1},
{"frame-nospatial", 2},
{"field-nospatial", 3})),
- OPT_FLAG("enabled", do_deinterlace, 0),
+ OPT_FLAG("interlaced-only", interlaced_only, 0),
OPT_SUBSTRUCT("", lw_opts, vf_lw_conf, 0),
{0}
};
@@ -72,6 +69,5 @@ const vf_info_t vf_info_yadif = {
.name = "yadif",
.open = vf_open,
.priv_size = sizeof(struct vf_priv_s),
- .priv_defaults = &vf_priv_default,
.options = vf_opts_fields,
};