diff options
author | Thomas Hellström <totte67@users.sourceforge.net> | 2005-04-09 11:47:27 +0000 |
---|---|---|
committer | Thomas Hellström <totte67@users.sourceforge.net> | 2005-04-09 11:47:27 +0000 |
commit | c1c082b44c4c97e0f4dc4909161fa8a472daa2e6 (patch) | |
tree | 11f96522b4ac918a0e8afb30b3a9c774a2e707ff | |
parent | 0cedd36dbc90961847cde63bbbe378874a14162f (diff) | |
download | xine-lib-c1c082b44c4c97e0f4dc4909161fa8a472daa2e6.tar.gz xine-lib-c1c082b44c4c97e0f4dc4909161fa8a472daa2e6.tar.bz2 |
Experimental bob deinterlacing support for the xxmc module.
Updated xxmc readme.
CVS patchset: 7451
CVS date: 2005/04/09 11:47:27
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | doc/README_xxmc.html | 61 | ||||
-rw-r--r-- | src/video_out/video_out_xxmc.c | 44 | ||||
-rw-r--r-- | src/video_out/xxmc.h | 4 |
4 files changed, 94 insertions, 16 deletions
@@ -1,4 +1,5 @@ xine-lib (1.1) + * Experimental bob deinterlacing support in the xxmc module xine-lib (1.0.1) * Big XvMC quality / correctness / cpu-usage fix. [bug #1114517] diff --git a/doc/README_xxmc.html b/doc/README_xxmc.html index 531b314ef..b1404f7d0 100644 --- a/doc/README_xxmc.html +++ b/doc/README_xxmc.html @@ -13,16 +13,27 @@ and installing Xine's xxmc plugin.</a> <ol> <li><a href="#mozTocId69222">Background</a></li> - <li><a href="#mozTocId160476">Needed drivers and libs</a></li> - <li><a href="#mozTocId849061">Configuring and installing</a></li> + <li><a href="#mozTocId160476">Needed drivers and +libs</a></li> + <li><a href="#mozTocId849061">Configuring and +installing</a></li> <li><a href="#mozTocId197304">Running the plugin</a> <ol> - <li><a href="#mozTocId437541">General</a></li> - <li><a href="#mozTocId374228">Caveats</a></li> + <li><a href="#mozTocId437541">General + </a></li> + <li><a href="#mozTocId374228">Caveats + </a></li> <li><a href="#mozTocId6059">Optimizing</a></li> <li><a href="#mozTocId769361">Deinterlacing</a></li> </ol> </li> + <li><a href="#mozTocId974751">Chips supporting XvMC acceleration +using the xxmc module.</a> + <ol> + <li><a href="#mozTocId803345">VIA Unichrome / Pro</a></li> + <li><a href="#mozTocId951553">Nvidia</a></li> + </ol> + </li> <li><a href="#mozTocId615875">FAQ</a></li> </ol> </li> @@ -31,7 +42,8 @@ and installing Xine's xxmc plugin.</a> The xine xxmc plugin supports playback with <br> <ul> <li>Standard XvMC, as supported by many Nvidia chips.</li> - <li>VLD XvMC, as supported by the VIA CLE266 chip, up to 1024x1024.<br> + <li>VLD XvMC, as supported by the VIA Unichrome / Pro chips, up to +1024x1024.<br> </li> <li>Standard Xv. The xxmc plugin will fall back to Xv if any of the above fails.</li> @@ -62,7 +74,8 @@ or <span style="font-family: monospace;">/usr/X11R6/lib/X11/XvMCConfig</span> and try to load the hardware-specific library mentioned in that file. If you downloaded the XvMC wrapper from the unichrome site, the default XvMCConfig will make the XvMC wrapper try to load the Nvidia XvMC -driver. If you want to use it with the VIA CLE266 chip, you will have +driver. If you want to use it with the VIA Unichrome /Pro chips, you +will have to edit the XvMCConfig file to contain the single word<br> <br> <span style="font-family: monospace;">libviaXvMC.so.1<br> @@ -110,7 +123,8 @@ back to plain Xv for these streams. Hopefully this will be fixed in the not too distant future.<br> <br> <h3><a name="mozTocId6059" class="mozTocH3"></a>Optimizing</h3> -If you are running VLD XvMC on the CLE266 there are some options that +If you are running VLD XvMC on the VIA Unichrome / Pros there are some +options that may affect performance:<br> <br> <span style="font-family: monospace;">video.device.unichrome_cpu_save:1</span><br> @@ -146,10 +160,35 @@ run a hardware accelerated stream, Interlacing will be toggled by pressing "i". If the xxmc plugin has fallen back to Xv and software decoding, post plugins will take care of deinterlacing. <br> <br> -BOB deinterlacing for XvMC accelerated streams will be implemented in -the near future. That means alternating between the top- and bottom -fields of the frame at twice the original frame-rate.<br> -<br> +BOB deinterlacing (alternating between top and bottom field at double +the frame-rate) for XvMC accelerated streams is available as an +experimental feature. It is activated using the config option<br> +<br> +<span style="font-family: monospace;">video.device.xvmc_bob_deinterlacing:1<br> +<br> +</span>If this option is enabled, The xxmc plugin will use bob as +deinterlacing method when deinterlace is toggled pressing "i". To get +the best results from this method, the screen update frequency should +be a multiple of double the frame rate. For example, if the frame-rate +is 25Hz, Your screen update frequency should be 50Hz or 100Hz. I have +been able to get reasonable results using a 75Hz update frequency, +however.<br> +<h2><a class="mozTocH2" name="mozTocId974751"></a>Chips supporting XvMC +acceleration using the xxmc module.</h2> +<h3><a class="mozTocH3" name="mozTocId803345"></a>VIA Unichrome / Pro</h3> +<ul> + <li>CLE266: up to 1024x1024.</li> + <li>K8M/N800: up to 1024x1024. Use Unichrome X drivers >= r31.</li> + <li>CN400: HDTV capable. Driver support is under development.</li> + <li>PM8X0: HDTV capable. Driver support is under development.<br> + </li> +</ul> +<h3><a class="mozTocH3" name="mozTocId951553"></a>Nvidia</h3> +<ul> + <li>Quadro FX 1000 (IDCT / Mocomp)</li> + <li>Please help me fill in here.<br> + </li> +</ul> <h2><a name="mozTocId615875" class="mozTocH2"></a>FAQ</h2> Q: The xxmc plugin is not enabled when I configure xine-lib<br> A: Check that you have installed the XvMC wrapper, and that you've run diff --git a/src/video_out/video_out_xxmc.c b/src/video_out/video_out_xxmc.c index b6cf74d10..2607d7b2a 100644 --- a/src/video_out/video_out_xxmc.c +++ b/src/video_out/video_out_xxmc.c @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out_xxmc.c,v 1.12 2005/02/22 18:31:58 totte67 Exp $ + * $Id: video_out_xxmc.c,v 1.13 2005/04/09 11:47:43 totte67 Exp $ * * video_out_xxmc.c, X11 decoding accelerated video extension interface for xine * @@ -39,6 +39,7 @@ #include "xxmc.h" +#include <unistd.h> static int gX11Fail; static void xxmc_frame_updates(xxmc_driver_t *driver, xxmc_frame_t *frame); @@ -1458,6 +1459,7 @@ static void xxmc_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) xxmc_driver_t *this = (xxmc_driver_t *) this_gen; xxmc_frame_t *frame = (xxmc_frame_t *) frame_gen; xine_xxmc_t *xxmc = &frame->xxmc_data; + int first_field; /* * queue frames (deinterlacing) @@ -1493,6 +1495,10 @@ static void xxmc_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) * ask for offset and output size */ + 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; + xxmc_redraw_needed (this_gen); if (frame->format == XINE_IMGFMT_XXMC) { XVMCLOCKDISPLAY( this->display ); @@ -1502,9 +1508,24 @@ static void xxmc_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) this->sc.displayed_width, this->sc.displayed_height, this->sc.output_xoffset, this->sc.output_yoffset, this->sc.output_width, this->sc.output_height, - ((this->deinterlace_enabled) ? - XVMC_TOP_FIELD : XVMC_FRAME_PICTURE)); + this->cur_field); XVMCUNLOCKDISPLAY( this->display ); + if (this->deinterlace_enabled && this->bob) { + unsigned + ms_per_field = 500 * frame->vo_frame.duration / 90000 - 2; + + usleep(ms_per_field*1000); + this->cur_field = (frame->vo_frame.top_field_first) ? XVMC_BOTTOM_FIELD : XVMC_TOP_FIELD; + + XVMCLOCKDISPLAY( this->display ); + XvMCPutSurface( this->display, frame->xvmc_surf , this->drawable, + this->sc.displayed_xoffset, this->sc.displayed_yoffset, + this->sc.displayed_width, this->sc.displayed_height, + this->sc.output_xoffset, this->sc.output_yoffset, + this->sc.output_width, this->sc.output_height, + this->cur_field); + XVMCUNLOCKDISPLAY( this->display ); + } } else { XLockDisplay (this->display); if (this->use_shm) { @@ -1699,7 +1720,7 @@ static int xxmc_gui_data_exchange (vo_driver_t *this_gen, this->sc.displayed_width, this->sc.displayed_height, this->sc.output_xoffset, this->sc.output_yoffset, this->sc.output_width, this->sc.output_height, - ((this->deinterlace_enabled) ? XVMC_TOP_FIELD : XVMC_FRAME_PICTURE)); + this->cur_field); XVMCUNLOCKDISPLAY( this->display ); } else { XLockDisplay (this->display); @@ -1950,6 +1971,12 @@ static void xxmc_update_nvidia_fix(void *this_gen, xine_cfg_entry_t *entry) { this->reverse_nvidia_palette = entry->num_value; } +static void xxmc_update_bob(void *this_gen, xine_cfg_entry_t *entry) { + xxmc_driver_t *this = (xxmc_driver_t *) this_gen; + + this->bob = entry->num_value; +} + static void checkXvMCCap( xxmc_driver_t *this, XvPortID xv_port) { @@ -2412,7 +2439,16 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi _("There's a bug in NVIDIA's XvMC lib that makes red OSD colors\n" "look blue and vice versa. This option provides a workaround.\n"), 10, xxmc_update_nvidia_fix, this); + this->bob = + 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"), + 10, xxmc_update_bob, this); + this->deinterlace_enabled = 0; + this->cur_field = XVMC_FRAME_PICTURE; + #ifdef HAVE_VLDXVMC printf("video_out_xxmc: Unichrome CPU saving is %s.\n", (this->cpu_save_enabled) ? "on":"off"); diff --git a/src/video_out/xxmc.h b/src/video_out/xxmc.h index 645fd9269..27103dea7 100644 --- a/src/video_out/xxmc.h +++ b/src/video_out/xxmc.h @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xxmc.h,v 1.6 2004/11/24 16:11:10 mroi Exp $ + * $Id: xxmc.h,v 1.7 2005/04/09 11:47:43 totte67 Exp $ * * video_out_xxmc.c, X11 decoding accelerated video extension interface for xine * @@ -204,6 +204,8 @@ struct xxmc_driver_s { uint32_t capabilities; xxmc_frame_t *recent_frames[VO_NUM_RECENT_FRAMES]; xxmc_frame_t *cur_frame; + int cur_field; + int bob; x11osd *xoverlay; int xv_xoverlay_type; int xoverlay_type; |