mirror of
https://github.com/mpv-player/mpv.git
synced 2024-09-20 20:03:10 +02:00
Make mkalpha function simpler, faster and more correct.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30523 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
a5bb20514a
commit
e008f62627
11
spudec.c
11
spudec.c
@ -175,14 +175,9 @@ static inline int mkalpha(int i)
|
|||||||
{
|
{
|
||||||
/* In mplayer's alpha planes, 0 is transparent, then 1 is nearly
|
/* In mplayer's alpha planes, 0 is transparent, then 1 is nearly
|
||||||
opaque upto 255 which is transparent */
|
opaque upto 255 which is transparent */
|
||||||
switch (i) {
|
// extend 4 -> 8 bit
|
||||||
case 0xf:
|
i |= i << 4;
|
||||||
return 1;
|
return (uint8_t)(-i);
|
||||||
case 0:
|
|
||||||
return 0;
|
|
||||||
default:
|
|
||||||
return (0xf - i) << 4;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Cut the sub to visible part */
|
/* Cut the sub to visible part */
|
||||||
|
Loading…
Reference in New Issue
Block a user