[Mplayer-cvslog] CVS: main/libmpcodecs vf_pullup.c, 1.6, 1.7 pullup.c, 1.16, 1.17

Richard Felker CVS syncmail at mplayerhq.hu
Thu Jun 10 07:06:37 CEST 2004


CVS change done by Richard Felker CVS

Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var2/tmp/cvs-serv24324/libmpcodecs

Modified Files:
	vf_pullup.c pullup.c 
Log Message:
old changes in my local tree i forgot to commit - minor fixes

Index: vf_pullup.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_pullup.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- vf_pullup.c	11 Dec 2003 16:07:14 -0000	1.6
+++ vf_pullup.c	10 Jun 2004 05:06:34 -0000	1.7
@@ -14,6 +14,9 @@
 
 #include "pullup.h"
 
+#undef MAX
+#define MAX(a,b) ((a)>(b)?(a):(b))
+
 struct vf_priv_s {
 	struct pullup_context *ctx;
 	int init;
@@ -36,6 +39,25 @@
 	return retval;
 }
 
+static inline void *il_memcpy_pic(void *dst, void *src0, void *src1, int w, int h, int ds, int ss)
+{
+	int i;
+	void *retval=dst;
+	ss += ss;
+
+	for(i=h>>1; i; i--)
+	{
+		memcpy(dst, src0, w);
+		src0 += ss;
+		dst += ds;
+		memcpy(dst, src1, w);
+		src1 += ss;
+		dst += ds;
+	}
+
+	return retval;
+}
+
 static void init_pullup(struct vf_instance_s* vf, mp_image_t *mpi)
 {
 	struct pullup_context *c = vf->priv->ctx;
@@ -58,6 +80,7 @@
 		c->metric_plane = 0;
 	}
 
+	c->strict_breaks = 0;
 	c->junk_left = c->junk_right = 1;
 	c->junk_top = c->junk_bottom = 4;
 	c->verbose = verbose;
@@ -165,6 +188,7 @@
 		}
 	}
 
+#if 0
 	/* Average qscale tables from both frames. */
 	if (mpi->qscale) {
 		for (i=0; i<c->w[3]; i++) {
@@ -172,6 +196,14 @@
 				+ f->ofields[1]->planes[3][i+c->w[3]])>>1;
 		}
 	}
+#else
+	/* Take worst of qscale tables from both frames. */
+	if (mpi->qscale) {
+		for (i=0; i<c->w[3]; i++) {
+			vf->priv->qbuf[i] = MAX(f->ofields[0]->planes[3][i], f->ofields[1]->planes[3][i+c->w[3]]);
+		}
+	}
+#endif
 
 	/* If the frame isn't already exportable... */
 	while (!f->buffer) {
@@ -184,6 +216,24 @@
 			break;
 		}
 		/* Direct render fields into output buffer */
+#if 0
+		/* Write-order copy seems to have worse cache performance
+		 * than read-order, but both should be checked on
+		 * various cpus to see which is actually better...*/
+		il_memcpy_pic(dmpi->planes[0], f->ofields[0]->planes[0],
+			f->ofields[1]->planes[0] + c->stride[0],
+			mpi->w, mpi->h, dmpi->stride[0], c->stride[0]);
+		if (mpi->flags & MP_IMGFLAG_PLANAR) {
+			il_memcpy_pic(dmpi->planes[1], f->ofields[0]->planes[1],
+				f->ofields[1]->planes[1] + c->stride[1],
+				mpi->chroma_width, mpi->chroma_height,
+				dmpi->stride[1], c->stride[1]);
+			il_memcpy_pic(dmpi->planes[2], f->ofields[0]->planes[2],
+				f->ofields[1]->planes[2] + c->stride[2],
+				mpi->chroma_width, mpi->chroma_height,
+				dmpi->stride[2], c->stride[2]);
+		}
+#else
 		my_memcpy_pic(dmpi->planes[0], f->ofields[0]->planes[0],
 			mpi->w, mpi->h/2, dmpi->stride[0]*2, c->stride[0]*2);
 		my_memcpy_pic(dmpi->planes[0] + dmpi->stride[0],
@@ -205,6 +255,7 @@
 				mpi->chroma_width, mpi->chroma_height/2,
 				dmpi->stride[2]*2, c->stride[2]*2);
 		}
+#endif
 		pullup_release_frame(f);
 		if (mpi->qscale) {
 			dmpi->qscale = vf->priv->qbuf;

Index: pullup.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/pullup.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- pullup.c	14 Dec 2003 01:38:41 -0000	1.16
+++ pullup.c	10 Jun 2004 05:06:34 -0000	1.17
@@ -424,10 +424,13 @@
 
 	/* Special case when fields are 100% identical */
 	if (f0->buffer == f2->buffer && f1->buffer != f3->buffer) {
-		f0->breaks |= BREAK_LEFT;
 		f2->breaks |= BREAK_RIGHT;
 		return;
 	}
+	if (f0->buffer != f2->buffer && f1->buffer == f3->buffer) {
+		f1->breaks |= BREAK_LEFT;
+		return;
+	}
 
 	for (i = 0; i < c->metric_len; i++) {
 		l = f2->diffs[i] - f3->diffs[i];
@@ -677,7 +680,7 @@
 			c->comb = licomb_y_mmx;
 		}
 #endif
-		//c->comb = qpcomb_y;
+		/* c->comb = qpcomb_y; */
 		break;
 #if 0
 	case PULLUP_FMT_YUY2:




More information about the MPlayer-cvslog mailing list