From d8863d37e2a266820b1faffcb19f9bd385a0ecee Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 29 Jan 2002 01:43:15 +0000 Subject: [PATCH] area averageing scaling support (-sws 5) (is identical to bilinear for upscale) Originally committed as revision 4403 to svn://svn.mplayerhq.hu/mplayer/trunk/postproc --- postproc/swscale.c | 25 +++++++++++++++++-------- postproc/swscale.h | 1 + 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/postproc/swscale.c b/postproc/swscale.c index dc52b2677e..7acdfbd074 100644 --- a/postproc/swscale.c +++ b/postproc/swscale.c @@ -604,6 +604,7 @@ void SwScale_YV12slice(unsigned char* src[], int srcStride[], int srcSliceY , case 2: flags|= SWS_BICUBIC; break; case 3: flags|= SWS_X; break; case 4: flags|= SWS_POINT; break; + case 5: flags|= SWS_AREA; break; default:flags|= SWS_BILINEAR; break; } @@ -666,7 +667,7 @@ static inline void initFilter(int16_t **outFilter, int16_t **filterPos, int *out int xDstInSrc; if (flags&SWS_BICUBIC) filterSize= 4; else if(flags&SWS_X ) filterSize= 4; - else filterSize= 2; + else filterSize= 2; // SWS_BILINEAR / SWS_AREA // printf("%d %d %d\n", filterSize, srcW, dstW); filter= (double*)memalign(8, dstW*sizeof(double)*filterSize); @@ -705,6 +706,7 @@ static inline void initFilter(int16_t **outFilter, int16_t **filterPos, int *out } else { + //Bilinear upscale / linear interpolate / Area averaging for(j=0; j