summaryrefslogtreecommitdiff
path: root/libavfilter/vf_threshold.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2017-11-12 19:11:51 +0100
committerPaul B Mahol <onemda@gmail.com>2017-12-02 14:58:56 +0100
commitbbfcb1b7c891319a3eb4420c144ddae471942631 (patch)
tree9dfd502aa95efa7586c68719345acfea51af4f57 /libavfilter/vf_threshold.c
parentb5587fd2c6ce39bad7a5e7ebb3bd86b6469648de (diff)
avfilter/vf_threshold: add x86 SIMD
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter/vf_threshold.c')
-rw-r--r--libavfilter/vf_threshold.c28
1 files changed, 6 insertions, 22 deletions
diff --git a/libavfilter/vf_threshold.c b/libavfilter/vf_threshold.c
index 76c3ddb892..4183b353d2 100644
--- a/libavfilter/vf_threshold.c
+++ b/libavfilter/vf_threshold.c
@@ -31,27 +31,7 @@
#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
@@ -203,8 +183,9 @@ static int config_input(AVFilterLink *inlink)
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;
- if (desc->comp[0].depth == 8) {
+ if (s->depth == 8) {
s->threshold = threshold8;
s->bpc = 1;
} else {
@@ -212,6 +193,9 @@ static int config_input(AVFilterLink *inlink)
s->bpc = 2;
}
+ if (ARCH_X86)
+ ff_threshold_init_x86(s);
+
return 0;
}