24 |
* Don't take the checksums and crc too seriouly, they aren't |
* Don't take the checksums and crc too seriouly, they aren't |
25 |
* bullet-proof (should plug some .md5 here)... |
* bullet-proof (should plug some .md5 here)... |
26 |
* |
* |
27 |
* compiles with something like: |
* compiles best at xvidcore/src-dir with something like |
28 |
* gcc -o xvid_bench xvid_bench.c -I../src/ -lxvidcore -lm |
* |
29 |
|
* gcc -DARCH_IS_IA32 -DARCH_IS_32BIT -o xvid_bench xvid_bench.c \ |
30 |
|
* ../build/generic/libxvidcore.a -lm |
31 |
* |
* |
32 |
* History: |
* History: |
33 |
* |
* |
34 |
* 06.06.2002 initial coding -Skal- |
* 06.06.2002 initial coding -Skal- |
35 |
|
* 27.02.2003 minor changes (compile, sad16v) <gruel@web.de> |
36 |
* |
* |
37 |
*************************************************************************/ |
*************************************************************************/ |
38 |
|
|
219 |
void test_sad() |
void test_sad() |
220 |
{ |
{ |
221 |
const int nb_tests = 2000*speed_ref; |
const int nb_tests = 2000*speed_ref; |
222 |
int tst; |
int tst,dummy[4]; |
223 |
CPU *cpu; |
CPU *cpu; |
224 |
int i; |
int i; |
225 |
uint8_t Cur[16*16], Ref1[16*16], Ref2[16*16]; |
uint8_t Cur[16*16], Ref1[16*16], Ref2[16*16]; |
248 |
|
|
249 |
t = gettime_usec(); |
t = gettime_usec(); |
250 |
emms(); |
emms(); |
251 |
for(tst=0; tst<nb_tests; ++tst) s = sad16(Cur, Ref1, 16, -1); |
for(tst=0; tst<nb_tests; ++tst) s = sad16(Cur, Ref1, 16, 65535); |
252 |
emms(); |
emms(); |
253 |
t = (gettime_usec() - t) / nb_tests; |
t = (gettime_usec() - t) / nb_tests; |
254 |
printf( "%s - sad16 %.3f usec sad=%d\n", cpu->name, t, s ); |
printf( "%s - sad16 %.3f usec sad=%d\n", cpu->name, t, s ); |
256 |
|
|
257 |
t = gettime_usec(); |
t = gettime_usec(); |
258 |
emms(); |
emms(); |
259 |
|
for(tst=0; tst<nb_tests; ++tst) s = sad16v(Cur, Ref1, 16, dummy); |
260 |
|
emms(); |
261 |
|
t = (gettime_usec() - t) / nb_tests; |
262 |
|
printf( "%s - sad16v %.3f usec sad=%d\n", cpu->name, t, s ); |
263 |
|
if (s!=27214) printf( "*** CRC ERROR! ***\n" ); |
264 |
|
|
265 |
|
t = gettime_usec(); |
266 |
|
emms(); |
267 |
for(tst=0; tst<nb_tests; ++tst) s = sad16bi(Cur, Ref1, Ref2, 16); |
for(tst=0; tst<nb_tests; ++tst) s = sad16bi(Cur, Ref1, Ref2, 16); |
268 |
emms(); |
emms(); |
269 |
t = (gettime_usec() - t) / nb_tests; |
t = (gettime_usec() - t) / nb_tests; |