summaryrefslogtreecommitdiffstats
path: root/postproc
diff options
context:
space:
mode:
authormichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-12-27 00:57:32 +0000
committermichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-12-27 00:57:32 +0000
commitb0a28151cb05e0a1589060cab1f16094d6930cbc (patch)
tree75b3da0c8ee5e17ca0adcbfdd01ef539b1323bee /postproc
parentbdf4a2dc07b7d90c06d858ff7dba2bf15099d0b8 (diff)
downloadmpv-b0a28151cb05e0a1589060cab1f16094d6930cbc.tar.bz2
mpv-b0a28151cb05e0a1589060cab1f16094d6930cbc.tar.xz
output shifted by a few pixels on extreem scalings bugfix
filterPos was wrong by 0.5 pixels on downscale with -sws 1 and 2 bugfix git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3783 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'postproc')
-rw-r--r--postproc/swscale_template.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/postproc/swscale_template.c b/postproc/swscale_template.c
index 565d6c3461..c1033da6f2 100644
--- a/postproc/swscale_template.c
+++ b/postproc/swscale_template.c
@@ -1889,7 +1889,7 @@ static inline void RENAME(initFilter)(int16_t *dstFilter, int16_t *filterPos, in
// printf("%d %d %d\n", filterSize, srcW, dstW);
*filterSize= (*filterSize +(filterAlign-1)) & (~(filterAlign-1));
- xDstInSrc= xInc - 0x8000;
+ xDstInSrc= xInc/2 - 0x8000;
for(i=0; i<dstW; i++)
{
int xx= (xDstInSrc>>16) - (*filterSize>>1) + 1;
@@ -1937,10 +1937,10 @@ static inline void RENAME(initFilter)(int16_t *dstFilter, int16_t *filterPos, in
// printf("%d %d %d\n", *filterSize, srcW, dstW);
*filterSize= (*filterSize +(filterAlign-1)) & (~(filterAlign-1));
- xDstInSrc= xInc - 0x8000;
+ xDstInSrc= xInc/2 - 0x8000;
for(i=0; i<dstW; i++)
{
- int xx= (int)((double)xDstInSrc/(double)(1<<16) - *filterSize*0.5 + 0.5);
+ int xx= (int)((double)xDstInSrc/(double)(1<<16) - ((*filterSize)-1)*0.5 + 0.5);
int j;
filterPos[i]= xx;