comparison libmpcodecs/vf_down3dright.c @ 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 e9a2af584986
children 44fbb21a4eba
comparison
equal deleted inserted replaced
10050:39a6387f1ebe 10051:55831d1b371b
51 unsigned char* t = to; 51 unsigned char* t = to;
52 unsigned char* sL = fromL; 52 unsigned char* sL = fromL;
53 unsigned char* sR = fromR; 53 unsigned char* sR = fromR;
54 54
55 if (p->scalew == 1) { 55 if (p->scalew == 1) {
56 for (j = dd; j > 0; j--) 56 for (j = dd; j > 0; j--) {
57 *t++ = (*sL++ + *sL++) / 2; 57 *t++ = (sL[0] + sL[1]) / 2;
58 for (j = dd ; j > 0; j--) 58 sL+=2;
59 *t++ = (*sR++ + *sR++) / 2; 59 }
60 for (j = dd ; j > 0; j--) {
61 *t++ = (sR[0] + sR[1]) / 2;
62 sR+=2;
63 }
60 } else { 64 } else {
61 for (j = dd * 2 ; j > 0; j--) 65 for (j = dd * 2 ; j > 0; j--)
62 *t++ = *sL++; 66 *t++ = *sL++;
63 for (j = dd * 2 ; j > 0; j--) 67 for (j = dd * 2 ; j > 0; j--)
64 *t++ = *sR++; 68 *t++ = *sR++;
127 131
128 vf->priv = calloc(1, sizeof (struct vf_priv_s)); 132 vf->priv = calloc(1, sizeof (struct vf_priv_s));
129 vf->priv->skipline = 0; 133 vf->priv->skipline = 0;
130 vf->priv->scalew = 1; 134 vf->priv->scalew = 1;
131 vf->priv->scaleh = 2; 135 vf->priv->scaleh = 2;
132 if (args) sscanf(args, "%d", &vf->priv->skipline); 136 if (args) sscanf(args, "%d:%d:%d", &vf->priv->skipline, &vf->priv->scalew, &vf->priv->scaleh);
133 137
134 return 1; 138 return 1;
135 } 139 }
136 140
137 vf_info_t vf_info_down3dright = { 141 vf_info_t vf_info_down3dright = {