From 41d608198fd75ab207721036d3d7efb035c59a1a Mon Sep 17 00:00:00 2001 From: rfelker Date: Sat, 3 May 2003 04:20:44 +0000 Subject: [PATCH] fixed a 10l (undefined behavior) and made the other parameters configurable (it's probably nice not to have to throw away half the information...) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10052 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vf_down3dright.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/libmpcodecs/vf_down3dright.c b/libmpcodecs/vf_down3dright.c index 6a9f979420..00b6703238 100644 --- a/libmpcodecs/vf_down3dright.c +++ b/libmpcodecs/vf_down3dright.c @@ -53,10 +53,14 @@ static void toright(unsigned char *dst[3], unsigned char *src[3], 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 @@ static int open(vf_instance_t *vf, char* args) 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; }