[svn] / trunk / xvidcore / examples / xvid_bench.c Repository:
ViewVC logotype

Diff of /trunk/xvidcore/examples/xvid_bench.c

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

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

Legend:
Removed from v.225  
changed lines
  Added in v.898

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