From f9263ee763a6ee7246d326d72ba1826ad3d0eba5 Mon Sep 17 00:00:00 2001 From: michael Date: Tue, 29 Jan 2002 01:43:15 +0000 Subject: [PATCH] area averageing scaling support (-sws 5) (is identical to bilinear for upscale) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4403 b3059339-0415-0410-9bf9-f77b7e298cf2 --- 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