spudec: use more precise alpha handling for -spuaa 4

Use more precise alpha handling for -spuaa 4.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34874 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: reimar
This commit is contained in:
mplayer-svn 2012-04-23 18:39:16 +00:00 committed by wm4
parent 3790146982
commit 97f0ed25ed
1 changed files with 2 additions and 2 deletions

View File

@ -873,9 +873,9 @@ static void sws_spu_image(unsigned char *d1, unsigned char *d2, int dw, int dh,
ctx=sws_getContext(sw, sh, PIX_FMT_GRAY8, dw, dh, PIX_FMT_GRAY8, SWS_GAUSS, &filter, NULL, NULL);
sws_scale(ctx,&s1,&ss,0,sh,&d1,&ds);
for (i=ss*sh-1; i>=0; i--) if (!s2[i]) s2[i] = 255; //else s2[i] = 1;
for (i=ss*sh-1; i>=0; i--) s2[i] = -s2[i];
sws_scale(ctx,(const uint8_t **)&s2,&ss,0,sh,&d2,&ds);
for (i=ds*dh-1; i>=0; i--) if (d2[i]==0) d2[i] = 1; else if (d2[i]==255) d2[i] = 0;
for (i=ds*dh-1; i>=0; i--) d2[i] = -d2[i];
sws_freeContext(ctx);
}