--- trunk/xvidcore/examples/xvid_bench.c 2005/10/26 12:38:34 1651 +++ trunk/xvidcore/examples/xvid_bench.c 2006/10/13 15:16:25 1737 @@ -19,7 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: xvid_bench.c,v 1.26 2005-10-26 12:38:33 Skal Exp $ + * $Id: xvid_bench.c,v 1.30 2006-10-13 15:16:25 Skal Exp $ * ****************************************************************************/ @@ -557,6 +557,11 @@ } } +#undef ENTER +#undef LEAVE +#undef TEST_MB +#undef TEST_MB2 + /********************************************************************* * test transfer *********************************************************************/ @@ -1700,6 +1705,80 @@ } #endif } + +/********************************************************************* + * test some YUV func + *********************************************************************/ + +#define ENTER \ +for(i=0; i<(int)sizeof(Dst0); ++i) Dst0[0][i] = 0; \ +t = gettime_usec(); \ +emms(); + +#define LEAVE \ +emms(); \ +t = (gettime_usec() - t) / nb_tests; \ + iCrc = calc_crc((uint8_t*)Dst0, sizeof(Dst0), CRC32_INITIAL) + +#define TEST_YUYV(FUNC, S) \ +ENTER \ +for(tst=0; tst255) ? 255 : v1; + Ref2[i] = (v2<0) ? 0 : (v2>255) ? 255 : v2; + } + lumc = ieee_rand(0, 255); + lumo = ieee_rand(0, 255); + + for(cpu = cpu_list; cpu->name!=0; ++cpu) + { + double t; + int m; + if (!init_cpu(cpu)) + continue; + lum8x8 = lum_8x8_c; + lum2x8 = lum_2x8_c; + csim = iconsim_c; + if (cpu->cpu & XVID_CPU_MMX){ + lum8x8 = lum_8x8_mmx; + csim = consim_mmx; + } + if (cpu->cpu & XVID_CPU_MMX){ + csim = consim_sse2; + } + + t = gettime_usec(); + emms(); + for(tst=0; tstname, t, m, + (m!=8230)?"| ERROR": "" ); + + t = gettime_usec(); + emms(); + for(tst=0; tstname, t, m, + (m!=-841)?"| ERROR": "" ); + + t = gettime_usec(); + emms(); + for(tst=0; tstname, t, devs[0], devs[1], devs[2], + (devs[0]!=0xeba80 || devs[1]!=0x1053e7 || devs[2]!=0x51215)?"| ERROR": "" ); + + printf( " --- \n" ); + } +} /********************************************************************* * main @@ -1935,6 +2101,8 @@ if (what==0 || what==11) test_log2bin(); if (what==0 || what==12) test_gcd(); if (what==0 || what==13) test_compiler(); + if (what==0 || what==14) test_yuv(); + if (what==0 || what==15) test_SSIM(); if (what==7) {