[MPlayer-cvslog] r27516 - trunk/libswscale/yuv2rgb.c

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Sun Sep 14 11:22:55 CEST 2008


On Sat, Sep 13, 2008 at 09:27:10PM +0200, Diego Biurrun wrote:
> On Thu, Sep 04, 2008 at 08:14:29PM +0200, michael wrote:
> > 
> > Log:
> > Fix rgb15/16 vs. bgr part1.
> 
> This has caused a regression with
> 
> http://samples.mplayerhq.hu/MPEG2/libmpeg2bug.ts
> 
> it now shows wrong colors, the typical endian swap.  I can reproduce it
> reliably with 'mplayer -vo x11', I get the following swscale-related
> output:
> 
> [swscaler @ 0x8876580]No accelerated colorspace conversion found.
> [swscaler @ 0x8876580]using unscaled yuv420p -> bgr565 special converter

Well, actually I think it indeed fixed a bug, it is just that MPlayer
worked around the bug because it was the more common case.
The mapping between MPlayer and FFmpeg colour spaces is messed up and
needs to be fixed.
Attached is one patch I had lying around, no idea if it is the correct
one.
-------------- next part --------------
Index: fmt-conversion.h
===================================================================
--- fmt-conversion.h	(revision 27514)
+++ fmt-conversion.h	(working copy)
@@ -13,32 +13,32 @@
         case IMGFMT_BGR24:
             return PIX_FMT_BGR24;
         case IMGFMT_BGR16:
-            return PIX_FMT_BGR565;
+            return PIX_FMT_RGB565;
         case IMGFMT_BGR15:
-            return PIX_FMT_BGR555;
+            return PIX_FMT_RGB555;
         case IMGFMT_BGR8:
-            return PIX_FMT_BGR8;
+            return PIX_FMT_RGB8;
         case IMGFMT_BGR4:
-            return PIX_FMT_BGR4;
+            return PIX_FMT_RGB4;
         case IMGFMT_BGR1:
         case IMGFMT_RGB1:
             return PIX_FMT_MONOBLACK;
         case IMGFMT_RG4B:
+            return PIX_FMT_BGR4_BYTE;
+        case IMGFMT_BG4B:
             return PIX_FMT_RGB4_BYTE;
-        case IMGFMT_BG4B:
-            return PIX_FMT_BGR4_BYTE;
         case IMGFMT_RGB32:
             return PIX_FMT_BGR32;
         case IMGFMT_RGB24:
             return PIX_FMT_RGB24;
         case IMGFMT_RGB16:
-            return PIX_FMT_RGB565;
+            return PIX_FMT_BGR565;
         case IMGFMT_RGB15:
-            return PIX_FMT_RGB555;
+            return PIX_FMT_BGR555;
         case IMGFMT_RGB8:
-            return PIX_FMT_RGB8;
+            return PIX_FMT_BGR8;
         case IMGFMT_RGB4:
-            return PIX_FMT_RGB4;
+            return PIX_FMT_BGR4;
         case IMGFMT_YUY2:
             return PIX_FMT_YUYV422;
         case IMGFMT_UYVY:


More information about the MPlayer-cvslog mailing list