50 #define COMPE(a,b,e) (abs((a)-(b)) < (((a)+(b))>>(e)))
51 #define COMPARABLE(a,b) COMPE((a),(b),2)
52 #define VERYCLOSE(a,b) COMPE((a),(b),3)
54 #define OUTER_TC_NBHD(s) ( \
55 COMPARABLE((s)[-1].m.even,(s)[-1].m.odd) && \
56 COMPARABLE((s)[1].m.even,(s)[0].m.odd) && \
57 COMPARABLE((s)[2].m.even,(s)[1].m.odd) && \
58 COMPARABLE((s)[-1].m.noise,(s)[0].m.temp) && \
59 COMPARABLE((s)[2].m.noise,(s)[2].m.temp) )
61 #define INNER_TC_NBHD(s,l,h) ( \
62 COMPARABLE((s)[0].m.even,(l)) && \
63 COMPARABLE((s)[2].m.odd,(l)) && ( \
64 COMPARABLE((s)[0].m.noise,(h)) || \
65 COMPARABLE((s)[1].m.noise,(h)) ) )
77 unsigned char *oldp, *newp;
84 even += abs(newp[0]-oldp[0]);
85 odd += abs(newp[ns]-oldp[os]);
86 noise += newp[ns]-newp[0];
87 temp += oldp[os]-newp[0];
98 static void diff_planes(
struct metrics *
m,
unsigned char *old,
unsigned char *
new,
int w,
int h,
int os,
int ns)
100 int x, y,
me=0, mo=0, mn=0, mt=0;
102 for (y = 0; y < h-7; y += 8) {
103 for (x = 0; x < w-7; x += 8) {
106 if (l.
odd > mo) mo = l.
odd;
121 new->w, new->h, old->
stride[0], new->stride[0]);
124 new->chroma_width, new->chroma_height,
125 old->
stride[1], new->stride[1]);
127 new->chroma_width, new->chroma_height,
128 old->
stride[2], new->stride[2]);
152 case -1:
case 0:
case 1:
case 2:
333 switch (p->
analyze(p, mpi, dmpi)) {
372 static int config(
struct vf_instance *vf,
379 static void uninit(
struct vf_instance *vf)
394 #define STARTVARS if (0)
395 #define GETVAR(str, name, out, func) \
396 else if (!strncmp((str), name "=", sizeof(name))) \
397 (out) = (func)((str) + sizeof(name))
415 for (args=orig=strdup(args); args; args=next) {
416 next = strchr(args,
':');
417 if (next) *next++ = 0;
447 "de-telecine filter",