summaryrefslogtreecommitdiffstats
path: root/spudec.c
diff options
context:
space:
mode:
Diffstat (limited to 'spudec.c')
-rw-r--r--spudec.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/spudec.c b/spudec.c
index 6241c99e0c..8be30e1e56 100644
--- a/spudec.c
+++ b/spudec.c
@@ -175,14 +175,9 @@ static inline int mkalpha(int i)
{
/* In mplayer's alpha planes, 0 is transparent, then 1 is nearly
opaque upto 255 which is transparent */
- switch (i) {
- case 0xf:
- return 1;
- case 0:
- return 0;
- default:
- return (0xf - i) << 4;
- }
+ // extend 4 -> 8 bit
+ i |= i << 4;
+ return (uint8_t)(-i);
}
/* Cut the sub to visible part */