--- trunk/xvidcore/examples/xvid_bench.c 2005/09/23 12:53:35 1641 +++ trunk/xvidcore/examples/xvid_bench.c 2006/06/05 21:30:49 1707 @@ -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.25 2005-09-23 12:53:35 suxen_drol Exp $ + * $Id: xvid_bench.c,v 1.28 2006-06-05 21:30:49 Skal Exp $ * ****************************************************************************/ @@ -518,10 +518,50 @@ (iCrc!=8107)?"| ERROR": "" ); #endif + /* New functions for field prediction by CK 1.10.2005 */ +#pragma NEW8X4 + TEST_MB(interpolate8x4_halfpel_h, 0); + printf("%s - interpfield-h -round0 %.3f usec crc32=0x%08x %s\n", + cpu->name, t, iCrc, + (iCrc!=0x9538d6df)?"| ERROR": "" ); + + TEST_MB(interpolate8x4_halfpel_h, 1); + printf("%s - round1 %.3f usec crc32=0x%08x %s\n", + cpu->name, t, iCrc, + (iCrc!=0xde5f1db4)?"| ERROR": "" ); + + + TEST_MB(interpolate8x4_halfpel_v, 0); + printf("%s - interpfield- v-round0 %.3f usec crc32=0x%08x %s\n", + cpu->name, t, iCrc, + (iCrc!=0xea5a69ef)?"| ERROR": "" ); + + TEST_MB(interpolate8x4_halfpel_v, 1); + printf("%s - round1 %.3f usec crc32=0x%08x %s\n", + cpu->name, t, iCrc, + (iCrc!=0x4f10ec0f)?"| ERROR": "" ); + + + TEST_MB(interpolate8x4_halfpel_hv, 0); + printf("%s - interpfield-hv-round0 %.3f usec crc32=0x%08x %s\n", + cpu->name, t, iCrc, + (iCrc!=0xf97ee367)?"| ERROR": "" ); + + TEST_MB(interpolate8x4_halfpel_hv, 1); + printf("%s - round1 %.3f usec crc32=0x%08x %s\n", + cpu->name, t, iCrc, + (iCrc!=0xb6a9f581)?"| ERROR": "" ); +/* End of 8x4 functions */ + printf( " --- \n" ); } } +#undef ENTER +#undef LEAVE +#undef TEST_MB +#undef TEST_MB2 + /********************************************************************* * test transfer *********************************************************************/ @@ -625,6 +665,14 @@ cpu->name, t, s, (s!=0xee7ccbb4)?"| ERROR": ""); + /* New functions for field prediction by CK 1.10.2005 */ +#pragma NEW8X4 + TEST_TRANSFER(transfer8x4_copy, Dst8, Src8); + printf("%s - 8to4 %.3f usec crc32=0x%08x %s\n", + cpu->name, t, s, + (s!=0xbb9c3db5)?"| ERROR": ""); +/* End of new functions */ + TEST_TRANSFER(transfer8x8_copy, Dst8, Src8); printf("%s - 8to8 %.3f usec crc32=0x%08x %s\n", cpu->name, t, s, @@ -1657,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; tst=0; v--) { + if ( (v>>2) != v/4) + nb_err++; + } + for(v=-1000; v!=-1; v++) { + if ( (v>>2) != (v/4)-!!(v%4)) + nb_err++; + } + if (nb_err!=0) { + printf( "ERROR! please post your platform/compiler specs to xvid-devel@xvid.org !\n" ); + } +} + +/********************************************************************* * main *********************************************************************/ @@ -1846,6 +2013,8 @@ if (what==0 || what==10) test_sse(); 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==7) {