summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vf_down3dright.c
diff options
context:
space:
mode:
authorrfelker <rfelker@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-05-03 04:20:44 +0000
committerrfelker <rfelker@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-05-03 04:20:44 +0000
commit41d608198fd75ab207721036d3d7efb035c59a1a (patch)
tree1918c7127c95768f3a39ca43b54c3146f3d2064c /libmpcodecs/vf_down3dright.c
parent92123824f979162cffc683631301826e17cf01ea (diff)
downloadmpv-41d608198fd75ab207721036d3d7efb035c59a1a.tar.bz2
mpv-41d608198fd75ab207721036d3d7efb035c59a1a.tar.xz
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
Diffstat (limited to 'libmpcodecs/vf_down3dright.c')
-rw-r--r--libmpcodecs/vf_down3dright.c14
1 files 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;
}