changeset 25289:4bbc9ad3124c

Restore y of palette into the same value range as it was in the .ifo file.
author ulion
date Sat, 08 Dec 2007 02:38:02 +0000
parents 831fbe89f76b
children 2502d1944968
files libmpdemux/demux_mkv.c vobsub.c
diffstat 2 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_mkv.c	Fri Dec 07 15:30:12 2007 +0000
+++ b/libmpdemux/demux_mkv.c	Sat Dec 08 02:38:02 2007 +0000
@@ -320,6 +320,7 @@
       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))
--- a/vobsub.c	Fri Dec 07 15:30:12 2007 +0000
+++ b/vobsub.c	Sat Dec 08 02:38:02 2007 +0000
@@ -825,6 +825,7 @@
 	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;