diff options
author | Christoph Pfister <christophpfister@gmail.com> | 2007-04-16 16:54:20 +0200 |
---|---|---|
committer | Christoph Pfister <christophpfister@gmail.com> | 2007-04-16 16:54:20 +0200 |
commit | e22a6d723156ff3ceee5e5c3fee8b5cfcf71c405 (patch) | |
tree | 1890a0a6d8e3c9387a5e013aea96b04712d12bdd /src | |
parent | 6b0d697a0bb44f845c819a5978f437da867f70a0 (diff) | |
download | xine-lib-e22a6d723156ff3ceee5e5c3fee8b5cfcf71c405.tar.gz xine-lib-e22a6d723156ff3ceee5e5c3fee8b5cfcf71c405.tar.bz2 |
removal of [xcb]xv deinterlacers
Hi,
As the deinterlacers in video_out_[xcb]xv.c are implemented purely in
software there's no need to have them there. Instead use the post
deinterlacer plugin.
Both plugins tested with kaffeine and no regression found.
Christoph
Diffstat (limited to 'src')
-rw-r--r-- | src/video_out/video_out_xcbxv.c | 205 | ||||
-rw-r--r-- | src/video_out/video_out_xv.c | 209 |
2 files changed, 0 insertions, 414 deletions
diff --git a/src/video_out/video_out_xcbxv.c b/src/video_out/video_out_xcbxv.c index 36d6de7a7..baeeaea8d 100644 --- a/src/video_out/video_out_xcbxv.c +++ b/src/video_out/video_out_xcbxv.c @@ -63,7 +63,6 @@ #include "video_out.h" #include "xine_internal.h" /* #include "overlay.h" */ -#include "deinterlace.h" #include "xineutils.h" #include "vo_scale.h" #include "xcbosd.h" @@ -132,10 +131,6 @@ struct xv_driver_s { /* all scaling information goes here */ vo_scale_t sc; - xv_frame_t deinterlace_frame; - int deinterlace_method; - int deinterlace_enabled; - int use_colorkey; uint32_t colorkey; @@ -405,117 +400,6 @@ static void xv_update_frame_format (vo_driver_t *this_gen, frame->ratio = ratio; } -#define DEINTERLACE_CROMA -static void xv_deinterlace_frame (xv_driver_t *this) { - uint8_t *recent_bitmaps[VO_NUM_RECENT_FRAMES]; - xv_frame_t *frame = this->recent_frames[0]; - int i; - int xvscaling; - - xvscaling = (this->deinterlace_method == DEINTERLACE_ONEFIELDXV) ? 2 : 1; - - if (!this->deinterlace_frame.image - || (frame->width != this->deinterlace_frame.width) - || (frame->height != this->deinterlace_frame.height ) - || (frame->format != this->deinterlace_frame.format) - || (frame->ratio != this->deinterlace_frame.ratio)) { - pthread_mutex_lock(&this->main_mutex); - - if(this->deinterlace_frame.image) - dispose_ximage(this, &this->deinterlace_frame); - - create_ximage(this, &this->deinterlace_frame, frame->width, frame->height / xvscaling, frame->format); - this->deinterlace_frame.width = frame->width; - this->deinterlace_frame.height = frame->height; - this->deinterlace_frame.format = frame->format; - this->deinterlace_frame.ratio = frame->ratio; - - pthread_mutex_unlock(&this->main_mutex); - } - - - if ( this->deinterlace_method != DEINTERLACE_ONEFIELDXV ) { -#ifdef DEINTERLACE_CROMA - - /* I don't think this is the right way to do it (deinterlacing croma by croma info). - DScaler deinterlaces croma together with luma, but it's easier for them because - they have that components 1:1 at the same table. - */ - for( i = 0; i < VO_NUM_RECENT_FRAMES; i++ ) - if( this->recent_frames[i] && this->recent_frames[i]->width == frame->width && - this->recent_frames[i]->height == frame->height ) - recent_bitmaps[i] = this->recent_frames[i]->image + frame->width*frame->height; - else - recent_bitmaps[i] = NULL; - - deinterlace_yuv( this->deinterlace_frame.image+frame->width*frame->height, - recent_bitmaps, frame->width/2, frame->height/2, this->deinterlace_method ); - for( i = 0; i < VO_NUM_RECENT_FRAMES; i++ ) - if( this->recent_frames[i] && this->recent_frames[i]->width == frame->width && - this->recent_frames[i]->height == frame->height ) - recent_bitmaps[i] = this->recent_frames[i]->image + frame->width*frame->height*5/4; - else - recent_bitmaps[i] = NULL; - - deinterlace_yuv( this->deinterlace_frame.image+frame->width*frame->height*5/4, - recent_bitmaps, frame->width/2, frame->height/2, this->deinterlace_method ); - -#else - - /* know bug: we are not deinterlacing Cb and Cr */ - xine_fast_memcpy(this->deinterlace_frame.image + frame->width*frame->height, - frame->image + frame->width*frame->height, - frame->width*frame->height*1/2); - -#endif - - for( i = 0; i < VO_NUM_RECENT_FRAMES; i++ ) - if( this->recent_frames[i] && this->recent_frames[i]->width == frame->width && - this->recent_frames[i]->height == frame->height ) - recent_bitmaps[i] = this->recent_frames[i]->image; - else - recent_bitmaps[i] = NULL; - - deinterlace_yuv( this->deinterlace_frame.image, recent_bitmaps, - frame->width, frame->height, this->deinterlace_method ); - } - else { - /* - dirty and cheap deinterlace method: we give half of the lines to xv - driver and let it scale for us. - note that memcpy's below don't seem to impact much on performance, - specially when fast memcpys are available. - */ - uint8_t *dst, *src; - - dst = this->deinterlace_frame.image; - src = this->recent_frames[0]->image; - for( i = 0; i < frame->height; i+=2 ) { - xine_fast_memcpy(dst,src,frame->width); - dst += frame->width; - src += 2 * frame->width; - } - - dst = this->deinterlace_frame.image + frame->width * frame->height / 2; - src = this->recent_frames[0]->image + frame->width * frame->height; - for( i = 0; i < frame->height; i+=4 ) { - xine_fast_memcpy(dst,src,frame->width / 2); - dst += frame->width / 2; - src += frame->width; - } - - dst = this->deinterlace_frame.image + frame->width * frame->height * 5 / 8; - src = this->recent_frames[0]->image + frame->width * frame->height * 5 / 4; - for( i = 0; i < frame->height; i+=4 ) { - xine_fast_memcpy(dst,src,frame->width / 2); - dst += frame->width / 2; - src += frame->width; - } - } - - this->cur_frame = &this->deinterlace_frame; -} - static void xv_clean_output_area (xv_driver_t *this) { int i; xcb_rectangle_t rects[4]; @@ -570,14 +454,6 @@ static void xv_compute_ideal_size (xv_driver_t *this) { static void xv_compute_output_size (xv_driver_t *this) { _x_vo_scale_compute_output_size( &this->sc ); - - /* onefield_xv divide by 2 the number of lines */ - if (this->deinterlace_enabled - && (this->deinterlace_method == DEINTERLACE_ONEFIELDXV) - && this->cur_frame && (this->cur_frame->format == XINE_IMGFMT_YV12)) { - this->sc.displayed_height = this->sc.displayed_height / 2 - 1; - this->sc.displayed_yoffset = this->sc.displayed_yoffset / 2; - } } static void xv_overlay_begin (vo_driver_t *this_gen, @@ -721,17 +597,6 @@ static void xv_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) { } /* - * deinterlace frame if necessary - * (currently only working for YUV images) - */ - - if (this->deinterlace_enabled && this->deinterlace_method - && frame->format == XINE_IMGFMT_YV12 - && (deinterlace_yuv_supported( this->deinterlace_method ) == 1 - || this->deinterlace_method == DEINTERLACE_ONEFIELDXV)) - xv_deinterlace_frame (this); - - /* * tell gui that we are about to display a frame, * ask for offset and output size */ @@ -825,18 +690,6 @@ static int xv_set_property (vo_driver_t *this_gen, } else { switch (property) { - - case VO_PROP_INTERLACED: - this->props[property].value = value; - xprintf(this->xine, XINE_VERBOSITY_LOG, - LOG_MODULE ": VO_PROP_INTERLACED(%d)\n", this->props[property].value); - this->deinterlace_enabled = value; - if (this->deinterlace_method == DEINTERLACE_ONEFIELDXV) { - xv_compute_ideal_size (this); - xv_compute_output_size (this); - } - break; - case VO_PROP_ASPECT_RATIO: if (value>=XINE_VO_ASPECT_NUM_RATIOS) value = XINE_VO_ASPECT_AUTO; @@ -981,15 +834,6 @@ static int xv_gui_data_exchange (vo_driver_t *this_gen, rect->y = y1; rect->w = x2-x1; rect->h = y2-y1; - - /* onefield_xv divide by 2 the number of lines */ - if (this->deinterlace_enabled - && (this->deinterlace_method == DEINTERLACE_ONEFIELDXV) - && (this->cur_frame->format == XINE_IMGFMT_YV12)) { - rect->y = rect->y * 2; - rect->h = rect->h * 2; - } - } break; @@ -1059,12 +903,6 @@ static void xv_dispose (vo_driver_t *this_gen) { /* restore port attributes to their initial values */ xv_restore_port_attributes(this); - - if (this->deinterlace_frame.image) { - pthread_mutex_lock(&this->main_mutex); - dispose_ximage(this, &this->deinterlace_frame); - pthread_mutex_unlock(&this->main_mutex); - } pthread_mutex_lock(&this->main_mutex); xcb_xv_ungrab_port(this->connection, this->xv_port, XCB_CURRENT_TIME); @@ -1196,13 +1034,6 @@ static void xv_check_capability (xv_driver_t *this, } } else this->props[property].value = int_default; - -} - -static void xv_update_deinterlace(void *this_gen, xine_cfg_entry_t *entry) { - xv_driver_t *this = (xv_driver_t *) this_gen; - - this->deinterlace_method = entry->num_value; } static void xv_update_XV_FILTER(void *this_gen, xine_cfg_entry_t *entry) { @@ -1356,8 +1187,6 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis xcb_create_gc(this->connection, this->gc, this->window, 0, NULL); this->capabilities = VO_CAP_CROP; this->use_shm = 1; - this->deinterlace_method = 0; - this->deinterlace_frame.image = NULL; this->use_colorkey = 0; this->colorkey = 0; this->xoverlay = NULL; @@ -1391,7 +1220,6 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis this->props[i].this = this; } - this->props[VO_PROP_INTERLACED].value = 0; this->sc.user_ratio = this->props[VO_PROP_ASPECT_RATIO].value = XINE_VO_ASPECT_AUTO; this->props[VO_PROP_ZOOM_X].value = 100; @@ -1527,39 +1355,6 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis _("Some buggy video drivers need a workaround to function properly."), 10, xv_update_xv_pitch_alignment, this); - this->deinterlace_method = - config->register_enum (config, "video.output.xv_deinterlace_method", 4, - deinterlace_methods, - _("deinterlace method (deprecated)"), - _("This config setting is deprecated. You should use the new deinterlacing " - "post processing settings instead.\n\n" - "From the old days of analog television, where the even and odd numbered " - "lines of a video frame would be displayed at different times comes the " - "idea to increase motion smoothness by also recording the lines at " - "different times. This is called \"interlacing\". But unfortunately, " - "todays displays show the even and odd numbered lines as one complete frame " - "all at the same time (called \"progressive display\"), which results in " - "ugly frame errors known as comb artifacts. Software deinterlacing is an " - "approach to reduce these artifacts. The individual values are:\n\n" - "none\n" - "Disables software deinterlacing.\n\n" - "bob\n" - "Interpolates between the lines for moving parts of the image.\n\n" - "weave\n" - "Similar to bob, but with a tendency to preserve the full resolution, " - "better for high detail in low movement scenes.\n\n" - "greedy\n" - "Very good adaptive deinterlacer, but needs a lot of CPU power.\n\n" - "onefield\n" - "Always interpolates and reduces vertical resolution.\n\n" - "onefieldxv\n" - "Same as onefield, but does the interpolation in hardware.\n\n" - "linearblend\n" - "Applies a slight vertical blur to remove the comb artifacts. Good results " - "with medium CPU usage."), - 10, xv_update_deinterlace, this); - this->deinterlace_enabled = 0; - if(this->use_colorkey==1) { this->xoverlay = xcbosd_create(this->xine, this->connection, this->screen, this->window, XCBOSD_COLORKEY); diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c index 4338246ae..894192c6b 100644 --- a/src/video_out/video_out_xv.c +++ b/src/video_out/video_out_xv.c @@ -68,7 +68,6 @@ #include "video_out.h" #include "xine_internal.h" /* #include "overlay.h" */ -#include "deinterlace.h" #include "xineutils.h" #include "vo_scale.h" #include "x11osd.h" @@ -137,10 +136,6 @@ struct xv_driver_s { /* all scaling information goes here */ vo_scale_t sc; - xv_frame_t deinterlace_frame; - int deinterlace_method; - int deinterlace_enabled; - int use_colorkey; uint32_t colorkey; @@ -490,120 +485,6 @@ static void xv_update_frame_format (vo_driver_t *this_gen, frame->ratio = ratio; } -#define DEINTERLACE_CROMA -static void xv_deinterlace_frame (xv_driver_t *this) { - uint8_t *recent_bitmaps[VO_NUM_RECENT_FRAMES]; - xv_frame_t *frame = this->recent_frames[0]; - int i; - int xvscaling; - - xvscaling = (this->deinterlace_method == DEINTERLACE_ONEFIELDXV) ? 2 : 1; - - if (!this->deinterlace_frame.image - || (frame->width != this->deinterlace_frame.width) - || (frame->height != this->deinterlace_frame.height ) - || (frame->format != this->deinterlace_frame.format) - || (frame->ratio != this->deinterlace_frame.ratio)) { - LOCK_DISPLAY(this); - - if(this->deinterlace_frame.image) - dispose_ximage (this, &this->deinterlace_frame.shminfo, - this->deinterlace_frame.image); - - this->deinterlace_frame.image = create_ximage (this, &this->deinterlace_frame.shminfo, - frame->width,frame->height / xvscaling, - frame->format); - this->deinterlace_frame.width = frame->width; - this->deinterlace_frame.height = frame->height; - this->deinterlace_frame.format = frame->format; - this->deinterlace_frame.ratio = frame->ratio; - - UNLOCK_DISPLAY(this); - } - - - if ( this->deinterlace_method != DEINTERLACE_ONEFIELDXV ) { -#ifdef DEINTERLACE_CROMA - - /* I don't think this is the right way to do it (deinterlacing croma by croma info). - DScaler deinterlaces croma together with luma, but it's easier for them because - they have that components 1:1 at the same table. - */ - for( i = 0; i < VO_NUM_RECENT_FRAMES; i++ ) - if( this->recent_frames[i] && this->recent_frames[i]->width == frame->width && - this->recent_frames[i]->height == frame->height ) - recent_bitmaps[i] = this->recent_frames[i]->image->data + frame->width*frame->height; - else - recent_bitmaps[i] = NULL; - - deinterlace_yuv( this->deinterlace_frame.image->data+this->deinterlace_frame.image->width*frame->height, - recent_bitmaps, this->deinterlace_frame.image->width/2, frame->height/2, this->deinterlace_method ); - for( i = 0; i < VO_NUM_RECENT_FRAMES; i++ ) - if( this->recent_frames[i] && this->recent_frames[i]->width == frame->width && - this->recent_frames[i]->height == frame->height ) - recent_bitmaps[i] = this->recent_frames[i]->image->data + this->deinterlace_frame.image->width*frame->height*5/4; - else - recent_bitmaps[i] = NULL; - - deinterlace_yuv( this->deinterlace_frame.image->data+this->deinterlace_frame.image->width*frame->height*5/4, - recent_bitmaps, this->deinterlace_frame.image->width/2, frame->height/2, this->deinterlace_method ); - -#else - - /* know bug: we are not deinterlacing Cb and Cr */ - xine_fast_memcpy(this->deinterlace_frame.image->data + frame->width*frame->height, - frame->image->data + frame->width*frame->height, - frame->width*frame->height*1/2); - -#endif - - for( i = 0; i < VO_NUM_RECENT_FRAMES; i++ ) - if( this->recent_frames[i] && this->recent_frames[i]->width == frame->width && - this->recent_frames[i]->height == frame->height ) - recent_bitmaps[i] = this->recent_frames[i]->image->data; - else - recent_bitmaps[i] = NULL; - - deinterlace_yuv( this->deinterlace_frame.image->data, recent_bitmaps, - this->deinterlace_frame.image->width, frame->height, this->deinterlace_method ); - } - else { - /* - dirty and cheap deinterlace method: we give half of the lines to xv - driver and let it scale for us. - note that memcpy's below don't seem to impact much on performance, - specially when fast memcpys are available. - */ - uint8_t *dst, *src; - - dst = this->deinterlace_frame.image->data; - src = this->recent_frames[0]->image->data; - for( i = 0; i < frame->height; i+=2 ) { - xine_fast_memcpy(dst,src,frame->width); - dst += frame->width; - src += 2 * frame->width; - } - - dst = this->deinterlace_frame.image->data + frame->width * frame->height / 2; - src = this->recent_frames[0]->image->data + frame->width * frame->height; - for( i = 0; i < frame->height; i+=4 ) { - xine_fast_memcpy(dst,src,frame->width / 2); - dst += frame->width / 2; - src += frame->width; - } - - dst = this->deinterlace_frame.image->data + frame->width * frame->height * 5 / 8; - src = this->recent_frames[0]->image->data + frame->width * frame->height * 5 / 4; - for( i = 0; i < frame->height; i+=4 ) { - xine_fast_memcpy(dst,src,frame->width / 2); - dst += frame->width / 2; - src += frame->width; - } - } - - this->cur_frame = &this->deinterlace_frame; -} - static void xv_clean_output_area (xv_driver_t *this) { int i; @@ -651,14 +532,6 @@ static void xv_compute_ideal_size (xv_driver_t *this) { static void xv_compute_output_size (xv_driver_t *this) { _x_vo_scale_compute_output_size( &this->sc ); - - /* onefield_xv divide by 2 the number of lines */ - if (this->deinterlace_enabled - && (this->deinterlace_method == DEINTERLACE_ONEFIELDXV) - && this->cur_frame && (this->cur_frame->format == XINE_IMGFMT_YV12)) { - this->sc.displayed_height = this->sc.displayed_height / 2 - 1; - this->sc.displayed_yoffset = this->sc.displayed_yoffset / 2; - } } static void xv_overlay_begin (vo_driver_t *this_gen, @@ -812,17 +685,6 @@ static void xv_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) { } /* - * deinterlace frame if necessary - * (currently only working for YUV images) - */ - - if (this->deinterlace_enabled && this->deinterlace_method - && frame->format == XINE_IMGFMT_YV12 - && (deinterlace_yuv_supported( this->deinterlace_method ) == 1 - || this->deinterlace_method == DEINTERLACE_ONEFIELDXV)) - xv_deinterlace_frame (this); - - /* * tell gui that we are about to display a frame, * ask for offset and output size */ @@ -926,17 +788,6 @@ static int xv_set_property (vo_driver_t *this_gen, else { switch (property) { - case VO_PROP_INTERLACED: - this->props[property].value = value; - xprintf(this->xine, XINE_VERBOSITY_LOG, - LOG_MODULE ": VO_PROP_INTERLACED(%d)\n", this->props[property].value); - this->deinterlace_enabled = value; - if (this->deinterlace_method == DEINTERLACE_ONEFIELDXV) { - xv_compute_ideal_size (this); - xv_compute_output_size (this); - } - break; - case VO_PROP_ASPECT_RATIO: if (value>=XINE_VO_ASPECT_NUM_RATIOS) value = XINE_VO_ASPECT_AUTO; @@ -1070,15 +921,6 @@ static int xv_gui_data_exchange (vo_driver_t *this_gen, rect->y = y1; rect->w = x2-x1; rect->h = y2-y1; - - /* onefield_xv divide by 2 the number of lines */ - if (this->deinterlace_enabled - && (this->deinterlace_method == DEINTERLACE_ONEFIELDXV) - && (this->cur_frame->format == XINE_IMGFMT_YV12)) { - rect->y = rect->y * 2; - rect->h = rect->h * 2; - } - } break; @@ -1134,14 +976,6 @@ static void xv_dispose (vo_driver_t *this_gen) { /* restore port attributes to their initial values */ xv_restore_port_attributes(this); - - if (this->deinterlace_frame.image) { - LOCK_DISPLAY(this); - dispose_ximage (this, &this->deinterlace_frame.shminfo, - this->deinterlace_frame.image); - UNLOCK_DISPLAY(this); - this->deinterlace_frame.image = NULL; - } LOCK_DISPLAY(this); if(XvUngrabPort (this->display, this->xv_port, CurrentTime) != Success) { @@ -1257,13 +1091,6 @@ static void xv_check_capability (xv_driver_t *this, } } else this->props[property].value = int_default; - -} - -static void xv_update_deinterlace(void *this_gen, xine_cfg_entry_t *entry) { - xv_driver_t *this = (xv_driver_t *) this_gen; - - this->deinterlace_method = entry->num_value; } static void xv_update_XV_FILTER(void *this_gen, xine_cfg_entry_t *entry) { @@ -1409,8 +1236,6 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void * UNLOCK_DISPLAY(this); this->capabilities = VO_CAP_CROP; this->use_shm = 1; - this->deinterlace_method = 0; - this->deinterlace_frame.image = NULL; this->use_colorkey = 0; this->colorkey = 0; this->xoverlay = NULL; @@ -1451,7 +1276,6 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void * this->props[i].this = this; } - this->props[VO_PROP_INTERLACED].value = 0; this->sc.user_ratio = this->props[VO_PROP_ASPECT_RATIO].value = XINE_VO_ASPECT_AUTO; this->props[VO_PROP_ZOOM_X].value = 100; @@ -1597,39 +1421,6 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void * _("Some buggy video drivers need a workaround to function properly."), 10, xv_update_xv_pitch_alignment, this); - this->deinterlace_method = - config->register_enum (config, "video.output.xv_deinterlace_method", 4, - deinterlace_methods, - _("deinterlace method (deprecated)"), - _("This config setting is deprecated. You should use the new deinterlacing " - "post processing settings instead.\n\n" - "From the old days of analog television, where the even and odd numbered " - "lines of a video frame would be displayed at different times comes the " - "idea to increase motion smoothness by also recording the lines at " - "different times. This is called \"interlacing\". But unfortunately, " - "todays displays show the even and odd numbered lines as one complete frame " - "all at the same time (called \"progressive display\"), which results in " - "ugly frame errors known as comb artifacts. Software deinterlacing is an " - "approach to reduce these artifacts. The individual values are:\n\n" - "none\n" - "Disables software deinterlacing.\n\n" - "bob\n" - "Interpolates between the lines for moving parts of the image.\n\n" - "weave\n" - "Similar to bob, but with a tendency to preserve the full resolution, " - "better for high detail in low movement scenes.\n\n" - "greedy\n" - "Very good adaptive deinterlacer, but needs a lot of CPU power.\n\n" - "onefield\n" - "Always interpolates and reduces vertical resolution.\n\n" - "onefieldxv\n" - "Same as onefield, but does the interpolation in hardware.\n\n" - "linearblend\n" - "Applies a slight vertical blur to remove the comb artifacts. Good results " - "with medium CPU usage."), - 10, xv_update_deinterlace, this); - this->deinterlace_enabled = 0; - LOCK_DISPLAY(this); if(this->use_colorkey==1) { this->xoverlay = x11osd_create (this->xine, this->display, this->screen, |