[FFmpeg-devel] [PATCH 6/9] x86: dct-test: add 10 bits versions.

Christophe Gisquet christophe.gisquet at gmail.com
Thu Oct 8 08:22:53 CEST 2015


---
 libavcodec/dct-test.c     |  4 ++++
 libavcodec/x86/dct-test.c | 31 ++++++++++++++++++++++++++++++-
 2 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c
index 9a195ab..9eab7fe 100644
--- a/libavcodec/dct-test.c
+++ b/libavcodec/dct-test.c
@@ -222,6 +222,10 @@ static int dct_error(const struct algo *dct, int test, int is_idct, int speed, c
         if (!strcmp(dct->name, "PR-SSE2"))
             for (i = 0; i < 64; i++)
                 block1[i] = av_clip(block1[i], 4-512, 1019-512);
+        else if (!strcmp(dct->name, "SIMPLE10-SSE2") ||
+                 !strcmp(dct->name, "SIMPLE10-AVX"))
+            for (i = 0; i < 64; i++)
+                block1[i] = av_clip(block1[i], -512, 511);
 
         blockSumErr = 0;
         for (i = 0; i < 64; i++) {
diff --git a/libavcodec/x86/dct-test.c b/libavcodec/x86/dct-test.c
index 692c23b..348585c 100644
--- a/libavcodec/x86/dct-test.c
+++ b/libavcodec/x86/dct-test.c
@@ -89,7 +89,36 @@ static const struct algo idct_tab_arch8[] = {
 };
 
 static const struct algo fdct_tab_arch10[] = { { 0 } };
-static const struct algo idct_tab_arch10[] = { { 0 } };
+
+// Used to wrap the _put version and modify range
+#define SI_WRAP(BITS, INSN) \
+static void simple_idct##BITS##_put_##INSN##_wrap(int16_t *dst){ \
+    int i; \
+    dst[0] += 1<<(BITS+2); \
+    ff_simple_idct##BITS##_put_##INSN((uint8_t*)dst, 16, dst); \
+    for (i = 0; i < 64; i++) dst[i] -= 1<<(BITS-1); \
+}
+
+#if HAVE_YASM
+#if HAVE_SSE2_EXTERNAL
+SI_WRAP(10, sse2)
+#endif
+#if HAVE_AVX_EXTERNAL
+SI_WRAP(10, avx)
+#endif
+#endif
+
+static const struct algo idct_tab_arch10[] = {
+#if HAVE_YASM
+#if HAVE_SSE2_EXTERNAL
+    { "SIMPLE10-SSE2",  simple_idct10_put_sse2_wrap, FF_IDCT_PERM_TRANSPOSE, AV_CPU_FLAG_SSE2, 1 },
+#endif
+#if HAVE_AVX_EXTERNAL
+    { "SIMPLE10-AVX",   simple_idct10_put_avx_wrap,  FF_IDCT_PERM_TRANSPOSE, AV_CPU_FLAG_AVX,  1 },
+#endif
+#endif
+    { 0 }
+};
 static const struct algo fdct_tab_arch12[] = { { 0 } };
 static const struct algo idct_tab_arch12[] = { { 0 } };
 
-- 
2.6.0



More information about the ffmpeg-devel mailing list