From 37a3c50f6f598987afb1559fd6c936803aa318e9 Mon Sep 17 00:00:00 2001 From: Andreas Auras Date: Thu, 3 Mar 2011 14:21:51 +0100 Subject: Configurable enabling of video properties noise and sharpness depending on actual video format (SD or HDTV) for vdpau output driver. With the new configuration parameter 'video.output.vdpau_sd_only_properties" enabling of this video properties can be restricted to SD video only. Videos with a frame width < 800 are considered as SD videos. Often noise and sharpness corrections are only necessary for SD videos and are counterproductive to HDTV videos. With the restriction enabled the user do not have to correct these settings each time the format changes. --HG-- extra : rebase_source : 874a98cd3e9fc64084c0b5c2e9a7eec34414db2a --- src/video_out/video_out_vdpau.c | 37 +++++++++++++++++++++++++++++++++++-- 1 file 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"), -- cgit v1.2.3