From 3719f0ab8e239e0ddb38eb758bb745d11880787d Mon Sep 17 00:00:00 2001 From: lilo_booter Date: Fri, 14 Oct 2005 10:27:26 +0000 Subject: [PATCH] + Rounding errors corrected for last gasp scaling git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@851 d19143bc-622f-0410-bfdd-b5b2a6649095 --- src/modules/sdl/consumer_sdl_still.c | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/modules/sdl/consumer_sdl_still.c b/src/modules/sdl/consumer_sdl_still.c index 6ee1e94..acb5098 100644 --- a/src/modules/sdl/consumer_sdl_still.c +++ b/src/modules/sdl/consumer_sdl_still.c @@ -269,11 +269,11 @@ static inline void display_1( SDL_Surface *screen, SDL_Rect rect, uint8_t *image for ( y = 0; y < rect.h; y ++ ) { p = start; - row_index = ( scale_height * y ) >> 16; + row_index = ( 32768 + scale_height * y ) >> 16; row = image + stride * row_index; for ( x = 0; x < rect.w; x ++ ) { - q = row + ( ( ( scale_width * x ) >> 16 ) * 3 ); + q = row + ( ( ( 32768 + scale_width * x ) >> 16 ) * 3 ); *p ++ = SDL_MapRGB( screen->format, *q, *( q + 1 ), *( q + 2 ) ); } start += scanlength; @@ -298,11 +298,11 @@ static inline void display_2( SDL_Surface *screen, SDL_Rect rect, uint8_t *image for ( y = 0; y < rect.h; y ++ ) { p = start; - row_index = ( scale_height * y ) >> 16; + row_index = ( 32768 + scale_height * y ) >> 16; row = image + stride * row_index; for ( x = 0; x < rect.w; x ++ ) { - q = row + ( ( ( scale_width * x ) >> 16 ) * 3 ); + q = row + ( ( ( 32768 + scale_width * x ) >> 16 ) * 3 ); *p ++ = SDL_MapRGB( screen->format, *q, *( q + 1 ), *( q + 2 ) ); } start += scanlength; @@ -328,11 +328,11 @@ static inline void display_3( SDL_Surface *screen, SDL_Rect rect, uint8_t *image for ( y = 0; y < rect.h; y ++ ) { p = start; - row_index = ( scale_height * y ) >> 16; + row_index = ( 32768 + scale_height * y ) >> 16; row = image + stride * row_index; for ( x = 0; x < rect.w; x ++ ) { - q = row + ( ( ( scale_width * x ) >> 16 ) * 3 ); + q = row + ( ( ( 32768 + scale_width * x ) >> 16 ) * 3 ); pixel = SDL_MapRGB( screen->format, *q, *( q + 1 ), *( q + 2 ) ); *p ++ = (pixel & 0xFF0000) >> 16; *p ++ = (pixel & 0x00FF00) >> 8; @@ -360,11 +360,11 @@ static inline void display_4( SDL_Surface *screen, SDL_Rect rect, uint8_t *image for ( y = 0; y < rect.h; y ++ ) { p = start; - row_index = ( scale_height * y ) >> 16; + row_index = ( 32768 + scale_height * y ) >> 16; row = image + stride * row_index; for ( x = 0; x < rect.w; x ++ ) { - q = row + ( ( ( scale_width * x ) >> 16 ) * 3 ); + q = row + ( ( ( 32768 + scale_width * x ) >> 16 ) * 3 ); *p ++ = SDL_MapRGB( screen->format, *q, *( q + 1 ), *( q + 2 ) ); } start += scanlength; -- 1.7.4.4