aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorZdenek Kabelac <kabi@informatics.muni.cz>2002-05-23 14:57:11 +0000
committerZdenek Kabelac <kabi@informatics.muni.cz>2002-05-23 14:57:11 +0000
commit9e8098e72a34d7c46518c30f3c3e785040fa9471 (patch)
treed44d1448b9b475f3ccc9a2f98c859f8e269b2132 /tests
parentec9a41f57d3df89859a5eb9addd3f0de167909ba (diff)
downloadffmpeg-9e8098e72a34d7c46518c30f3c3e785040fa9471.tar.gz
* a little bit extended dsptest also suports dsptestpic target
Originally committed as revision 569 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile2
-rw-r--r--tests/dsptest.c53
2 files changed, 46 insertions, 9 deletions
diff --git a/tests/Makefile b/tests/Makefile
index cb3b387c66..f5198d7040 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -39,6 +39,8 @@ audiogen: audiogen.c
DSPDEPS = $(SRC_PATH)/libavcodec/i386/dsputil_mmx.c \
$(SRC_PATH)/libavcodec/i386/dsputil_mmx_avg.h
+dsptestpic: dsptest.c $(DSPDEPS)
+ $(CC) -fPIC -DPIC -O4 -fomit-frame-pointer -DHAVE_AV_CONFIG_H -I.. -I$(SRC_PATH)/libavcodec/i386 -I$(SRC_PATH)/libavcodec/ -o $@ $<
dsptest: dsptest.c $(DSPDEPS)
$(CC) -O4 -fomit-frame-pointer -DHAVE_AV_CONFIG_H -I.. -I$(SRC_PATH)/libavcodec/i386 -I$(SRC_PATH)/libavcodec/ -o $@ $<
diff --git a/tests/dsptest.c b/tests/dsptest.c
index 57596dd1f0..ab51027fa6 100644
--- a/tests/dsptest.c
+++ b/tests/dsptest.c
@@ -20,6 +20,7 @@
#define TESTCPU_MAIN
#include "dsputil.h"
+//#include "../libavcodec/dsputil.c"
#include "../libavcodec/i386/cputest.c"
#include "../libavcodec/i386/dsputil_mmx.c"
#undef TESTCPU_MAIN
@@ -31,22 +32,51 @@
*
* currently only for i386 - FIXME
*/
+
+#define PIX_FUNC_C(a) \
+ { #a "_c", a ## _c, 0 }, \
+ { #a "_mmx", a ## _mmx, MM_MMX }, \
+ { #a "_mmx2", a ## _mmx2, MM_MMXEXT | PAD }
+
+#define PIX_FUNC(a) \
+ { #a "_mmx", a ## _mmx, MM_MMX }, \
+ { #a "_3dnow", a ## _3dnow, MM_3DNOW }, \
+ { #a "_mmx2", a ## _mmx2, MM_MMXEXT | PAD }
+
+#define PIX_FUNC_MMX(a) \
+ { #a "_mmx", a ## _mmx, MM_MMX | PAD }
+
+/*
+ PIX_FUNC_C(pix_abs16x16),
+ PIX_FUNC_C(pix_abs16x16_x2),
+ PIX_FUNC_C(pix_abs16x16_y2),
+ PIX_FUNC_C(pix_abs16x16_xy2),
+ PIX_FUNC_C(pix_abs8x8),
+ PIX_FUNC_C(pix_abs8x8_x2),
+ PIX_FUNC_C(pix_abs8x8_y2),
+ PIX_FUNC_C(pix_abs8x8_xy2),
+*/
+
static const struct pix_func {
char* name;
op_pixels_func func;
int mm_flags;
} pix_func[] = {
- { "put_pixels_x2_mmx", put_pixels_y2_mmx, MM_MMX },
- { "put_pixels_x2_3dnow", put_pixels_y2_3dnow, MM_3DNOW },
- { "put_pixels_x2_mmx2", put_pixels_y2_mmx2, MM_MMXEXT | PAD },
- { "put_no_rnd_pixels_x2_mmx", put_no_rnd_pixels_x2_mmx, MM_MMX },
- { "put_no_rnd_pixels_x2_3dnow", put_no_rnd_pixels_x2_3dnow, MM_3DNOW },
- { "put_no_rnd_pixels_x2_mmx2", put_no_rnd_pixels_x2_mmx2, MM_MMXEXT | PAD },
+ PIX_FUNC_MMX(put_pixels),
+ PIX_FUNC_MMX(put_pixels_x2),
+ PIX_FUNC_MMX(put_pixels_y2),
+ PIX_FUNC_MMX(put_pixels_xy2),
+
+ PIX_FUNC(put_no_rnd_pixels_x2),
+ PIX_FUNC(put_no_rnd_pixels_y2),
+ PIX_FUNC_MMX(put_no_rnd_pixels_xy2),
+
+ PIX_FUNC(avg_pixels),
+ PIX_FUNC(avg_pixels_x2),
+ PIX_FUNC(avg_pixels_y2),
+ PIX_FUNC(avg_pixels_xy2),
- { "put_pixels_y2_mmx", put_pixels_y2_mmx, MM_MMX },
- { "put_pixels_y2_3dnow", put_pixels_y2_3dnow, MM_3DNOW },
- { "put_pixels_y2_mmx2", put_pixels_y2_mmx2, MM_MMXEXT | PAD },
{ 0, 0 }
};
@@ -66,6 +96,8 @@ static test_speed(int step)
char empty[32768];
char* bu =(char*)(((long)empty + 32) & ~0xf);
+ int sum = 0;
+
while (pix->name)
{
int i;
@@ -88,10 +120,13 @@ static test_speed(int step)
te = rdtsc();
emms();
printf("% 9d\n", (int)(te - ts));
+ sum += (te - ts) / 100000;
if (pix->mm_flags & PAD)
puts("");
pix++;
}
+
+ printf("Total sum: %d\n", sum);
}
int main(int argc, char* argv[])