From 4781f9e69a074ded4404784138bccc231906b492 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 8 Jul 2015 13:40:06 +0200 Subject: vf_vavpp: don't attempt to deinterlace progressive frames --- DOCS/interface-changes.rst | 1 + DOCS/man/vf.rst | 4 ++++ video/filter/vf_vavpp.c | 7 +++++++ 3 files changed, 12 insertions(+) diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst index 48e25fb7b2..47ad7b5ae9 100644 --- a/DOCS/interface-changes.rst +++ b/DOCS/interface-changes.rst @@ -20,6 +20,7 @@ Interface changes :: --- mpv 0.10.0 will be released --- + - add vf yadif/vavpp interlaced-only suboptions - add --hwdec-preload - add ao coreaudio exclusive suboption - add ``track-list/N/forced`` property diff --git a/DOCS/man/vf.rst b/DOCS/man/vf.rst index 991dd64eca..0b2cf8154d 100644 --- a/DOCS/man/vf.rst +++ b/DOCS/man/vf.rst @@ -822,6 +822,10 @@ Available filters are: depends on the GPU hardware, the GPU drivers, driver bugs, and mpv bugs. + ```` + :no: Deinterlace all frames. + :yes: Only deinterlace frames marked as interlaced (default). + ``vdpaupp`` VDPAU video post processing. Works with ``--vo=vdpau`` and ``--vo=opengl`` only. This filter is automatically inserted if deinterlacing is requested diff --git a/video/filter/vf_vavpp.c b/video/filter/vf_vavpp.c index 642420a544..cb11e69cbb 100644 --- a/video/filter/vf_vavpp.c +++ b/video/filter/vf_vavpp.c @@ -58,6 +58,7 @@ struct pipeline { struct vf_priv_s { int deint_type; // 0: none, 1: discard, 2: double fps + int interlaced_only; bool do_deint; VABufferID buffers[VAProcFilterCount]; int num_buffers; @@ -86,6 +87,7 @@ static const struct vf_priv_s vf_priv_default = { .config = VA_INVALID_ID, .context = VA_INVALID_ID, .deint_type = 2, + .interlaced_only = 1, }; // The array items must match with the "deint" suboption values. @@ -254,6 +256,10 @@ static void output_frames(struct vf_instance *vf) } unsigned int csp = va_get_colorspace_flag(p->params.colorspace); unsigned int field = get_deint_field(p, 0, in); + if (field == VA_FRAME_PICTURE && p->interlaced_only) { + vf_add_output_frame(vf, mp_image_new_ref(in)); + return; + } struct mp_image *out1 = render(vf, in, field | csp); if (!out1) { // cannot render vf_add_output_frame(vf, mp_image_new_ref(in)); @@ -497,6 +503,7 @@ static const m_option_t vf_opts_fields[] = { {"weave", 3}, {"motion-adaptive", 4}, {"motion-compensated", 5})), + OPT_FLAG("interlaced-only", interlaced_only, 0), {0} }; -- cgit v1.2.3