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

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

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