From 93236a755d9303fa1eee68853d35b502b8395128 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= Date: Tue, 26 Apr 2005 09:02:55 +0000 Subject: **BUGFIX** Fix IDCT / Mocomp rendering errors in xxmc and xvmc modules caused by them not resetting the macroblock counter when a frame is created. Fixed libmpeg2 Mocomp XvMC forgetting to handle the signed / usigned intra flag, resulting in a purple screen on Nvidia when XvMC Mocomp only is used. CVS patchset: 7500 CVS date: 2005/04/26 09:02:55 --- src/libmpeg2/slice_xvmc.c | 9 ++++++--- src/video_out/video_out_xvmc.c | 8 +++++++- src/video_out/video_out_xxmc.c | 19 ++++++++++++++----- 3 files changed, 27 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/libmpeg2/slice_xvmc.c b/src/libmpeg2/slice_xvmc.c index f3ce5fb74..43d9666ee 100644 --- a/src/libmpeg2/slice_xvmc.c +++ b/src/libmpeg2/slice_xvmc.c @@ -1663,7 +1663,8 @@ static inline int slice_xvmc_init (picture_t * picture, int code) picture->limit_y = height - 16; //TODO conversion to signed format signed format - if((picture->mc->xvmc_accel & ACCEL) == MOTION_ACCEL) { + if((picture->mc->xvmc_accel & ACCEL) == MOTION_ACCEL && + !(picture->mc->xvmc_accel & SIGNED_INTRA)) { //Motion Comp only unsigned intra // original: picture->dc_dct_pred[0] = picture->dc_dct_pred[1] = @@ -1920,7 +1921,8 @@ void mpeg2_xvmc_slice (mpeg2dec_accel_t *accel, picture_t * picture, int code, u picture->pitches[2]); // cc2 croma } - if((picture->mc->xvmc_accel & ACCEL) == MOTION_ACCEL) { + if((picture->mc->xvmc_accel & ACCEL) == MOTION_ACCEL && + !(picture->mc->xvmc_accel & SIGNED_INTRA)) { // original: picture->dc_dct_pred[0] = picture->dc_dct_pred[1] = picture->dc_dct_pred[2] = 128 << picture->intra_dc_precision; @@ -1977,7 +1979,8 @@ void mpeg2_xvmc_slice (mpeg2dec_accel_t *accel, picture_t * picture, int code, u mba_inc += mba->mba; if (mba_inc) { //TODO conversion to signed format signed format - if((picture->mc->xvmc_accel & ACCEL) == MOTION_ACCEL) { + if((picture->mc->xvmc_accel & ACCEL) == MOTION_ACCEL && + !(picture->mc->xvmc_accel & SIGNED_INTRA)) { // original: picture->dc_dct_pred[0] = picture->dc_dct_pred[1] = picture->dc_dct_pred[2] = 128 << picture->intra_dc_precision; diff --git a/src/video_out/video_out_xvmc.c b/src/video_out/video_out_xvmc.c index aee64cc08..0b0e3ec24 100644 --- a/src/video_out/video_out_xvmc.c +++ b/src/video_out/video_out_xvmc.c @@ -17,7 +17,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_xvmc.c,v 1.21 2005/02/22 18:31:55 totte67 Exp $ + * $Id: video_out_xvmc.c,v 1.22 2005/04/26 09:03:04 totte67 Exp $ * * video_out_xvmc.c, X11 video motion compensation extension interface for xine * @@ -786,6 +786,12 @@ static void xvmc_update_frame_format (vo_driver_t *this_gen, } xvmc->macroblocks = (xine_macroblocks_t *)&this->macroblocks; + this->macroblocks.num_blocks = 0; + this->macroblocks.macroblockptr = this->macroblocks.macroblockbaseptr; + this->macroblocks.xine_mc.blockptr = + this->macroblocks.xine_mc.blockbaseptr; + + if( flags & VO_NEW_SEQUENCE_FLAG ) { xvmc_set_context (this, width, height, ratio, format, flags, xvmc->macroblocks); diff --git a/src/video_out/video_out_xxmc.c b/src/video_out/video_out_xxmc.c index 2607d7b2a..ebf15767b 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.13 2005/04/09 11:47:43 totte67 Exp $ + * $Id: video_out_xxmc.c,v 1.14 2005/04/26 09:03:05 totte67 Exp $ * * video_out_xxmc.c, X11 decoding accelerated video extension interface for xine * @@ -42,7 +42,8 @@ #include static int gX11Fail; -static void xxmc_frame_updates(xxmc_driver_t *driver, xxmc_frame_t *frame); +static void xxmc_frame_updates(xxmc_driver_t *driver, xxmc_frame_t *frame, + int init_macroblocks); static void dispose_ximage (xxmc_driver_t *this, XShmSegmentInfo *shminfo, XvImage *myimage); @@ -409,7 +410,7 @@ static void xxmc_duplicate_frame_data(vo_frame_t *this_gen, this->format = original->format; this->ratio = original->ratio; - xxmc_frame_updates(driver,this); + xxmc_frame_updates(driver,this,0); /* * Allocate a dummy subpicture and copy using @@ -962,7 +963,8 @@ static int xxmc_xvmc_update_context(xxmc_driver_t *driver, xxmc_frame_t *frame, } static void xxmc_frame_updates(xxmc_driver_t *driver, - xxmc_frame_t *frame) + xxmc_frame_t *frame, + int init_macroblocks) { xine_xxmc_t *xxmc = &frame->xxmc_data; @@ -1011,6 +1013,13 @@ static void xxmc_frame_updates(xxmc_driver_t *driver, xxmc->xvmc.macroblocks->xvmc_accel = 0; } + if (init_macroblocks) { + driver->macroblocks.num_blocks = 0; + driver->macroblocks.macroblockptr = driver->macroblocks.macroblockbaseptr; + driver->macroblocks.xine_mc.blockptr = + driver->macroblocks.xine_mc.blockbaseptr; + } + xxmc->proc_xxmc_flush = xvmc_flush; xxmc->xvmc.proc_macro_block = xxmc_xvmc_proc_macro_block; frame->vo_frame.proc_duplicate_frame_data = xxmc_duplicate_frame_data; @@ -1121,7 +1130,7 @@ static void xxmc_do_update_frame(vo_driver_t *this_gen, } if (this->contextActive) - xxmc_frame_updates(this, frame); + xxmc_frame_updates(this, frame, 1); xxmc_do_update_frame_xv(this_gen, frame_gen, width, height, ratio, xxmc->fallback_format, flags); -- cgit v1.2.3