[FFmpeg-devel] [PATCH]Fix the idcin palette

Carl Eugen Hoyos cehoyos at ag.or.at
Sat Dec 24 03:02:31 CET 2011


Hi!

Attached patch fixes the palette in Quake II CIN files.

Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavformat/idcin.c b/libavformat/idcin.c
index 0cca69f..c855808 100644
--- a/libavformat/idcin.c
+++ b/libavformat/idcin.c
@@ -248,7 +248,9 @@ static int idcin_read_packet(AVFormatContext *s,
                 r = palette_buffer[i * 3    ] << palette_scale;
                 g = palette_buffer[i * 3 + 1] << palette_scale;
                 b = palette_buffer[i * 3 + 2] << palette_scale;
-                palette[i] = (r << 16) | (g << 8) | (b);
+                palette[i] = (0xFF << 24) | (r << 16) | (g << 8) | (b);
+                if (palette_scale == 2)
+                    palette[i] |= palette[i] >> 6 & 0x30303;
             }
         }
 


More information about the ffmpeg-devel mailing list