changeset 12708:a7e80ffdd89e

Negate default palette for grayscale cvid
author rtognimp
date Sun, 27 Jun 2004 19:53:30 +0000
parents 24d26e525df7
children bd90b887fb13
files libmpdemux/demux_mov.c
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_mov.c	Sun Jun 27 19:17:24 2004 +0000
+++ b/libmpdemux/demux_mov.c	Sun Jun 27 19:53:30 2004 +0000
@@ -1180,8 +1180,18 @@
 		      mp_msg(MSGT_DEMUX, MSGL_INFO, "Using default QT grayscale palette\n");
 		      if (palette_count == 16)
 		        memcpy(palette_map, qt_default_grayscale_palette_16, 16 * 4);
-		      else if (palette_count == 256)
+		      else if (palette_count == 256) {
 		        memcpy(palette_map, qt_default_grayscale_palette_256, 256 * 4);
+		        if (trak->fourcc == mmioFOURCC('c','v','i','d')) {
+		          int i;
+		          // Hack for grayscale CVID, negative palette
+		          // If you have samples where this is not required contact me (rxt)
+		          mp_msg(MSGT_DEMUX, MSGL_INFO, "MOV: greyscale cvid with default palette,"
+		            " enabling negative palette hack.\n");
+		          for (i = 0; i < 256 * 4; i++)
+		            palette_map[i] = palette_map[i] ^ 0xff;
+		        }
+		      }
 		    }
 		    else
 		    {