22 |
* |
* |
23 |
* 'Reference' output is at the end of file. |
* 'Reference' output is at the end of file. |
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... |
* bullet-proof (should plug some .md5 here)... |
26 |
* |
* |
27 |
* compiles with something like: |
* compiles with something like: |
28 |
* gcc -o xvid_bench xvid_bench.c -I../src/ -lxvidcore -lm |
* gcc -o xvid_bench xvid_bench.c -I../src/ -lxvidcore -lm |
35 |
|
|
36 |
#include <stdio.h> |
#include <stdio.h> |
37 |
#include <stdlib.h> |
#include <stdlib.h> |
|
#include <sys/time.h> // for gettimeofday |
|
38 |
#include <string.h> // for memset |
#include <string.h> // for memset |
39 |
#include <assert.h> |
#include <assert.h> |
40 |
|
|
41 |
|
#ifndef WIN32 |
42 |
|
#include <sys/time.h> // for gettimeofday |
43 |
|
#else |
44 |
|
#include <time.h> |
45 |
|
#endif |
46 |
|
|
47 |
|
|
48 |
#include "xvid.h" |
#include "xvid.h" |
49 |
|
|
50 |
// inner guts |
// inner guts |
61 |
#include "quant/quant_matrix.c" |
#include "quant/quant_matrix.c" |
62 |
#include "bitstream/cbp.h" |
#include "bitstream/cbp.h" |
63 |
|
|
64 |
|
#include <math.h> |
65 |
|
|
66 |
|
#ifndef M_PI |
67 |
|
#define M_PI 3.14159265358979323846 |
68 |
|
#endif |
69 |
|
|
70 |
const int speed_ref = 100; // on slow machines, decrease this value |
const int speed_ref = 100; // on slow machines, decrease this value |
71 |
|
|
72 |
/********************************************************************* |
/********************************************************************* |
76 |
/* returns time in micro-s*/ |
/* returns time in micro-s*/ |
77 |
double gettime_usec() |
double gettime_usec() |
78 |
{ |
{ |
79 |
|
#ifndef WIN32 |
80 |
struct timeval tv; |
struct timeval tv; |
81 |
gettimeofday(&tv, 0); |
gettimeofday(&tv, 0); |
82 |
return tv.tv_sec*1.0e6 + tv.tv_usec; |
return tv.tv_sec*1.0e6 + tv.tv_usec; |
83 |
|
#else |
84 |
|
clock_t clk; |
85 |
|
clk = clock(); |
86 |
|
return clk * 1000000 / CLOCKS_PER_SEC; |
87 |
|
#endif |
88 |
} |
} |
89 |
|
|
90 |
/* returns squared deviates (mean(v*v)-mean(v)^2) of a 8x8 block */ |
/* returns squared deviates (mean(v*v)-mean(v)^2) of a 8x8 block */ |
119 |
, { "SSE2 ", XVID_CPU_SSE2 | XVID_CPU_MMX } |
, { "SSE2 ", XVID_CPU_SSE2 | XVID_CPU_MMX } |
120 |
, { "3DNOW ", XVID_CPU_3DNOW } |
, { "3DNOW ", XVID_CPU_3DNOW } |
121 |
, { "3DNOWE", XVID_CPU_3DNOWEXT } |
, { "3DNOWE", XVID_CPU_3DNOWEXT } |
122 |
|
, { "IA64 ", XVID_CPU_IA64 } |
123 |
//, { "TSC ", XVID_CPU_TSC } |
//, { "TSC ", XVID_CPU_TSC } |
124 |
, { 0, 0 } } |
, { 0, 0 } } |
125 |
|
|
126 |
, cpu_short_list[] = |
, cpu_short_list[] = |
127 |
{ { "PLAINC", 0 } |
{ { "PLAINC", 0 } |
128 |
, { "MMX ", XVID_CPU_MMX } |
, { "MMX ", XVID_CPU_MMX } |
129 |
, { "MMXEXT", XVID_CPU_MMXEXT | XVID_CPU_MMX } |
//, { "MMXEXT", XVID_CPU_MMXEXT | XVID_CPU_MMX } |
130 |
, { "IA64 ", XVID_CPU_IA64 } |
, { "IA64 ", XVID_CPU_IA64 } |
131 |
, { 0, 0 } } |
, { 0, 0 } } |
132 |
|
|
181 |
|
|
182 |
for(cpu = cpu_list; cpu->name!=0; ++cpu) |
for(cpu = cpu_list; cpu->name!=0; ++cpu) |
183 |
{ |
{ |
184 |
double t; |
double t, PSNR, MSE; |
|
int iCrc, fCrc; |
|
185 |
|
|
186 |
if (!init_cpu(cpu)) |
if (!init_cpu(cpu)) |
187 |
continue; |
continue; |
197 |
} |
} |
198 |
emms(); |
emms(); |
199 |
t = (gettime_usec() - t - overhead) / nb_tests; |
t = (gettime_usec() - t - overhead) / nb_tests; |
200 |
iCrc=0; fCrc=0; |
MSE = 0.; |
201 |
for(i=0; i<8*8; ++i) { |
for(i=0; i<8*8; ++i) { |
202 |
iCrc += ABS(iDst[i] - iDst0[i]); |
double delta = 1.0*(iDst[i] - iDst0[i]); |
203 |
fCrc += fDst[i]^i; |
MSE += delta*delta; |
204 |
} |
} |
205 |
printf( "%s - %.3f usec iCrc=%d fCrc=%d\n", |
PSNR = (MSE==0.) ? 1.e6 : -4.3429448*log( MSE/64. ); |
206 |
cpu->name, t, iCrc, fCrc ); |
printf( "%s - %.3f usec PSNR=%.3f MSE=%.3f\n", |
207 |
// the norm tolerates ~1 bit of diff per coeff |
cpu->name, t, PSNR, MSE ); |
208 |
if (ABS(iCrc)>=64) printf( "*** CRC ERROR! ***\n" ); |
if (ABS(MSE)>=64) printf( "*** CRC ERROR! ***\n" ); |
209 |
} |
} |
210 |
} |
} |
211 |
|
|
351 |
printf( "%s - round1 %.3f usec iCrc=%d\n", cpu->name, t, iCrc ); |
printf( "%s - round1 %.3f usec iCrc=%d\n", cpu->name, t, iCrc ); |
352 |
if (iCrc!=8103) printf( "*** CRC ERROR! ***\n" ); |
if (iCrc!=8103) printf( "*** CRC ERROR! ***\n" ); |
353 |
|
|
354 |
|
|
355 |
|
// this is a new function, as of 06.06.2002 |
356 |
|
#if 0 |
357 |
|
TEST_MB2(interpolate8x8_avrg); |
358 |
|
printf( "%s - interpolate8x8_c %.3f usec iCrc=%d\n", cpu->name, t, iCrc ); |
359 |
|
if (iCrc!=8107) printf( "*** CRC ERROR! ***\n" ); |
360 |
|
#endif |
361 |
|
|
362 |
printf( " --- \n" ); |
printf( " --- \n" ); |
363 |
} |
} |
364 |
} |
} |
470 |
s = 0; for(i=0; i<8*32; ++i) { s += (Src8[i]-Ref1[i])&i; } |
s = 0; for(i=0; i<8*32; ++i) { s += (Src8[i]-Ref1[i])&i; } |
471 |
printf( "crc2=%d\n", s); |
printf( "crc2=%d\n", s); |
472 |
if (s!=16256) printf( "*** CRC ERROR! ***\n" ); |
if (s!=16256) printf( "*** CRC ERROR! ***\n" ); |
473 |
|
#if 1 |
474 |
TEST_TRANSFER3(transfer_8to16sub2, Dst16, Src8, Ref1, Ref2); |
TEST_TRANSFER3(transfer_8to16sub2, Dst16, Src8, Ref1, Ref2); |
475 |
printf( "%s - 8to16sub2 %.3f usec crc=%d\n", cpu->name, t, s ); |
printf( "%s - 8to16sub2 %.3f usec crc=%d\n", cpu->name, t, s ); |
476 |
if (s!=20384) printf( "*** CRC ERROR! ***\n" ); |
if (s!=20384) printf( "*** CRC ERROR! ***\n" ); |
477 |
|
// for(i=0; i<64; ++i) printf( "[%d]", Dst16[i]); |
478 |
|
// printf("\n"); |
479 |
|
#endif |
480 |
printf( " --- \n" ); |
printf( " --- \n" ); |
481 |
} |
} |
482 |
} |
} |
487 |
|
|
488 |
#define TEST_QUANT(FUNC, DST, SRC) \ |
#define TEST_QUANT(FUNC, DST, SRC) \ |
489 |
t = gettime_usec(); \ |
t = gettime_usec(); \ |
490 |
|
for(s=0,qm=1; qm<=255; ++qm) { \ |
491 |
|
for(i=0; i<8*8; ++i) Quant[i] = qm; \ |
492 |
|
set_inter_matrix( Quant ); \ |
493 |
emms(); \ |
emms(); \ |
494 |
|
for(q=1; q<=max_Q; ++q) { \ |
495 |
for(tst=0; tst<nb_tests; ++tst) \ |
for(tst=0; tst<nb_tests; ++tst) \ |
|
for(s=0, q=1; q<=max_Q; ++q) { \ |
|
496 |
(FUNC)((DST), (SRC), q); \ |
(FUNC)((DST), (SRC), q); \ |
497 |
for(i=0; i<64; ++i) s+=(DST)[i]^i; \ |
for(i=0; i<64; ++i) s+=(DST)[i]^i^qm; \ |
498 |
} \ |
} \ |
499 |
emms(); \ |
emms(); \ |
500 |
t = (gettime_usec()-t-overhead)/nb_tests; |
} \ |
501 |
|
t = (gettime_usec()-t-overhead)/nb_tests/qm;\ |
502 |
|
s = (s&0xffff)^(s>>16) |
503 |
|
|
504 |
#define TEST_QUANT2(FUNC, DST, SRC, MULT) \ |
#define TEST_QUANT2(FUNC, DST, SRC) \ |
505 |
t = gettime_usec(); \ |
t = gettime_usec(); \ |
506 |
|
for(s=0,qm=1; qm<=255; ++qm) { \ |
507 |
|
for(i=0; i<8*8; ++i) Quant[i] = qm; \ |
508 |
|
set_intra_matrix( Quant ); \ |
509 |
emms(); \ |
emms(); \ |
510 |
|
for(q=1; q<=max_Q; ++q) { \ |
511 |
for(tst=0; tst<nb_tests; ++tst) \ |
for(tst=0; tst<nb_tests; ++tst) \ |
512 |
for(s=0, q=1; q<=max_Q; ++q) { \ |
(FUNC)((DST), (SRC), q, q); \ |
513 |
(FUNC)((DST), (SRC), q, MULT); \ |
for(i=0; i<64; ++i) s+=(DST)[i]^i^qm; \ |
|
for(i=0; i<64; ++i) s+=(DST)[i]^i; \ |
|
514 |
} \ |
} \ |
515 |
emms(); \ |
emms(); \ |
516 |
t = (gettime_usec()-t-overhead)/nb_tests; |
} \ |
517 |
|
t = (gettime_usec()-t-overhead)/nb_tests/qm;\ |
518 |
|
s = (s&0xffff)^(s>>16) |
519 |
|
|
520 |
void test_quant() |
void test_quant() |
521 |
{ |
{ |
522 |
const int nb_tests = 150*speed_ref; |
const int nb_tests = 1*speed_ref; |
523 |
const int max_Q = 31; |
const int max_Q = 31; |
524 |
int i; |
int i, qm; |
525 |
CPU *cpu; |
CPU *cpu; |
526 |
int16_t Src[8*8], Dst[8*8]; |
int16_t Src[8*8], Dst[8*8]; |
527 |
|
uint8_t Quant[8*8]; |
528 |
|
|
529 |
printf( "\n ===== test quant =====\n" ); |
printf( "\n ===== test quant =====\n" ); |
530 |
|
|
531 |
|
// we deliberately enfringe the norm's specified range [-127,127], |
532 |
|
// to test the robustness of the iquant module |
533 |
for(i=0; i<64; ++i) { |
for(i=0; i<64; ++i) { |
534 |
Src[i] = i-32; |
Src[i] = 1 + (i-32) * (i&6); |
535 |
Dst[i] = 0; |
Dst[i] = 0; |
536 |
} |
} |
537 |
|
|
|
|
|
538 |
for(cpu = cpu_short_list; cpu->name!=0; ++cpu) |
for(cpu = cpu_short_list; cpu->name!=0; ++cpu) |
539 |
{ |
{ |
540 |
double t, overhead; |
double t, overhead; |
541 |
int tst, s, q; |
int tst, q; |
542 |
|
uint32_t s; |
543 |
|
|
544 |
if (!init_cpu(cpu)) |
if (!init_cpu(cpu)) |
545 |
continue; |
continue; |
546 |
|
|
|
set_inter_matrix( get_default_inter_matrix() ); |
|
|
set_intra_matrix( get_default_intra_matrix() ); |
|
547 |
overhead = -gettime_usec(); |
overhead = -gettime_usec(); |
548 |
for(tst=0; tst<nb_tests; ++tst) |
for(s=0,qm=1; qm<=255; ++qm) { |
549 |
for(s=0, q=1; q<=max_Q; ++q) |
for(i=0; i<8*8; ++i) Quant[i] = qm; |
550 |
for(i=0; i<64; ++i) s+=Dst[i]^i; |
set_inter_matrix( Quant ); |
551 |
|
for(q=1; q<=max_Q; ++q) |
552 |
|
for(i=0; i<64; ++i) s+=Dst[i]^i^qm; |
553 |
|
} |
554 |
overhead += gettime_usec(); |
overhead += gettime_usec(); |
555 |
|
|
556 |
TEST_QUANT2(quant4_intra, Dst, Src, 7); |
#if 1 |
557 |
|
TEST_QUANT2(quant4_intra, Dst, Src); |
558 |
printf( "%s - quant4_intra %.3f usec crc=%d\n", cpu->name, t, s ); |
printf( "%s - quant4_intra %.3f usec crc=%d\n", cpu->name, t, s ); |
559 |
if (s!=55827) printf( "*** CRC ERROR! ***\n" ); |
if (s!=29809) printf( "*** CRC ERROR! ***\n" ); |
560 |
|
|
561 |
TEST_QUANT(quant4_inter, Dst, Src); |
TEST_QUANT(quant4_inter, Dst, Src); |
562 |
printf( "%s - quant4_inter %.3f usec crc=%d\n", cpu->name, t, s ); |
printf( "%s - quant4_inter %.3f usec crc=%d\n", cpu->name, t, s ); |
563 |
if (s!=58201) printf( "*** CRC ERROR! ***\n" ); |
if (s!=12574) printf( "*** CRC ERROR! ***\n" ); |
564 |
|
#endif |
565 |
|
#if 1 |
566 |
TEST_QUANT2(dequant4_intra, Dst, Src, 7); |
TEST_QUANT2(dequant4_intra, Dst, Src); |
567 |
printf( "%s - dequant4_intra %.3f usec crc=%d\n", cpu->name, t, s ); |
printf( "%s - dequant4_intra %.3f usec crc=%d\n", cpu->name, t, s ); |
568 |
if (s!=193340) printf( "*** CRC ERROR! ***\n" ); |
if (s!=24052) printf( "*** CRC ERROR! ***\n" ); |
569 |
|
|
570 |
TEST_QUANT(dequant4_inter, Dst, Src); |
TEST_QUANT(dequant4_inter, Dst, Src); |
571 |
printf( "%s - dequant4_inter %.3f usec crc=%d\n", cpu->name, t, s ); |
printf( "%s - dequant4_inter %.3f usec crc=%d\n", cpu->name, t, s ); |
572 |
if (s!=116483) printf( "*** CRC ERROR! ***\n" ); |
if (s!=63847) printf( "*** CRC ERROR! ***\n" ); |
573 |
|
#endif |
574 |
TEST_QUANT2(quant_intra, Dst, Src, 7); |
#if 1 |
575 |
|
TEST_QUANT2(quant_intra, Dst, Src); |
576 |
printf( "%s - quant_intra %.3f usec crc=%d\n", cpu->name, t, s ); |
printf( "%s - quant_intra %.3f usec crc=%d\n", cpu->name, t, s ); |
577 |
if (s!=56885) printf( "*** CRC ERROR! ***\n" ); |
if (s!=25662) printf( "*** CRC ERROR! ***\n" ); |
578 |
|
|
579 |
TEST_QUANT(quant_inter, Dst, Src); |
TEST_QUANT(quant_inter, Dst, Src); |
580 |
printf( "%s - quant_inter %.3f usec crc=%d\n", cpu->name, t, s ); |
printf( "%s - quant_inter %.3f usec crc=%d\n", cpu->name, t, s ); |
581 |
if (s!=58056) printf( "*** CRC ERROR! ***\n" ); |
if (s!=23972) printf( "*** CRC ERROR! ***\n" ); |
582 |
|
#endif |
583 |
TEST_QUANT2(dequant_intra, Dst, Src, 7); |
#if 1 |
584 |
|
TEST_QUANT2(dequant_intra, Dst, Src); |
585 |
printf( "%s - dequant_intra %.3f usec crc=%d\n", cpu->name, t, s ); |
printf( "%s - dequant_intra %.3f usec crc=%d\n", cpu->name, t, s ); |
586 |
if (s!=-7936) printf( "*** CRC ERROR! ***\n" ); |
if (s!=49900) printf( "*** CRC ERROR! ***\n" ); |
587 |
|
|
588 |
TEST_QUANT(dequant_inter, Dst, Src); |
TEST_QUANT(dequant_inter, Dst, Src); |
589 |
printf( "%s - dequant_inter %.3f usec crc=%d\n", cpu->name, t, s ); |
printf( "%s - dequant_inter %.3f usec crc=%d\n", cpu->name, t, s ); |
590 |
// { int k,l; for(k=0; k<8; ++k) { for(l=0; l<8; ++l) printf( "[%.4d]", Dst[k*8+l]); printf("\n"); } } |
if (s!=48899) printf( "*** CRC ERROR! ***\n" ); |
591 |
if (s!=-33217) printf( "*** CRC ERROR! ***\n" ); |
#endif |
|
|
|
592 |
printf( " --- \n" ); |
printf( " --- \n" ); |
593 |
} |
} |
594 |
} |
} |
647 |
} |
} |
648 |
|
|
649 |
/********************************************************************* |
/********************************************************************* |
650 |
|
* fdct/idct IEEE1180 compliance |
651 |
|
*********************************************************************/ |
652 |
|
|
653 |
|
typedef struct { |
654 |
|
long Errors[64]; |
655 |
|
long Sqr_Errors[64]; |
656 |
|
long Max_Errors[64]; |
657 |
|
long Nb; |
658 |
|
} STATS_8x8; |
659 |
|
|
660 |
|
void init_stats(STATS_8x8 *S) |
661 |
|
{ |
662 |
|
int i; |
663 |
|
for(i=0; i<64; ++i) { |
664 |
|
S->Errors[i] = 0; |
665 |
|
S->Sqr_Errors[i] = 0; |
666 |
|
S->Max_Errors[i] = 0; |
667 |
|
} |
668 |
|
S->Nb = 0; |
669 |
|
} |
670 |
|
|
671 |
|
void store_stats(STATS_8x8 *S, short Blk[64], short Ref[64]) |
672 |
|
{ |
673 |
|
int i; |
674 |
|
for(i=0; i<64; ++i) |
675 |
|
{ |
676 |
|
short Err = Blk[i] - Ref[i]; |
677 |
|
S->Errors[i] += Err; |
678 |
|
S->Sqr_Errors[i] += Err * Err; |
679 |
|
if (Err<0) Err = -Err; |
680 |
|
if (S->Max_Errors[i]<Err) |
681 |
|
S->Max_Errors[i] = Err; |
682 |
|
} |
683 |
|
S->Nb++; |
684 |
|
} |
685 |
|
|
686 |
|
void print_stats(STATS_8x8 *S) |
687 |
|
{ |
688 |
|
int i; |
689 |
|
double Norm; |
690 |
|
|
691 |
|
assert(S->Nb>0); |
692 |
|
Norm = 1. / (double)S->Nb; |
693 |
|
printf("\n== Max absolute values of errors ==\n"); |
694 |
|
for(i=0; i<64; i++) { |
695 |
|
printf(" %4ld", S->Max_Errors[i]); |
696 |
|
if ((i&7)==7) printf("\n"); |
697 |
|
} |
698 |
|
|
699 |
|
printf("\n== Mean square errors ==\n"); |
700 |
|
for(i=0; i<64; i++) |
701 |
|
{ |
702 |
|
double Err = Norm * (double)S->Sqr_Errors[i]; |
703 |
|
printf(" %.3f", Err); |
704 |
|
if ((i&7)==7) printf("\n"); |
705 |
|
} |
706 |
|
|
707 |
|
printf("\n== Mean errors ==\n"); |
708 |
|
for(i=0; i<64; i++) |
709 |
|
{ |
710 |
|
double Err = Norm * (double)S->Errors[i]; |
711 |
|
printf(" %.3f", Err); |
712 |
|
if ((i&7)==7) printf("\n"); |
713 |
|
} |
714 |
|
printf("\n"); |
715 |
|
} |
716 |
|
|
717 |
|
static const char *CHECK(double v, double l) { |
718 |
|
if (fabs(v)<=l) return "ok"; |
719 |
|
else return "FAIL!"; |
720 |
|
} |
721 |
|
|
722 |
|
void report_stats(STATS_8x8 *S, const double *Limits) |
723 |
|
{ |
724 |
|
int i; |
725 |
|
double Norm, PE, PMSE, OMSE, PME, OME; |
726 |
|
|
727 |
|
assert(S->Nb>0); |
728 |
|
Norm = 1. / (double)S->Nb; |
729 |
|
PE = 0.; |
730 |
|
for(i=0; i<64; i++) { |
731 |
|
if (PE<S->Max_Errors[i]) |
732 |
|
PE = S->Max_Errors[i]; |
733 |
|
} |
734 |
|
|
735 |
|
PMSE = 0.; |
736 |
|
OMSE = 0.; |
737 |
|
for(i=0; i<64; i++) |
738 |
|
{ |
739 |
|
double Err = Norm * (double)S->Sqr_Errors[i]; |
740 |
|
OMSE += Err; |
741 |
|
if (PMSE < Err) PMSE = Err; |
742 |
|
} |
743 |
|
OMSE /= 64.; |
744 |
|
|
745 |
|
PME = 0.; |
746 |
|
OME = 0.; |
747 |
|
for(i=0; i<64; i++) |
748 |
|
{ |
749 |
|
double Err = Norm * (double)S->Errors[i]; |
750 |
|
OME += Err; |
751 |
|
Err = fabs(Err); |
752 |
|
if (PME < Err) PME = Err; |
753 |
|
} |
754 |
|
OME /= 64.; |
755 |
|
|
756 |
|
printf( "Peak error: %4.4f\n", PE ); |
757 |
|
printf( "Peak MSE: %4.4f\n", PMSE ); |
758 |
|
printf( "Overall MSE: %4.4f\n", OMSE ); |
759 |
|
printf( "Peak ME: %4.4f\n", PME ); |
760 |
|
printf( "Overall ME: %4.4f\n", OME ); |
761 |
|
|
762 |
|
if (Limits!=0) |
763 |
|
{ |
764 |
|
printf( "[PE<=%.4f %s] ", Limits[0], CHECK(PE, Limits[0]) ); |
765 |
|
printf( "\n" ); |
766 |
|
printf( "[PMSE<=%.4f %s]", Limits[1], CHECK(PMSE, Limits[1]) ); |
767 |
|
printf( "[OMSE<=%.4f %s]", Limits[2], CHECK(OMSE, Limits[2]) ); |
768 |
|
printf( "\n" ); |
769 |
|
printf( "[PME<=%.4f %s] ", Limits[3], CHECK(PME , Limits[3]) ); |
770 |
|
printf( "[OME<=%.4f %s] ", Limits[4], CHECK(OME , Limits[4]) ); |
771 |
|
printf( "\n" ); |
772 |
|
} |
773 |
|
} |
774 |
|
|
775 |
|
////////////////////////////////////////////////////////// |
776 |
|
/* Pseudo-random generator specified by IEEE 1180 */ |
777 |
|
|
778 |
|
static long ieee_seed = 1; |
779 |
|
static void ieee_reseed(long s) { |
780 |
|
ieee_seed = s; |
781 |
|
} |
782 |
|
static long ieee_rand(int Min, int Max) |
783 |
|
{ |
784 |
|
static double z = (double) 0x7fffffff; |
785 |
|
|
786 |
|
long i,j; |
787 |
|
double x; |
788 |
|
|
789 |
|
ieee_seed = (ieee_seed * 1103515245) + 12345; |
790 |
|
i = ieee_seed & 0x7ffffffe; |
791 |
|
x = ((double) i) / z; |
792 |
|
x *= (Max-Min+1); |
793 |
|
j = (long)x; |
794 |
|
j = j + Min; |
795 |
|
assert(j>=Min && j<=Max); |
796 |
|
return (short)j; |
797 |
|
} |
798 |
|
|
799 |
|
#define CLAMP(x, M) (x) = ((x)<-(M)) ? (-(M)) : ((x)>=(M) ? ((M)-1) : (x)) |
800 |
|
|
801 |
|
static double Cos[8][8]; |
802 |
|
static void init_ref_dct() |
803 |
|
{ |
804 |
|
int i, j; |
805 |
|
for(i=0; i<8; i++) |
806 |
|
{ |
807 |
|
double scale = (i == 0) ? sqrt(0.125) : 0.5; |
808 |
|
for (j=0; j<8; j++) |
809 |
|
Cos[i][j] = scale*cos( (M_PI/8.0)*i*(j + 0.5) ); |
810 |
|
} |
811 |
|
} |
812 |
|
|
813 |
|
void ref_idct(short *M) |
814 |
|
{ |
815 |
|
int i, j, k; |
816 |
|
double Tmp[8][8]; |
817 |
|
|
818 |
|
for(i=0; i<8; i++) { |
819 |
|
for(j=0; j<8; j++) |
820 |
|
{ |
821 |
|
double Sum = 0.0; |
822 |
|
for (k=0; k<8; k++) Sum += Cos[k][j]*M[8*i+k]; |
823 |
|
Tmp[i][j] = Sum; |
824 |
|
} |
825 |
|
} |
826 |
|
for(i=0; i<8; i++) { |
827 |
|
for(j=0; j<8; j++) { |
828 |
|
double Sum = 0.0; |
829 |
|
for (k=0; k<8; k++) Sum += Cos[k][i]*Tmp[k][j]; |
830 |
|
M[8*i+j] = (short)floor(Sum + .5); |
831 |
|
} |
832 |
|
} |
833 |
|
} |
834 |
|
|
835 |
|
void ref_fdct(short *M) |
836 |
|
{ |
837 |
|
int i, j, k; |
838 |
|
double Tmp[8][8]; |
839 |
|
|
840 |
|
for(i=0; i<8; i++) { |
841 |
|
for(j=0; j<8; j++) |
842 |
|
{ |
843 |
|
double Sum = 0.0; |
844 |
|
for (k=0; k<8; k++) Sum += Cos[j][k]*M[8*i+k]; |
845 |
|
Tmp[i][j] = Sum; |
846 |
|
} |
847 |
|
} |
848 |
|
for(i=0; i<8; i++) { |
849 |
|
for(j=0; j<8; j++) { |
850 |
|
double Sum = 0.0; |
851 |
|
for (k=0; k<8; k++) Sum += Cos[i][k]*Tmp[k][j]; |
852 |
|
M[8*i+j] = (short)floor(Sum + 0.5); |
853 |
|
} |
854 |
|
} |
855 |
|
} |
856 |
|
|
857 |
|
void test_IEEE1180_compliance(int Min, int Max, int Sign) |
858 |
|
{ |
859 |
|
static const double ILimits[5] = { 1., 0.06, 0.02, 0.015, 0.0015 }; |
860 |
|
int Loops = 10000; |
861 |
|
int i, m, n; |
862 |
|
short Blk0[64]; // reference |
863 |
|
short Blk[64], iBlk[64]; |
864 |
|
short Ref_FDCT[64]; |
865 |
|
short Ref_IDCT[64]; |
866 |
|
|
867 |
|
STATS_8x8 FStats; // forward dct stats |
868 |
|
STATS_8x8 IStats; // inverse dct stats |
869 |
|
|
870 |
|
CPU *cpu; |
871 |
|
|
872 |
|
init_ref_dct(); |
873 |
|
|
874 |
|
for(cpu = cpu_list; cpu->name!=0; ++cpu) |
875 |
|
{ |
876 |
|
if (!init_cpu(cpu)) |
877 |
|
continue; |
878 |
|
|
879 |
|
printf( "\n===== IEEE test for %s ==== (Min=%d Max=%d Sign=%d Loops=%d)\n", |
880 |
|
cpu->name, Min, Max, Sign, Loops); |
881 |
|
|
882 |
|
init_stats(&IStats); |
883 |
|
init_stats(&FStats); |
884 |
|
|
885 |
|
ieee_reseed(1); |
886 |
|
for(n=0; n<Loops; ++n) |
887 |
|
{ |
888 |
|
for(i=0; i<64; ++i) |
889 |
|
Blk0[i] = (short)ieee_rand(Min,Max) * Sign; |
890 |
|
|
891 |
|
// hmm, I'm not quite sure this is exactly |
892 |
|
// the tests described in the norm. check... |
893 |
|
|
894 |
|
memcpy(Ref_FDCT, Blk0, 64*sizeof(short)); |
895 |
|
ref_fdct(Ref_FDCT); |
896 |
|
for(i=0; i<64; i++) CLAMP( Ref_FDCT[i], 2048 ); |
897 |
|
|
898 |
|
memcpy(Blk, Blk0, 64*sizeof(short)); |
899 |
|
emms(); fdct(Blk); emms(); |
900 |
|
for(i=0; i<64; i++) CLAMP( Blk[i], 2048 ); |
901 |
|
|
902 |
|
store_stats(&FStats, Blk, Ref_FDCT); |
903 |
|
|
904 |
|
|
905 |
|
memcpy(Ref_IDCT, Ref_FDCT, 64*sizeof(short)); |
906 |
|
ref_idct(Ref_IDCT); |
907 |
|
for (i=0; i<64; i++) CLAMP( Ref_IDCT[i], 256 ); |
908 |
|
|
909 |
|
memcpy(iBlk, Ref_FDCT, 64*sizeof(short)); |
910 |
|
emms(); idct(iBlk); emms(); |
911 |
|
for(i=0; i<64; i++) CLAMP( iBlk[i], 256 ); |
912 |
|
|
913 |
|
store_stats(&IStats, iBlk, Ref_IDCT); |
914 |
|
} |
915 |
|
|
916 |
|
|
917 |
|
printf( "\n -- FDCT report --\n" ); |
918 |
|
// print_stats(&FStats); |
919 |
|
report_stats(&FStats, 0); // so far I know, IEEE1180 says nothing for fdct |
920 |
|
|
921 |
|
for(i=0; i<64; i++) Blk[i] = 0; |
922 |
|
emms(); fdct(Blk); emms(); |
923 |
|
for(m=i=0; i<64; i++) if (Blk[i]!=0) m++; |
924 |
|
printf( "FDCT(0) == 0 ? %s\n", (m!=0) ? "NOPE!" : "yup." ); |
925 |
|
|
926 |
|
printf( "\n -- IDCT report --\n" ); |
927 |
|
// print_stats(&IStats); |
928 |
|
report_stats(&IStats, ILimits); |
929 |
|
|
930 |
|
|
931 |
|
for(i=0; i<64; i++) Blk[i] = 0; |
932 |
|
emms(); idct(Blk); emms(); |
933 |
|
for(m=i=0; i<64; i++) if (Blk[i]!=0) m++; |
934 |
|
printf( "IDCT(0) == 0 ? %s\n", (m!=0) ? "NOPE!" : "yup." ); |
935 |
|
} |
936 |
|
} |
937 |
|
|
938 |
|
|
939 |
|
void test_dct_saturation(int Min, int Max) |
940 |
|
{ |
941 |
|
// test behaviour on input range fringe |
942 |
|
|
943 |
|
int i, n, p; |
944 |
|
CPU *cpu; |
945 |
|
// const short IDCT_MAX = 2047; // 12bits input |
946 |
|
// const short IDCT_MIN = -2048; |
947 |
|
// const short IDCT_OUT = 256; // 9bits ouput |
948 |
|
const int Partitions = 4; |
949 |
|
const int Loops = 10000 / Partitions; |
950 |
|
|
951 |
|
init_ref_dct(); |
952 |
|
|
953 |
|
for(cpu = cpu_list; cpu->name!=0; ++cpu) |
954 |
|
{ |
955 |
|
short Blk0[64], Blk[64]; |
956 |
|
STATS_8x8 Stats; |
957 |
|
|
958 |
|
if (!init_cpu(cpu)) |
959 |
|
continue; |
960 |
|
|
961 |
|
printf( "\n===== IEEE test for %s Min=%d Max=%d =====\n", |
962 |
|
cpu->name, Min, Max ); |
963 |
|
|
964 |
|
// FDCT tests // |
965 |
|
|
966 |
|
init_stats(&Stats); |
967 |
|
|
968 |
|
// test each computation channels separately |
969 |
|
for(i=0; i<64; i++) Blk[i] = Blk0[i] = ((i/8)==(i%8)) ? Max : 0; |
970 |
|
ref_fdct(Blk0); |
971 |
|
emms(); fdct(Blk); emms(); |
972 |
|
store_stats(&Stats, Blk, Blk0); |
973 |
|
|
974 |
|
for(i=0; i<64; i++) Blk[i] = Blk0[i] = ((i/8)==(i%8)) ? Min : 0; |
975 |
|
ref_fdct(Blk0); |
976 |
|
emms(); fdct(Blk); emms(); |
977 |
|
store_stats(&Stats, Blk, Blk0); |
978 |
|
|
979 |
|
// randomly saturated inputs |
980 |
|
for(p=0; p<Partitions; ++p) |
981 |
|
{ |
982 |
|
for(n=0; n<Loops; ++n) |
983 |
|
{ |
984 |
|
for(i=0; i<64; ++i) |
985 |
|
Blk0[i] = Blk[i] = (ieee_rand(0,Partitions)>=p)? Max : Min; |
986 |
|
ref_fdct(Blk0); |
987 |
|
emms(); fdct(Blk); emms(); |
988 |
|
store_stats(&Stats, Blk, Blk0); |
989 |
|
} |
990 |
|
} |
991 |
|
printf( "\n -- FDCT saturation report --\n" ); |
992 |
|
report_stats(&Stats, 0); |
993 |
|
|
994 |
|
|
995 |
|
// IDCT tests // |
996 |
|
#if 0 |
997 |
|
// no finished yet |
998 |
|
|
999 |
|
init_stats(&Stats); |
1000 |
|
|
1001 |
|
// test each computation channel separately |
1002 |
|
for(i=0; i<64; i++) Blk[i] = Blk0[i] = ((i/8)==(i%8)) ? IDCT_MAX : 0; |
1003 |
|
ref_idct(Blk0); |
1004 |
|
emms(); idct(Blk); emms(); |
1005 |
|
for(i=0; i<64; i++) { CLAMP(Blk0[i], IDCT_OUT); CLAMP(Blk[i], IDCT_OUT); } |
1006 |
|
store_stats(&Stats, Blk, Blk0); |
1007 |
|
|
1008 |
|
for(i=0; i<64; i++) Blk[i] = Blk0[i] = ((i/8)==(i%8)) ? IDCT_MIN : 0; |
1009 |
|
ref_idct(Blk0); |
1010 |
|
emms(); idct(Blk); emms(); |
1011 |
|
for(i=0; i<64; i++) { CLAMP(Blk0[i], IDCT_OUT); CLAMP(Blk[i], IDCT_OUT); } |
1012 |
|
store_stats(&Stats, Blk, Blk0); |
1013 |
|
|
1014 |
|
// randomly saturated inputs |
1015 |
|
for(p=0; p<Partitions; ++p) |
1016 |
|
{ |
1017 |
|
for(n=0; n<Loops; ++n) |
1018 |
|
{ |
1019 |
|
for(i=0; i<64; ++i) |
1020 |
|
Blk0[i] = Blk[i] = (ieee_rand(0,Partitions)>=p)? IDCT_MAX : IDCT_MIN; |
1021 |
|
ref_idct(Blk0); |
1022 |
|
emms(); idct(Blk); emms(); |
1023 |
|
for(i=0; i<64; i++) { CLAMP(Blk0[i],IDCT_OUT); CLAMP(Blk[i],IDCT_OUT); } |
1024 |
|
store_stats(&Stats, Blk, Blk0); |
1025 |
|
} |
1026 |
|
} |
1027 |
|
|
1028 |
|
printf( "\n -- IDCT saturation report --\n" ); |
1029 |
|
print_stats(&Stats); |
1030 |
|
report_stats(&Stats, 0); |
1031 |
|
#endif |
1032 |
|
} |
1033 |
|
} |
1034 |
|
|
1035 |
|
/********************************************************************* |
1036 |
* measure raw decoding speed |
* measure raw decoding speed |
1037 |
*********************************************************************/ |
*********************************************************************/ |
1038 |
|
|
1051 |
int buf_size, pos; |
int buf_size, pos; |
1052 |
uint32_t chksum = 0; |
uint32_t chksum = 0; |
1053 |
|
|
1054 |
xinit.cpu_flags = 0; |
xinit.cpu_flags = XVID_CPU_MMX | XVID_CPU_FORCE; |
1055 |
xvid_init(NULL, 0, &xinit, NULL); |
xvid_init(NULL, 0, &xinit, NULL); |
1056 |
printf( "API version: %d, core build:%d\n", xinit.api_version, xinit.core_build); |
printf( "API version: %d, core build:%d\n", xinit.api_version, xinit.core_build); |
1057 |
|
|
1153 |
|
|
1154 |
for(i=0; i<64; ++i) Src[i] = i-32; |
for(i=0; i<64; ++i) Src[i] = i-32; |
1155 |
set_intra_matrix( get_default_intra_matrix() ); |
set_intra_matrix( get_default_intra_matrix() ); |
1156 |
dequant4_intra(Dst, Src, 32, 5); |
dequant4_intra(Dst, Src, 31, 5); |
1157 |
printf( "dequant4_intra with CPU=%s: ", cpu->name); |
printf( "dequant4_intra with CPU=%s: ", cpu->name); |
1158 |
printf( " Out[]= " ); |
printf( " Out[]= " ); |
1159 |
for(i=0; i<64; ++i) printf( "[%d]", Dst[i]); |
for(i=0; i<64; ++i) printf( "[%d]", Dst[i]); |
1172 |
|
|
1173 |
for(i=0; i<64; ++i) Src[i] = i-32; |
for(i=0; i<64; ++i) Src[i] = i-32; |
1174 |
set_inter_matrix( get_default_inter_matrix() ); |
set_inter_matrix( get_default_inter_matrix() ); |
1175 |
dequant4_inter(Dst, Src, 32); |
dequant4_inter(Dst, Src, 31); |
1176 |
printf( "dequant4_inter with CPU=%s: ", cpu->name); |
printf( "dequant4_inter with CPU=%s: ", cpu->name); |
1177 |
printf( " Out[]= " ); |
printf( " Out[]= " ); |
1178 |
for(i=0; i<64; ++i) printf( "[%d]", Dst[i]); |
for(i=0; i<64; ++i) printf( "[%d]", Dst[i]); |
1185 |
CPU *cpu; |
CPU *cpu; |
1186 |
short Blk[8*8], Blk0[8*8]; |
short Blk[8*8], Blk0[8*8]; |
1187 |
|
|
1188 |
printf( "\n ===== fdct/idct saturation diffs =====\n" ); |
printf( "\n ===== fdct/idct precision diffs =====\n" ); |
1189 |
|
|
1190 |
for(cpu = cpu_short_list; cpu->name!=0; ++cpu) |
for(cpu = cpu_short_list; cpu->name!=0; ++cpu) |
1191 |
{ |
{ |
1211 |
} |
} |
1212 |
} |
} |
1213 |
|
|
1214 |
|
void test_quant_bug() |
1215 |
|
{ |
1216 |
|
const int max_Q = 31; |
1217 |
|
int i, n, qm, q; |
1218 |
|
CPU *cpu; |
1219 |
|
int16_t Src[8*8], Dst[8*8]; |
1220 |
|
uint8_t Quant[8*8]; |
1221 |
|
CPU cpu_bug_list[] = { { "PLAINC", 0 }, { "MMX ", XVID_CPU_MMX }, {0,0} }; |
1222 |
|
uint16_t Crcs_Inter[2][32]; |
1223 |
|
uint16_t Crcs_Intra[2][32]; |
1224 |
|
printf( "\n ===== test MPEG4-quantize bug =====\n" ); |
1225 |
|
|
1226 |
|
for(i=0; i<64; ++i) Src[i] = 2048*(i-32)/32; |
1227 |
|
|
1228 |
|
#if 1 |
1229 |
|
for(qm=1; qm<=255; ++qm) |
1230 |
|
{ |
1231 |
|
for(i=0; i<8*8; ++i) Quant[i] = qm; |
1232 |
|
set_inter_matrix( Quant ); |
1233 |
|
|
1234 |
|
for(n=0, cpu = cpu_bug_list; cpu->name!=0; ++cpu, ++n) |
1235 |
|
{ |
1236 |
|
uint16_t s; |
1237 |
|
|
1238 |
|
if (!init_cpu(cpu)) |
1239 |
|
continue; |
1240 |
|
|
1241 |
|
for(q=1; q<=max_Q; ++q) { |
1242 |
|
emms(); |
1243 |
|
quant4_inter( Dst, Src, q ); |
1244 |
|
emms(); |
1245 |
|
for(s=0, i=0; i<64; ++i) s+=((uint16_t)Dst[i])^i; |
1246 |
|
Crcs_Inter[n][q] = s; |
1247 |
|
} |
1248 |
|
} |
1249 |
|
|
1250 |
|
for(q=1; q<=max_Q; ++q) |
1251 |
|
for(i=0; i<n-1; ++i) |
1252 |
|
if (Crcs_Inter[i][q]!=Crcs_Inter[i+1][q]) |
1253 |
|
printf( "Discrepancy Inter: qm=%d, q=%d -> %d/%d !\n", |
1254 |
|
qm, q, Crcs_Inter[i][q], Crcs_Inter[i+1][q]); |
1255 |
|
} |
1256 |
|
#endif |
1257 |
|
|
1258 |
|
#if 1 |
1259 |
|
for(qm=1; qm<=255; ++qm) |
1260 |
|
{ |
1261 |
|
for(i=0; i<8*8; ++i) Quant[i] = qm; |
1262 |
|
set_intra_matrix( Quant ); |
1263 |
|
|
1264 |
|
for(n=0, cpu = cpu_bug_list; cpu->name!=0; ++cpu, ++n) |
1265 |
|
{ |
1266 |
|
uint16_t s; |
1267 |
|
|
1268 |
|
if (!init_cpu(cpu)) |
1269 |
|
continue; |
1270 |
|
|
1271 |
|
for(q=1; q<=max_Q; ++q) { |
1272 |
|
emms(); |
1273 |
|
quant4_intra( Dst, Src, q, q); |
1274 |
|
emms(); |
1275 |
|
for(s=0, i=0; i<64; ++i) s+=((uint16_t)Dst[i])^i; |
1276 |
|
Crcs_Intra[n][q] = s; |
1277 |
|
} |
1278 |
|
} |
1279 |
|
|
1280 |
|
for(q=1; q<=max_Q; ++q) |
1281 |
|
for(i=0; i<n-1; ++i) |
1282 |
|
if (Crcs_Intra[i][q]!=Crcs_Intra[i+1][q]) |
1283 |
|
printf( "Discrepancy Intra: qm=%d, q=%d -> %d/%d!\n", |
1284 |
|
qm, q, Crcs_Inter[i][q], Crcs_Inter[i+1][q]); |
1285 |
|
} |
1286 |
|
#endif |
1287 |
|
} |
1288 |
|
|
1289 |
/********************************************************************* |
/********************************************************************* |
1290 |
* main |
* main |
1301 |
if (what==0 || what==5) test_quant(); |
if (what==0 || what==5) test_quant(); |
1302 |
if (what==0 || what==6) test_cbp(); |
if (what==0 || what==6) test_cbp(); |
1303 |
|
|
1304 |
if (what==8) { |
if (what==7) { |
1305 |
|
test_IEEE1180_compliance(-256, 255, 1); |
1306 |
|
#if 0 |
1307 |
|
test_IEEE1180_compliance(-256, 255,-1); |
1308 |
|
test_IEEE1180_compliance( -5, 5, 1); |
1309 |
|
test_IEEE1180_compliance( -5, 5,-1); |
1310 |
|
test_IEEE1180_compliance(-300, 300, 1); |
1311 |
|
test_IEEE1180_compliance(-300, 300,-1); |
1312 |
|
#endif |
1313 |
|
} |
1314 |
|
if (what==8) test_dct_saturation(-256, 255); |
1315 |
|
|
1316 |
|
if (what==9) { |
1317 |
int width, height; |
int width, height; |
1318 |
if (argc<5) { |
if (argc<5) { |
1319 |
printf("usage: %s %d [bitstream] [width] [height]\n", argv[0], what); |
printf("usage: %s %d [bitstream] [width] [height]\n", argv[0], what); |
1325 |
} |
} |
1326 |
|
|
1327 |
if (what==-1) { |
if (what==-1) { |
|
test_bugs1(); |
|
1328 |
test_dct_precision_diffs(); |
test_dct_precision_diffs(); |
1329 |
|
test_bugs1(); |
1330 |
} |
} |
1331 |
|
if (what==-2) |
1332 |
|
test_quant_bug(); |
1333 |
|
|
1334 |
return 0; |
return 0; |
1335 |
} |
} |
1336 |
|
|
1337 |
/********************************************************************* |
/********************************************************************* |
1338 |
* 'Reference' output (except for timing) on a PIII 1.13Ghz/linux |
* 'Reference' output (except for timing) on a PIII 1.13Ghz/linux |
1339 |
*********************************************************************/ |
*********************************************************************/ |
1340 |
|
|
1341 |
|
/* as of 07/01/2002, there's a problem with mpeg4-quantization */ |
1342 |
/* |
/* |
1343 |
|
|
1344 |
===== test fdct/idct ===== |
===== test fdct/idct ===== |
1345 |
PLAINC - 2.631 usec iCrc=3 fCrc=-85 |
PLAINC - 3.312 usec PSNR=13.291 MSE=3.000 |
1346 |
MMX - 0.596 usec iCrc=3 fCrc=-67 |
MMX - 0.591 usec PSNR=13.291 MSE=3.000 |
1347 |
MMXEXT - 0.608 usec iCrc=3 fCrc=-67 |
MMXEXT - 0.577 usec PSNR=13.291 MSE=3.000 |
1348 |
SSE2 - 0.605 usec iCrc=3 fCrc=-67 |
SSE2 - 0.588 usec PSNR=13.291 MSE=3.000 |
1349 |
3DNOW - skipped... |
3DNOW - skipped... |
1350 |
3DNOWE - skipped... |
3DNOWE - skipped... |
1351 |
|
|
1352 |
=== test block motion === |
=== test block motion === |
1353 |
PLAINC - interp- h-round0 1.031 usec iCrc=8107 |
PLAINC - interp- h-round0 0.911 usec iCrc=8107 |
1354 |
PLAINC - round1 1.022 usec iCrc=8100 |
PLAINC - round1 0.863 usec iCrc=8100 |
1355 |
PLAINC - interp- v-round0 1.002 usec iCrc=8108 |
PLAINC - interp- v-round0 0.860 usec iCrc=8108 |
1356 |
PLAINC - round1 1.011 usec iCrc=8105 |
PLAINC - round1 0.857 usec iCrc=8105 |
1357 |
PLAINC - interp-hv-round0 1.623 usec iCrc=8112 |
PLAINC - interp-hv-round0 2.103 usec iCrc=8112 |
1358 |
PLAINC - round1 1.621 usec iCrc=8103 |
PLAINC - round1 2.050 usec iCrc=8103 |
|
PLAINC - interpolate8x8_c 0.229 usec iCrc=8107 |
|
1359 |
--- |
--- |
1360 |
MMX - interp- h-round0 0.105 usec iCrc=8107 |
MMX - interp- h-round0 0.105 usec iCrc=8107 |
1361 |
MMX - round1 0.105 usec iCrc=8100 |
MMX - round1 0.106 usec iCrc=8100 |
1362 |
MMX - interp- v-round0 0.106 usec iCrc=8108 |
MMX - interp- v-round0 0.106 usec iCrc=8108 |
1363 |
MMX - round1 0.107 usec iCrc=8105 |
MMX - round1 0.106 usec iCrc=8105 |
1364 |
MMX - interp-hv-round0 0.145 usec iCrc=8112 |
MMX - interp-hv-round0 0.145 usec iCrc=8112 |
1365 |
MMX - round1 0.145 usec iCrc=8103 |
MMX - round1 0.145 usec iCrc=8103 |
|
MMX - interpolate8x8_c 0.229 usec iCrc=8107 |
|
1366 |
--- |
--- |
1367 |
MMXEXT - interp- h-round0 0.027 usec iCrc=8107 |
MMXEXT - interp- h-round0 0.028 usec iCrc=8107 |
1368 |
MMXEXT - round1 0.041 usec iCrc=8100 |
MMXEXT - round1 0.041 usec iCrc=8100 |
1369 |
MMXEXT - interp- v-round0 0.027 usec iCrc=8108 |
MMXEXT - interp- v-round0 0.027 usec iCrc=8108 |
1370 |
MMXEXT - round1 0.040 usec iCrc=8105 |
MMXEXT - round1 0.041 usec iCrc=8105 |
1371 |
MMXEXT - interp-hv-round0 0.070 usec iCrc=8112 |
MMXEXT - interp-hv-round0 0.066 usec iCrc=8112 |
1372 |
MMXEXT - round1 0.066 usec iCrc=8103 |
MMXEXT - round1 0.065 usec iCrc=8103 |
|
MMXEXT - interpolate8x8_c 0.027 usec iCrc=8107 |
|
1373 |
--- |
--- |
1374 |
SSE2 - interp- h-round0 0.106 usec iCrc=8107 |
SSE2 - interp- h-round0 0.109 usec iCrc=8107 |
1375 |
SSE2 - round1 0.105 usec iCrc=8100 |
SSE2 - round1 0.105 usec iCrc=8100 |
1376 |
SSE2 - interp- v-round0 0.106 usec iCrc=8108 |
SSE2 - interp- v-round0 0.106 usec iCrc=8108 |
1377 |
SSE2 - round1 0.106 usec iCrc=8105 |
SSE2 - round1 0.109 usec iCrc=8105 |
1378 |
SSE2 - interp-hv-round0 0.145 usec iCrc=8112 |
SSE2 - interp-hv-round0 0.145 usec iCrc=8112 |
1379 |
SSE2 - round1 0.145 usec iCrc=8103 |
SSE2 - round1 0.145 usec iCrc=8103 |
|
SSE2 - interpolate8x8_c 0.237 usec iCrc=8107 |
|
1380 |
--- |
--- |
1381 |
3DNOW - skipped... |
3DNOW - skipped... |
1382 |
3DNOWE - skipped... |
3DNOWE - skipped... |
1383 |
|
|
1384 |
====== test SAD ====== |
====== test SAD ====== |
1385 |
PLAINC - sad8 0.296 usec sad=3776 |
PLAINC - sad8 0.251 usec sad=3776 |
1386 |
PLAINC - sad16 1.599 usec sad=27214 |
PLAINC - sad16 1.601 usec sad=27214 |
1387 |
PLAINC - sad16bi 2.350 usec sad=26274 |
PLAINC - sad16bi 2.371 usec sad=26274 |
1388 |
PLAINC - dev16 1.610 usec sad=3344 |
PLAINC - dev16 1.564 usec sad=3344 |
1389 |
--- |
--- |
1390 |
MMX - sad8 0.057 usec sad=3776 |
MMX - sad8 0.057 usec sad=3776 |
1391 |
MMX - sad16 0.178 usec sad=27214 |
MMX - sad16 0.182 usec sad=27214 |
1392 |
MMX - sad16bi 2.381 usec sad=26274 |
MMX - sad16bi 2.462 usec sad=26274 |
1393 |
MMX - dev16 0.312 usec sad=3344 |
MMX - dev16 0.311 usec sad=3344 |
1394 |
--- |
--- |
1395 |
MMXEXT - sad8 0.036 usec sad=3776 |
MMXEXT - sad8 0.036 usec sad=3776 |
1396 |
MMXEXT - sad16 0.106 usec sad=27214 |
MMXEXT - sad16 0.109 usec sad=27214 |
1397 |
MMXEXT - sad16bi 0.182 usec sad=26274 |
MMXEXT - sad16bi 0.143 usec sad=26274 |
1398 |
MMXEXT - dev16 0.193 usec sad=3344 |
MMXEXT - dev16 0.192 usec sad=3344 |
1399 |
--- |
--- |
1400 |
SSE2 - sad8 0.057 usec sad=3776 |
SSE2 - sad8 0.057 usec sad=3776 |
1401 |
SSE2 - sad16 0.178 usec sad=27214 |
SSE2 - sad16 0.179 usec sad=27214 |
1402 |
SSE2 - sad16bi 2.427 usec sad=26274 |
SSE2 - sad16bi 2.456 usec sad=26274 |
1403 |
SSE2 - dev16 0.313 usec sad=3344 |
SSE2 - dev16 0.321 usec sad=3344 |
1404 |
--- |
--- |
1405 |
3DNOW - skipped... |
3DNOW - skipped... |
1406 |
3DNOWE - skipped... |
3DNOWE - skipped... |
1407 |
|
|
1408 |
=== test transfer === |
=== test transfer === |
1409 |
PLAINC - 8to16 0.124 usec crc=28288 |
PLAINC - 8to16 0.151 usec crc=28288 |
1410 |
PLAINC - 16to8 0.753 usec crc=28288 |
PLAINC - 16to8 1.113 usec crc=28288 |
1411 |
PLAINC - 8to8 0.041 usec crc=20352 |
PLAINC - 8to8 0.043 usec crc=20352 |
1412 |
PLAINC - 16to8add 0.916 usec crc=25536 |
PLAINC - 16to8add 1.069 usec crc=25536 |
1413 |
PLAINC - 8to16sub 0.812 usec crc1=28064 crc2=16256 |
PLAINC - 8to16sub 0.631 usec crc1=28064 crc2=16256 |
1414 |
PLAINC - 8to16sub2 0.954 usec crc=20384 |
PLAINC - 8to16sub2 0.597 usec crc=20384 |
1415 |
--- |
--- |
1416 |
MMX - 8to16 0.037 usec crc=28288 |
MMX - 8to16 0.032 usec crc=28288 |
1417 |
MMX - 16to8 0.016 usec crc=28288 |
MMX - 16to8 0.024 usec crc=28288 |
1418 |
MMX - 8to8 0.018 usec crc=20352 |
MMX - 8to8 0.020 usec crc=20352 |
1419 |
MMX - 16to8add 0.044 usec crc=25536 |
MMX - 16to8add 0.043 usec crc=25536 |
1420 |
MMX - 8to16sub 0.065 usec crc1=28064 crc2=16256 |
MMX - 8to16sub 0.066 usec crc1=28064 crc2=16256 |
1421 |
MMX - 8to16sub2 0.110 usec crc=20384 |
MMX - 8to16sub2 0.111 usec crc=20384 |
|
--- |
|
|
MMXEXT - 8to16 0.032 usec crc=28288 |
|
|
MMXEXT - 16to8 0.023 usec crc=28288 |
|
|
MMXEXT - 8to8 0.018 usec crc=20352 |
|
|
MMXEXT - 16to8add 0.041 usec crc=25536 |
|
|
MMXEXT - 8to16sub 0.065 usec crc1=28064 crc2=16256 |
|
|
MMXEXT - 8to16sub2 0.069 usec crc=20384 |
|
1422 |
--- |
--- |
1423 |
|
|
1424 |
===== test quant ===== |
===== test quant ===== |
1425 |
PLAINC - quant4_intra 78.889 usec crc=55827 |
PLAINC - quant4_intra 74.248 usec crc=29809 |
1426 |
PLAINC - quant4_inter 71.957 usec crc=58201 |
PLAINC - quant4_inter 70.850 usec crc=12574 |
1427 |
PLAINC - dequant4_intra 34.968 usec crc=193340 |
PLAINC - dequant4_intra 40.628 usec crc=24052 |
1428 |
PLAINC - dequant4_inter 40.792 usec crc=116483 |
PLAINC - dequant4_inter 45.691 usec crc=63847 |
1429 |
PLAINC - quant_intra 30.845 usec crc=56885 |
PLAINC - quant_intra 43.357 usec crc=25662 |
1430 |
PLAINC - quant_inter 34.842 usec crc=58056 |
PLAINC - quant_inter 33.410 usec crc=23972 |
1431 |
PLAINC - dequant_intra 33.211 usec crc=-7936 |
PLAINC - dequant_intra 36.384 usec crc=49900 |
1432 |
PLAINC - dequant_inter 45.486 usec crc=-33217 |
PLAINC - dequant_inter 48.930 usec crc=48899 |
1433 |
--- |
--- |
1434 |
MMX - quant4_intra 9.030 usec crc=55827 |
MMX - quant4_intra 7.445 usec crc=3459 |
1435 |
MMX - quant4_inter 8.234 usec crc=58201 |
*** CRC ERROR! *** |
1436 |
MMX - dequant4_intra 18.330 usec crc=193340 |
MMX - quant4_inter 5.384 usec crc=51072 |
1437 |
MMX - dequant4_inter 19.181 usec crc=116483 |
*** CRC ERROR! *** |
1438 |
MMX - quant_intra 7.124 usec crc=56885 |
MMX - dequant4_intra 5.515 usec crc=24052 |
1439 |
MMX - quant_inter 6.861 usec crc=58056 |
MMX - dequant4_inter 7.745 usec crc=63847 |
1440 |
MMX - dequant_intra 9.048 usec crc=-7936 |
MMX - quant_intra 4.661 usec crc=25662 |
1441 |
MMX - dequant_inter 8.203 usec crc=-33217 |
MMX - quant_inter 4.406 usec crc=23972 |
1442 |
--- |
MMX - dequant_intra 4.928 usec crc=49900 |
1443 |
MMXEXT - quant4_intra 9.045 usec crc=55827 |
MMX - dequant_inter 4.532 usec crc=48899 |
|
MMXEXT - quant4_inter 8.232 usec crc=58201 |
|
|
MMXEXT - dequant4_intra 18.250 usec crc=193340 |
|
|
MMXEXT - dequant4_inter 19.256 usec crc=116483 |
|
|
MMXEXT - quant_intra 7.121 usec crc=56885 |
|
|
MMXEXT - quant_inter 6.855 usec crc=58056 |
|
|
MMXEXT - dequant_intra 9.034 usec crc=-7936 |
|
|
MMXEXT - dequant_inter 8.202 usec crc=-33217 |
|
1444 |
--- |
--- |
1445 |
|
|
1446 |
===== test cbp ===== |
===== test cbp ===== |
1447 |
PLAINC - calc_cbp#1 0.545 usec cbp=0x15 |
PLAINC - calc_cbp#1 0.371 usec cbp=0x15 |
1448 |
PLAINC - calc_cbp#2 0.540 usec cbp=0x38 |
PLAINC - calc_cbp#2 0.432 usec cbp=0x38 |
1449 |
PLAINC - calc_cbp#3 0.477 usec cbp=0xf |
PLAINC - calc_cbp#3 0.339 usec cbp=0xf |
1450 |
PLAINC - calc_cbp#4 0.739 usec cbp=0x5 |
PLAINC - calc_cbp#4 0.506 usec cbp=0x5 |
1451 |
--- |
--- |
1452 |
MMX - calc_cbp#1 0.136 usec cbp=0x15 |
MMX - calc_cbp#1 0.136 usec cbp=0x15 |
1453 |
MMX - calc_cbp#2 0.131 usec cbp=0x38 |
MMX - calc_cbp#2 0.134 usec cbp=0x38 |
1454 |
MMX - calc_cbp#3 0.132 usec cbp=0xf |
MMX - calc_cbp#3 0.138 usec cbp=0xf |
1455 |
MMX - calc_cbp#4 0.135 usec cbp=0x5 |
MMX - calc_cbp#4 0.135 usec cbp=0x5 |
1456 |
--- |
--- |
1457 |
SSE2 - calc_cbp#1 0.135 usec cbp=0x15 |
SSE2 - calc_cbp#1 0.136 usec cbp=0x15 |
1458 |
SSE2 - calc_cbp#2 0.131 usec cbp=0x38 |
SSE2 - calc_cbp#2 0.133 usec cbp=0x38 |
1459 |
SSE2 - calc_cbp#3 0.134 usec cbp=0xf |
SSE2 - calc_cbp#3 0.133 usec cbp=0xf |
1460 |
SSE2 - calc_cbp#4 0.136 usec cbp=0x5 |
SSE2 - calc_cbp#4 0.141 usec cbp=0x5 |
1461 |
--- |
--- |
1462 |
|
|
1463 |
*/ |
*/ |