summaryrefslogtreecommitdiffstats
path: root/video/filter/vf_vdpaupp.c
diff options
context:
space:
mode:
author1nsane000 <33362569+1nsane000@users.noreply.github.com>2024-02-21 01:55:36 +0100
committerPhilip Langdale <github.philipl@overt.org>2024-03-04 17:41:40 -0800
commit03bfd797f6d8d703601aad1065194c760d8927dd (patch)
tree20e66ae0646dac493b4cbb3717316785d011ce1e /video/filter/vf_vdpaupp.c
parent5b52d4497206f9d977f0f1bbf08c396e76dd619f (diff)
downloadmpv-03bfd797f6d8d703601aad1065194c760d8927dd.tar.bz2
mpv-03bfd797f6d8d703601aad1065194c760d8927dd.tar.xz
video/filter: add field order support for built in deinterlacers
refqueue gets the field of the frame from mp_image which almost always(if not always) assumes bottom field order first. By default this behavior should not change but specifying the field order should bypass this.
Diffstat (limited to 'video/filter/vf_vdpaupp.c')
-rw-r--r--video/filter/vf_vdpaupp.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/video/filter/vf_vdpaupp.c b/video/filter/vf_vdpaupp.c
index b8a5d4194f..b5434cdfbc 100644
--- a/video/filter/vf_vdpaupp.c
+++ b/video/filter/vf_vdpaupp.c
@@ -43,6 +43,7 @@
struct opts {
bool deint_enabled;
bool interlaced_only;
+ int field_parity;
struct mp_vdpau_mixer_opts opts;
};
@@ -156,6 +157,8 @@ static struct mp_filter *vf_vdpaupp_create(struct mp_filter *parent, void *optio
(p->opts->interlaced_only ? MP_MODE_INTERLACED_ONLY : 0) |
(p->opts->opts.deint >= 2 ? MP_MODE_OUTPUT_FIELDS : 0));
+ mp_refqueue_set_parity(p->queue, p->opts->field_parity);
+
mp_refqueue_add_in_format(p->queue, IMGFMT_VDPAU, 0);
return f;
@@ -180,6 +183,10 @@ static const m_option_t vf_opts_fields[] = {
{"sharpen", OPT_FLOAT(opts.sharpen), M_RANGE(-1, 1)},
{"hqscaling", OPT_INT(opts.hqscaling), M_RANGE(0, 9)},
{"interlaced-only", OPT_BOOL(interlaced_only)},
+ {"parity", OPT_CHOICE(field_parity,
+ {"tff", MP_FIELD_PARITY_TFF},
+ {"bff", MP_FIELD_PARITY_BFF},
+ {"auto", MP_FIELD_PARITY_AUTO})},
{0}
};
@@ -188,6 +195,9 @@ const struct mp_user_filter_entry vf_vdpaupp = {
.description = "vdpau postprocessing",
.name = "vdpaupp",
.priv_size = sizeof(OPT_BASE_STRUCT),
+ .priv_defaults = &(const OPT_BASE_STRUCT){
+ .field_parity = MP_FIELD_PARITY_AUTO,
+ },
.options = vf_opts_fields,
},
.create = vf_vdpaupp_create,