changeset 9532:0b4c387ddd4f

hmm found this in my local tree ;) seems to fix chroma w/h if %2!=0 ??
author michael
date Wed, 05 Mar 2003 10:23:52 +0000
parents 46340b0f5a91
children 9c596857cbe0
files libmpcodecs/vf.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vf.c	Wed Mar 05 10:20:14 2003 +0000
+++ b/libmpcodecs/vf.c	Wed Mar 05 10:23:52 2003 +0000
@@ -210,8 +210,8 @@
 		printf("vf.c: have to REALLOCATE buffer memory :(\n");
 	    }
 	} else {
-	    mpi->width=w2; mpi->chroma_width=w2>>mpi->chroma_x_shift;
-	    mpi->height=h; mpi->chroma_height=h>>mpi->chroma_y_shift;
+	    mpi->width=w2; mpi->chroma_width=(w2 + (1<<mpi->chroma_x_shift) - 1)>>mpi->chroma_x_shift;
+	    mpi->height=h; mpi->chroma_height=(h + (1<<mpi->chroma_y_shift) - 1)>>mpi->chroma_y_shift;
 	}
     }
     if(!mpi->bpp) mp_image_setfmt(mpi,outfmt);
@@ -236,7 +236,7 @@
 //		  printf("query -> 0x%X    \n",flags);
 		  if(flags&VFCAP_ACCEPT_STRIDE){
 	              mpi->width=w2;
-		      mpi->chroma_width=w2>>mpi->chroma_x_shift;
+		      mpi->chroma_width=(w2 + (1<<mpi->chroma_x_shift) - 1)>>mpi->chroma_x_shift;
 		  }
 	      }
 	  }