518 |
(iCrc!=8107)?"| ERROR": "" ); |
(iCrc!=8107)?"| ERROR": "" ); |
519 |
#endif |
#endif |
520 |
|
|
521 |
|
/* New functions for field prediction by CK 1.10.2005 */ |
522 |
|
#pragma NEW8X4 |
523 |
|
TEST_MB(interpolate8x4_halfpel_h, 0); |
524 |
|
printf("%s - interpfield-h -round0 %.3f usec crc32=0x%08x %s\n", |
525 |
|
cpu->name, t, iCrc, |
526 |
|
(iCrc!=0x9538d6df)?"| ERROR": "" ); |
527 |
|
|
528 |
|
TEST_MB(interpolate8x4_halfpel_h, 1); |
529 |
|
printf("%s - round1 %.3f usec crc32=0x%08x %s\n", |
530 |
|
cpu->name, t, iCrc, |
531 |
|
(iCrc!=0xde5f1db4)?"| ERROR": "" ); |
532 |
|
|
533 |
|
|
534 |
|
TEST_MB(interpolate8x4_halfpel_v, 0); |
535 |
|
printf("%s - interpfield- v-round0 %.3f usec crc32=0x%08x %s\n", |
536 |
|
cpu->name, t, iCrc, |
537 |
|
(iCrc!=0xea5a69ef)?"| ERROR": "" ); |
538 |
|
|
539 |
|
TEST_MB(interpolate8x4_halfpel_v, 1); |
540 |
|
printf("%s - round1 %.3f usec crc32=0x%08x %s\n", |
541 |
|
cpu->name, t, iCrc, |
542 |
|
(iCrc!=0x4f10ec0f)?"| ERROR": "" ); |
543 |
|
|
544 |
|
|
545 |
|
TEST_MB(interpolate8x4_halfpel_hv, 0); |
546 |
|
printf("%s - interpfield-hv-round0 %.3f usec crc32=0x%08x %s\n", |
547 |
|
cpu->name, t, iCrc, |
548 |
|
(iCrc!=0xf97ee367)?"| ERROR": "" ); |
549 |
|
|
550 |
|
TEST_MB(interpolate8x4_halfpel_hv, 1); |
551 |
|
printf("%s - round1 %.3f usec crc32=0x%08x %s\n", |
552 |
|
cpu->name, t, iCrc, |
553 |
|
(iCrc!=0xb6a9f581)?"| ERROR": "" ); |
554 |
|
/* End of 8x4 functions */ |
555 |
|
|
556 |
printf( " --- \n" ); |
printf( " --- \n" ); |
557 |
} |
} |
558 |
} |
} |
660 |
cpu->name, t, s, |
cpu->name, t, s, |
661 |
(s!=0xee7ccbb4)?"| ERROR": ""); |
(s!=0xee7ccbb4)?"| ERROR": ""); |
662 |
|
|
663 |
|
/* New functions for field prediction by CK 1.10.2005 */ |
664 |
|
#pragma NEW8X4 |
665 |
|
TEST_TRANSFER(transfer8x4_copy, Dst8, Src8); |
666 |
|
printf("%s - 8to4 %.3f usec crc32=0x%08x %s\n", |
667 |
|
cpu->name, t, s, |
668 |
|
(s!=0xbb9c3db5)?"| ERROR": ""); |
669 |
|
/* End of new functions */ |
670 |
|
|
671 |
TEST_TRANSFER(transfer8x8_copy, Dst8, Src8); |
TEST_TRANSFER(transfer8x8_copy, Dst8, Src8); |
672 |
printf("%s - 8to8 %.3f usec crc32=0x%08x %s\n", |
printf("%s - 8to8 %.3f usec crc32=0x%08x %s\n", |
673 |
cpu->name, t, s, |
cpu->name, t, s, |
966 |
DECLARE_ALIGNED_MATRIX(Src2, 6, 64, int16_t, 16); |
DECLARE_ALIGNED_MATRIX(Src2, 6, 64, int16_t, 16); |
967 |
DECLARE_ALIGNED_MATRIX(Src3, 6, 64, int16_t, 16); |
DECLARE_ALIGNED_MATRIX(Src3, 6, 64, int16_t, 16); |
968 |
DECLARE_ALIGNED_MATRIX(Src4, 6, 64, int16_t, 16); |
DECLARE_ALIGNED_MATRIX(Src4, 6, 64, int16_t, 16); |
969 |
|
DECLARE_ALIGNED_MATRIX(Src5, 6, 64, int16_t, 16); |
970 |
|
|
971 |
printf( "\n ===== test cbp =====\n" ); |
printf( "\n ===== test cbp =====\n" ); |
972 |
|
|
975 |
Src2[i] = (i<3*64); /* half-full */ |
Src2[i] = (i<3*64); /* half-full */ |
976 |
Src3[i] = ((i+32)>3*64); |
Src3[i] = ((i+32)>3*64); |
977 |
Src4[i] = (i==(3*64+2) || i==(5*64+9)); |
Src4[i] = (i==(3*64+2) || i==(5*64+9)); |
978 |
|
Src5[i] = ieee_rand(0,1) ? -1 : 1; /* +/- test */ |
979 |
} |
} |
980 |
|
|
981 |
for(cpu = cpu_list; cpu->name!=0; ++cpu) |
for(cpu = cpu_list; cpu->name!=0; ++cpu) |
998 |
TEST_CBP(calc_cbp, Src4, nb_tests); |
TEST_CBP(calc_cbp, Src4, nb_tests); |
999 |
printf("%s - calc_cbp#4 %.3f usec cbp=0x%02x %s\n", |
printf("%s - calc_cbp#4 %.3f usec cbp=0x%02x %s\n", |
1000 |
cpu->name, t, cbp, (cbp!=0x05)?"| ERROR": "" ); |
cpu->name, t, cbp, (cbp!=0x05)?"| ERROR": "" ); |
1001 |
|
TEST_CBP(calc_cbp, Src5, nb_tests); |
1002 |
|
printf("%s - calc_cbp#4 %.3f usec cbp=0x%02x %s\n", |
1003 |
|
cpu->name, t, cbp, (cbp!=0x3f)?"| ERROR": "" ); |
1004 |
printf( " --- \n" ); |
printf( " --- \n" ); |
1005 |
} |
} |
1006 |
|
|
1822 |
} |
} |
1823 |
|
|
1824 |
/********************************************************************* |
/********************************************************************* |
1825 |
|
* test compiler |
1826 |
|
*********************************************************************/ |
1827 |
|
|
1828 |
|
void test_compiler() { |
1829 |
|
int nb_err = 0; |
1830 |
|
int32_t v; |
1831 |
|
if (sizeof(uint16_t)<2) { |
1832 |
|
printf( "ERROR: sizeof(uint16_t)<2!\n" ); |
1833 |
|
nb_err++; |
1834 |
|
} |
1835 |
|
if (sizeof(int16_t)<2) { |
1836 |
|
printf( "ERROR: sizeof(int16_t)<2!\n" ); |
1837 |
|
nb_err++; |
1838 |
|
} |
1839 |
|
if (sizeof(uint8_t)!=1) { |
1840 |
|
printf( "ERROR: sizeof(uint8_t)!=1!\n" ); |
1841 |
|
nb_err++; |
1842 |
|
} |
1843 |
|
if (sizeof(int8_t)!=1) { |
1844 |
|
printf( "ERROR: sizeof(uint8_t)!=1!\n" ); |
1845 |
|
nb_err++; |
1846 |
|
} |
1847 |
|
if (sizeof(uint32_t)<4) { |
1848 |
|
printf( "ERROR: sizeof(uint8_t)<4!\n" ); |
1849 |
|
nb_err++; |
1850 |
|
} |
1851 |
|
if (sizeof(int32_t)<4) { |
1852 |
|
printf( "ERROR: sizeof(uint32_t)<4!\n" ); |
1853 |
|
nb_err++; |
1854 |
|
} |
1855 |
|
/* yes, i know, this test is silly. But better be safe than sorry. :) */ |
1856 |
|
for(v=1000; v>=0; v--) { |
1857 |
|
if ( (v>>2) != v/4) |
1858 |
|
nb_err++; |
1859 |
|
} |
1860 |
|
for(v=-1000; v!=-1; v++) { |
1861 |
|
if ( (v>>2) != (v/4)-!!(v%4)) |
1862 |
|
nb_err++; |
1863 |
|
} |
1864 |
|
if (nb_err!=0) { |
1865 |
|
printf( "ERROR! please post your platform/compiler specs to xvid-devel@xvid.org !\n" ); |
1866 |
|
} |
1867 |
|
} |
1868 |
|
|
1869 |
|
/********************************************************************* |
1870 |
* main |
* main |
1871 |
*********************************************************************/ |
*********************************************************************/ |
1872 |
|
|
1934 |
if (what==0 || what==10) test_sse(); |
if (what==0 || what==10) test_sse(); |
1935 |
if (what==0 || what==11) test_log2bin(); |
if (what==0 || what==11) test_log2bin(); |
1936 |
if (what==0 || what==12) test_gcd(); |
if (what==0 || what==12) test_gcd(); |
1937 |
|
if (what==0 || what==13) test_compiler(); |
1938 |
|
|
1939 |
|
|
1940 |
if (what==7) { |
if (what==7) { |