summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinhard Nißl <rnissl@gmx.de>2007-04-12 23:51:04 +0200
committerReinhard Nißl <rnissl@gmx.de>2007-04-12 23:51:04 +0200
commit60871f034457fb6727df480c311b76e81a4ca6fb (patch)
tree1a109d6ffa38ed69a347a5db901c4be9ca3a3de1
parent7b50cbef25c8e2769bfbdd801b7318bb86047f87 (diff)
downloadxine-lib-60871f034457fb6727df480c311b76e81a4ca6fb.tar.gz
xine-lib-60871f034457fb6727df480c311b76e81a4ca6fb.tar.bz2
Disable bob deinterlacing on a per frame decision.
There are some situations where bob deinterlacing doesn't make much sense, as the effect doesn't work for example for slow motion. And in fast motion mode, the sleep between displaying the two fields lowers the reachable fast motion frame rate. Another annoying effect is the reduction in vertical resolution for still images. The changed code tries to detect such issues and disables bob deinterlacing for such frames. The detection of still images is still to come.
-rw-r--r--src/video_out/video_out_xxmc.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/video_out/video_out_xxmc.c b/src/video_out/video_out_xxmc.c
index 37dad7a99..20ce00a5e 100644
--- a/src/video_out/video_out_xxmc.c
+++ b/src/video_out/video_out_xxmc.c
@@ -1588,6 +1588,7 @@ static void xxmc_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen)
xxmc_frame_t *frame = (xxmc_frame_t *) frame_gen;
xine_xxmc_t *xxmc = &frame->xxmc_data;
int first_field;
+ int disable_deinterlace = 0;
struct timeval tv_top;
/*
@@ -1596,6 +1597,19 @@ static void xxmc_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen)
gettimeofday(&tv_top, 0);
/*
+ * bob deinterlacing doesn't make much sense for still images or at replay speeds
+ * 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
+ || !frame->vo_frame.stream
+ || xine_get_param(frame->vo_frame.stream, XINE_PARAM_FINE_SPEED) != XINE_FINE_SPEED_NORMAL;
+ if (!disable_deinterlace) {
+ /* TODO: still frame detection */
+ }
+ }
+
+ /*
* queue frames (deinterlacing)
* free old frames
*/
@@ -1645,7 +1659,7 @@ static void xxmc_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen)
first_field = (frame->vo_frame.top_field_first) ? XVMC_TOP_FIELD : XVMC_BOTTOM_FIELD;
first_field = (this->bob) ? first_field : XVMC_TOP_FIELD;
- this->cur_field = (this->deinterlace_enabled) ? first_field : XVMC_FRAME_PICTURE;
+ this->cur_field = (this->deinterlace_enabled && !disable_deinterlace) ? first_field : XVMC_FRAME_PICTURE;
xxmc_redraw_needed (this_gen);
if (frame->format == XINE_IMGFMT_XXMC) {
@@ -1658,7 +1672,7 @@ static void xxmc_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen)
this->sc.output_width, this->sc.output_height,
this->cur_field);
XVMCUNLOCKDISPLAY( this->display );
- if (this->deinterlace_enabled && this->bob) {
+ if (this->deinterlace_enabled && !disable_deinterlace && this->bob) {
struct timeval tv_middle;
long us_spent_so_far, us_per_field = frame->vo_frame.duration * 50 / 9;