#include "framesync.h"
#include "internal.h"
#include "video.h"
-
-typedef struct ThresholdContext {
- const AVClass *class;
-
- int planes;
- int bpc;
-
- int nb_planes;
- int width[4], height[4];
-
- void (*threshold)(const uint8_t *in, const uint8_t *threshold,
- const uint8_t *min, const uint8_t *max,
- uint8_t *out,
- ptrdiff_t ilinesize, ptrdiff_t tlinesize,
- ptrdiff_t flinesize, ptrdiff_t slinesize,
- ptrdiff_t olinesize,
- int w, int h);
-
- AVFrame *frames[4];
- FFFrameSync fs;
-} ThresholdContext;
+#include "threshold.h"
#define OFFSET(x) offsetof(ThresholdContext, x)
#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
in += ilinesize;
threshold += tlinesize;
min += flinesize;
- max += flinesize;
+ max += slinesize;
out += olinesize;
}
}
in += ilinesize / 2;
threshold += tlinesize / 2;
min += flinesize / 2;
- max += flinesize / 2;
+ max += slinesize / 2;
out += olinesize / 2;
}
}
s->height[0] = s->height[3] = inlink->h;
s->width[1] = s->width[2] = AV_CEIL_RSHIFT(inlink->w, hsub);
s->width[0] = s->width[3] = inlink->w;
+ s->depth = desc->comp[0].depth;
+
+ ff_threshold_init(s);
- if (desc->comp[0].depth == 8) {
+ return 0;
+}
+
+void ff_threshold_init(ThresholdContext *s)
+{
+ if (s->depth == 8) {
s->threshold = threshold8;
s->bpc = 1;
} else {
s->bpc = 2;
}
- return 0;
+ if (ARCH_X86)
+ ff_threshold_init_x86(s);
}
static int config_output(AVFilterLink *outlink)