changeset 5772:cfb787b821a0

10l, >1bpp modes fixed..., x<->y swapped
author arpi
date Sun, 21 Apr 2002 16:42:08 +0000
parents e9280ded1fb2
children 4c6b5ab80de2
files libmpcodecs/vf_mirror.c
diffstat 1 files changed, 12 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vf_mirror.c	Sun Apr 21 16:37:28 2002 +0000
+++ b/libmpcodecs/vf_mirror.c	Sun Apr 21 16:42:08 2002 +0000
@@ -15,33 +15,29 @@
 
 
 static void mirror(unsigned char* dst,unsigned char* src,int dststride,int srcstride,int w,int h,int bpp){
-    int x;
-
-    // 
-    for(x=0;x<h;x++){
-	int y;
+    int y;
+    for(y=0;y<h;y++){
+	int x;
 	switch(bpp){
 	case 1:
-	    for(y=0;y<w;y++) dst[y]=src[w-y-1+x*srcstride];
+	    for(x=0;x<w;x++) dst[x]=src[w-x-1];
 	    break;
 	case 2:
-	    for(y=0;y<w;y++) *((short*)(dst+y*2))=*((short*)(src+w-y*2-1+x*srcstride));
+	    for(x=0;x<w;x++) *((short*)(dst+x*2))=*((short*)(src+(w-x-1)*2));
 	    break;
 	case 3:
-	    for(y=0;y<w;y++){
-		dst[y*3+0]=src[0+w-y*3-1+x*srcstride];
-		dst[y*3+1]=src[1+w-y*3-1+x*srcstride];
-		dst[y*3+2]=src[2+w-y*3-1+x*srcstride];
+	    for(x=0;x<w;x++){
+		dst[x*3+0]=src[0+(w-x-1)*3];
+		dst[x*3+1]=src[1+(w-x-1)*3];
+		dst[x*3+2]=src[2+(w-x-1)*3];
 	    }
 	    break;
 	case 4:
-	    for(y=0;y<w;y++) *((int*)(dst+y*4))=*((int*)(src+w-y*4-1+x*srcstride));
+	    for(x=0;x<w;x++) *((int*)(dst+x*4))=*((int*)(src+(w-x-1)*4));
 	}
+	src+=srcstride;
 	dst+=dststride;
     }
-
-    //
-
 }
 
 //===========================================================================//
@@ -53,7 +49,6 @@
     dmpi=vf_get_image(vf->next,mpi->imgfmt,
 	MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
 	mpi->w, mpi->h);
-	//mpi->h, mpi->w);
 
     if(mpi->flags&MP_IMGFLAG_PLANAR){
 	       mirror(dmpi->planes[0],mpi->planes[0],
@@ -83,7 +78,7 @@
 }
 
 vf_info_t vf_info_mirror = {
-    "mirror",
+    "horizontal mirror",
     "mirror",
     "Eyck",
     "",