This patch corrects the colors of the 2 and 4 bpp palettes. Compare the output of the two files below in QuickTime in Win or Mac with the FFmpeg output, before and after the patch is applied (the second file is not so obvious, but the 4 bpp palette is incorrect nevertheless):

https://drive.google.com/open?id=0B3_pEBoLs0faZUc4VEVwalhGSE0

https://drive.google.com/open?id=0B3_pEBoLs0facHJkWnhvYXdtbms

Mats

--
Mats Peterson
http://matsp888.no-ip.org/~mats/
>From 5c8eac83f0fdc32c7d0ab43fffc33d63e16fdbb7 Mon Sep 17 00:00:00 2001
From: Mats Peterson <matsp...@yahoo.com>
Date: Mon, 18 Jan 2016 11:11:30 +0100
Subject: [PATCH] lavf/qtpalette: Fix incorrect palettes

This patch corrects the colors of the 2 and 4 bpp palettes.

---
 libavformat/qtpalette.h |   34 ++++++++++++++++++----------------
 1 file changed, 18 insertions(+), 16 deletions(-)

diff --git a/libavformat/qtpalette.h b/libavformat/qtpalette.h
index b2bd360..10d0cf1 100644
--- a/libavformat/qtpalette.h
+++ b/libavformat/qtpalette.h
@@ -31,29 +31,31 @@ static const uint8_t ff_qt_default_palette_2[2 * 3] = {
   0x00, 0x00, 0x00
 };
 
+/* Obviously uses grays, judging by the Mac or Windows display */
 static const uint8_t ff_qt_default_palette_4[4 * 3] = {
-  0x93, 0x65, 0x5E,
   0xFF, 0xFF, 0xFF,
-  0xDF, 0xD0, 0xAB,
+  0xAA, 0xAA, 0xAA,
+  0x55, 0x55, 0x55,
   0x00, 0x00, 0x00
 };
 
+/* From the table (*not* the image) at https://en.wikipedia.org/wiki/List_of_software_palettes#Apple_Macintosh_default_16-color_palette */
 static const uint8_t ff_qt_default_palette_16[16 * 3] = {
-  0xFF, 0xFB, 0xFF,
-  0xEF, 0xD9, 0xBB,
-  0xE8, 0xC9, 0xB1,
-  0x93, 0x65, 0x5E,
-  0xFC, 0xDE, 0xE8,
-  0x9D, 0x88, 0x91,
   0xFF, 0xFF, 0xFF,
-  0xFF, 0xFF, 0xFF,
-  0xFF, 0xFF, 0xFF,
-  0x47, 0x48, 0x37,
-  0x7A, 0x5E, 0x55,
-  0xDF, 0xD0, 0xAB,
-  0xFF, 0xFB, 0xF9,
-  0xE8, 0xCA, 0xC5,
-  0x8A, 0x7C, 0x77,
+  0xFB, 0xF3, 0x05,
+  0xFF, 0x64, 0x03,
+  0xDD, 0x09, 0x07,
+  0xF2, 0x08, 0x84,
+  0x47, 0x00, 0xA5,
+  0x00, 0x00, 0xD3,
+  0x02, 0xAB, 0xEA,
+  0x1F, 0xB7, 0x14,
+  0x00, 0x64, 0x12,
+  0x56, 0x2C, 0x05,
+  0x90, 0x71, 0x3A,
+  0xC0, 0xC0, 0xC0,
+  0x80, 0x80, 0x80,
+  0x40, 0x40, 0x40,
   0x00, 0x00, 0x00
 };
 
-- 
1.7.10.4

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to