[Mplayer-cvslog] CVS: main codec-cfg.c,1.87,1.88 dll_init.c,1.44,1.45 xacodec.c,1.31,1.32

Alex Beregszaszi alex at mplayerhq.hu
Sun Jun 23 18:01:38 CEST 2002


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

Modified Files:
	codec-cfg.c dll_init.c xacodec.c 
Log Message:
yvu9 and if09 support

Index: codec-cfg.c
===================================================================
RCS file: /cvsroot/mplayer/main/codec-cfg.c,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -r1.87 -r1.88
--- codec-cfg.c	22 Jun 2002 23:09:12 -0000	1.87
+++ codec-cfg.c	23 Jun 2002 16:01:35 -0000	1.88
@@ -119,6 +119,7 @@
 		{"I420",  IMGFMT_I420},
 		{"IYUV",  IMGFMT_IYUV},
 		{"YVU9",  IMGFMT_YVU9},
+		{"IF09",  IMGFMT_IF09},
 
 		{"YUY2",  IMGFMT_YUY2},
 		{"UYVY",  IMGFMT_UYVY},

Index: dll_init.c
===================================================================
RCS file: /cvsroot/mplayer/main/dll_init.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- dll_init.c	21 Apr 2002 11:37:44 -0000	1.44
+++ dll_init.c	23 Jun 2002 16:01:35 -0000	1.45
@@ -55,7 +55,7 @@
     sh_audio->o_wf.cbSize=0;
 
     if(verbose) {
-#if 0
+#if 1
 	printf("Input format:\n");
 	    printf("  wFormatTag %d\n", in_fmt->wFormatTag);
 	    printf("  nChannels %d\n", in_fmt->nChannels);
@@ -75,6 +75,7 @@
 #else
 	printf("Input format:\n");
 	print_wave_header(in_fmt);
+	print_wave_header(sh_audio->wf);
 	printf("Output fmt:\n");
 	print_wave_header(&sh_audio->o_wf);
 	printf("\n");
@@ -312,6 +313,11 @@
   case IMGFMT_I420:
   case IMGFMT_IYUV:
       sh_video->o_bih.biBitCount=12;
+      yuv=1;
+      break;
+  case IMGFMT_YVU9:
+  case IMGFMT_IF09:
+      sh_video->o_bih.biBitCount=9;
       yuv=1;
       break;
 

Index: xacodec.c
===================================================================
RCS file: /cvsroot/mplayer/main/xacodec.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- xacodec.c	23 Mar 2002 18:38:41 -0000	1.31
+++ xacodec.c	23 Jun 2002 16:01:35 -0000	1.32
@@ -281,41 +281,22 @@
 
     switch(out_format)
     {
-/*	case IMGFMT_RGB8:
-	    codec_hdr.depth = 8;
-	    break;
-	case IMGFMT_RGB15:
-	    codec_hdr.depth = 15;
-	    break;
-	case IMGFMT_RGB16:
-	    codec_hdr.depth = 16;
-	    break;
-	case IMGFMT_RGB24:
-	    codec_hdr.depth = 24;
-	    break;
-	case IMGFMT_RGB32:
-	    codec_hdr.depth = 32;
-	    break;
-	case IMGFMT_BGR8:
-	    codec_hdr.depth = 8;
-	    break;
-	case IMGFMT_BGR15:
-	    codec_hdr.depth = 15;
-	    break;
-	case IMGFMT_BGR16:
-	    codec_hdr.depth = 16;
-	    break;
-	case IMGFMT_BGR24:
-	    codec_hdr.depth = 24;
-	    break;
-	case IMGFMT_BGR32:
-	    codec_hdr.depth = 32;
-	    break;*/
 	case IMGFMT_IYUV:
 	case IMGFMT_I420:
 	case IMGFMT_YV12:
 	    codec_hdr.depth = 12;
 	    break;
+	case IMGFMT_YVU9:
+	    if (vidinfo->bih->biCompression == mmioFOURCC('I','V','3','2') ||
+		vidinfo->bih->biCompression == mmioFOURCC('i','v','3','2') ||
+		vidinfo->bih->biCompression == mmioFOURCC('I','V','3','1') ||
+		vidinfo->bih->biCompression == mmioFOURCC('i','v','3','2'))
+	    {
+		mp_msg(MSGT_DECVIDEO, MSGL_FATAL, "xacodec: not supporting YVU9 output with Indeo3\n");
+		return(0);
+	    }
+	    codec_hdr.depth = 9;
+	    break;
 	default:
 	    mp_msg(MSGT_DECVIDEO, MSGL_FATAL, "xacodec: not supported image out format (%s)\n",
 		vo_format_name(out_format));
@@ -392,16 +373,22 @@
 
     image->planes[0]=image->mem;
     image->stride[0]=image->width;
-    image->stride[1]=image->stride[2]=image->width/2;
     switch(image->out_fmt){
     case IMGFMT_YV12:
 	image->planes[2]=image->planes[0]+image->width*image->height;
 	image->planes[1]=image->planes[2]+image->width*image->height/4;
+	image->stride[1]=image->stride[2]=image->width/2;
 	break;
     case IMGFMT_I420:
     case IMGFMT_IYUV:
 	image->planes[1]=image->planes[0]+image->width*image->height;
 	image->planes[2]=image->planes[1]+image->width*image->height/4;
+	image->stride[1]=image->stride[2]=image->width/2;
+	break;
+    case IMGFMT_YVU9:
+	image->planes[2]=image->planes[0]+image->width*image->height;
+	image->planes[1]=image->planes[2]+(image->width>>2)*(image->height>>2);
+	image->stride[1]=image->stride[2]=image->width/4;
 	break;
     }
 
@@ -641,7 +628,7 @@
 YUVBufs jpg_YUVBufs;
 YUVTabs def_yuv_tabs;
 
-/* -------------- YUV 4x4 1x1 1x1  [Indeo 3,4,5] ------------------ */
+/* -------------- YUV 4x4 1x1 1x1  (4:1:0 aka YVU9) [Indeo 3,4,5] ------------------ */
 
 void XA_YUV1611_Convert(unsigned char *image_p, unsigned int imagex, unsigned int imagey,
     unsigned int i_x, unsigned int i_y, YUVBufs *yuv, YUVTabs *yuv_tabs,
@@ -665,6 +652,27 @@
 	yuv->Ybuf,yuv->Ubuf,yuv->Vbuf,yuv->the_buf,yuv->the_buf_size,
 	yuv->y_w,yuv->y_h,yuv->uv_w,yuv->uv_h);
 
+    if(image->out_fmt == IMGFMT_YVU9 && !yuv_tabs->YUV_Y_tab)
+    {
+	if(i_x==image->width && i_y==image->height){
+	    image->planes[0]=yuv->Ybuf;
+	    image->planes[1]=yuv->Ubuf;
+	    image->planes[2]=yuv->Vbuf;
+	    image->stride[0]=i_x; // yuv->y_w
+	    image->stride[1]=image->stride[2]=i_x/4; // yuv->uv_w
+	} else {
+	    int y;
+	    for(y=0;y<i_y;y++)
+		memcpy(image->planes[0]+y*image->stride[0],yuv->Ybuf+y*i_x,i_x);
+	    i_x>>=2; i_y>>=2;
+	    for(y=0;y<i_y;y++){
+		memcpy(image->planes[1]+y*image->stride[1],yuv->Ubuf+y*i_x,i_x);
+		memcpy(image->planes[2]+y*image->stride[2],yuv->Vbuf+y*i_x,i_x);
+	    }
+	}
+	return;
+    }
+
     // copy Y plane:
     if(yuv_tabs->YUV_Y_tab){     // dirty hack to detect iv32:
 	for(y=0;y<imagey*imagex;y++)
@@ -707,7 +715,7 @@
     return((void *)XA_YUV1611_Convert);
 }
 
-/* -------------- YUV 4x1 1x1 1x1 (4:1:1 ?) [CYUV] ------------------ */
+/* -------------- YUV 4x1 1x1 1x1 (4:1:1 but interleaved) [CYUV] ------------------ */
 
 void XA_YUV411111_Convert(unsigned char *image, unsigned int imagex, unsigned int imagey,
     unsigned int i_x, unsigned int i_y, YUVBufs *yuv_bufs, YUVTabs *yuv_tabs,
@@ -739,8 +747,6 @@
     mp_dbg(MSGT_DECVIDEO,MSGL_DBG3, "YUV: %p %p %p %X (%X) %Xx%X %Xx%X\n",
 	yuv->Ybuf,yuv->Ubuf,yuv->Vbuf,yuv->the_buf,yuv->the_buf_size,
 	yuv->y_w,yuv->y_h,yuv->uv_w,yuv->uv_h);
-
-#warning "FIXME! Decoder doesn't supports Vivo/2.00 :("
 
 if(i_x==image->width && i_y==image->height){
 //    printf("Direct render!!!\n");




More information about the MPlayer-cvslog mailing list