From 4d38521e2cd1e62ef334a73624cbd4a95f1de436 Mon Sep 17 00:00:00 2001 From: kmkaplan Date: Fri, 29 Mar 2002 03:17:57 +0000 Subject: * New command line switch for mplayer & mencoder: -ifo Indicate the file that will be used to load palette and frame size for MPEG subtitles. * mencoder.c: Fix cropping when decoding MPEG2. * spudec.c: If scaling is needed only do it once. Change WITH_NO_ANTIALIASING to ANTIALIASING_ALGORITHM. * vobsub.c: Support reading info regarding size and palette from IDX file instead of IFO file. Support streams containing audio or video. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5389 b3059339-0415-0410-9bf9-f77b7e298cf2 --- spudec.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'spudec.c') diff --git a/spudec.c b/spudec.c index b1f143f23e..de2f57e800 100644 --- a/spudec.c +++ b/spudec.c @@ -26,7 +26,7 @@ #include #include #include -#ifndef WITH_NO_ANTIALIASING +#if ANTIALIASING_ALGORITHM == 2 #include #endif #include "spudec.h" @@ -55,7 +55,7 @@ typedef struct { size_t image_size; /* Size of the image buffer */ unsigned char *image; /* Grayscale value */ unsigned char *aimage; /* Alpha value */ - int scaled; /* flag if the image has already been scaled */ + unsigned int scaled_frame_width, scaled_frame_height; unsigned int scaled_start_col, scaled_start_row; unsigned int scaled_width, scaled_height, scaled_stride; size_t scaled_image_size; @@ -116,7 +116,8 @@ static void spudec_process_data(spudec_handle_t *this) unsigned int cmap[4], alpha[4]; unsigned int i, x, y; - this->scaled = 0; + this->scaled_frame_width = 0; + this->scaled_frame_height = 0; for (i = 0; i < 4; ++i) { alpha[i] = mkalpha(this->alpha[i]); if (alpha[i] == 0) @@ -389,8 +390,7 @@ void spudec_draw_scaled(void *me, unsigned int dxs, unsigned int dys, void (*dra spu->image, spu->aimage, spu->stride); } else { - if (!spu->scaled || - spu->orig_frame_width != dxs || spu->orig_frame_height != dys) { /* Resizing is needed */ + if (spu->scaled_frame_width != dxs || spu->scaled_frame_height != dys) { /* Resizing is needed */ /* scaled_x = scalex * x / 0x100 scaled_y = scaley * y / 0x100 order of operations is important because of rounding. */ @@ -642,7 +642,8 @@ void spudec_draw_scaled(void *me, unsigned int dxs, unsigned int dys, void (*dra } } #endif - spu->scaled = 1; + spu->scaled_frame_width = dxs; + spu->scaled_frame_height = dys; } } if (spu->scaled_image) -- cgit v1.2.3