]> git.sesse.net Git - ffmpeg/commitdiff
pgssubdec: fix incorrect colors.
authorAlexandre Colucci <alexandre@elgato.com>
Fri, 25 Mar 2011 16:31:28 +0000 (17:31 +0100)
committerAnton Khirnov <anton@khirnov.net>
Tue, 24 May 2011 17:10:34 +0000 (19:10 +0200)
On Blu-ray colors are stored in the order YCrCb (and not YCbCr) as mentioned in the specifications:
see System Description Blu-ray Disc Read-Only Format, 9.14.4.2.2.1 Palette Definition Segment

When decoding a Blu-ray subtitle, the colors were incorrectly set.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavcodec/pgssubdec.c

index ea53e55b35871bbf68380a34767776f34c736fcd..a480da1168f27ce432af67e1df67ddf6f03a886c 100644 (file)
@@ -246,8 +246,8 @@ static void parse_palette_segment(AVCodecContext *avctx,
     while (buf < buf_end) {
         color_id  = bytestream_get_byte(&buf);
         y         = bytestream_get_byte(&buf);
-        cb        = bytestream_get_byte(&buf);
         cr        = bytestream_get_byte(&buf);
+        cb        = bytestream_get_byte(&buf);
         alpha     = bytestream_get_byte(&buf);
 
         YUV_TO_RGB1(cb, cr);