43 #define MAXROWSIZE 1200
45 static int config (
struct vf_instance *vf,
47 unsigned int flags,
unsigned int outfmt)
61 vf->priv->imgfmt = outfmt;
63 rowsize = vf->priv->pmpi->width;
65 vf->priv->max = vf->priv->level * vf->priv->pmpi->height * rowsize / 2;
67 vf->priv->diff = vf->priv->sense * 256;
69 vf->priv->diff = vf->priv->sense * (1 << (vf->priv->pmpi->bpp/3));
70 if (vf->priv->diff < 0) vf->priv->diff = 0;
72 vf->priv->pmpi->bpp < 24 && vf->priv->diff > 31)
75 vf->priv->pmpi->width, vf->priv->pmpi->height,
76 vf->priv->diff, (
unsigned int)vf->priv->max);
78 vf->priv->was_dint = 0;
87 int8_t *row0 = rrow0, *row1 = rrow1, *row2 = rrow2;
88 int rowsize = mpi->
width;
89 uint32_t nok = 0, max = vf->priv->max;
90 int diff = vf->priv->diff;
93 unsigned char *cur0, *prv0;
94 register unsigned char *cur, *prv;
98 if (mpi->
imgfmt == vf->priv->imgfmt)
102 for (j = 1; j < mpi->
height && nok <= max; j++)
108 for (i = 0; i < rowsize; i++)
110 if (cur[0] - prv[0] > diff)
112 else if (cur[0] - prv[0] < -diff)
120 if (j > 2 && row0[i] > 0 && (row1[i] < 0 || (!row1[i] && row2[i] < 0)) &&
124 else if (mpi->
bpp < 24)
125 for (i = 0; i < rowsize; i++)
127 n1 = cur[0] + (cur[1]<<8);
128 n2 = prv[0] + (prv[1]<<8);
129 if ((n1&0x1f) - (n2&0x1f) > diff ||
130 ((n1>>5)&0x3f) - ((n2>>5)&0x3f) > diff ||
131 ((n1>>11)&0x1f) - ((n2>>11)&0x1f) > diff)
133 else if ((n1&0x1f) - (n2&0x1f) < -diff ||
134 ((n1>>5)&0x3f) - ((n2>>5)&0x3f) < -diff ||
135 ((n1>>11)&0x1f) - ((n2>>11)&0x1f) < -diff)
143 if (j > 2 && row0[i] > 0 && (row1[i] < 0 || (!row1[i] && row2[i] < 0)) &&
148 for (i = 0; i < rowsize; i++)
150 if (cur[0] - prv[0] > diff ||
151 cur[1] - prv[1] > diff ||
152 cur[2] - prv[2] > diff)
154 else if (prv[0] - cur[0] > diff ||
155 prv[1] - cur[1] > diff ||
156 prv[2] - cur[2] > diff)
164 if (j > 2 && row0[i] > 0 && (row1[i] < 0 || (!row1[i] && row2[i] < 0)) &&
181 if (vf->priv->was_dint < 1)
183 vf->priv->was_dint++;
189 vf->priv->was_dint = 0;
208 "drop interlaced frames",