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:
ulion 2007-12-08 02:38:02 +00:00
parent 48d39aa9a5
commit fad92e57fa
2 changed files with 2 additions and 0 deletions

View File

@ -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))

View File

@ -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;