19 |
* along with this program; if not, write to the Free Software |
* along with this program; if not, write to the Free Software |
20 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 |
* |
* |
22 |
* $Id: xvid_bench.c,v 1.20 2005-05-23 12:06:02 Skal Exp $ |
* $Id: xvid_bench.c,v 1.21 2005-06-14 13:58:21 Skal Exp $ |
23 |
* |
* |
24 |
****************************************************************************/ |
****************************************************************************/ |
25 |
|
|
527 |
} \ |
} \ |
528 |
emms(); \ |
emms(); \ |
529 |
t = (gettime_usec()-t -overhead) / nb_tests;\ |
t = (gettime_usec()-t -overhead) / nb_tests;\ |
530 |
s = calc_crc((uint8_t*)(DST), sizeof((DST)), CRC32_INITIAL) |
s = calc_crc((uint8_t*)(DST), 8*32*sizeof((DST)[0]), CRC32_INITIAL) |
531 |
|
|
532 |
#define TEST_TRANSFER(FUNC, DST, SRC) \ |
#define TEST_TRANSFER(FUNC, DST, SRC) \ |
533 |
TEST_TRANSFER_BEGIN(DST); \ |
TEST_TRANSFER_BEGIN(DST); \ |
553 |
} \ |
} \ |
554 |
emms(); \ |
emms(); \ |
555 |
t = (gettime_usec()-t -overhead) / nb_tests;\ |
t = (gettime_usec()-t -overhead) / nb_tests;\ |
556 |
s = calc_crc((uint8_t*)(DST), sizeof((DST)), CRC32_INITIAL) |
s = calc_crc((uint8_t*)(DST), 8*32*sizeof((DST)[0]), CRC32_INITIAL) |
557 |
|
|
558 |
#define TEST_TRANSFER2(FUNC, DST, SRC, R1) \ |
#define TEST_TRANSFER2(FUNC, DST, SRC, R1) \ |
559 |
TEST_TRANSFER2_BEGIN(DST,SRC); \ |
TEST_TRANSFER2_BEGIN(DST,SRC); \ |
570 |
const int nb_tests = 4000*speed_ref; |
const int nb_tests = 4000*speed_ref; |
571 |
int i; |
int i; |
572 |
CPU *cpu; |
CPU *cpu; |
573 |
uint8_t Src8[8*32], Dst8[8*32], Ref1[8*32], Ref2[8*32]; |
// uint8_t Src8[8*32], Dst8[8*32], Ref1[8*32], Ref2[8*32]; |
574 |
int16_t Src16[8*32], Dst16[8*32]; |
// int16_t Src16[8*32], Dst16[8*32]; |
575 |
|
DECLARE_ALIGNED_MATRIX(Src8, 8, 32, uint8_t, CACHE_LINE); |
576 |
|
DECLARE_ALIGNED_MATRIX(Dst8, 8, 32, uint8_t, CACHE_LINE); |
577 |
|
DECLARE_ALIGNED_MATRIX(Ref1, 8, 32, uint8_t, CACHE_LINE); |
578 |
|
DECLARE_ALIGNED_MATRIX(Ref2, 8, 32, uint8_t, CACHE_LINE); |
579 |
|
DECLARE_ALIGNED_MATRIX(Src16, 8, 32, uint16_t, CACHE_LINE); |
580 |
|
DECLARE_ALIGNED_MATRIX(Dst16, 8, 32, uint16_t, CACHE_LINE); |
581 |
|
|
582 |
printf( "\n === test transfer ===\n" ); |
printf( "\n === test transfer ===\n" ); |
583 |
|
|
612 |
TEST_TRANSFER2(transfer_8to16sub, Dst16, Src8, Ref1); |
TEST_TRANSFER2(transfer_8to16sub, Dst16, Src8, Ref1); |
613 |
{ |
{ |
614 |
int s1, s2; |
int s1, s2; |
615 |
s1 = calc_crc((uint8_t*)Dst16, sizeof(Dst16), CRC32_INITIAL); |
s1 = calc_crc((uint8_t*)Dst16, 8*32*sizeof(Dst16[0]), CRC32_INITIAL); |
616 |
s2 = calc_crc((uint8_t*)Src8, sizeof(Src8), CRC32_INITIAL); |
s2 = calc_crc((uint8_t*)Src8, 8*32*sizeof(Src8[0]), CRC32_INITIAL); |
617 |
printf("%s - 8to16sub %.3f usec crc32(1)=0x%08x crc32(2)=0x%08x %s %s\n", |
printf("%s - 8to16sub %.3f usec crc32(1)=0x%08x crc32(2)=0x%08x %s %s\n", |
618 |
cpu->name, t, s1, s2, |
cpu->name, t, s1, s2, |
619 |
(s1!=0xa1e07163)?"| ERROR1": "", |
(s1!=0xa1e07163)?"| ERROR1": "", |