diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-11-15 18:39:48 +0200 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-11-15 18:39:48 +0200 |
commit | 14bb3416c735e99cbf0507548d3f3fcbba0fba7f (patch) | |
tree | cae9d476b0b381a5af124f9ff7f5074af1d44320 /libvo/vo_vdpau.c | |
parent | 82ee2e217f8f9ec67bcbd3b6b60f49a003da9300 (diff) | |
download | mpv-14bb3416c735e99cbf0507548d3f3fcbba0fba7f.tar.bz2 mpv-14bb3416c735e99cbf0507548d3f3fcbba0fba7f.tar.xz |
vo_vdpau: Add support for high-quality scaling feature
Part of the code is currently under #ifdef to allow compilation with
older VDPAU library versions; that can be removed later.
Partially based on a patch by Carl Eugen Hoyos.
Diffstat (limited to 'libvo/vo_vdpau.c')
-rw-r--r-- | libvo/vo_vdpau.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/libvo/vo_vdpau.c b/libvo/vo_vdpau.c index 26314a948a..b48f44052a 100644 --- a/libvo/vo_vdpau.c +++ b/libvo/vo_vdpau.c @@ -132,6 +132,7 @@ struct vdpctx { int pullup; float denoise; float sharpen; + int hqscaling; int chroma_deint; int top_field_first; bool flip; @@ -576,7 +577,7 @@ static int create_vdp_mixer(struct vo *vo, VdpChromaType vdp_chroma_type) struct vdpctx *vc = vo->priv; struct vdp_functions *vdp = vc->vdp; #define VDP_NUM_MIXER_PARAMETER 3 -#define MAX_NUM_FEATURES 5 +#define MAX_NUM_FEATURES 6 int i; VdpStatus vdp_st; @@ -616,6 +617,25 @@ static int create_vdp_mixer(struct vo *vo, VdpChromaType vdp_chroma_type) features[feature_count++] = VDP_VIDEO_MIXER_FEATURE_NOISE_REDUCTION; if (vc->sharpen) features[feature_count++] = VDP_VIDEO_MIXER_FEATURE_SHARPNESS; + if (vc->hqscaling) { +#ifndef VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1 + mp_msg(MSGT_VO, MSGL_ERR, "[vdpau] MPlayer was compiled with (old?)" + "libvdpau headers with no support for requested hqscaling.\n"); +#else + VdpVideoMixerFeature hqscaling_feature = + VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1 + vc->hqscaling-1; + VdpBool hqscaling_available; + vdp_st = vdp->video_mixer_query_feature_support(vc->vdp_device, + hqscaling_feature, + &hqscaling_available); + CHECK_ST_ERROR("Error when calling video_mixer_query_feature_support"); + if (hqscaling_available) + features[feature_count++] = hqscaling_feature; + else + mp_msg(MSGT_VO, MSGL_ERR, "[vdpau] Your hardware or VDPAU " + "library does not support requested hqscaling.\n"); + } +#endif vdp_st = vdp->video_mixer_create(vc->vdp_device, feature_count, features, VDP_NUM_MIXER_PARAMETER, @@ -1592,10 +1612,12 @@ static int preinit(struct vo *vo, const char *arg) {"denoise", OPT_ARG_FLOAT, &vc->denoise, NULL}, {"sharpen", OPT_ARG_FLOAT, &vc->sharpen, NULL}, {"colorspace", OPT_ARG_INT, &vc->user_colorspace, NULL}, + {"hqscaling", OPT_ARG_INT, &vc->hqscaling, NULL}, {"fps", OPT_ARG_FLOAT, &vc->user_fps, NULL}, {NULL} }; - if (subopt_parse(arg, subopts) != 0) { + if (subopt_parse(arg, subopts) != 0 || vc->hqscaling < 0 + || vc->hqscaling > 9) { mp_msg(MSGT_VO, MSGL_FATAL, help_msg); return -1; } |