diff libmpcodecs/vf_divtc.c @ 23666:5c3c7efd9b75

Get rid of my_memcpy_pic code duplication in many filters.
author reimar
date Thu, 28 Jun 2007 11:24:12 +0000
parents fa99b3d31d13
children ba7da0656d80
line wrap: on
line diff
--- a/libmpcodecs/vf_divtc.c	Thu Jun 28 11:18:16 2007 +0000
+++ b/libmpcodecs/vf_divtc.c	Thu Jun 28 11:24:12 2007 +0000
@@ -170,6 +170,11 @@
    return 0;
    }
 
+static int copyop(unsigned char *d, unsigned char *s, int bpl, int h, int dstride, int sstride, int dummy) {
+  memcpy_pic(d, s, bpl, h, dstride, sstride);
+  return 0;
+}
+
 static int imgop(int(*planeop)(unsigned char *, unsigned char *,
 			       int, int, int, int, int),
 		 mp_image_t *dst, mp_image_t *src, int arg)
@@ -336,7 +341,7 @@
    switch((p->frameno++-p->phase+10)%5)
       {
       case 0:
-	 imgop((void *)memcpy_pic, dmpi, mpi, 0);
+	 imgop(copyop, dmpi, mpi, 0);
 	 return 0;
 
       case 4:
@@ -348,14 +353,14 @@
 			      mpi->width, mpi->height);
 	    vf_clone_mpi_attributes(tmpi, mpi);
 
-	    imgop((void *)memcpy_pic, tmpi, mpi, 0);
+	    imgop(copyop, tmpi, mpi, 0);
 	    imgop(deghost_plane, tmpi, dmpi, p->deghost);
-	    imgop((void *)memcpy_pic, dmpi, mpi, 0);
+	    imgop(copyop, dmpi, mpi, 0);
 	    return vf_next_put_image(vf, tmpi, MP_NOPTS_VALUE);
 	    }
       }
 
-   imgop((void *)memcpy_pic, dmpi, mpi, 0);
+   imgop(copyop, dmpi, mpi, 0);
    return vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE);
    }