changeset 10051:55831d1b371b

fixed a 10l (undefined behavior) and made the other parameters configurable (it's probably nice not to have to throw away half the information...)
author rfelker
date Sat, 03 May 2003 04:20:44 +0000
parents 39a6387f1ebe
children b358b7509e1a
files libmpcodecs/vf_down3dright.c
diffstat 1 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vf_down3dright.c	Fri May 02 19:59:37 2003 +0000
+++ b/libmpcodecs/vf_down3dright.c	Sat May 03 04:20:44 2003 +0000
@@ -53,10 +53,14 @@
 			unsigned char* sR = fromR;
 
 			if (p->scalew == 1) {
-				for (j = dd; j > 0; j--)
-					*t++ = (*sL++ + *sL++) / 2;
-				for (j = dd ; j > 0; j--)
-					*t++ = (*sR++ + *sR++) / 2;
+				for (j = dd; j > 0; j--) {
+					*t++ = (sL[0] + sL[1]) / 2;
+					sL+=2;
+				}
+				for (j = dd ; j > 0; j--) {
+					*t++ = (sR[0] + sR[1]) / 2;
+					sR+=2;
+				}
 			} else {
 				for (j = dd * 2 ; j > 0; j--)
 					*t++ = *sL++;
@@ -129,7 +133,7 @@
 	vf->priv->skipline = 0;
 	vf->priv->scalew = 1;
 	vf->priv->scaleh = 2;
-	if (args) sscanf(args, "%d", &vf->priv->skipline);
+	if (args) sscanf(args, "%d:%d:%d", &vf->priv->skipline, &vf->priv->scalew, &vf->priv->scaleh);
 
 	return 1;
 }