From 406a025a2e1b12eab3ae9aa0124f8707bd8112bc Mon Sep 17 00:00:00 2001 From: Eduard Hasenleithner Date: Tue, 14 Aug 2001 17:13:33 +0000 Subject: Fixed a bug resulting from the misassumption that the pixels are counted without the right and bottom border. CVS patchset: 429 CVS date: 2001/08/14 17:13:33 --- src/libspudec/spu.c | 16 +++++++--------- src/video_out/alphablend.c | 36 ++++-------------------------------- 2 files changed, 11 insertions(+), 41 deletions(-) diff --git a/src/libspudec/spu.c b/src/libspudec/spu.c index 8c572bf54..9573fe040 100644 --- a/src/libspudec/spu.c +++ b/src/libspudec/spu.c @@ -19,6 +19,8 @@ * along with this program; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * +* $Id: spu.c,v 1.6 2001/08/14 17:13:33 ehasenle Exp $ +* *****/ /* @@ -75,10 +77,6 @@ #define LOG(lvl, fmt...) #endif -void spuInit (void) -{ -} - /* Return value: reassembly complete = 1 */ int spuReassembly (spu_seq_t *seq, int start, uint8_t *pkt_data, u_int pkt_len) { @@ -295,13 +293,13 @@ void spuDrawPicture (spu_state_t *state, spu_seq_t* seq, vo_overlay_t *ovl) ovl->x = state->o_left; ovl->y = state->o_top; - ovl->width = state->o_right - state->o_left; - ovl->height = state->o_bottom - state->o_top; + ovl->width = state->o_right - state->o_left + 1; + ovl->height = state->o_bottom - state->o_top + 1; ovl->clip_top = 0; - ovl->clip_bottom = ovl->height; + ovl->clip_bottom = ovl->height - 1; ovl->clip_left = 0; - ovl->clip_right = ovl->width; + ovl->clip_right = ovl->width - 1; spuUpdateMenu(state, ovl); @@ -331,7 +329,7 @@ void spuDrawPicture (spu_state_t *state, spu_seq_t* seq, vo_overlay_t *ovl) } color = vlc & 0x03; - len = vlc>>2; + len = vlc >> 2; /* if len == 0 -> end sequence - fill to end of line */ if (!len) diff --git a/src/video_out/alphablend.c b/src/video_out/alphablend.c index b8a540b2a..b86968c43 100644 --- a/src/video_out/alphablend.c +++ b/src/video_out/alphablend.c @@ -227,34 +227,6 @@ void blend_rgb32 (uint8_t * img, vo_overlay_t * img_overl, int dst_width, #define BLEND_YUV(dst, src, o) (((src)*o + ((dst)*(0xf-o)))/0xf) -/* FIXME: my_clut should disappear once I find out how to get the clut from the MPEG2 stream. */ -/* It looks like it comes from the ,IFO file, so will have to wait for IFO parser in xine. - * Here is an extract of another DVD player (oms) - * clut = ifoGetCLUT (priv->pgci); - * codec->ctrl (codec, CTRL_SPU_SET_CLUT, clut); - */ -/* This happens to work with "The Matrix" using 0(edges), 8(white) */ - -static clut_t __default_clut[] = { - {y: 0x00, cr: 0x80, cb:0x80}, - {y: 0xbf, cr: 0x80, cb:0x80}, - {y: 0x10, cr: 0x80, cb:0x80}, - {y: 0x28, cr: 0x6d, cb:0xef}, - {y: 0x51, cr: 0xef, cb:0x5a}, - {y: 0xbf, cr: 0x80, cb:0x80}, - {y: 0x36, cr: 0x80, cb:0x80}, - {y: 0x28, cr: 0x6d, cb:0xef}, - {y: 0xbf, cr: 0x80, cb:0x80}, - {y: 0x51, cr: 0x80, cb:0x80}, - {y: 0xbf, cr: 0x80, cb:0x80}, - {y: 0x10, cr: 0x80, cb:0x80}, - {y: 0x28, cr: 0x6d, cb:0xef}, - {y: 0x5c, cr: 0x80, cb:0x80}, - {y: 0xbf, cr: 0x80, cb:0x80}, - {y: 0x1c, cr: 0x80, cb:0x80}, - {y: 0x28, cr: 0x6d, cb:0xef} -}; - void blend_yuv (uint8_t * dst_img, vo_overlay_t * img_overl, int dst_width, int dst_height) { @@ -289,10 +261,10 @@ void blend_yuv (uint8_t * dst_img, vo_overlay_t * img_overl, /* OK, this looks time consuming. * But it gets only evaluated if (o != 0) */ - if (o) if (img_overl->clip_left > x || - img_overl->clip_right <= x || - img_overl->clip_top > y || - img_overl->clip_bottom <= y) + if (o) if (img_overl->clip_left > x || + img_overl->clip_right < x || + img_overl->clip_top > y || + img_overl->clip_bottom < y) o = 0; if (o) -- cgit v1.2.3