changeset 6524:05cd2cf758e4

if09 support
author alex
date Sun, 23 Jun 2002 15:03:54 +0000
parents 3d520cf84f50
children 0a7be46617d8
files libmpcodecs/vf.c libmpcodecs/vf_yvu9.c
diffstat 2 files changed, 12 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vf.c	Sun Jun 23 14:23:21 2002 +0000
+++ b/libmpcodecs/vf.c	Sun Jun 23 15:03:54 2002 +0000
@@ -72,7 +72,7 @@
 void vf_mpi_clear(mp_image_t* mpi,int x0,int y0,int w,int h){
     int y;
     if(mpi->flags&MP_IMGFLAG_PLANAR){
-	int div = (mpi->imgfmt == IMGFMT_YVU9) ? 2 : 1;
+	int div = (mpi->imgfmt == IMGFMT_YVU9 || mpi->imgfmt == IMGFMT_IF09) ? 2 : 1;
 	y0&=~1;h+=h&1;
 	if(x0==0 && w==mpi->width){
 	    // full width clear:
@@ -164,14 +164,19 @@
 	if(vf->get_image) vf->get_image(vf,mpi);
 	
         if(!(mpi->flags&MP_IMGFLAG_DIRECT)){
-          // non-direct and not yet allocaed image. allocate it!
-	  mpi->planes[0]=memalign(64, mpi->bpp*mpi->width*(mpi->height+2)/8);
+          // non-direct and not yet allocated image. allocate it!
+	  // IF09 - allocate space for 4. plane delta info - unused
+	  if (mpi->imgfmt == IMGFMT_IF09) 
+	     mpi->planes[0]=memalign(64, mpi->bpp*mpi->width*(mpi->height+2)/8+
+	    				(mpi->width>>2)*(mpi->height>>2));
+	  else
+	     mpi->planes[0]=memalign(64, mpi->bpp*mpi->width*(mpi->height+2)/8);
 	  if(mpi->flags&MP_IMGFLAG_PLANAR){
-	      // YV12/I420/YVU9. feel free to add other planar formats here...
+	      // YV12/I420/YVU9/IF09. feel free to add other planar formats here...
 	      if(!mpi->stride[0]) mpi->stride[0]=mpi->width;
 	      if (!mpi->stride[1])
 	      {
-	        if (mpi->imgfmt == IMGFMT_YVU9)
+	        if (mpi->imgfmt == IMGFMT_YVU9 || mpi->imgfmt == IMGFMT_IF09)
 		    mpi->stride[1]=mpi->stride[2]=mpi->width/4;
 	        else
 		    mpi->stride[1]=mpi->stride[2]=mpi->width/2;
@@ -183,7 +188,7 @@
 	      } else {
 	          // YV12,YVU9  (Y,V,U)
 	          mpi->planes[2]=mpi->planes[0]+mpi->width*mpi->height;
-		  if (mpi->imgfmt == IMGFMT_YVU9)
+		  if (mpi->imgfmt == IMGFMT_YVU9 || mpi->imgfmt == IMGFMT_IF09)
 		    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);
--- a/libmpcodecs/vf_yvu9.c	Sun Jun 23 14:23:21 2002 +0000
+++ b/libmpcodecs/vf_yvu9.c	Sun Jun 23 15:03:54 2002 +0000
@@ -64,7 +64,7 @@
 //===========================================================================//
 
 static int query_format(struct vf_instance_s* vf, unsigned int fmt){
-    if (fmt == IMGFMT_YVU9)
+    if (fmt == IMGFMT_YVU9 || fmt == IMGFMT_IF09)
 	return vf_next_query_format(vf,IMGFMT_YV12) & (~VFCAP_CSP_SUPPORTED_BY_HW);
     return 0;
 }