[FFmpeg-devel] [PATCH 7/9] dct-test: allow comparing x86 simple idcts
Christophe Gisquet
christophe.gisquet at gmail.com
Thu Oct 8 08:22:54 CEST 2015
Currently, no arch-specific implementation of the simple idcts
actually exist, only their _put version, and for x86. Therefore,
wrap also the C version to allow easier comparison of the
generated results.
---
libavcodec/dct-test.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c
index 9eab7fe..18d1ba7 100644
--- a/libavcodec/dct-test.c
+++ b/libavcodec/dct-test.c
@@ -98,8 +98,18 @@ static const struct algo idct_tab8[] = {
{ 0 }
};
+#define SIC_WRAP(BITS) \
+static void simple_idct##BITS##_put_wrap(int16_t *dst){ \
+ int i; \
+ dst[0] += 1<<(BITS+2); \
+ ff_simple_idct_put_##BITS((uint8_t*)dst, 16, dst); \
+ for (i = 0; i < 64; i++) dst[i] -= 1<<(BITS-1); \
+}
+
+SIC_WRAP(10)
+
static const struct algo idct_tab10[] = {
- { "SIMPLE10-C", ff_simple_idct_10, FF_IDCT_PERM_NONE },
+ { "SIMPLE10-C", simple_idct10_put_wrap, FF_IDCT_PERM_NONE },
{ 0 }
};
@@ -222,8 +232,7 @@ 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"))
+ else if (strcmp(dct->name, "SIMPLE10-") > 0)
for (i = 0; i < 64; i++)
block1[i] = av_clip(block1[i], -512, 511);
--
2.6.0
More information about the ffmpeg-devel
mailing list