diff options
author | skal <pascal.massimino@gmail.com> | 2014-09-03 13:02:32 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-09-05 00:19:00 +0400 |
commit | 406a9ccffea8fc36c1e56c07ca32c559ccce52af (patch) | |
tree | 10c9fb8d62af811393a63a472ca7d286d2947b9a /libavfilter/vf_idet.c | |
parent | 53b089200557b299174bec72415b166ad43083a6 (diff) |
avfilter/vf_idet: MMX/MMXEXT/SSE2 implementation of idet's filter_line()
integration by Neil Birkbeck, with help from Vitor Sessak.
core SSE2 loop by Skal (pascal.massimino@gmail.com)
Reviewed-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/vf_idet.c')
-rw-r--r-- | libavfilter/vf_idet.c | 38 |
1 files changed, 6 insertions, 32 deletions
diff --git a/libavfilter/vf_idet.c b/libavfilter/vf_idet.c index d441a5f07a..4416228431 100644 --- a/libavfilter/vf_idet.c +++ b/libavfilter/vf_idet.c @@ -23,37 +23,8 @@ #include "libavutil/cpu.h" #include "libavutil/common.h" #include "libavutil/opt.h" -#include "libavutil/pixdesc.h" -#include "avfilter.h" #include "internal.h" - -#define HIST_SIZE 4 - -typedef enum { - TFF, - BFF, - PROGRSSIVE, - UNDETERMINED, -} Type; - -typedef struct { - const AVClass *class; - float interlace_threshold; - float progressive_threshold; - - Type last_type; - int prestat[4]; - int poststat[4]; - - uint8_t history[HIST_SIZE]; - - AVFrame *cur; - AVFrame *next; - AVFrame *prev; - int (*filter_line)(const uint8_t *prev, const uint8_t *cur, const uint8_t *next, int w); - - const AVPixFmtDescriptor *csp; -} IDETContext; +#include "vf_idet.h" #define OFFSET(x) offsetof(IDETContext, x) #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM @@ -77,7 +48,7 @@ static const char *type2str(Type type) return NULL; } -static int filter_line_c(const uint8_t *a, const uint8_t *b, const uint8_t *c, int w) +int ff_idet_filter_line_c(const uint8_t *a, const uint8_t *b, const uint8_t *c, int w) { int x; int ret=0; @@ -271,7 +242,10 @@ static av_cold int init(AVFilterContext *ctx) idet->last_type = UNDETERMINED; memset(idet->history, UNDETERMINED, HIST_SIZE); - idet->filter_line = filter_line_c; + idet->filter_line = ff_idet_filter_line_c; + + if (ARCH_X86) + ff_idet_init_x86(idet); return 0; } |