changeset 34786:a0b10e46f7e6

Use more precise alpha handling for -spuaa 4.
author reimar
date Mon, 23 Apr 2012 18:39:16 +0000
parents b89534df8e1e
children 16cfd8912ae6
files sub/spudec.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/sub/spudec.c	Mon Apr 23 18:39:14 2012 +0000
+++ b/sub/spudec.c	Mon Apr 23 18:39:16 2012 +0000
@@ -877,9 +877,9 @@
 
 	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,&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);
 }