29#define accumulator int
32#define accumulator int64_t
35#define fn3(a,b) a##_##b
36#define fn2(a,b) fn3(a,b)
37#define fn(a) fn2(a, DEPTH)
47#define DIFF(a, as, b, bs) ((t) = ((*(a) - (b)[bs]) * 4) + (a)[(as) * 2] - (b)[-(bs)], (t) * (t))
55 double bdiff, tdiff, pdiff;
66 bdiff = pdiff = tdiff = 65536.0;
69 const int ns =
new->linesize[0] /
sizeof(
pixel);
70 const int os = old->linesize[0] /
sizeof(
pixel);
73 const int h =
new->height;
74 const int w =
new->width;
79 const pixel *rend, *end = nptr + (
h - 2) * ns;
81 bdiff = pdiff = tdiff = 0.0;
86 pdif = tdif = bdif = 0;
91 for (rend = nptr +
w; nptr < rend; nptr++, optr++) {
92 pdif +=
DIFF(nptr, ns, nptr, ns);
93 tdif +=
DIFF(nptr, ns, optr, os);
96 for (rend = nptr +
w; nptr < rend; nptr++, optr++) {
97 pdif +=
DIFF(nptr, ns, nptr, ns);
98 tdif +=
DIFF(optr, os, nptr, ns);
104 for (rend = nptr +
w; nptr < rend; nptr++, optr++) {
105 pdif +=
DIFF(nptr, ns, nptr, ns);
106 bdif +=
DIFF(optr, os, nptr, ns);
109 for (rend = nptr +
w; nptr < rend; nptr++, optr++) {
110 pdif +=
DIFF(nptr, ns, nptr, ns);
111 bdif +=
DIFF(nptr, ns, optr, os);
117 for (rend = nptr +
w; nptr < rend; nptr++, optr++) {
118 tdif +=
DIFF(nptr, ns, optr, os);
119 bdif +=
DIFF(optr, os, nptr, ns);
122 for (rend = nptr +
w; nptr < rend; nptr++, optr++) {
123 bdif +=
DIFF(nptr, ns, optr, os);
124 tdif +=
DIFF(optr, os, nptr, ns);
130 for (rend = nptr +
w; nptr < rend; nptr++, optr++) {
131 pdif +=
DIFF(nptr, ns, nptr, ns);
132 tdif +=
DIFF(nptr, ns, optr, os);
133 bdif +=
DIFF(optr, os, nptr, ns);
136 for (rend = nptr +
w; nptr < rend; nptr++, optr++) {
137 pdif +=
DIFF(nptr, ns, nptr, ns);
138 bdif +=
DIFF(nptr, ns, optr, os);
139 tdif +=
DIFF(optr, os, nptr, ns);
168 if (bdiff < pdiff && bdiff < tdiff) {
170 }
else if (tdiff < pdiff && tdiff < bdiff) {
179 tdiff, bdiff, pdiff);
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Main libavfilter public API header.
#define AV_FRAME_FLAG_INTERLACED
A flag to mark frames whose content is interlaced.
#define AV_FRAME_FLAG_TOP_FIELD_FIRST
A flag to mark frames where the top field is displayed first if the content is interlaced.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
static void scale(int *out, const int *in, const int w, const int h, const int shift)
static const int factor[16]
static enum PhaseMode fn analyze_plane(void *ctx, enum PhaseMode mode, AVFrame *old, AVFrame *new)
#define DIFF(a, as, b, bs)
This structure describes decoded (raw) audio or video data.
static AVFormatContext * ctx
@ PROGRESSIVE
in the bitstream is reported as 00b