diff options
-rw-r--r-- | src/video_out/video_out_vdpau.c | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/src/video_out/video_out_vdpau.c b/src/video_out/video_out_vdpau.c index d44ac616d..e807a2399 100644 --- a/src/video_out/video_out_vdpau.c +++ b/src/video_out/video_out_vdpau.c @@ -90,6 +90,14 @@ char* vdpau_deinterlacer_description [] = { }; +char *vdpau_sd_only_properties[] = { + "none", + "noise", + "sharpness", + "noise+sharpness", + NULL +}; + VdpOutputSurfaceRenderBlendState blend = { VDP_OUTPUT_SURFACE_RENDER_BLEND_STATE_VERSION, VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE, @@ -391,6 +399,7 @@ typedef struct { int enable_inverse_telecine; int honor_progressive; int skip_chroma; + int sd_only_properties; int studio_levels; int background; @@ -1353,7 +1362,7 @@ static void vdpau_update_noise( vdpau_driver_t *this_gen ) return; float value = this_gen->noise/100.0; - if ( value==0 ) { + if ( value==0 || ((this_gen->sd_only_properties & 1) && this_gen->video_mixer_width >= 800)) { VdpVideoMixerFeature features[] = { VDP_VIDEO_MIXER_FEATURE_NOISE_REDUCTION }; VdpBool feature_enables[] = { 0 }; vdp_video_mixer_set_feature_enables( this_gen->video_mixer, 1, features, feature_enables ); @@ -1382,7 +1391,7 @@ static void vdpau_update_sharpness( vdpau_driver_t *this_gen ) return; float value = this_gen->sharpness/100.0; - if ( value==0 ) { + if ( value==0 || (this_gen->sd_only_properties >= 2 && this_gen->video_mixer_width >= 800)) { VdpVideoMixerFeature features[] = { VDP_VIDEO_MIXER_FEATURE_SHARPNESS }; VdpBool feature_enables[] = { 0 }; vdp_video_mixer_set_feature_enables( this_gen->video_mixer, 1, features, feature_enables ); @@ -1405,6 +1414,18 @@ static void vdpau_update_sharpness( vdpau_driver_t *this_gen ) +static void vdpau_update_sd_only_properties( void *this_gen, xine_cfg_entry_t *entry ) +{ + vdpau_driver_t *this = (vdpau_driver_t *) this_gen; + + this->sd_only_properties = entry->num_value; + printf( "vo_vdpau: enable sd only noise=%d, sd only sharpness %d\n", ((this->sd_only_properties & 1) != 0), (this->sd_only_properties >= 2) ); + vdpau_update_noise(this); + vdpau_update_sharpness(this); +} + + + static void vdpau_update_csc( vdpau_driver_t *this_gen ) { float hue = this_gen->hue/100.0; @@ -2735,6 +2756,18 @@ static vo_driver_t *vdpau_open_plugin (video_driver_class_t *class_gen, const vo 10, vdpau_set_background, this ); } + this->sd_only_properties = config->register_enum( config, "video.output.vdpau_sd_only_properties", 0, vdpau_sd_only_properties, + _("vdpau: restrict enabling video properties for SD video only"), + _("none\n" + "No restrictions\n\n" + "noise\n" + "Restrict noise reduction property.\n\n" + "sharpness\n" + "Restrict sharpness property.\n\n" + "noise+sharpness" + "Restrict noise and sharpness properties.\n\n"), + 10, vdpau_update_sd_only_properties, this ); + /* number of video frames from config - register it with the default value. */ int frame_num = config->register_num (config, "engine.buffers.video_num_frames", 15, /* default */ _("default number of video frames"), |