[svn] / branches / dev-api-4 / xvidcore / examples / xvid_bench.c Repository:
ViewVC logotype

Diff of /branches/dev-api-4/xvidcore/examples/xvid_bench.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/xvidcore/examples/xvid_bench.c revision 257, Fri Jul 5 14:54:15 2002 UTC branches/dev-api-4/xvidcore/examples/xvid_bench.c revision 1060, Tue Jun 10 09:14:48 2003 UTC
# Line 1  Line 1 
1  /**************************************************************************  /*****************************************************************************
2   *   *
3   *      XVID MPEG-4 VIDEO CODEC - Unit tests and benches   *  XVID MPEG-4 VIDEO CODEC
4     *  - Unit tests and benches -
5     *
6     *  Copyright(C) 2002 Pascal Massimino <skal@planet-d.net>
7   *   *
8   *      This program is free software; you can redistribute it and/or modify   *      This program is free software; you can redistribute it and/or modify
9   *      it under the terms of the GNU General Public License as published by   *      it under the terms of the GNU General Public License as published by
# Line 14  Line 17 
17   *   *
18   *      You should have received a copy of the GNU General Public License   *      You should have received a copy of the GNU General Public License
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., 675 Mass Ave, Cambridge, MA 02139, USA.   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
21     *
22     * $Id: xvid_bench.c,v 1.9.2.3 2003-06-10 09:14:48 edgomez Exp $
23   *   *
24   *************************************************************************/   ****************************************************************************/
25    
26  /************************************************************************  /*****************************************************************************
27   *   *
28   *  'Reference' output is at the end of file.   *  'Reference' output is at the end of file.
29   *  Don't take the checksums and crc too seriouly, they aren't   *  Don't take the checksums and crc too seriouly, they aren't
30   *  bullet-proof...   *  bullet-proof (should plug some .md5 here)...
31   *   *
32   *   compiles with something like:   *   compiles with something like:
33   *   gcc -o xvid_bench xvid_bench.c  -I../src/ -lxvidcore -lm   *   gcc -o xvid_bench xvid_bench.c  -I../src/ -lxvidcore -lm
34   *   *
35   *      History:   ****************************************************************************/
  *  
  *      06.06.2002  initial coding      -Skal-  
  *  
  *************************************************************************/  
36    
37  #include <stdio.h>  #include <stdio.h>
38  #include <stdlib.h>  #include <stdlib.h>
39  #include <sys/time.h>  // for gettimeofday  #include <string.h>    /* for memset */
 #include <string.h>    // for memset  
40  #include <assert.h>  #include <assert.h>
41    
42    #ifndef WIN32
43    #include <sys/time.h>   /* for gettimeofday */
44    #else
45    #include <time.h>
46    #endif
47    
48    
49  #include "xvid.h"  #include "xvid.h"
50    
51  // inner guts  // inner guts
# Line 55  Line 62 
62  #include "quant/quant_matrix.c"  #include "quant/quant_matrix.c"
63  #include "bitstream/cbp.h"  #include "bitstream/cbp.h"
64    
65  const int speed_ref = 100;  // on slow machines, decrease this value  #include <math.h>
66    
67    #ifndef M_PI
68    #define M_PI            3.14159265358979323846
69    #endif
70    
71    const int speed_ref = 100;  /* on slow machines, decrease this value */
72    
73  /*********************************************************************  /*********************************************************************
74   * misc   * misc
# Line 64  Line 77 
77   /* returns time in micro-s*/   /* returns time in micro-s*/
78  double gettime_usec()  double gettime_usec()
79  {  {
80    #ifndef WIN32
81    struct timeval  tv;    struct timeval  tv;
82    gettimeofday(&tv, 0);    gettimeofday(&tv, 0);
83    return tv.tv_sec*1.0e6 + tv.tv_usec;    return tv.tv_sec*1.0e6 + tv.tv_usec;
84    #else
85            clock_t clk;
86            clk = clock();
87            return clk * 1000000 / CLOCKS_PER_SEC;
88    #endif
89  }  }
90    
91   /* 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 */
# Line 101  Line 120 
120  , { "SSE2  ", XVID_CPU_SSE2 | XVID_CPU_MMX }  , { "SSE2  ", XVID_CPU_SSE2 | XVID_CPU_MMX }
121  , { "3DNOW ", XVID_CPU_3DNOW }  , { "3DNOW ", XVID_CPU_3DNOW }
122  , { "3DNOWE", XVID_CPU_3DNOWEXT }  , { "3DNOWE", XVID_CPU_3DNOWEXT }
123    //, { "IA64  ", XVID_CPU_IA64 }
124  //, { "TSC   ", XVID_CPU_TSC }  //, { "TSC   ", XVID_CPU_TSC }
125  , { 0, 0 } }    , { 0, 0 } };
126    
127  , cpu_short_list[] =  CPU  cpu_short_list[] =
128  { { "PLAINC", 0 }  { { "PLAINC", 0 }
129  , { "MMX   ", XVID_CPU_MMX }  , { "MMX   ", XVID_CPU_MMX }
130  , { "MMXEXT", XVID_CPU_MMXEXT | XVID_CPU_MMX }  //, { "MMXEXT", XVID_CPU_MMXEXT | XVID_CPU_MMX }
131  , { "IA64  ", XVID_CPU_IA64 }  //, { "IA64  ", XVID_CPU_IA64 }
132  , { 0, 0 } }    , { 0, 0 } };
133    
134  , cpu_short_list2[] =  CPU cpu_short_list2[] =
135  { { "PLAINC", 0 }  { { "PLAINC", 0 }
136  , { "MMX   ", XVID_CPU_MMX }  , { "MMX   ", XVID_CPU_MMX }
137  , { "SSE2  ", XVID_CPU_SSE2 | XVID_CPU_MMX }  , { "SSE2  ", XVID_CPU_SSE2 | XVID_CPU_MMX }
# Line 122  Line 141 
141  int init_cpu(CPU *cpu)  int init_cpu(CPU *cpu)
142  {  {
143    int xerr, cpu_type;    int xerr, cpu_type;
144    XVID_INIT_PARAM xinit;          xvid_gbl_init_t xinit;
145    
146    cpu_type = check_cpu_features() & cpu->cpu;    cpu_type = check_cpu_features() & cpu->cpu;
147            memset(&xinit, 0, sizeof(xinit));
148    xinit.cpu_flags = cpu_type | XVID_CPU_FORCE;    xinit.cpu_flags = cpu_type | XVID_CPU_FORCE;
149    //    xinit.cpu_flags = XVID_CPU_MMX | XVID_CPU_FORCE;          xinit.version = XVID_VERSION;
150    xerr = xvid_init(NULL, 0, &xinit, NULL);          xerr = xvid_global(NULL, 0, &xinit, NULL);
151    if (cpu->cpu>0 && (cpu_type==0 || xerr!=XVID_ERR_OK)) {          if (cpu->cpu>0 && (cpu_type==0 || xerr==XVID_ERR_FAIL)) {
152      printf( "%s - skipped...\n", cpu->name );      printf( "%s - skipped...\n", cpu->name );
153      return 0;      return 0;
154    }    }
# Line 163  Line 183 
183    
184    for(cpu = cpu_list; cpu->name!=0; ++cpu)    for(cpu = cpu_list; cpu->name!=0; ++cpu)
185    {    {
186      double t;                  double t, PSNR, MSE;
     int iCrc, fCrc;  
187    
188      if (!init_cpu(cpu))      if (!init_cpu(cpu))
189        continue;        continue;
# Line 180  Line 199 
199      }      }
200      emms();      emms();
201      t = (gettime_usec() - t - overhead) / nb_tests;      t = (gettime_usec() - t - overhead) / nb_tests;
202      iCrc=0; fCrc=0;                  MSE = 0.;
203      for(i=0; i<8*8; ++i) {      for(i=0; i<8*8; ++i) {
204        iCrc += ABS(iDst[i] - iDst0[i]);                          double delta = 1.0*(iDst[i] - iDst0[i]);
205        fCrc += fDst[i]^i;                          MSE += delta*delta;
206      }      }
207      printf( "%s -  %.3f usec       iCrc=%d  fCrc=%d\n",                  PSNR = (MSE==0.) ? 1.e6 : -4.3429448*log( MSE/64. );
208        cpu->name, t, iCrc, fCrc );                  printf( "%s -  %.3f usec       PSNR=%.3f  MSE=%.3f\n",
209        // the norm tolerates ~1 bit of diff per coeff                                  cpu->name, t, PSNR, MSE );
210      if (ABS(iCrc)>=64) printf( "*** CRC ERROR! ***\n" );                  if (ABS(MSE)>=64) printf( "*** CRC ERROR! ***\n" );
211    }    }
212  }  }
213    
# Line 285  Line 304 
304    const int nb_tests = 2000*speed_ref;    const int nb_tests = 2000*speed_ref;
305    CPU *cpu;    CPU *cpu;
306    const uint8_t Src0[16*9] = {    const uint8_t Src0[16*9] = {
307          // try to have every possible combinaison of rounding...                  /* try to have every possible combinaison of rounding... */
308        0, 0, 1, 0, 2, 0, 3, 0, 4             ,0,0,0, 0,0,0,0        0, 0, 1, 0, 2, 0, 3, 0, 4             ,0,0,0, 0,0,0,0
309      , 0, 1, 1, 1, 2, 1, 3, 1, 3             ,0,0,0, 0,0,0,0      , 0, 1, 1, 1, 2, 1, 3, 1, 3             ,0,0,0, 0,0,0,0
310      , 0, 2, 1, 2, 2, 2, 3, 2, 2             ,0,0,0, 0,0,0,0      , 0, 2, 1, 2, 2, 2, 3, 2, 2             ,0,0,0, 0,0,0,0
# Line 334  Line 353 
353      printf( "%s -           round1 %.3f usec       iCrc=%d\n", cpu->name, t, iCrc );      printf( "%s -           round1 %.3f usec       iCrc=%d\n", cpu->name, t, iCrc );
354      if (iCrc!=8103) printf( "*** CRC ERROR! ***\n" );      if (iCrc!=8103) printf( "*** CRC ERROR! ***\n" );
355    
356    
357                    /* this is a new function, as of 06.06.2002 */
358    #if 0
359                    TEST_MB2(interpolate8x8_avrg);
360                    printf( "%s - interpolate8x8_c %.3f usec       iCrc=%d\n", cpu->name, t, iCrc );
361                    if (iCrc!=8107) printf( "*** CRC ERROR! ***\n" );
362    #endif
363    
364      printf( " --- \n" );      printf( " --- \n" );
365    }    }
366  }  }
# Line 445  Line 472 
472      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; }
473      printf( "crc2=%d\n", s);      printf( "crc2=%d\n", s);
474      if (s!=16256) printf( "*** CRC ERROR! ***\n" );      if (s!=16256) printf( "*** CRC ERROR! ***\n" );
475    #if 1
476      TEST_TRANSFER3(transfer_8to16sub2, Dst16, Src8, Ref1, Ref2);      TEST_TRANSFER3(transfer_8to16sub2, Dst16, Src8, Ref1, Ref2);
477      printf( "%s - 8to16sub2 %.3f usec       crc=%d\n", cpu->name, t, s );      printf( "%s - 8to16sub2 %.3f usec       crc=%d\n", cpu->name, t, s );
478      if (s!=20384) printf( "*** CRC ERROR! ***\n" );      if (s!=20384) printf( "*** CRC ERROR! ***\n" );
479    //    for(i=0; i<64; ++i) printf( "[%d]", Dst16[i]);
480    //    printf("\n");
481    #endif
482      printf( " --- \n" );      printf( " --- \n" );
483    }    }
484  }  }
# Line 460  Line 489 
489    
490  #define TEST_QUANT(FUNC, DST, SRC)            \  #define TEST_QUANT(FUNC, DST, SRC)            \
491      t = gettime_usec();                       \      t = gettime_usec();                       \
492    for(s=0,qm=1; qm<=255; ++qm) {              \
493      for(i=0; i<8*8; ++i) Quant[i] = qm;       \
494      set_inter_matrix( Quant );                \
495      emms();                                   \      emms();                                   \
496      for(q=1; q<=max_Q; ++q) {                 \
497      for(tst=0; tst<nb_tests; ++tst)           \      for(tst=0; tst<nb_tests; ++tst)           \
       for(s=0, q=1; q<=max_Q; ++q) {          \  
498          (FUNC)((DST), (SRC), q);              \          (FUNC)((DST), (SRC), q);              \
499          for(i=0; i<64; ++i) s+=(DST)[i]^i;    \          for(i=0; i<64; ++i) s+=(DST)[i]^i^qm;   \
500        }                                       \        }                                       \
501      emms();                                   \      emms();                                   \
502      t = (gettime_usec()-t-overhead)/nb_tests;  }                                           \
503    t = (gettime_usec()-t-overhead)/nb_tests/qm;\
504    s = (s&0xffff)^(s>>16)
505    
506  #define TEST_QUANT2(FUNC, DST, SRC, MULT)     \  #define TEST_QUANT2(FUNC, DST, SRC)             \
507      t = gettime_usec();                       \      t = gettime_usec();                       \
508    for(s=0,qm=1; qm<=255; ++qm) {              \
509      for(i=0; i<8*8; ++i) Quant[i] = qm;       \
510      set_intra_matrix( Quant );                \
511      emms();                                   \      emms();                                   \
512      for(q=1; q<=max_Q; ++q) {                 \
513      for(tst=0; tst<nb_tests; ++tst)           \      for(tst=0; tst<nb_tests; ++tst)           \
514        for(s=0, q=1; q<=max_Q; ++q) {          \            (FUNC)((DST), (SRC), q, q);           \
515          (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;    \  
516        }                                       \        }                                       \
517      emms();                                   \      emms();                                   \
518      t = (gettime_usec()-t-overhead)/nb_tests;  }                                           \
519    t = (gettime_usec()-t-overhead)/nb_tests/qm;\
520    s = (s&0xffff)^(s>>16)
521    
522  void test_quant()  void test_quant()
523  {  {
524    const int nb_tests = 150*speed_ref;          const int nb_tests = 1*speed_ref;
525    const int max_Q = 31;    const int max_Q = 31;
526    int i;          int i, qm;
527    CPU *cpu;    CPU *cpu;
528    int16_t  Src[8*8], Dst[8*8];    int16_t  Src[8*8], Dst[8*8];
529            uint8_t Quant[8*8];
530    
531    printf( "\n =====  test quant =====\n" );    printf( "\n =====  test quant =====\n" );
532    
533    /* we deliberately enfringe the norm's specified range [-127,127], */
534    /* to test the robustness of the iquant module */
535    for(i=0; i<64; ++i) {    for(i=0; i<64; ++i) {
536      Src[i] = i-32;                  Src[i] = 1 + (i-32) * (i&6);
537      Dst[i] = 0;      Dst[i] = 0;
538    }    }
539    
   
540    for(cpu = cpu_short_list; cpu->name!=0; ++cpu)    for(cpu = cpu_short_list; cpu->name!=0; ++cpu)
541    {    {
542      double t, overhead;      double t, overhead;
543      int tst, s, q;                  int tst, q;
544                    uint32_t s;
545    
546      if (!init_cpu(cpu))      if (!init_cpu(cpu))
547        continue;        continue;
548    
     set_inter_matrix( get_default_inter_matrix() );  
     set_intra_matrix( get_default_intra_matrix() );  
549      overhead = -gettime_usec();      overhead = -gettime_usec();
550      for(tst=0; tst<nb_tests; ++tst)                  for(s=0,qm=1; qm<=255; ++qm) {
551        for(s=0, q=1; q<=max_Q; ++q)                          for(i=0; i<8*8; ++i) Quant[i] = qm;
552          for(i=0; i<64; ++i) s+=Dst[i]^i;                          set_inter_matrix( Quant );
553                            for(q=1; q<=max_Q; ++q)
554                                    for(i=0; i<64; ++i) s+=Dst[i]^i^qm;
555                    }
556      overhead += gettime_usec();      overhead += gettime_usec();
557    
558      TEST_QUANT2(quant4_intra, Dst, Src, 7);  #if 1
559                    TEST_QUANT2(quant4_intra, Dst, Src);
560      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 );
561      if (s!=55827) printf( "*** CRC ERROR! ***\n" );                  if (s!=29809) printf( "*** CRC ERROR! ***\n" );
562    
563      TEST_QUANT(quant4_inter, Dst, Src);      TEST_QUANT(quant4_inter, Dst, Src);
564      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 );
565      if (s!=58201) printf( "*** CRC ERROR! ***\n" );                  if (s!=12574) printf( "*** CRC ERROR! ***\n" );
566    #endif
567    #if 1
568      TEST_QUANT2(dequant4_intra, Dst, Src, 7);                  TEST_QUANT2(dequant4_intra, Dst, Src);
569      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 );
570      if (s!=193340) printf( "*** CRC ERROR! ***\n" );                  if (s!=24052) printf( "*** CRC ERROR! ***\n" );
571    
572      TEST_QUANT(dequant4_inter, Dst, Src);      TEST_QUANT(dequant4_inter, Dst, Src);
573      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 );
574      if (s!=116483) printf( "*** CRC ERROR! ***\n" );                  if (s!=63847) printf( "*** CRC ERROR! ***\n" );
575    #endif
576      TEST_QUANT2(quant_intra, Dst, Src, 7);  #if 1
577                    TEST_QUANT2(quant_intra, Dst, Src);
578      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 );
579      if (s!=56885) printf( "*** CRC ERROR! ***\n" );                  if (s!=25662) printf( "*** CRC ERROR! ***\n" );
580    
581      TEST_QUANT(quant_inter, Dst, Src);      TEST_QUANT(quant_inter, Dst, Src);
582      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 );
583      if (s!=58056) printf( "*** CRC ERROR! ***\n" );                  if (s!=23972) printf( "*** CRC ERROR! ***\n" );
584    #endif
585      TEST_QUANT2(dequant_intra, Dst, Src, 7);  #if 1
586                    TEST_QUANT2(dequant_intra, Dst, Src);
587      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 );
588      if (s!=-7936) printf( "*** CRC ERROR! ***\n" );                  if (s!=49900) printf( "*** CRC ERROR! ***\n" );
589    
590      TEST_QUANT(dequant_inter, Dst, Src);      TEST_QUANT(dequant_inter, Dst, Src);
591      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 );
592  //    { 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" );
593      if (s!=-33217) printf( "*** CRC ERROR! ***\n" );  #endif
   
594      printf( " --- \n" );      printf( " --- \n" );
595    }    }
596  }  }
# Line 573  Line 618 
618    printf( "\n =====  test cbp =====\n" );    printf( "\n =====  test cbp =====\n" );
619    
620    for(i=0; i<6*64; ++i) {    for(i=0; i<6*64; ++i) {
621      Src1[i] = (i*i*3/8192)&(i/64)&1;  // 'random'                  Src1[i] = (i*i*3/8192)&(i/64)&1;  /* 'random' */
622      Src2[i] = (i<3*64);               // half-full                  Src2[i] = (i<3*64);               /* half-full */
623      Src3[i] = ((i+32)>3*64);      Src3[i] = ((i+32)>3*64);
624      Src4[i] = (i==(3*64+2) || i==(5*64+9));      Src4[i] = (i==(3*64+2) || i==(5*64+9));
625    }    }
# Line 604  Line 649 
649  }  }
650    
651  /*********************************************************************  /*********************************************************************
652     * fdct/idct IEEE1180 compliance
653     *********************************************************************/
654    
655    typedef struct {
656            long Errors[64];
657            long Sqr_Errors[64];
658            long Max_Errors[64];
659            long Nb;
660    } STATS_8x8;
661    
662    void init_stats(STATS_8x8 *S)
663    {
664            int i;
665            for(i=0; i<64; ++i) {
666                    S->Errors[i]     = 0;
667                    S->Sqr_Errors[i] = 0;
668                    S->Max_Errors[i] = 0;
669            }
670            S->Nb = 0;
671    }
672    
673    void store_stats(STATS_8x8 *S, short Blk[64], short Ref[64])
674    {
675            int i;
676            for(i=0; i<64; ++i)
677            {
678                    short Err = Blk[i] - Ref[i];
679                    S->Errors[i] += Err;
680                    S->Sqr_Errors[i] += Err * Err;
681                    if (Err<0) Err = -Err;
682                    if (S->Max_Errors[i]<Err)
683                            S->Max_Errors[i] = Err;
684            }
685            S->Nb++;
686    }
687    
688    void print_stats(STATS_8x8 *S)
689    {
690            int i;
691            double Norm;
692    
693            assert(S->Nb>0);
694            Norm = 1. / (double)S->Nb;
695            printf("\n== Max absolute values of errors ==\n");
696            for(i=0; i<64; i++) {
697                    printf("  %4ld", S->Max_Errors[i]);
698                    if ((i&7)==7) printf("\n");
699            }
700    
701            printf("\n== Mean square errors ==\n");
702            for(i=0; i<64; i++)
703            {
704                    double Err = Norm * (double)S->Sqr_Errors[i];
705                    printf(" %.3f", Err);
706                    if ((i&7)==7) printf("\n");
707            }
708    
709            printf("\n== Mean errors ==\n");
710            for(i=0; i<64; i++)
711            {
712                    double Err = Norm * (double)S->Errors[i];
713                    printf(" %.3f", Err);
714                    if ((i&7)==7) printf("\n");
715            }
716            printf("\n");
717    }
718    
719    static const char *CHECK(double v, double l) {
720            if (fabs(v)<=l) return "ok";
721            else return "FAIL!";
722    }
723    
724    void report_stats(STATS_8x8 *S, const double *Limits)
725    {
726            int i;
727            double Norm, PE, PMSE, OMSE, PME, OME;
728    
729            assert(S->Nb>0);
730            Norm = 1. / (double)S->Nb;
731            PE = 0.;
732            for(i=0; i<64; i++) {
733                    if (PE<S->Max_Errors[i])
734                            PE = S->Max_Errors[i];
735            }
736    
737            PMSE = 0.;
738            OMSE = 0.;
739            for(i=0; i<64; i++)
740            {
741                    double Err = Norm * (double)S->Sqr_Errors[i];
742                    OMSE += Err;
743                    if (PMSE < Err) PMSE = Err;
744            }
745            OMSE /= 64.;
746    
747            PME = 0.;
748            OME = 0.;
749            for(i=0; i<64; i++)
750            {
751                    double Err = Norm * (double)S->Errors[i];
752                    OME += Err;
753                    Err = fabs(Err);
754                    if (PME < Err) PME = Err;
755            }
756            OME /= 64.;
757    
758            printf( "Peak error:   %4.4f\n", PE );
759            printf( "Peak MSE:     %4.4f\n", PMSE );
760            printf( "Overall MSE:  %4.4f\n", OMSE );
761            printf( "Peak ME:      %4.4f\n", PME );
762            printf( "Overall ME:   %4.4f\n", OME );
763    
764            if (Limits!=0)
765            {
766                    printf( "[PE<=%.4f %s]  ", Limits[0], CHECK(PE,   Limits[0]) );
767                    printf( "\n" );
768                    printf( "[PMSE<=%.4f %s]", Limits[1], CHECK(PMSE, Limits[1]) );
769                    printf( "[OMSE<=%.4f %s]", Limits[2], CHECK(OMSE, Limits[2]) );
770                    printf( "\n" );
771                    printf( "[PME<=%.4f %s] ", Limits[3], CHECK(PME , Limits[3]) );
772                    printf( "[OME<=%.4f %s] ", Limits[4], CHECK(OME , Limits[4]) );
773                    printf( "\n" );
774            }
775    }
776    
777    ///* ////////////////////////////////////////////////////// */
778    /* Pseudo-random generator specified by IEEE 1180 */
779    
780    static long ieee_seed = 1;
781    static void ieee_reseed(long s) {
782            ieee_seed = s;
783    }
784    static long ieee_rand(int Min, int Max)
785    {
786            static double z = (double) 0x7fffffff;
787    
788            long i,j;
789            double x;
790    
791            ieee_seed = (ieee_seed * 1103515245) + 12345;
792            i = ieee_seed & 0x7ffffffe;
793            x = ((double) i) / z;
794            x *= (Max-Min+1);
795            j = (long)x;
796            j = j + Min;
797            assert(j>=Min && j<=Max);
798            return (short)j;
799    }
800    
801    #define CLAMP(x, M)   (x) = ((x)<-(M)) ? (-(M)) : ((x)>=(M) ? ((M)-1) : (x))
802    
803    static double Cos[8][8];
804    static void init_ref_dct()
805    {
806            int i, j;
807            for(i=0; i<8; i++)
808            {
809                    double scale = (i == 0) ? sqrt(0.125) : 0.5;
810                    for (j=0; j<8; j++)
811                            Cos[i][j] = scale*cos( (M_PI/8.0)*i*(j + 0.5) );
812            }
813    }
814    
815    void ref_idct(short *M)
816    {
817            int i, j, k;
818            double Tmp[8][8];
819    
820            for(i=0; i<8; i++) {
821                    for(j=0; j<8; j++)
822                    {
823                            double Sum = 0.0;
824                            for (k=0; k<8; k++) Sum += Cos[k][j]*M[8*i+k];
825                            Tmp[i][j] = Sum;
826                    }
827            }
828            for(i=0; i<8; i++) {
829                    for(j=0; j<8; j++) {
830                            double Sum = 0.0;
831                            for (k=0; k<8; k++) Sum += Cos[k][i]*Tmp[k][j];
832                            M[8*i+j] = (short)floor(Sum + .5);
833                    }
834            }
835    }
836    
837    void ref_fdct(short *M)
838    {
839            int i, j, k;
840            double Tmp[8][8];
841    
842            for(i=0; i<8; i++) {
843                    for(j=0; j<8; j++)
844                    {
845                            double Sum = 0.0;
846                            for (k=0; k<8; k++) Sum += Cos[j][k]*M[8*i+k];
847                            Tmp[i][j] = Sum;
848                    }
849            }
850            for(i=0; i<8; i++) {
851                    for(j=0; j<8; j++) {
852                            double Sum = 0.0;
853                            for (k=0; k<8; k++) Sum += Cos[i][k]*Tmp[k][j];
854                            M[8*i+j] = (short)floor(Sum + 0.5);
855                    }
856            }
857    }
858    
859    void test_IEEE1180_compliance(int Min, int Max, int Sign)
860    {
861            static const double ILimits[5] = { 1., 0.06, 0.02, 0.015, 0.0015 };
862            int Loops = 10000;
863            int i, m, n;
864            short Blk0[64];     /* reference */
865            short Blk[64], iBlk[64];
866            short Ref_FDCT[64];
867            short Ref_IDCT[64];
868    
869            STATS_8x8 FStats; /* forward dct stats */
870            STATS_8x8 IStats; /* inverse dct stats */
871    
872            CPU *cpu;
873    
874            init_ref_dct();
875    
876            for(cpu = cpu_list; cpu->name!=0; ++cpu)
877            {
878                    if (!init_cpu(cpu))
879                            continue;
880    
881                    printf( "\n===== IEEE test for %s ==== (Min=%d Max=%d Sign=%d Loops=%d)\n",
882                                    cpu->name, Min, Max, Sign, Loops);
883    
884                    init_stats(&IStats);
885                    init_stats(&FStats);
886    
887                    ieee_reseed(1);
888                    for(n=0; n<Loops; ++n)
889                    {
890                            for(i=0; i<64; ++i)
891                                    Blk0[i] = (short)ieee_rand(Min,Max) * Sign;
892    
893                            /* hmm, I'm not quite sure this is exactly */
894                            /* the tests described in the norm. check... */
895    
896                            memcpy(Ref_FDCT, Blk0, 64*sizeof(short));
897                            ref_fdct(Ref_FDCT);
898                            for(i=0; i<64; i++) CLAMP( Ref_FDCT[i], 2048 );
899    
900                            memcpy(Blk, Blk0, 64*sizeof(short));
901                            emms(); fdct(Blk); emms();
902                            for(i=0; i<64; i++) CLAMP( Blk[i], 2048 );
903    
904                            store_stats(&FStats, Blk, Ref_FDCT);
905    
906    
907                            memcpy(Ref_IDCT, Ref_FDCT, 64*sizeof(short));
908                            ref_idct(Ref_IDCT);
909                            for (i=0; i<64; i++) CLAMP( Ref_IDCT[i], 256 );
910    
911                            memcpy(iBlk, Ref_FDCT, 64*sizeof(short));
912                            emms(); idct(iBlk); emms();
913                            for(i=0; i<64; i++) CLAMP( iBlk[i], 256 );
914    
915                            store_stats(&IStats, iBlk, Ref_IDCT);
916                    }
917    
918    
919                    printf( "\n  -- FDCT report --\n" );
920    //    print_stats(&FStats);
921                    report_stats(&FStats, 0); /* so far I know, IEEE1180 says nothing for fdct */
922    
923                    for(i=0; i<64; i++) Blk[i] = 0;
924                    emms(); fdct(Blk); emms();
925                    for(m=i=0; i<64; i++) if (Blk[i]!=0) m++;
926                    printf( "FDCT(0) == 0 ?  %s\n", (m!=0) ? "NOPE!" : "yup." );
927    
928                    printf( "\n  -- IDCT report --\n" );
929    //    print_stats(&IStats);
930                    report_stats(&IStats, ILimits);
931    
932    
933                    for(i=0; i<64; i++) Blk[i] = 0;
934                    emms(); idct(Blk); emms();
935                    for(m=i=0; i<64; i++) if (Blk[i]!=0) m++;
936                    printf( "IDCT(0) == 0 ?  %s\n", (m!=0) ? "NOPE!" : "yup." );
937            }
938    }
939    
940    
941    void test_dct_saturation(int Min, int Max)
942    {
943    /* test behaviour on input range fringe */
944    
945            int i, n, p;
946            CPU *cpu;
947    //  const short IDCT_MAX =  2047;  /* 12bits input */
948    //  const short IDCT_MIN = -2048;
949    //  const short IDCT_OUT =   256;  /* 9bits ouput */
950            const int Partitions = 4;
951            const int Loops = 10000 / Partitions;
952    
953            init_ref_dct();
954    
955            for(cpu = cpu_list; cpu->name!=0; ++cpu)
956            {
957                    short Blk0[64], Blk[64];
958                    STATS_8x8 Stats;
959    
960                    if (!init_cpu(cpu))
961                            continue;
962    
963                    printf( "\n===== IEEE test for %s Min=%d Max=%d =====\n",
964                                    cpu->name, Min, Max );
965    
966                    /* FDCT tests // */
967    
968                    init_stats(&Stats);
969    
970                    /* test each computation channels separately */
971                    for(i=0; i<64; i++) Blk[i] = Blk0[i] = ((i/8)==(i%8)) ? Max : 0;
972                    ref_fdct(Blk0);
973                    emms(); fdct(Blk); emms();
974                    store_stats(&Stats, Blk, Blk0);
975    
976                    for(i=0; i<64; i++) Blk[i] = Blk0[i] = ((i/8)==(i%8)) ? Min : 0;
977                    ref_fdct(Blk0);
978                    emms(); fdct(Blk); emms();
979                    store_stats(&Stats, Blk, Blk0);
980    
981                    /* randomly saturated inputs */
982                    for(p=0; p<Partitions; ++p)
983                    {
984                            for(n=0; n<Loops; ++n)
985                            {
986                                    for(i=0; i<64; ++i)
987                                            Blk0[i] = Blk[i] = (ieee_rand(0,Partitions)>=p)? Max : Min;
988                                    ref_fdct(Blk0);
989                                    emms(); fdct(Blk); emms();
990                                    store_stats(&Stats, Blk, Blk0);
991                            }
992                    }
993                    printf( "\n  -- FDCT saturation report --\n" );
994                    report_stats(&Stats, 0);
995    
996    
997                    /* IDCT tests // */
998    #if 0
999                    /* no finished yet */
1000    
1001                    init_stats(&Stats);
1002    
1003    /* test each computation channel separately */
1004                    for(i=0; i<64; i++) Blk[i] = Blk0[i] = ((i/8)==(i%8)) ? IDCT_MAX : 0;
1005                    ref_idct(Blk0);
1006                    emms(); idct(Blk); emms();
1007                    for(i=0; i<64; i++) { CLAMP(Blk0[i], IDCT_OUT); CLAMP(Blk[i], IDCT_OUT); }
1008                    store_stats(&Stats, Blk, Blk0);
1009    
1010                    for(i=0; i<64; i++) Blk[i] = Blk0[i] = ((i/8)==(i%8)) ? IDCT_MIN : 0;
1011                    ref_idct(Blk0);
1012                    emms(); idct(Blk); emms();
1013                    for(i=0; i<64; i++) { CLAMP(Blk0[i], IDCT_OUT); CLAMP(Blk[i], IDCT_OUT); }
1014                    store_stats(&Stats, Blk, Blk0);
1015    
1016                    /* randomly saturated inputs */
1017                    for(p=0; p<Partitions; ++p)
1018                    {
1019                            for(n=0; n<Loops; ++n)
1020                            {
1021                                    for(i=0; i<64; ++i)
1022                                            Blk0[i] = Blk[i] = (ieee_rand(0,Partitions)>=p)? IDCT_MAX : IDCT_MIN;
1023                                    ref_idct(Blk0);
1024                                    emms(); idct(Blk); emms();
1025                                    for(i=0; i<64; i++) { CLAMP(Blk0[i],IDCT_OUT); CLAMP(Blk[i],IDCT_OUT); }
1026                                    store_stats(&Stats, Blk, Blk0);
1027                            }
1028                    }
1029    
1030                    printf( "\n  -- IDCT saturation report --\n" );
1031                    print_stats(&Stats);
1032                    report_stats(&Stats, 0);
1033    #endif
1034            }
1035    }
1036    
1037    /*********************************************************************
1038   * measure raw decoding speed   * measure raw decoding speed
1039   *********************************************************************/   *********************************************************************/
1040    
# Line 612  Line 1043 
1043    FILE *f = 0;    FILE *f = 0;
1044    void *dechandle = 0;    void *dechandle = 0;
1045    int xerr;    int xerr;
1046          XVID_INIT_PARAM xinit;          xvid_gbl_init_t xinit;
1047          XVID_DEC_PARAM xparam;          xvid_dec_create_t xparam;
1048          XVID_DEC_FRAME xframe;          xvid_dec_frame_t xframe;
1049          double t = 0.;          double t = 0.;
1050          int nb = 0;          int nb = 0;
1051    uint8_t *buf = 0;    uint8_t *buf = 0;
# Line 622  Line 1053 
1053    int buf_size, pos;    int buf_size, pos;
1054    uint32_t chksum = 0;    uint32_t chksum = 0;
1055    
1056          xinit.cpu_flags = 0;          memset(&xinit, 0, sizeof(xinit));
1057          xvid_init(NULL, 0, &xinit, NULL);          xinit.cpu_flags = XVID_CPU_MMX | XVID_CPU_FORCE;
1058          printf( "API version: %d, core build:%d\n", xinit.api_version, xinit.core_build);          xinit.version = XVID_VERSION;
1059            xvid_global(NULL, 0, &xinit, NULL);
1060    
1061            memset(&xparam, 0, sizeof(xparam));
1062          xparam.width = width;          xparam.width = width;
1063          xparam.height = height;          xparam.height = height;
1064            xparam.version = XVID_VERSION;
1065          xerr = xvid_decore(NULL, XVID_DEC_CREATE, &xparam, NULL);          xerr = xvid_decore(NULL, XVID_DEC_CREATE, &xparam, NULL);
1066          if (xerr!=XVID_ERR_OK) {          if (xerr==XVID_ERR_FAIL) {
1067            printf("can't init decoder (err=%d)\n", xerr);            printf("can't init decoder (err=%d)\n", xerr);
1068            return;            return;
1069          }          }
# Line 651  Line 1084 
1084    }    }
1085    else printf( "Input size: %d\n", buf_size);    else printf( "Input size: %d\n", buf_size);
1086    
1087    buf = malloc(buf_size); // should be enuf'          buf = malloc(buf_size); /* should be enuf' */
1088    rgb_out = calloc(4, width*height);  // <-room for _RGB24          rgb_out = calloc(4, width*height);  /* <-room for _RGB24 */
1089    if (buf==0 || rgb_out==0) {    if (buf==0 || rgb_out==0) {
1090      printf( "malloc failed!\n" );      printf( "malloc failed!\n" );
1091      goto End;      goto End;
# Line 667  Line 1100 
1100    pos = 0;    pos = 0;
1101    t = -gettime_usec();    t = -gettime_usec();
1102    while(1) {    while(1) {
1103                    memset(&xframe, 0, sizeof(xframe));
1104                    xframe.version = XVID_VERSION;
1105      xframe.bitstream = buf + pos;      xframe.bitstream = buf + pos;
1106      xframe.length = buf_size - pos;      xframe.length = buf_size - pos;
1107      xframe.image = rgb_out;                  xframe.output.plane[0] = rgb_out;
1108      xframe.stride = width;                  xframe.output.stride[0] = width;
1109      xframe.colorspace = XVID_CSP_RGB24;                  xframe.output.csp = XVID_CSP_BGR;
1110      xerr = xvid_decore(dechandle, XVID_DEC_DECODE, &xframe, 0);      xerr = xvid_decore(dechandle, XVID_DEC_DECODE, &xframe, 0);
1111      nb++;      nb++;
1112      pos += xframe.length;      pos += xframe.length;
# Line 682  Line 1117 
1117      }      }
1118      if (pos==buf_size)      if (pos==buf_size)
1119        break;        break;
1120      if (xerr!=XVID_ERR_OK) {                  if (xerr==XVID_ERR_FAIL) {
1121            printf("decoding failed for frame #%d (err=%d)!\n", nb, xerr);            printf("decoding failed for frame #%d (err=%d)!\n", nb, xerr);
1122            break;            break;
1123          }          }
# Line 698  Line 1133 
1133    if (buf!=0) free(buf);    if (buf!=0) free(buf);
1134    if (dechandle!=0) {    if (dechandle!=0) {
1135      xerr= xvid_decore(dechandle, XVID_DEC_DESTROY, NULL, NULL);      xerr= xvid_decore(dechandle, XVID_DEC_DESTROY, NULL, NULL);
1136      if (xerr!=XVID_ERR_OK)                  if (xerr==XVID_ERR_FAIL)
1137              printf("destroy-decoder failed (err=%d)!\n", xerr);              printf("destroy-decoder failed (err=%d)!\n", xerr);
1138    }    }
1139    if (f!=0) fclose(f);    if (f!=0) fclose(f);
# Line 724  Line 1159 
1159    
1160      for(i=0; i<64; ++i) Src[i] = i-32;      for(i=0; i<64; ++i) Src[i] = i-32;
1161      set_intra_matrix( get_default_intra_matrix() );      set_intra_matrix( get_default_intra_matrix() );
1162      dequant4_intra(Dst, Src, 32, 5);                  dequant4_intra(Dst, Src, 31, 5);
1163      printf( "dequant4_intra with CPU=%s:  ", cpu->name);      printf( "dequant4_intra with CPU=%s:  ", cpu->name);
1164      printf( "  Out[]= " );      printf( "  Out[]= " );
1165      for(i=0; i<64; ++i) printf( "[%d]", Dst[i]);      for(i=0; i<64; ++i) printf( "[%d]", Dst[i]);
# Line 743  Line 1178 
1178    
1179      for(i=0; i<64; ++i) Src[i] = i-32;      for(i=0; i<64; ++i) Src[i] = i-32;
1180      set_inter_matrix( get_default_inter_matrix() );      set_inter_matrix( get_default_inter_matrix() );
1181      dequant4_inter(Dst, Src, 32);                  dequant4_inter(Dst, Src, 31);
1182      printf( "dequant4_inter with CPU=%s:  ", cpu->name);      printf( "dequant4_inter with CPU=%s:  ", cpu->name);
1183      printf( "  Out[]= " );      printf( "  Out[]= " );
1184      for(i=0; i<64; ++i) printf( "[%d]", Dst[i]);      for(i=0; i<64; ++i) printf( "[%d]", Dst[i]);
# Line 756  Line 1191 
1191    CPU *cpu;    CPU *cpu;
1192    short Blk[8*8], Blk0[8*8];    short Blk[8*8], Blk0[8*8];
1193    
1194    printf( "\n =====  fdct/idct saturation diffs =====\n" );          printf( "\n =====  fdct/idct precision diffs =====\n" );
1195    
1196    for(cpu = cpu_short_list; cpu->name!=0; ++cpu)    for(cpu = cpu_short_list; cpu->name!=0; ++cpu)
1197    {    {
# Line 782  Line 1217 
1217    }    }
1218  }  }
1219    
1220    void test_quant_bug()
1221    {
1222            const int max_Q = 31;
1223            int i, n, qm, q;
1224            CPU *cpu;
1225            int16_t  Src[8*8], Dst[8*8];
1226            uint8_t Quant[8*8];
1227            CPU cpu_bug_list[] = { { "PLAINC", 0 }, { "MMX   ", XVID_CPU_MMX }, {0,0} };
1228            uint16_t Crcs_Inter[2][32];
1229            uint16_t Crcs_Intra[2][32];
1230            printf( "\n =====  test MPEG4-quantize bug =====\n" );
1231    
1232            for(i=0; i<64; ++i) Src[i] = 2048*(i-32)/32;
1233    
1234    #if 1
1235            for(qm=1; qm<=255; ++qm)
1236            {
1237                    for(i=0; i<8*8; ++i) Quant[i] = qm;
1238                    set_inter_matrix( Quant );
1239    
1240                    for(n=0, cpu = cpu_bug_list; cpu->name!=0; ++cpu, ++n)
1241                    {
1242                            uint16_t s;
1243    
1244                            if (!init_cpu(cpu))
1245                                    continue;
1246    
1247                            for(q=1; q<=max_Q; ++q) {
1248                                    emms();
1249                                    quant4_inter( Dst, Src, q );
1250                                    emms();
1251                                    for(s=0, i=0; i<64; ++i) s+=((uint16_t)Dst[i])^i;
1252                                    Crcs_Inter[n][q] = s;
1253                            }
1254                    }
1255    
1256                    for(q=1; q<=max_Q; ++q)
1257                            for(i=0; i<n-1; ++i)
1258                                    if (Crcs_Inter[i][q]!=Crcs_Inter[i+1][q])
1259                                            printf( "Discrepancy Inter: qm=%d, q=%d  -> %d/%d !\n",
1260                                                            qm, q, Crcs_Inter[i][q], Crcs_Inter[i+1][q]);
1261            }
1262    #endif
1263    
1264    #if 1
1265            for(qm=1; qm<=255; ++qm)
1266            {
1267                    for(i=0; i<8*8; ++i) Quant[i] = qm;
1268                    set_intra_matrix( Quant );
1269    
1270                    for(n=0, cpu = cpu_bug_list; cpu->name!=0; ++cpu, ++n)
1271                    {
1272                            uint16_t s;
1273    
1274                            if (!init_cpu(cpu))
1275                                    continue;
1276    
1277                            for(q=1; q<=max_Q; ++q) {
1278                                    emms();
1279                                    quant4_intra( Dst, Src, q, q);
1280                                    emms();
1281                                    for(s=0, i=0; i<64; ++i) s+=((uint16_t)Dst[i])^i;
1282                                    Crcs_Intra[n][q] = s;
1283                            }
1284                    }
1285    
1286                    for(q=1; q<=max_Q; ++q)
1287                            for(i=0; i<n-1; ++i)
1288                                    if (Crcs_Intra[i][q]!=Crcs_Intra[i+1][q])
1289                                            printf( "Discrepancy Intra: qm=%d, q=%d  -> %d/%d!\n",
1290                                                            qm, q, Crcs_Inter[i][q], Crcs_Inter[i+1][q]);
1291            }
1292    #endif
1293    }
1294    
1295  /*********************************************************************  /*********************************************************************
1296   * main   * main
# Line 798  Line 1307 
1307    if (what==0 || what==5) test_quant();    if (what==0 || what==5) test_quant();
1308    if (what==0 || what==6) test_cbp();    if (what==0 || what==6) test_cbp();
1309    
1310    if (what==8) {          if (what==7) {
1311                    test_IEEE1180_compliance(-256, 255, 1);
1312    #if 0
1313                    test_IEEE1180_compliance(-256, 255,-1);
1314                    test_IEEE1180_compliance(  -5,   5, 1);
1315                    test_IEEE1180_compliance(  -5,   5,-1);
1316                    test_IEEE1180_compliance(-300, 300, 1);
1317                    test_IEEE1180_compliance(-300, 300,-1);
1318    #endif
1319            }
1320            if (what==8) test_dct_saturation(-256, 255);
1321    
1322            if (what==9) {
1323      int width, height;      int width, height;
1324      if (argc<5) {      if (argc<5) {
1325        printf("usage: %s %d [bitstream] [width] [height]\n", argv[0], what);        printf("usage: %s %d [bitstream] [width] [height]\n", argv[0], what);
# Line 810  Line 1331 
1331    }    }
1332    
1333    if (what==-1) {    if (what==-1) {
     test_bugs1();  
1334      test_dct_precision_diffs();      test_dct_precision_diffs();
1335                    test_bugs1();
1336    }    }
1337            if (what==-2)
1338                    test_quant_bug();
1339    
1340    return 0;    return 0;
1341  }  }
1342    
1343  /*********************************************************************  /*********************************************************************
1344   * 'Reference' output (except for timing) on a PIII 1.13Ghz/linux   * 'Reference' output (except for timing) on a PIII 1.13Ghz/linux
1345   *********************************************************************/   *********************************************************************/
1346    
1347    /* as of 07/01/2002, there's a problem with mpeg4-quantization */
1348  /*  /*
1349    
1350   ===== test fdct/idct =====   ===== test fdct/idct =====
1351  PLAINC -  2.631 usec       iCrc=3  fCrc=-85  PLAINC -  3.312 usec       PSNR=13.291  MSE=3.000
1352  MMX    -  0.596 usec       iCrc=3  fCrc=-67  MMX    -  0.591 usec       PSNR=13.291  MSE=3.000
1353  MMXEXT -  0.608 usec       iCrc=3  fCrc=-67  MMXEXT -  0.577 usec       PSNR=13.291  MSE=3.000
1354  SSE2   -  0.605 usec       iCrc=3  fCrc=-67  SSE2   -  0.588 usec       PSNR=13.291  MSE=3.000
1355  3DNOW  - skipped...  3DNOW  - skipped...
1356  3DNOWE - skipped...  3DNOWE - skipped...
1357    
1358   ===  test block motion ===   ===  test block motion ===
1359  PLAINC - interp- h-round0 1.031 usec       iCrc=8107  PLAINC - interp- h-round0 0.911 usec       iCrc=8107
1360  PLAINC -           round1 1.022 usec       iCrc=8100  PLAINC -           round1 0.863 usec       iCrc=8100
1361  PLAINC - interp- v-round0 1.002 usec       iCrc=8108  PLAINC - interp- v-round0 0.860 usec       iCrc=8108
1362  PLAINC -           round1 1.011 usec       iCrc=8105  PLAINC -           round1 0.857 usec       iCrc=8105
1363  PLAINC - interp-hv-round0 1.623 usec       iCrc=8112  PLAINC - interp-hv-round0 2.103 usec       iCrc=8112
1364  PLAINC -           round1 1.621 usec       iCrc=8103  PLAINC -           round1 2.050 usec       iCrc=8103
 PLAINC - interpolate8x8_c 0.229 usec       iCrc=8107  
1365   ---   ---
1366  MMX    - interp- h-round0 0.105 usec       iCrc=8107  MMX    - interp- h-round0 0.105 usec       iCrc=8107
1367  MMX    -           round1 0.105 usec       iCrc=8100  MMX    -           round1 0.106 usec       iCrc=8100
1368  MMX    - interp- v-round0 0.106 usec       iCrc=8108  MMX    - interp- v-round0 0.106 usec       iCrc=8108
1369  MMX    -           round1 0.107 usec       iCrc=8105  MMX    -           round1 0.106 usec       iCrc=8105
1370  MMX    - interp-hv-round0 0.145 usec       iCrc=8112  MMX    - interp-hv-round0 0.145 usec       iCrc=8112
1371  MMX    -           round1 0.145 usec       iCrc=8103  MMX    -           round1 0.145 usec       iCrc=8103
 MMX    - interpolate8x8_c 0.229 usec       iCrc=8107  
1372   ---   ---
1373  MMXEXT - interp- h-round0 0.027 usec       iCrc=8107  MMXEXT - interp- h-round0 0.028 usec       iCrc=8107
1374  MMXEXT -           round1 0.041 usec       iCrc=8100  MMXEXT -           round1 0.041 usec       iCrc=8100
1375  MMXEXT - interp- v-round0 0.027 usec       iCrc=8108  MMXEXT - interp- v-round0 0.027 usec       iCrc=8108
1376  MMXEXT -           round1 0.040 usec       iCrc=8105  MMXEXT -           round1 0.041 usec       iCrc=8105
1377  MMXEXT - interp-hv-round0 0.070 usec       iCrc=8112  MMXEXT - interp-hv-round0 0.066 usec       iCrc=8112
1378  MMXEXT -           round1 0.066 usec       iCrc=8103  MMXEXT -           round1 0.065 usec       iCrc=8103
 MMXEXT - interpolate8x8_c 0.027 usec       iCrc=8107  
1379   ---   ---
1380  SSE2   - interp- h-round0 0.106 usec       iCrc=8107  SSE2   - interp- h-round0 0.109 usec       iCrc=8107
1381  SSE2   -           round1 0.105 usec       iCrc=8100  SSE2   -           round1 0.105 usec       iCrc=8100
1382  SSE2   - interp- v-round0 0.106 usec       iCrc=8108  SSE2   - interp- v-round0 0.106 usec       iCrc=8108
1383  SSE2   -           round1 0.106 usec       iCrc=8105  SSE2   -           round1 0.109 usec       iCrc=8105
1384  SSE2   - interp-hv-round0 0.145 usec       iCrc=8112  SSE2   - interp-hv-round0 0.145 usec       iCrc=8112
1385  SSE2   -           round1 0.145 usec       iCrc=8103  SSE2   -           round1 0.145 usec       iCrc=8103
 SSE2   - interpolate8x8_c 0.237 usec       iCrc=8107  
1386   ---   ---
1387  3DNOW  - skipped...  3DNOW  - skipped...
1388  3DNOWE - skipped...  3DNOWE - skipped...
1389    
1390   ======  test SAD ======   ======  test SAD ======
1391  PLAINC - sad8    0.296 usec       sad=3776  PLAINC - sad8    0.251 usec       sad=3776
1392  PLAINC - sad16   1.599 usec       sad=27214  PLAINC - sad16   1.601 usec       sad=27214
1393  PLAINC - sad16bi 2.350 usec       sad=26274  PLAINC - sad16bi 2.371 usec       sad=26274
1394  PLAINC - dev16   1.610 usec       sad=3344  PLAINC - dev16   1.564 usec       sad=3344
1395   ---   ---
1396  MMX    - sad8    0.057 usec       sad=3776  MMX    - sad8    0.057 usec       sad=3776
1397  MMX    - sad16   0.178 usec       sad=27214  MMX    - sad16   0.182 usec       sad=27214
1398  MMX    - sad16bi 2.381 usec       sad=26274  MMX    - sad16bi 2.462 usec       sad=26274
1399  MMX    - dev16   0.312 usec       sad=3344  MMX    - dev16   0.311 usec       sad=3344
1400   ---   ---
1401  MMXEXT - sad8    0.036 usec       sad=3776  MMXEXT - sad8    0.036 usec       sad=3776
1402  MMXEXT - sad16   0.106 usec       sad=27214  MMXEXT - sad16   0.109 usec       sad=27214
1403  MMXEXT - sad16bi 0.182 usec       sad=26274  MMXEXT - sad16bi 0.143 usec       sad=26274
1404  MMXEXT - dev16   0.193 usec       sad=3344  MMXEXT - dev16   0.192 usec       sad=3344
1405   ---   ---
1406  SSE2   - sad8    0.057 usec       sad=3776  SSE2   - sad8    0.057 usec       sad=3776
1407  SSE2   - sad16   0.178 usec       sad=27214  SSE2   - sad16   0.179 usec       sad=27214
1408  SSE2   - sad16bi 2.427 usec       sad=26274  SSE2   - sad16bi 2.456 usec       sad=26274
1409  SSE2   - dev16   0.313 usec       sad=3344  SSE2   - dev16   0.321 usec       sad=3344
1410   ---   ---
1411  3DNOW  - skipped...  3DNOW  - skipped...
1412  3DNOWE - skipped...  3DNOWE - skipped...
1413    
1414   ===  test transfer ===   ===  test transfer ===
1415  PLAINC - 8to16     0.124 usec       crc=28288  PLAINC - 8to16     0.151 usec       crc=28288
1416  PLAINC - 16to8     0.753 usec       crc=28288  PLAINC - 16to8     1.113 usec       crc=28288
1417  PLAINC - 8to8      0.041 usec       crc=20352  PLAINC - 8to8      0.043 usec       crc=20352
1418  PLAINC - 16to8add  0.916 usec       crc=25536  PLAINC - 16to8add  1.069 usec       crc=25536
1419  PLAINC - 8to16sub  0.812 usec       crc1=28064 crc2=16256  PLAINC - 8to16sub  0.631 usec       crc1=28064 crc2=16256
1420  PLAINC - 8to16sub2 0.954 usec       crc=20384  PLAINC - 8to16sub2 0.597 usec       crc=20384
1421   ---  ---
1422  MMX    - 8to16     0.037 usec       crc=28288  MMX    - 8to16     0.032 usec       crc=28288
1423  MMX    - 16to8     0.016 usec       crc=28288  MMX    - 16to8     0.024 usec       crc=28288
1424  MMX    - 8to8      0.018 usec       crc=20352  MMX    - 8to8      0.020 usec       crc=20352
1425  MMX    - 16to8add  0.044 usec       crc=25536  MMX    - 16to8add  0.043 usec       crc=25536
1426  MMX    - 8to16sub  0.065 usec       crc1=28064 crc2=16256  MMX    - 8to16sub  0.066 usec       crc1=28064 crc2=16256
1427  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  
1428   ---   ---
1429    
1430   =====  test quant =====   =====  test quant =====
1431  PLAINC -   quant4_intra 78.889 usec       crc=55827  PLAINC -   quant4_intra 74.248 usec       crc=29809
1432  PLAINC -   quant4_inter 71.957 usec       crc=58201  PLAINC -   quant4_inter 70.850 usec       crc=12574
1433  PLAINC - dequant4_intra 34.968 usec       crc=193340  PLAINC - dequant4_intra 40.628 usec       crc=24052
1434  PLAINC - dequant4_inter 40.792 usec       crc=116483  PLAINC - dequant4_inter 45.691 usec       crc=63847
1435  PLAINC -    quant_intra 30.845 usec       crc=56885  PLAINC -    quant_intra 43.357 usec       crc=25662
1436  PLAINC -    quant_inter 34.842 usec       crc=58056  PLAINC -    quant_inter 33.410 usec       crc=23972
1437  PLAINC -  dequant_intra 33.211 usec       crc=-7936  PLAINC -  dequant_intra 36.384 usec       crc=49900
1438  PLAINC -  dequant_inter 45.486 usec       crc=-33217  PLAINC -  dequant_inter 48.930 usec       crc=48899
1439   ---  ---
1440  MMX    -   quant4_intra 9.030 usec       crc=55827  MMX    -   quant4_intra 7.445 usec       crc=3459
1441  MMX    -   quant4_inter 8.234 usec       crc=58201  *** CRC ERROR! ***
1442  MMX    - dequant4_intra 18.330 usec       crc=193340  MMX    -   quant4_inter 5.384 usec       crc=51072
1443  MMX    - dequant4_inter 19.181 usec       crc=116483  *** CRC ERROR! ***
1444  MMX    -    quant_intra 7.124 usec       crc=56885  MMX    - dequant4_intra 5.515 usec       crc=24052
1445  MMX    -    quant_inter 6.861 usec       crc=58056  MMX    - dequant4_inter 7.745 usec       crc=63847
1446  MMX    -  dequant_intra 9.048 usec       crc=-7936  MMX    -    quant_intra 4.661 usec       crc=25662
1447  MMX    -  dequant_inter 8.203 usec       crc=-33217  MMX    -    quant_inter 4.406 usec       crc=23972
1448   ---  MMX    -  dequant_intra 4.928 usec       crc=49900
1449  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  
1450   ---   ---
1451    
1452   =====  test cbp =====   =====  test cbp =====
1453  PLAINC -   calc_cbp#1 0.545 usec       cbp=0x15  PLAINC -   calc_cbp#1 0.371 usec       cbp=0x15
1454  PLAINC -   calc_cbp#2 0.540 usec       cbp=0x38  PLAINC -   calc_cbp#2 0.432 usec       cbp=0x38
1455  PLAINC -   calc_cbp#3 0.477 usec       cbp=0xf  PLAINC -   calc_cbp#3 0.339 usec       cbp=0xf
1456  PLAINC -   calc_cbp#4 0.739 usec       cbp=0x5  PLAINC -   calc_cbp#4 0.506 usec       cbp=0x5
1457   ---   ---
1458  MMX    -   calc_cbp#1 0.136 usec       cbp=0x15  MMX    -   calc_cbp#1 0.136 usec       cbp=0x15
1459  MMX    -   calc_cbp#2 0.131 usec       cbp=0x38  MMX    -   calc_cbp#2 0.134 usec       cbp=0x38
1460  MMX    -   calc_cbp#3 0.132 usec       cbp=0xf  MMX    -   calc_cbp#3 0.138 usec       cbp=0xf
1461  MMX    -   calc_cbp#4 0.135 usec       cbp=0x5  MMX    -   calc_cbp#4 0.135 usec       cbp=0x5
1462   ---   ---
1463  SSE2   -   calc_cbp#1 0.135 usec       cbp=0x15  SSE2   -   calc_cbp#1 0.136 usec       cbp=0x15
1464  SSE2   -   calc_cbp#2 0.131 usec       cbp=0x38  SSE2   -   calc_cbp#2 0.133 usec       cbp=0x38
1465  SSE2   -   calc_cbp#3 0.134 usec       cbp=0xf  SSE2   -   calc_cbp#3 0.133 usec       cbp=0xf
1466  SSE2   -   calc_cbp#4 0.136 usec       cbp=0x5  SSE2   -   calc_cbp#4 0.141 usec       cbp=0x5
1467   ---   ---
1468    
1469  */  */

Legend:
Removed from v.257  
changed lines
  Added in v.1060

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4