X-Git-Url: http://git.ffmpeg.org/gitweb/ffmpeg.git/blobdiff_plain/9e8098e72a34d7c46518c30f3c3e785040fa9471..b4f237b6b5d60a12a81b6c01785ce3240396a375:/tests/dsptest.c diff --git a/tests/dsptest.c b/tests/dsptest.c index ab51027..0b3a397 100644 --- a/tests/dsptest.c +++ b/tests/dsptest.c @@ -1,28 +1,38 @@ /* * MMX optimized DSP utils - * Copyright (c) 2000, 2001 Gerard Lantau. + * Copyright (c) 2000, 2001, 2002 Fabrice Bellard. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - #define TESTCPU_MAIN +#include "avcodec.h" #include "dsputil.h" -//#include "../libavcodec/dsputil.c" +#include "mpegvideo.h" +#include "mpeg12data.h" +#include "mpeg4data.h" #include "../libavcodec/i386/cputest.c" #include "../libavcodec/i386/dsputil_mmx.c" + +#include "../libavcodec/i386/fdct_mmx.c" +#include "../libavcodec/i386/idct_mmx.c" +#include "../libavcodec/i386/motion_est_mmx.c" +#include "../libavcodec/i386/simple_idct_mmx.c" +#include "../libavcodec/dsputil.c" +#include "../libavcodec/simple_idct.c" +#include "../libavcodec/jfdctfst.c" + #undef TESTCPU_MAIN #define PAD 0x10000 @@ -64,8 +74,11 @@ static const struct pix_func { } pix_func[] = { PIX_FUNC_MMX(put_pixels), - PIX_FUNC_MMX(put_pixels_x2), - PIX_FUNC_MMX(put_pixels_y2), + //PIX_FUNC_MMX(get_pixels), + //PIX_FUNC_MMX(put_pixels_clamped), +#if 1 + PIX_FUNC(put_pixels_x2), + PIX_FUNC(put_pixels_y2), PIX_FUNC_MMX(put_pixels_xy2), PIX_FUNC(put_no_rnd_pixels_x2), @@ -77,6 +90,11 @@ static const struct pix_func { PIX_FUNC(avg_pixels_y2), PIX_FUNC(avg_pixels_xy2), + PIX_FUNC_MMX(avg_no_rnd_pixels), + PIX_FUNC_MMX(avg_no_rnd_pixels_x2), + PIX_FUNC_MMX(avg_no_rnd_pixels_y2), + PIX_FUNC_MMX(avg_no_rnd_pixels_xy2), +#endif { 0, 0 } }; @@ -105,25 +123,25 @@ static test_speed(int step) op_pixels_func func = pix->func; char* im = bu; - if (!(pix->mm_flags & mm_flags)) - continue; - - printf("%30s... ", pix->name); - fflush(stdout); - ts = rdtsc(); - for(i=0; i<100000; i++){ - func(im, im + 1000, linesize, 16); - im += step; - if (im > bu + 20000) - im = bu; + if (pix->mm_flags & mm_flags) + { + printf("%30s... ", pix->name); + fflush(stdout); + ts = rdtsc(); + for(i=0; i<100000; i++){ + func(im, im + 1000, linesize, 16); + im += step; + if (im > bu + 20000) + im = bu; + } + te = rdtsc(); + emms(); + printf("% 9d\n", (int)(te - ts)); + sum += (te - ts) / 100000; + if (pix->mm_flags & PAD) + puts(""); } - te = rdtsc(); - emms(); - printf("% 9d\n", (int)(te - ts)); - sum += (te - ts) / 100000; - if (pix->mm_flags & PAD) - puts(""); - pix++; + pix++; } printf("Total sum: %d\n", sum); @@ -142,7 +160,7 @@ int main(int argc, char* argv[]) } mm_flags = mm_support(); - printf("dsptest: CPU flags:"); + printf("%s: detected CPU flags:", argv[0]); if (mm_flags & MM_MMX) printf(" mmx"); if (mm_flags & MM_MMXEXT)