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

Alex Beregszaszi alex at mplayerhq.hu
Sun Aug 31 22:58:29 CEST 2003


Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var/tmp.root/cvs-serv14069

Modified Files:
	vd_hmblck.c 
Log Message:
nv21 support

Index: vd_hmblck.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd_hmblck.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- vd_hmblck.c	18 Jun 2003 00:34:34 -0000	1.1
+++ vd_hmblck.c	31 Aug 2003 20:58:25 -0000	1.2
@@ -9,9 +9,9 @@
 #define TEMP_BUF_SIZE (720*576)
 
 static vd_info_t info = {
-	"Hauppauge Macroblock/NV12 Decoder",
+	"Hauppauge Macroblock/NV12/NV21 Decoder",
 	"hmblck",
-	"Alex <d18c7db at hotmail.com>, A'rpi",
+	"Alex <d18c7db at hotmail.com>, A'rpi, Alex Beregszaszi",
 	"Alex <d18c7db at hotmail.com>",
 	"uncompressed"
 };
@@ -59,13 +59,13 @@
 /*************************************************************************
  * convert a nv12 buffer to yv12
  */
-static int nv12_to_yv12(void *data, int len, mp_image_t* mpi) {
+static int nv12_to_yv12(void *data, int len, mp_image_t* mpi, int swapped) {
     unsigned int Y_size  = mpi->width * mpi->height;
     unsigned int UV_size = mpi->chroma_width * mpi->chroma_height;
     unsigned int idx;
     unsigned char *dst_Y = mpi->planes[0];
-    unsigned char *dst_U = mpi->planes[1];
-    unsigned char *dst_V = mpi->planes[2];
+    unsigned char *dst_U = swapped?mpi->planes[2]:mpi->planes[1];
+    unsigned char *dst_V = swapped?mpi->planes[1]:mpi->planes[2];
     unsigned char *src   = data + Y_size;
 
     // sanity check raw stream
@@ -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)) return NULL;
+	if(!nv12_to_yv12(data, len, mpi,(sh->format == IMGFMT_NV12))) return NULL;
     }
 
     return mpi;



More information about the MPlayer-cvslog mailing list