[MPlayer-cvslog] r25317 - in trunk: libmpdemux/demux_mkv.c vobsub.c

ulion subversion at mplayerhq.hu
Sat Dec 8 03:38:02 CET 2007


Author: ulion
Date: Sat Dec  8 03:38:02 2007
New Revision: 25317

Log:
Restore y of palette into the same value range as it was in the .ifo file.


Modified:
   trunk/libmpdemux/demux_mkv.c
   trunk/vobsub.c

Modified: trunk/libmpdemux/demux_mkv.c
==============================================================================
--- trunk/libmpdemux/demux_mkv.c	(original)
+++ trunk/libmpdemux/demux_mkv.c	Sat Dec  8 03:38:02 2007
@@ -320,6 +320,7 @@ vobsub_parse_palette (sh_sub_t *sh, cons
       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))

Modified: trunk/vobsub.c
==============================================================================
--- trunk/vobsub.c	(original)
+++ trunk/vobsub.c	Sat Dec  8 03:38:02 2007
@@ -825,6 +825,7 @@ vobsub_parse_palette(vobsub_t *vob, cons
 	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;



More information about the MPlayer-cvslog mailing list