[FFmpeg-cvslog] x86: dct-test: evaluate prores idct avx version

Christophe Gisquet git at videolan.org
Sat Mar 14 13:53:07 CET 2015


ffmpeg | branch: master | Christophe Gisquet <christophe.gisquet at gmail.com> | Sat Mar 14 07:57:43 2015 +0000| [8200575d849473516cfe0a76cfceecdf9099a218] | committer: Michael Niedermayer

x86: dct-test: evaluate prores idct avx version

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8200575d849473516cfe0a76cfceecdf9099a218
---

 libavcodec/x86/dct-test.c |   39 ++++++++++++++++++++++++++-------------
 1 file changed, 26 insertions(+), 13 deletions(-)

diff --git a/libavcodec/x86/dct-test.c b/libavcodec/x86/dct-test.c
index 63a9aeb..d1a5067 100644
--- a/libavcodec/x86/dct-test.c
+++ b/libavcodec/x86/dct-test.c
@@ -26,21 +26,31 @@
 void ff_prores_idct_put_10_sse2(uint16_t *dst, int linesize,
                                 int16_t *block, int16_t *qmat);
 
-static void ff_prores_idct_put_10_sse2_wrap(int16_t *dst){
-    DECLARE_ALIGNED(16, static int16_t, qmat)[64];
-    DECLARE_ALIGNED(16, static int16_t, tmp)[64];
-    int i;
+#define PR_WRAP(INSN) \
+static void ff_prores_idct_put_10_##INSN##_wrap(int16_t *dst){ \
+    DECLARE_ALIGNED(16, static int16_t, qmat)[64]; \
+    DECLARE_ALIGNED(16, static int16_t, tmp)[64]; \
+    int i; \
+ \
+    for(i=0; i<64; i++){ \
+        qmat[i]=4; \
+        tmp[i]= dst[i]; \
+    } \
+    ff_prores_idct_put_10_##INSN (dst, 16, tmp, qmat); \
+ \
+    for(i=0; i<64; i++) { \
+         dst[i] -= 512; \
+    } \
+}
 
-    for(i=0; i<64; i++){
-        qmat[i]=4;
-        tmp[i]= dst[i];
-    }
-    ff_prores_idct_put_10_sse2(dst, 16, tmp, qmat);
+PR_WRAP(sse2)
+
+# if HAVE_AVX_EXTERNAL
+void ff_prores_idct_put_10_avx(uint16_t *dst, int linesize,
+                               int16_t *block, int16_t *qmat);
+PR_WRAP(avx)
+# endif
 
-    for(i=0; i<64; i++) {
-         dst[i] -= 512;
-    }
-}
 #endif
 
 static const struct algo fdct_tab_arch[] = {
@@ -71,6 +81,9 @@ static const struct algo idct_tab_arch[] = {
 #endif /* CONFIG_MPEG4_DECODER && HAVE_YASM */
 #if (CONFIG_PRORES_DECODER || CONFIG_PRORES_LGPL_DECODER) && ARCH_X86_64 && HAVE_YASM
     { "PR-SSE2",     ff_prores_idct_put_10_sse2_wrap, FF_IDCT_PERM_TRANSPOSE, AV_CPU_FLAG_SSE2, 1 },
+# if HAVE_AVX_EXTERNAL
+    { "PR-AVX",      ff_prores_idct_put_10_avx_wrap, FF_IDCT_PERM_TRANSPOSE, AV_CPU_FLAG_AVX, 1 },
+# endif
 #endif
     { 0 }
 };



More information about the ffmpeg-cvslog mailing list