summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinhard Nißl <rnissl@gmx.de>2007-08-26 22:05:41 +0200
committerReinhard Nißl <rnissl@gmx.de>2007-08-26 22:05:41 +0200
commit62d7654ffd81daef9d1f38d43d30b1e97675e614 (patch)
treeaece2bb4b39cfcf852a6a6d17fbb1101aa719684
parent195b53839e170cc4efe059784b1ebb31ce7707af (diff)
downloadxine-lib-62d7654ffd81daef9d1f38d43d30b1e97675e614.tar.gz
xine-lib-62d7654ffd81daef9d1f38d43d30b1e97675e614.tar.bz2
Provide options to control ondemand disabling of bob deinterlacing.
While disabling for progressive frames was ment to improve DVD playback, it turned out that many TV broadcasters set this flag too, although their content is not progressive. Adding an option allows the user now to enable this feature when the watched streams make correct use of this flag. Another option allows to disable bob deinterlacing when a scaled OSD is on screen. As bobbing adds some noise to horizontal lines the OSD quality might be improved by enabling this option.
-rw-r--r--src/video_out/video_out_xxmc.c38
-rw-r--r--src/video_out/xxmc.h3
2 files changed, 39 insertions, 2 deletions
diff --git a/src/video_out/video_out_xxmc.c b/src/video_out/video_out_xxmc.c
index 60bd694b2..2cde18dac 100644
--- a/src/video_out/video_out_xxmc.c
+++ b/src/video_out/video_out_xxmc.c
@@ -1491,6 +1491,7 @@ static void xxmc_overlay_blend (vo_driver_t *this_gen, vo_frame_t *frame_gen,
xxmc_frame_t *frame = (xxmc_frame_t *) frame_gen;
if (overlay->rle) {
+ this->scaled_osd_active = !overlay->unscaled;
if( overlay->unscaled ) {
if( this->ovl_changed && this->xoverlay ) {
XLockDisplay (this->display);
@@ -1618,7 +1619,8 @@ static void xxmc_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen)
* other than 100 %, so let's disable deinterlacing at all for this frame
*/
if (this->deinterlace_enabled && this->bob) {
- disable_deinterlace = frame->vo_frame.progressive_frame
+ disable_deinterlace = this->disable_bob_for_progressive_frames && frame->vo_frame.progressive_frame
+ || this->disable_bob_for_scaled_osd && this->scaled_osd_active
|| !frame->vo_frame.stream
|| xine_get_param(frame->vo_frame.stream, XINE_PARAM_FINE_SPEED) != XINE_FINE_SPEED_NORMAL;
if (!disable_deinterlace) {
@@ -1629,6 +1631,12 @@ static void xxmc_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen)
}
/*
+ * reset this flag now -- it will be set again before the next call to
+ * xxmc_display_frame() as long as there is a scaled OSD active on screen.
+ */
+ this->scaled_osd_active = 0;
+
+ /*
* queue frames (deinterlacing)
* free old frames
*/
@@ -2182,6 +2190,18 @@ static void xxmc_update_bob(void *this_gen, xine_cfg_entry_t *entry) {
this->bob = entry->num_value;
}
+static void xxmc_update_disable_bob_for_progressive_frames(void *this_gen, xine_cfg_entry_t *entry) {
+ xxmc_driver_t *this = (xxmc_driver_t *) this_gen;
+
+ this->disable_bob_for_progressive_frames = entry->num_value;
+}
+
+static void xxmc_update_disable_bob_for_scaled_osd(void *this_gen, xine_cfg_entry_t *entry) {
+ xxmc_driver_t *this = (xxmc_driver_t *) this_gen;
+
+ this->disable_bob_for_scaled_osd = entry->num_value;
+}
+
static void checkXvMCCap( xxmc_driver_t *this, XvPortID xv_port)
{
@@ -2648,9 +2668,23 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
config->register_bool (config, "video.device.xvmc_bob_deinterlacing", 0,
_("Use bob as accelerated deinterlace method."),
_("When interlacing is enabled for hardware accelerated frames,\n"
- "Alternate between top and bottom field at double the frame rate.\n"),
+ "alternate between top and bottom field at double the frame rate.\n"),
10, xxmc_update_bob, this);
+ this->disable_bob_for_progressive_frames =
+ config->register_bool (config, "video.device.xvmc_disable_bob_deinterlacing_for_progressive_frames", 0,
+ _("Don't use bob deinterlacing for progressive frames."),
+ _("Progressive frames don't need deinterlacing, so disabling it on\n"
+ "demand should result in a better picture.\n"),
+ 10, xxmc_update_disable_bob_for_progressive_frames, this);
+
+ this->disable_bob_for_scaled_osd =
+ config->register_bool (config, "video.device.xvmc_disable_bob_deinterlacing_for_scaled_osd", 0,
+ _("Don't use bob deinterlacing while a scaled OSD is active."),
+ _("Bob deinterlacing adds some noise to horizontal lines, so disabling it\n"
+ "on demand should result in a better OSD picture.\n"),
+ 10, xxmc_update_disable_bob_for_scaled_osd, this);
+
this->deinterlace_enabled = 0;
this->cur_field = XVMC_FRAME_PICTURE;
diff --git a/src/video_out/xxmc.h b/src/video_out/xxmc.h
index d5c067d36..a25e651e4 100644
--- a/src/video_out/xxmc.h
+++ b/src/video_out/xxmc.h
@@ -205,6 +205,9 @@ struct xxmc_driver_s {
xxmc_frame_t *cur_frame;
int cur_field;
int bob;
+ int disable_bob_for_progressive_frames;
+ int disable_bob_for_scaled_osd;
+ int scaled_osd_active;
x11osd *xoverlay;
int xv_xoverlay_type;
int xoverlay_type;