changeset 6486:c0d84f46d349

yvu9 support
author alex
date Fri, 21 Jun 2002 17:38:06 +0000
parents 52563321dc78
children ac54be92e55b
files libmpcodecs/vf.c
diffstat 1 files changed, 17 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vf.c	Fri Jun 21 17:37:30 2002 +0000
+++ b/libmpcodecs/vf.c	Fri Jun 21 17:38:06 2002 +0000
@@ -33,6 +33,7 @@
 extern vf_info_t vf_info_cropdetect;
 extern vf_info_t vf_info_test;
 extern vf_info_t vf_info_noise;
+extern vf_info_t vf_info_yvu9;
 
 char** vo_plugin_args=(char**) NULL;
 
@@ -61,6 +62,7 @@
     &vf_info_cropdetect,
     &vf_info_test,
     &vf_info_noise,
+    &vf_info_yvu9,
     NULL
 };
 
@@ -164,9 +166,15 @@
           // non-direct and not yet allocaed image. allocate it!
 	  mpi->planes[0]=memalign(64, mpi->bpp*mpi->width*(mpi->height+2)/8);
 	  if(mpi->flags&MP_IMGFLAG_PLANAR){
-	      // YV12/I420. feel free to add other planar formats here...
+	      // YV12/I420/YVU9. feel free to add other planar formats here...
 	      if(!mpi->stride[0]) mpi->stride[0]=mpi->width;
-	      if(!mpi->stride[1]) mpi->stride[1]=mpi->stride[2]=mpi->width/2;
+	      if (!mpi->stride[1])
+	      {
+	        if (mpi->imgfmt == IMGFMT_YVU9)
+		    mpi->stride[1]=mpi->stride[2]=mpi->width/4;
+	        else
+		    mpi->stride[1]=mpi->stride[2]=mpi->width/2;
+	      }
 	      if(mpi->flags&MP_IMGFLAG_SWAPPED){
 	          // I420/IYUV  (Y,U,V)
 	          mpi->planes[1]=mpi->planes[0]+mpi->width*mpi->height;
@@ -174,7 +182,10 @@
 	      } else {
 	          // YV12,YVU9  (Y,V,U)
 	          mpi->planes[2]=mpi->planes[0]+mpi->width*mpi->height;
-	          mpi->planes[1]=mpi->planes[2]+(mpi->width>>1)*(mpi->height>>1);
+		  if (mpi->imgfmt == IMGFMT_YVU9)
+		    mpi->planes[1]=mpi->planes[2]+(mpi->width>>2)*(mpi->height>>2);
+		  else
+	            mpi->planes[1]=mpi->planes[2]+(mpi->width>>1)*(mpi->height>>1);
 	      }
 	  } else {
 	      if(!mpi->stride[0]) mpi->stride[0]=mpi->width*mpi->bpp/8;
@@ -192,6 +203,9 @@
 		  (mpi->flags&MP_IMGFLAG_YUV)?"YUV":"RGB",
 		  (mpi->flags&MP_IMGFLAG_PLANAR)?"planar":"packed",
 	          mpi->bpp*mpi->width*mpi->height/8);
+	    mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"(imgfmt: %x, planes: %x,%x,%x strides: %d,%d,%d)\n",
+		mpi->imgfmt, mpi->planes[0], mpi->planes[1], mpi->planes[2],
+		mpi->stride[0], mpi->stride[1], mpi->stride[2]);
 	    mpi->flags|=MP_IMGFLAG_TYPE_DISPLAYED;
     }