[MPlayer-dev-eng] [PATCH] colorspace issues for gif and jpeg

Joey Parrish joey at yunamusic.com
Sun Sep 22 20:14:52 CEST 2002


Hello,

On Sun, Sep 22, 2002 at 03:41:13PM +0200, Arpi wrote:
> Hi,
> 
> is there any non-rejected patch not yet applied?

Here is a patch that fixes colorspace issues with the
jpeg and gif vo's.

-----------------------------
Jpeg vo had red & blue planes swapped with YUV and I420 inputs.

Example, with this movie,
ftp://mplayerhq.hu/MPlayer/samples/V-codecs/I263/i263.avi

VDec: vo config request - 352 x 240 (preferred csp: Packed YUY2)
VDec: using Planar I420 as output csp (no 0)
-----------------------------
Gif vo had red & blue planes swapped with YV12 input.

Example, with this movie,
ftp://mplayerhq.hu/MPlayer/samples/V-codecs/MP4S/Oceans.Eleven.VCD.avi

VDec: vo config request - 352 x 288 (preferred csp: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
-----------------------------

This patch fixes both issues.  I have also tested this patch against
many various colorspaces that did not have problems.  This patch
does not seem to break anything.

Thanks,
--Joey

-- 

"Keep on truckin'." --Darth Vader
-------------- next part --------------
--- libvo/vo_gif89a.c	Sat Sep 21 21:33:26 2002
+++ libvo/vo_gif89a.c	Sun Sep 22 12:37:32 2002
@@ -79,7 +79,7 @@
 	case IMGFMT_RGB24:
 	break;     
 	case IMGFMT_YV12:
-	     yuv2rgb_init(24, MODE_RGB);
+	     yuv2rgb_init(24, MODE_BGR);
 	     image_data = malloc(image_width*image_height*3);
 	break;
 	default:
--- libvo/vo_jpeg.c	Sat Sep 21 21:33:26 2002
+++ libvo/vo_jpeg.c	Sun Sep 22 12:50:31 2002
@@ -191,17 +191,6 @@
 
 static uint32_t draw_slice( uint8_t *src[],int stride[],int w,int h,int x,int y )
 {
-  // hack: swap planes for I420 ;) -- alex 
- if ((image_format == IMGFMT_IYUV) || (image_format == IMGFMT_I420))
-  {
-   uint8_t *src_i420[3];
-    
-   src_i420[0]=src[0];
-   src_i420[1]=src[2];
-   src_i420[2]=src[1];
-   src=src_i420;
-  }
-
  if (scale_srcW) 
   {
    uint8_t *dst[3]={image_data, NULL, NULL};


More information about the MPlayer-dev-eng mailing list