[Mplayer-cvslog] CVS: main/libmpcodecs vd_hmblck.c,1.2,1.3

Attila Kinali CVS attila at mplayerhq.hu
Sat Jan 10 11:00:21 CET 2004


Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/scsi/2/tmp/cvs-serv18173/libmpcodecs

Modified Files:
	vd_hmblck.c 
Log Message:
fix for nv12 swapped chroma
patch by From: John Wehle <john at feith.com>


Index: vd_hmblck.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd_hmblck.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- vd_hmblck.c	31 Aug 2003 20:58:25 -0000	1.2
+++ vd_hmblck.c	10 Jan 2004 10:00:18 -0000	1.3
@@ -64,8 +64,8 @@
     unsigned int UV_size = mpi->chroma_width * mpi->chroma_height;
     unsigned int idx;
     unsigned char *dst_Y = mpi->planes[0];
-    unsigned char *dst_U = swapped?mpi->planes[2]:mpi->planes[1];
-    unsigned char *dst_V = swapped?mpi->planes[1]:mpi->planes[2];
+    unsigned char *dst_U = mpi->planes[1];
+    unsigned char *dst_V = mpi->planes[2];
     unsigned char *src   = data + Y_size;
 
     // sanity check raw stream
@@ -90,8 +90,8 @@
 
     // chroma data is interlaced UVUV... so deinterlace it
     for(idx=0; idx<UV_size; idx++ ) {
-        *(dst_U + idx) = *(src + (idx<<1) + 0); 
-        *(dst_V + idx) = *(src + (idx<<1) + 1);
+        *(dst_U + idx) = *(src + (idx<<1) + (swapped ? 1 : 0)); 
+        *(dst_V + idx) = *(src + (idx<<1) + (swapped ? 0 : 1));
     }
     return 1;
 }
@@ -130,7 +130,7 @@
 	de_macro_y(mpi->planes[0],data,mpi->stride[0],mpi->w,mpi->h);
 	de_macro_uv(mpi->planes[1],mpi->planes[2],data+mpi->w*mpi->h,mpi->stride[1],mpi->w/2,mpi->h/2);
     } else {
-	if(!nv12_to_yv12(data, len, mpi,(sh->format == IMGFMT_NV12))) return NULL;
+	if(!nv12_to_yv12(data, len, mpi,(sh->format == IMGFMT_NV21))) return NULL;
     }
 
     return mpi;




More information about the MPlayer-cvslog mailing list