Hi,

updated patch, sorry for the broken format in the previous one. Hope it's
ok now.


On Wed, Sep 3, 2014 at 1:08 AM, James Darnley <james.darn...@gmail.com>
wrote:

> On 2014-09-02 17:13, Pascal Massimino wrote:
> > %macro DECLARE_VAR 2
> >     %define  %1 %2
> >     %define  %1d %2d
> > %endmacro
> >
> > ;; Mappings for common variables
> > DECLARE_VAR index, r5
> > DECLARE_VAR total, r4
> > DECLARE_VAR parallel_width, r6
>
> I suggest you leave these up to the cglobal macro
>
> > DECLARE_VAR tmp1, r7
> > DECLARE_VAR tmp2, r6
>
> Perhaps these two should use DECLARE_REG_TMP
>

Ok, i axed the left-over thing and make used for the c-version for
left-overs. Simpler.
x8inc.asm is quite hairy. Hope i used 'cglobal' right now.

/skal


> > movsxd
>
> Use x264asm's movsxifnidn macro, then it will only do something on 64-bit.
>
From 3002f01f4fe1bb547f2018119eaf2aded71fbc1b Mon Sep 17 00:00:00 2001
From: skal <pascal.massim...@gmail.com>
Date: Wed, 3 Sep 2014 11:02:32 +0200
Subject: [PATCH] MMX/MMXEXT/SSE2 implementation of idet's filter_line()

integration by Neil Birkbeck, with help from Vitor Sessak.
core SSE2 loop by Skal (pascal.massim...@gmail.com)
---
 MAINTAINERS              |  1 +
 libavfilter/vf_idet.c    | 38 ++++++--------------------------------
 libavfilter/x86/Makefile |  2 ++
 3 files changed, 9 insertions(+), 32 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index b80fe7a..0992ab5 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -353,6 +353,7 @@ Filters:
   vf_extractplanes.c                    Paul B Mahol
   vf_histogram.c                        Paul B Mahol
   vf_hqx.c                              Clément Bœsch
+  vf_idec.c                             Pascal Massimino
   vf_il.c                               Paul B Mahol
   vf_lenscorrection.c                   Daniel Oberhoff
   vf_mergeplanes.c                      Paul B Mahol
diff --git a/libavfilter/vf_idet.c b/libavfilter/vf_idet.c
index d441a5f..1f82dbf 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;
 }
diff --git a/libavfilter/x86/Makefile b/libavfilter/x86/Makefile
index 6a252b4..ddb3774 100644
--- a/libavfilter/x86/Makefile
+++ b/libavfilter/x86/Makefile
@@ -1,5 +1,6 @@
 OBJS-$(CONFIG_GRADFUN_FILTER)                += x86/vf_gradfun_init.o
 OBJS-$(CONFIG_HQDN3D_FILTER)                 += x86/vf_hqdn3d_init.o
+OBJS-$(CONFIG_IDET_FILTER)                   += x86/vf_idet_init.o
 OBJS-$(CONFIG_PULLUP_FILTER)                 += x86/vf_pullup_init.o
 OBJS-$(CONFIG_SPP_FILTER)                    += x86/vf_spp.o
 OBJS-$(CONFIG_VOLUME_FILTER)                 += x86/af_volume_init.o
@@ -7,6 +8,7 @@ OBJS-$(CONFIG_YADIF_FILTER)                  += x86/vf_yadif_init.o
 
 YASM-OBJS-$(CONFIG_GRADFUN_FILTER)           += x86/vf_gradfun.o
 YASM-OBJS-$(CONFIG_HQDN3D_FILTER)            += x86/vf_hqdn3d.o
+YASM-OBJS-$(CONFIG_IDET_FILTER)              += x86/vf_idet.o
 YASM-OBJS-$(CONFIG_PULLUP_FILTER)            += x86/vf_pullup.o
 YASM-OBJS-$(CONFIG_VOLUME_FILTER)            += x86/af_volume.o
 YASM-OBJS-$(CONFIG_YADIF_FILTER)             += x86/vf_yadif.o x86/yadif-16.o x86/yadif-10.o
-- 
2.1.0.rc2.206.gedb03e5

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to