mirror of https://github.com/mpv-player/mpv
Restore y of palette into the same value range as it was in the .ifo file.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25317 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
48d39aa9a5
commit
fad92e57fa
|
@ -320,6 +320,7 @@ vobsub_parse_palette (sh_sub_t *sh, const char *start)
|
|||
y = av_clip_uint8( 0.1494 * r + 0.6061 * g + 0.2445 * b);
|
||||
u = av_clip_uint8( 0.6066 * r - 0.4322 * g - 0.1744 * b + 128);
|
||||
v = av_clip_uint8(-0.08435 * r - 0.3422 * g + 0.4266 * b + 128);
|
||||
y = y * 219 / 255 + 16;
|
||||
sh->palette[i] = y << 16 | u << 8 | v;
|
||||
start += 6;
|
||||
while ((*start == ',') || isspace(*start))
|
||||
|
|
1
vobsub.c
1
vobsub.c
|
@ -825,6 +825,7 @@ vobsub_parse_palette(vobsub_t *vob, const char *line)
|
|||
y = av_clip_uint8( 0.1494 * r + 0.6061 * g + 0.2445 * b);
|
||||
u = av_clip_uint8( 0.6066 * r - 0.4322 * g - 0.1744 * b + 128);
|
||||
v = av_clip_uint8(-0.08435 * r - 0.3422 * g + 0.4266 * b + 128);
|
||||
y = y * 219 / 255 + 16;
|
||||
vob->palette[n++] = y << 16 | u << 8 | v;
|
||||
if (n == 16)
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue