Commit 07946c4e authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

vdpau: optional high quality scaling

parent c0090b15
...@@ -55,7 +55,7 @@ static VdpVideoMixer MixerCreate(filter_t *filter) ...@@ -55,7 +55,7 @@ static VdpVideoMixer MixerCreate(filter_t *filter)
VdpBool ok; VdpBool ok;
/* Check for potentially useful features */ /* Check for potentially useful features */
VdpVideoMixerFeature featv[2]; VdpVideoMixerFeature featv[3];
unsigned featc = 0; unsigned featc = 0;
const float noise = var_InheritFloat(filter, "vdpau-noise-reduction"); const float noise = var_InheritFloat(filter, "vdpau-noise-reduction");
...@@ -78,6 +78,23 @@ static VdpVideoMixer MixerCreate(filter_t *filter) ...@@ -78,6 +78,23 @@ static VdpVideoMixer MixerCreate(filter_t *filter)
featv[featc++] = VDP_VIDEO_MIXER_FEATURE_SHARPNESS; featv[featc++] = VDP_VIDEO_MIXER_FEATURE_SHARPNESS;
} }
const int offset = VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1 - 1;
unsigned level = var_InheritInteger(filter, "vdpau-scaling");
while (level > 0)
{
err = vdp_video_mixer_query_feature_support(sys->vdp, sys->device,
offset + level, &ok);
if (err == VDP_STATUS_OK && ok == VDP_TRUE)
{
msg_Dbg(filter, "using video mixer high quality scaling L%u",
level);
featv[featc++] = offset + level;
break;
}
level--; /* fallback to lower quality */
}
/* Create the mixer */ /* Create the mixer */
VdpVideoMixerParameter parms[3] = { VdpVideoMixerParameter parms[3] = {
VDP_VIDEO_MIXER_PARAMETER_VIDEO_SURFACE_WIDTH, VDP_VIDEO_MIXER_PARAMETER_VIDEO_SURFACE_WIDTH,
...@@ -112,6 +129,9 @@ static VdpVideoMixer MixerCreate(filter_t *filter) ...@@ -112,6 +129,9 @@ static VdpVideoMixer MixerCreate(filter_t *filter)
attrc++; attrc++;
} }
if (level > 0)
featv[featc++] = offset + level;
if (featc > 0) if (featc > 0)
{ {
VdpBool enablev[featc]; VdpBool enablev[featc];
...@@ -570,6 +590,8 @@ vlc_module_begin() ...@@ -570,6 +590,8 @@ vlc_module_begin()
add_float_with_range("vdpau-noise-reduction", 0., 0., 1., add_float_with_range("vdpau-noise-reduction", 0., 0., 1.,
N_("Noise reduction level"), N_("Noise reduction level"), true) N_("Noise reduction level"), N_("Noise reduction level"), true)
add_integer_with_range("vdpau-scaling", 0, 0, 9,
N_("Scaling quality"), N_("High quality scaling level"), true)
add_submodule() add_submodule()
set_callbacks(YCbCrOpen, YCbCrClose) set_callbacks(YCbCrOpen, YCbCrClose)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment