[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 1122, Wed Aug 13 11:44:02 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.4 2003-08-13 11:43:45 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 96  Line 115 
115    
116  CPU cpu_list[] =  CPU cpu_list[] =
117  { { "PLAINC", 0 }  { { "PLAINC", 0 }
118    #ifdef ARCH_IS_IA32
119  , { "MMX   ", XVID_CPU_MMX }  , { "MMX   ", XVID_CPU_MMX }
120  , { "MMXEXT", XVID_CPU_MMXEXT | XVID_CPU_MMX }  , { "MMXEXT", XVID_CPU_MMXEXT | XVID_CPU_MMX }
121  , { "SSE2  ", XVID_CPU_SSE2 | XVID_CPU_MMX }  , { "SSE2  ", XVID_CPU_SSE2 | XVID_CPU_MMX }
122  , { "3DNOW ", XVID_CPU_3DNOW }  , { "3DNOW ", XVID_CPU_3DNOW }
123  , { "3DNOWE", XVID_CPU_3DNOWEXT }  , { "3DNOWE", XVID_CPU_3DNOWEXT }
124    #endif
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  cpu_short_list[] =
130  { { "PLAINC", 0 }  { { "PLAINC", 0 }
131    #ifdef ARCH_IS_IA32
132  , { "MMX   ", XVID_CPU_MMX }  , { "MMX   ", XVID_CPU_MMX }
133  , { "MMXEXT", XVID_CPU_MMXEXT | XVID_CPU_MMX }  //, { "MMXEXT", XVID_CPU_MMXEXT | XVID_CPU_MMX }
134  , { "IA64  ", XVID_CPU_IA64 }  #endif
135  , { 0, 0 } }  //, { "IA64  ", XVID_CPU_IA64 }
136      , { 0, 0 } };
137    
138  , cpu_short_list2[] =  CPU cpu_short_list2[] =
139  { { "PLAINC", 0 }  { { "PLAINC", 0 }
140    #ifdef ARCH_IS_IA32
141  , { "MMX   ", XVID_CPU_MMX }  , { "MMX   ", XVID_CPU_MMX }
142  , { "SSE2  ", XVID_CPU_SSE2 | XVID_CPU_MMX }  , { "SSE2  ", XVID_CPU_SSE2 | XVID_CPU_MMX }
143    #endif
144  , { 0, 0 } };  , { 0, 0 } };
145    
146    
147  int init_cpu(CPU *cpu)  int init_cpu(CPU *cpu)
148  {  {
149    int xerr, cpu_type;    int xerr, cpu_type;
150    XVID_INIT_PARAM xinit;          xvid_gbl_init_t xinit;
151    
152    #ifdef ARCH_IS_IA32
153    cpu_type = check_cpu_features() & cpu->cpu;    cpu_type = check_cpu_features() & cpu->cpu;
154    #else
155            cpu_type = XVID_CPU_ASM;
156    #endif
157            memset(&xinit, 0, sizeof(xinit));
158    xinit.cpu_flags = cpu_type | XVID_CPU_FORCE;    xinit.cpu_flags = cpu_type | XVID_CPU_FORCE;
159    //    xinit.cpu_flags = XVID_CPU_MMX | XVID_CPU_FORCE;          xinit.version = XVID_VERSION;
160    xerr = xvid_init(NULL, 0, &xinit, NULL);          xerr = xvid_global(NULL, 0, &xinit, NULL);
161    if (cpu->cpu>0 && (cpu_type==0 || xerr!=XVID_ERR_OK)) {          if (cpu->cpu>0 && (cpu_type==0 || xerr==XVID_ERR_FAIL)) {
162      printf( "%s - skipped...\n", cpu->name );      printf( "%s - skipped...\n", cpu->name );
163      return 0;      return 0;
164    }    }
# Line 163  Line 193 
193    
194    for(cpu = cpu_list; cpu->name!=0; ++cpu)    for(cpu = cpu_list; cpu->name!=0; ++cpu)
195    {    {
196      double t;                  double t, PSNR, MSE;
     int iCrc, fCrc;  
197    
198      if (!init_cpu(cpu))      if (!init_cpu(cpu))
199        continue;        continue;
# Line 180  Line 209 
209      }      }
210      emms();      emms();
211      t = (gettime_usec() - t - overhead) / nb_tests;      t = (gettime_usec() - t - overhead) / nb_tests;
212      iCrc=0; fCrc=0;                  MSE = 0.;
213      for(i=0; i<8*8; ++i) {      for(i=0; i<8*8; ++i) {
214        iCrc += ABS(iDst[i] - iDst0[i]);                          double delta = 1.0*(iDst[i] - iDst0[i]);
215        fCrc += fDst[i]^i;                          MSE += delta*delta;
216      }      }
217      printf( "%s -  %.3f usec       iCrc=%d  fCrc=%d\n",                  PSNR = (MSE==0.) ? 1.e6 : -4.3429448*log( MSE/64. );
218        cpu->name, t, iCrc, fCrc );                  printf( "%s -  %.3f usec       PSNR=%.3f  MSE=%.3f\n",
219        // the norm tolerates ~1 bit of diff per coeff                                  cpu->name, t, PSNR, MSE );
220      if (ABS(iCrc)>=64) printf( "*** CRC ERROR! ***\n" );                  if (ABS(MSE)>=64) printf( "*** CRC ERROR! ***\n" );
221    }    }
222  }  }
223    
# Line 285  Line 314 
314    const int nb_tests = 2000*speed_ref;    const int nb_tests = 2000*speed_ref;
315    CPU *cpu;    CPU *cpu;
316    const uint8_t Src0[16*9] = {    const uint8_t Src0[16*9] = {
317          // try to have every possible combinaison of rounding...                  /* try to have every possible combinaison of rounding... */
318        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
319      , 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
320      , 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 363 
363      printf( "%s -           round1 %.3f usec       iCrc=%d\n", cpu->name, t, iCrc );      printf( "%s -           round1 %.3f usec       iCrc=%d\n", cpu->name, t, iCrc );
364      if (iCrc!=8103) printf( "*** CRC ERROR! ***\n" );      if (iCrc!=8103) printf( "*** CRC ERROR! ***\n" );
365    
366    
367                    /* this is a new function, as of 06.06.2002 */
368    #if 0
369                    TEST_MB2(interpolate8x8_avrg);
370                    printf( "%s - interpolate8x8_c %.3f usec       iCrc=%d\n", cpu->name, t, iCrc );
371                    if (iCrc!=8107) printf( "*** CRC ERROR! ***\n" );
372    #endif
373    
374      printf( " --- \n" );      printf( " --- \n" );
375    }    }
376  }  }
# Line 445  Line 482 
482      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; }
483      printf( "crc2=%d\n", s);      printf( "crc2=%d\n", s);
484      if (s!=16256) printf( "*** CRC ERROR! ***\n" );      if (s!=16256) printf( "*** CRC ERROR! ***\n" );
485    #if 1
486      TEST_TRANSFER3(transfer_8to16sub2, Dst16, Src8, Ref1, Ref2);      TEST_TRANSFER3(transfer_8to16sub2, Dst16, Src8, Ref1, Ref2);
487      printf( "%s - 8to16sub2 %.3f usec       crc=%d\n", cpu->name, t, s );      printf( "%s - 8to16sub2 %.3f usec       crc=%d\n", cpu->name, t, s );
488      if (s!=20384) printf( "*** CRC ERROR! ***\n" );      if (s!=20384) printf( "*** CRC ERROR! ***\n" );
489    //    for(i=0; i<64; ++i) printf( "[%d]", Dst16[i]);
490    //    printf("\n");
491    #endif
492      printf( " --- \n" );      printf( " --- \n" );
493    }    }
494  }  }
# Line 460  Line 499 
499    
500  #define TEST_QUANT(FUNC, DST, SRC)            \  #define TEST_QUANT(FUNC, DST, SRC)            \
501      t = gettime_usec();                       \      t = gettime_usec();                       \
502    for(s=0,qm=1; qm<=255; ++qm) {              \
503      for(i=0; i<8*8; ++i) Quant[i] = qm;       \
504      set_inter_matrix( Quant );                \
505      emms();                                   \      emms();                                   \
506      for(q=1; q<=max_Q; ++q) {                 \
507      for(tst=0; tst<nb_tests; ++tst)           \      for(tst=0; tst<nb_tests; ++tst)           \
       for(s=0, q=1; q<=max_Q; ++q) {          \  
508          (FUNC)((DST), (SRC), q);              \          (FUNC)((DST), (SRC), q);              \
509          for(i=0; i<64; ++i) s+=(DST)[i]^i;    \          for(i=0; i<64; ++i) s+=(DST)[i]^i^qm;   \
510        }                                       \        }                                       \
511      emms();                                   \      emms();                                   \
512      t = (gettime_usec()-t-overhead)/nb_tests;  }                                           \
513    t = (gettime_usec()-t-overhead)/nb_tests/qm;\
514    s = (s&0xffff)^(s>>16)
515    
516  #define TEST_QUANT2(FUNC, DST, SRC, MULT)     \  #define TEST_QUANT2(FUNC, DST, SRC)             \
517      t = gettime_usec();                       \      t = gettime_usec();                       \
518    for(s=0,qm=1; qm<=255; ++qm) {              \
519      for(i=0; i<8*8; ++i) Quant[i] = qm;       \
520      set_intra_matrix( Quant );                \
521      emms();                                   \      emms();                                   \
522      for(q=1; q<=max_Q; ++q) {                 \
523      for(tst=0; tst<nb_tests; ++tst)           \      for(tst=0; tst<nb_tests; ++tst)           \
524        for(s=0, q=1; q<=max_Q; ++q) {          \            (FUNC)((DST), (SRC), q, q);           \
525          (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;    \  
526        }                                       \        }                                       \
527      emms();                                   \      emms();                                   \
528      t = (gettime_usec()-t-overhead)/nb_tests;  }                                           \
529    t = (gettime_usec()-t-overhead)/nb_tests/qm;\
530    s = (s&0xffff)^(s>>16)
531    
532  void test_quant()  void test_quant()
533  {  {
534    const int nb_tests = 150*speed_ref;          const int nb_tests = 1*speed_ref;
535    const int max_Q = 31;    const int max_Q = 31;
536    int i;          int i, qm;
537    CPU *cpu;    CPU *cpu;
538    int16_t  Src[8*8], Dst[8*8];    int16_t  Src[8*8], Dst[8*8];
539            uint8_t Quant[8*8];
540    
541    printf( "\n =====  test quant =====\n" );    printf( "\n =====  test quant =====\n" );
542    
543    /* we deliberately enfringe the norm's specified range [-127,127], */
544    /* to test the robustness of the iquant module */
545    for(i=0; i<64; ++i) {    for(i=0; i<64; ++i) {
546      Src[i] = i-32;                  Src[i] = 1 + (i-32) * (i&6);
547      Dst[i] = 0;      Dst[i] = 0;
548    }    }
549    
   
550    for(cpu = cpu_short_list; cpu->name!=0; ++cpu)    for(cpu = cpu_short_list; cpu->name!=0; ++cpu)
551    {    {
552      double t, overhead;      double t, overhead;
553      int tst, s, q;                  int tst, q;
554                    uint32_t s;
555    
556      if (!init_cpu(cpu))      if (!init_cpu(cpu))
557        continue;        continue;
558    
     set_inter_matrix( get_default_inter_matrix() );  
     set_intra_matrix( get_default_intra_matrix() );  
559      overhead = -gettime_usec();      overhead = -gettime_usec();
560      for(tst=0; tst<nb_tests; ++tst)                  for(s=0,qm=1; qm<=255; ++qm) {
561        for(s=0, q=1; q<=max_Q; ++q)                          for(i=0; i<8*8; ++i) Quant[i] = qm;
562          for(i=0; i<64; ++i) s+=Dst[i]^i;                          set_inter_matrix( Quant );
563                            for(q=1; q<=max_Q; ++q)
564                                    for(i=0; i<64; ++i) s+=Dst[i]^i^qm;
565                    }
566      overhead += gettime_usec();      overhead += gettime_usec();
567    
568      TEST_QUANT2(quant4_intra, Dst, Src, 7);  #if 1
569                    TEST_QUANT2(quant4_intra, Dst, Src);
570      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 );
571      if (s!=55827) printf( "*** CRC ERROR! ***\n" );                  if (s!=29809) printf( "*** CRC ERROR! ***\n" );
572    
573      TEST_QUANT(quant4_inter, Dst, Src);      TEST_QUANT(quant4_inter, Dst, Src);
574      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 );
575      if (s!=58201) printf( "*** CRC ERROR! ***\n" );                  if (s!=12574) printf( "*** CRC ERROR! ***\n" );
576    #endif
577    #if 1
578      TEST_QUANT2(dequant4_intra, Dst, Src, 7);                  TEST_QUANT2(dequant4_intra, Dst, Src);
579      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 );
580      if (s!=193340) printf( "*** CRC ERROR! ***\n" );                  if (s!=24052) printf( "*** CRC ERROR! ***\n" );
581    
582      TEST_QUANT(dequant4_inter, Dst, Src);      TEST_QUANT(dequant4_inter, Dst, Src);
583      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 );
584      if (s!=116483) printf( "*** CRC ERROR! ***\n" );                  if (s!=63847) printf( "*** CRC ERROR! ***\n" );
585    #endif
586      TEST_QUANT2(quant_intra, Dst, Src, 7);  #if 1
587                    TEST_QUANT2(quant_intra, Dst, Src);
588      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 );
589      if (s!=56885) printf( "*** CRC ERROR! ***\n" );                  if (s!=25662) printf( "*** CRC ERROR! ***\n" );
590    
591      TEST_QUANT(quant_inter, Dst, Src);      TEST_QUANT(quant_inter, Dst, Src);
592      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 );
593      if (s!=58056) printf( "*** CRC ERROR! ***\n" );                  if (s!=23972) printf( "*** CRC ERROR! ***\n" );
594    #endif
595      TEST_QUANT2(dequant_intra, Dst, Src, 7);  #if 1
596                    TEST_QUANT2(dequant_intra, Dst, Src);
597      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 );
598      if (s!=-7936) printf( "*** CRC ERROR! ***\n" );                  if (s!=49900) printf( "*** CRC ERROR! ***\n" );
599    
600      TEST_QUANT(dequant_inter, Dst, Src);      TEST_QUANT(dequant_inter, Dst, Src);
601      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 );
602  //    { 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" );
603      if (s!=-33217) printf( "*** CRC ERROR! ***\n" );  #endif
   
604      printf( " --- \n" );      printf( " --- \n" );
605    }    }
606  }  }
# Line 573  Line 628 
628    printf( "\n =====  test cbp =====\n" );    printf( "\n =====  test cbp =====\n" );
629    
630    for(i=0; i<6*64; ++i) {    for(i=0; i<6*64; ++i) {
631      Src1[i] = (i*i*3/8192)&(i/64)&1;  // 'random'                  Src1[i] = (i*i*3/8192)&(i/64)&1;  /* 'random' */
632      Src2[i] = (i<3*64);               // half-full                  Src2[i] = (i<3*64);               /* half-full */
633      Src3[i] = ((i+32)>3*64);      Src3[i] = ((i+32)>3*64);
634      Src4[i] = (i==(3*64+2) || i==(5*64+9));      Src4[i] = (i==(3*64+2) || i==(5*64+9));
635    }    }
# Line 604  Line 659 
659  }  }
660    
661  /*********************************************************************  /*********************************************************************
662     * fdct/idct IEEE1180 compliance
663     *********************************************************************/
664    
665    typedef struct {
666            long Errors[64];
667            long Sqr_Errors[64];
668            long Max_Errors[64];
669            long Nb;
670    } STATS_8x8;
671    
672    void init_stats(STATS_8x8 *S)
673    {
674            int i;
675            for(i=0; i<64; ++i) {
676                    S->Errors[i]     = 0;
677                    S->Sqr_Errors[i] = 0;
678                    S->Max_Errors[i] = 0;
679            }
680            S->Nb = 0;
681    }
682    
683    void store_stats(STATS_8x8 *S, short Blk[64], short Ref[64])
684    {
685            int i;
686            for(i=0; i<64; ++i)
687            {
688                    short Err = Blk[i] - Ref[i];
689                    S->Errors[i] += Err;
690                    S->Sqr_Errors[i] += Err * Err;
691                    if (Err<0) Err = -Err;
692                    if (S->Max_Errors[i]<Err)
693                            S->Max_Errors[i] = Err;
694            }
695            S->Nb++;
696    }
697    
698    void print_stats(STATS_8x8 *S)
699    {
700            int i;
701            double Norm;
702    
703            assert(S->Nb>0);
704            Norm = 1. / (double)S->Nb;
705            printf("\n== Max absolute values of errors ==\n");
706            for(i=0; i<64; i++) {
707                    printf("  %4ld", S->Max_Errors[i]);
708                    if ((i&7)==7) printf("\n");
709            }
710    
711            printf("\n== Mean square errors ==\n");
712            for(i=0; i<64; i++)
713            {
714                    double Err = Norm * (double)S->Sqr_Errors[i];
715                    printf(" %.3f", Err);
716                    if ((i&7)==7) printf("\n");
717            }
718    
719            printf("\n== Mean errors ==\n");
720            for(i=0; i<64; i++)
721            {
722                    double Err = Norm * (double)S->Errors[i];
723                    printf(" %.3f", Err);
724                    if ((i&7)==7) printf("\n");
725            }
726            printf("\n");
727    }
728    
729    static const char *CHECK(double v, double l) {
730            if (fabs(v)<=l) return "ok";
731            else return "FAIL!";
732    }
733    
734    void report_stats(STATS_8x8 *S, const double *Limits)
735    {
736            int i;
737            double Norm, PE, PMSE, OMSE, PME, OME;
738    
739            assert(S->Nb>0);
740            Norm = 1. / (double)S->Nb;
741            PE = 0.;
742            for(i=0; i<64; i++) {
743                    if (PE<S->Max_Errors[i])
744                            PE = S->Max_Errors[i];
745            }
746    
747            PMSE = 0.;
748            OMSE = 0.;
749            for(i=0; i<64; i++)
750            {
751                    double Err = Norm * (double)S->Sqr_Errors[i];
752                    OMSE += Err;
753                    if (PMSE < Err) PMSE = Err;
754            }
755            OMSE /= 64.;
756    
757            PME = 0.;
758            OME = 0.;
759            for(i=0; i<64; i++)
760            {
761                    double Err = Norm * (double)S->Errors[i];
762                    OME += Err;
763                    Err = fabs(Err);
764                    if (PME < Err) PME = Err;
765            }
766            OME /= 64.;
767    
768            printf( "Peak error:   %4.4f\n", PE );
769            printf( "Peak MSE:     %4.4f\n", PMSE );
770            printf( "Overall MSE:  %4.4f\n", OMSE );
771            printf( "Peak ME:      %4.4f\n", PME );
772            printf( "Overall ME:   %4.4f\n", OME );
773    
774            if (Limits!=0)
775            {
776                    printf( "[PE<=%.4f %s]  ", Limits[0], CHECK(PE,   Limits[0]) );
777                    printf( "\n" );
778                    printf( "[PMSE<=%.4f %s]", Limits[1], CHECK(PMSE, Limits[1]) );
779                    printf( "[OMSE<=%.4f %s]", Limits[2], CHECK(OMSE, Limits[2]) );
780                    printf( "\n" );
781                    printf( "[PME<=%.4f %s] ", Limits[3], CHECK(PME , Limits[3]) );
782                    printf( "[OME<=%.4f %s] ", Limits[4], CHECK(OME , Limits[4]) );
783                    printf( "\n" );
784            }
785    }
786    
787    ///* ////////////////////////////////////////////////////// */
788    /* Pseudo-random generator specified by IEEE 1180 */
789    
790    static long ieee_seed = 1;
791    static void ieee_reseed(long s) {
792            ieee_seed = s;
793    }
794    static long ieee_rand(int Min, int Max)
795    {
796            static double z = (double) 0x7fffffff;
797    
798            long i,j;
799            double x;
800    
801            ieee_seed = (ieee_seed * 1103515245) + 12345;
802            i = ieee_seed & 0x7ffffffe;
803            x = ((double) i) / z;
804            x *= (Max-Min+1);
805            j = (long)x;
806            j = j + Min;
807            assert(j>=Min && j<=Max);
808            return (short)j;
809    }
810    
811    #define CLAMP(x, M)   (x) = ((x)<-(M)) ? (-(M)) : ((x)>=(M) ? ((M)-1) : (x))
812    
813    static double Cos[8][8];
814    static void init_ref_dct()
815    {
816            int i, j;
817            for(i=0; i<8; i++)
818            {
819                    double scale = (i == 0) ? sqrt(0.125) : 0.5;
820                    for (j=0; j<8; j++)
821                            Cos[i][j] = scale*cos( (M_PI/8.0)*i*(j + 0.5) );
822            }
823    }
824    
825    void ref_idct(short *M)
826    {
827            int i, j, k;
828            double Tmp[8][8];
829    
830            for(i=0; i<8; i++) {
831                    for(j=0; j<8; j++)
832                    {
833                            double Sum = 0.0;
834                            for (k=0; k<8; k++) Sum += Cos[k][j]*M[8*i+k];
835                            Tmp[i][j] = Sum;
836                    }
837            }
838            for(i=0; i<8; i++) {
839                    for(j=0; j<8; j++) {
840                            double Sum = 0.0;
841                            for (k=0; k<8; k++) Sum += Cos[k][i]*Tmp[k][j];
842                            M[8*i+j] = (short)floor(Sum + .5);
843                    }
844            }
845    }
846    
847    void ref_fdct(short *M)
848    {
849            int i, j, k;
850            double Tmp[8][8];
851    
852            for(i=0; i<8; i++) {
853                    for(j=0; j<8; j++)
854                    {
855                            double Sum = 0.0;
856                            for (k=0; k<8; k++) Sum += Cos[j][k]*M[8*i+k];
857                            Tmp[i][j] = Sum;
858                    }
859            }
860            for(i=0; i<8; i++) {
861                    for(j=0; j<8; j++) {
862                            double Sum = 0.0;
863                            for (k=0; k<8; k++) Sum += Cos[i][k]*Tmp[k][j];
864                            M[8*i+j] = (short)floor(Sum + 0.5);
865                    }
866            }
867    }
868    
869    void test_IEEE1180_compliance(int Min, int Max, int Sign)
870    {
871            static const double ILimits[5] = { 1., 0.06, 0.02, 0.015, 0.0015 };
872            int Loops = 10000;
873            int i, m, n;
874            short Blk0[64];     /* reference */
875            short Blk[64], iBlk[64];
876            short Ref_FDCT[64];
877            short Ref_IDCT[64];
878    
879            STATS_8x8 FStats; /* forward dct stats */
880            STATS_8x8 IStats; /* inverse dct stats */
881    
882            CPU *cpu;
883    
884            init_ref_dct();
885    
886            for(cpu = cpu_list; cpu->name!=0; ++cpu)
887            {
888                    if (!init_cpu(cpu))
889                            continue;
890    
891                    printf( "\n===== IEEE test for %s ==== (Min=%d Max=%d Sign=%d Loops=%d)\n",
892                                    cpu->name, Min, Max, Sign, Loops);
893    
894                    init_stats(&IStats);
895                    init_stats(&FStats);
896    
897                    ieee_reseed(1);
898                    for(n=0; n<Loops; ++n)
899                    {
900                            for(i=0; i<64; ++i)
901                                    Blk0[i] = (short)ieee_rand(Min,Max) * Sign;
902    
903                            /* hmm, I'm not quite sure this is exactly */
904                            /* the tests described in the norm. check... */
905    
906                            memcpy(Ref_FDCT, Blk0, 64*sizeof(short));
907                            ref_fdct(Ref_FDCT);
908                            for(i=0; i<64; i++) CLAMP( Ref_FDCT[i], 2048 );
909    
910                            memcpy(Blk, Blk0, 64*sizeof(short));
911                            emms(); fdct(Blk); emms();
912                            for(i=0; i<64; i++) CLAMP( Blk[i], 2048 );
913    
914                            store_stats(&FStats, Blk, Ref_FDCT);
915    
916    
917                            memcpy(Ref_IDCT, Ref_FDCT, 64*sizeof(short));
918                            ref_idct(Ref_IDCT);
919                            for (i=0; i<64; i++) CLAMP( Ref_IDCT[i], 256 );
920    
921                            memcpy(iBlk, Ref_FDCT, 64*sizeof(short));
922                            emms(); idct(iBlk); emms();
923                            for(i=0; i<64; i++) CLAMP( iBlk[i], 256 );
924    
925                            store_stats(&IStats, iBlk, Ref_IDCT);
926                    }
927    
928    
929                    printf( "\n  -- FDCT report --\n" );
930    //    print_stats(&FStats);
931                    report_stats(&FStats, 0); /* so far I know, IEEE1180 says nothing for fdct */
932    
933                    for(i=0; i<64; i++) Blk[i] = 0;
934                    emms(); fdct(Blk); emms();
935                    for(m=i=0; i<64; i++) if (Blk[i]!=0) m++;
936                    printf( "FDCT(0) == 0 ?  %s\n", (m!=0) ? "NOPE!" : "yup." );
937    
938                    printf( "\n  -- IDCT report --\n" );
939    //    print_stats(&IStats);
940                    report_stats(&IStats, ILimits);
941    
942    
943                    for(i=0; i<64; i++) Blk[i] = 0;
944                    emms(); idct(Blk); emms();
945                    for(m=i=0; i<64; i++) if (Blk[i]!=0) m++;
946                    printf( "IDCT(0) == 0 ?  %s\n", (m!=0) ? "NOPE!" : "yup." );
947            }
948    }
949    
950    
951    void test_dct_saturation(int Min, int Max)
952    {
953    /* test behaviour on input range fringe */
954    
955            int i, n, p;
956            CPU *cpu;
957    //  const short IDCT_MAX =  2047;  /* 12bits input */
958    //  const short IDCT_MIN = -2048;
959    //  const short IDCT_OUT =   256;  /* 9bits ouput */
960            const int Partitions = 4;
961            const int Loops = 10000 / Partitions;
962    
963            init_ref_dct();
964    
965            for(cpu = cpu_list; cpu->name!=0; ++cpu)
966            {
967                    short Blk0[64], Blk[64];
968                    STATS_8x8 Stats;
969    
970                    if (!init_cpu(cpu))
971                            continue;
972    
973                    printf( "\n===== IEEE test for %s Min=%d Max=%d =====\n",
974                                    cpu->name, Min, Max );
975    
976                    /* FDCT tests // */
977    
978                    init_stats(&Stats);
979    
980                    /* test each computation channels separately */
981                    for(i=0; i<64; i++) Blk[i] = Blk0[i] = ((i/8)==(i%8)) ? Max : 0;
982                    ref_fdct(Blk0);
983                    emms(); fdct(Blk); emms();
984                    store_stats(&Stats, Blk, Blk0);
985    
986                    for(i=0; i<64; i++) Blk[i] = Blk0[i] = ((i/8)==(i%8)) ? Min : 0;
987                    ref_fdct(Blk0);
988                    emms(); fdct(Blk); emms();
989                    store_stats(&Stats, Blk, Blk0);
990    
991                    /* randomly saturated inputs */
992                    for(p=0; p<Partitions; ++p)
993                    {
994                            for(n=0; n<Loops; ++n)
995                            {
996                                    for(i=0; i<64; ++i)
997                                            Blk0[i] = Blk[i] = (ieee_rand(0,Partitions)>=p)? Max : Min;
998                                    ref_fdct(Blk0);
999                                    emms(); fdct(Blk); emms();
1000                                    store_stats(&Stats, Blk, Blk0);
1001                            }
1002                    }
1003                    printf( "\n  -- FDCT saturation report --\n" );
1004                    report_stats(&Stats, 0);
1005    
1006    
1007                    /* IDCT tests // */
1008    #if 0
1009                    /* no finished yet */
1010    
1011                    init_stats(&Stats);
1012    
1013    /* test each computation channel separately */
1014                    for(i=0; i<64; i++) Blk[i] = Blk0[i] = ((i/8)==(i%8)) ? IDCT_MAX : 0;
1015                    ref_idct(Blk0);
1016                    emms(); idct(Blk); emms();
1017                    for(i=0; i<64; i++) { CLAMP(Blk0[i], IDCT_OUT); CLAMP(Blk[i], IDCT_OUT); }
1018                    store_stats(&Stats, Blk, Blk0);
1019    
1020                    for(i=0; i<64; i++) Blk[i] = Blk0[i] = ((i/8)==(i%8)) ? IDCT_MIN : 0;
1021                    ref_idct(Blk0);
1022                    emms(); idct(Blk); emms();
1023                    for(i=0; i<64; i++) { CLAMP(Blk0[i], IDCT_OUT); CLAMP(Blk[i], IDCT_OUT); }
1024                    store_stats(&Stats, Blk, Blk0);
1025    
1026                    /* randomly saturated inputs */
1027                    for(p=0; p<Partitions; ++p)
1028                    {
1029                            for(n=0; n<Loops; ++n)
1030                            {
1031                                    for(i=0; i<64; ++i)
1032                                            Blk0[i] = Blk[i] = (ieee_rand(0,Partitions)>=p)? IDCT_MAX : IDCT_MIN;
1033                                    ref_idct(Blk0);
1034                                    emms(); idct(Blk); emms();
1035                                    for(i=0; i<64; i++) { CLAMP(Blk0[i],IDCT_OUT); CLAMP(Blk[i],IDCT_OUT); }
1036                                    store_stats(&Stats, Blk, Blk0);
1037                            }
1038                    }
1039    
1040                    printf( "\n  -- IDCT saturation report --\n" );
1041                    print_stats(&Stats);
1042                    report_stats(&Stats, 0);
1043    #endif
1044            }
1045    }
1046    
1047    /*********************************************************************
1048   * measure raw decoding speed   * measure raw decoding speed
1049   *********************************************************************/   *********************************************************************/
1050    
# Line 612  Line 1053 
1053    FILE *f = 0;    FILE *f = 0;
1054    void *dechandle = 0;    void *dechandle = 0;
1055    int xerr;    int xerr;
1056          XVID_INIT_PARAM xinit;          xvid_gbl_init_t xinit;
1057          XVID_DEC_PARAM xparam;          xvid_dec_create_t xparam;
1058          XVID_DEC_FRAME xframe;          xvid_dec_frame_t xframe;
1059          double t = 0.;          double t = 0.;
1060          int nb = 0;          int nb = 0;
1061    uint8_t *buf = 0;    uint8_t *buf = 0;
# Line 622  Line 1063 
1063    int buf_size, pos;    int buf_size, pos;
1064    uint32_t chksum = 0;    uint32_t chksum = 0;
1065    
1066          xinit.cpu_flags = 0;          memset(&xinit, 0, sizeof(xinit));
1067          xvid_init(NULL, 0, &xinit, NULL);          xinit.cpu_flags = XVID_CPU_MMX | XVID_CPU_FORCE;
1068          printf( "API version: %d, core build:%d\n", xinit.api_version, xinit.core_build);          xinit.version = XVID_VERSION;
1069            xvid_global(NULL, 0, &xinit, NULL);
1070    
1071            memset(&xparam, 0, sizeof(xparam));
1072          xparam.width = width;          xparam.width = width;
1073          xparam.height = height;          xparam.height = height;
1074            xparam.version = XVID_VERSION;
1075          xerr = xvid_decore(NULL, XVID_DEC_CREATE, &xparam, NULL);          xerr = xvid_decore(NULL, XVID_DEC_CREATE, &xparam, NULL);
1076          if (xerr!=XVID_ERR_OK) {          if (xerr==XVID_ERR_FAIL) {
1077            printf("can't init decoder (err=%d)\n", xerr);            printf("can't init decoder (err=%d)\n", xerr);
1078            return;            return;
1079          }          }
# Line 651  Line 1094 
1094    }    }
1095    else printf( "Input size: %d\n", buf_size);    else printf( "Input size: %d\n", buf_size);
1096    
1097    buf = malloc(buf_size); // should be enuf'          buf = malloc(buf_size); /* should be enuf' */
1098    rgb_out = calloc(4, width*height);  // <-room for _RGB24          rgb_out = calloc(4, width*height);  /* <-room for _RGB24 */
1099    if (buf==0 || rgb_out==0) {    if (buf==0 || rgb_out==0) {
1100      printf( "malloc failed!\n" );      printf( "malloc failed!\n" );
1101      goto End;      goto End;
# Line 667  Line 1110 
1110    pos = 0;    pos = 0;
1111    t = -gettime_usec();    t = -gettime_usec();
1112    while(1) {    while(1) {
1113                    memset(&xframe, 0, sizeof(xframe));
1114                    xframe.version = XVID_VERSION;
1115      xframe.bitstream = buf + pos;      xframe.bitstream = buf + pos;
1116      xframe.length = buf_size - pos;      xframe.length = buf_size - pos;
1117      xframe.image = rgb_out;                  xframe.output.plane[0] = rgb_out;
1118      xframe.stride = width;                  xframe.output.stride[0] = width;
1119      xframe.colorspace = XVID_CSP_RGB24;                  xframe.output.csp = XVID_CSP_BGR;
1120      xerr = xvid_decore(dechandle, XVID_DEC_DECODE, &xframe, 0);      xerr = xvid_decore(dechandle, XVID_DEC_DECODE, &xframe, 0);
1121      nb++;      nb++;
1122      pos += xframe.length;      pos += xframe.length;
# Line 682  Line 1127 
1127      }      }
1128      if (pos==buf_size)      if (pos==buf_size)
1129        break;        break;
1130      if (xerr!=XVID_ERR_OK) {                  if (xerr==XVID_ERR_FAIL) {
1131            printf("decoding failed for frame #%d (err=%d)!\n", nb, xerr);            printf("decoding failed for frame #%d (err=%d)!\n", nb, xerr);
1132            break;            break;
1133          }          }
# Line 698  Line 1143 
1143    if (buf!=0) free(buf);    if (buf!=0) free(buf);
1144    if (dechandle!=0) {    if (dechandle!=0) {
1145      xerr= xvid_decore(dechandle, XVID_DEC_DESTROY, NULL, NULL);      xerr= xvid_decore(dechandle, XVID_DEC_DESTROY, NULL, NULL);
1146      if (xerr!=XVID_ERR_OK)                  if (xerr==XVID_ERR_FAIL)
1147              printf("destroy-decoder failed (err=%d)!\n", xerr);              printf("destroy-decoder failed (err=%d)!\n", xerr);
1148    }    }
1149    if (f!=0) fclose(f);    if (f!=0) fclose(f);
# Line 724  Line 1169 
1169    
1170      for(i=0; i<64; ++i) Src[i] = i-32;      for(i=0; i<64; ++i) Src[i] = i-32;
1171      set_intra_matrix( get_default_intra_matrix() );      set_intra_matrix( get_default_intra_matrix() );
1172      dequant4_intra(Dst, Src, 32, 5);                  dequant4_intra(Dst, Src, 31, 5);
1173      printf( "dequant4_intra with CPU=%s:  ", cpu->name);      printf( "dequant4_intra with CPU=%s:  ", cpu->name);
1174      printf( "  Out[]= " );      printf( "  Out[]= " );
1175      for(i=0; i<64; ++i) printf( "[%d]", Dst[i]);      for(i=0; i<64; ++i) printf( "[%d]", Dst[i]);
# Line 743  Line 1188 
1188    
1189      for(i=0; i<64; ++i) Src[i] = i-32;      for(i=0; i<64; ++i) Src[i] = i-32;
1190      set_inter_matrix( get_default_inter_matrix() );      set_inter_matrix( get_default_inter_matrix() );
1191      dequant4_inter(Dst, Src, 32);                  dequant4_inter(Dst, Src, 31);
1192      printf( "dequant4_inter with CPU=%s:  ", cpu->name);      printf( "dequant4_inter with CPU=%s:  ", cpu->name);
1193      printf( "  Out[]= " );      printf( "  Out[]= " );
1194      for(i=0; i<64; ++i) printf( "[%d]", Dst[i]);      for(i=0; i<64; ++i) printf( "[%d]", Dst[i]);
# Line 756  Line 1201 
1201    CPU *cpu;    CPU *cpu;
1202    short Blk[8*8], Blk0[8*8];    short Blk[8*8], Blk0[8*8];
1203    
1204    printf( "\n =====  fdct/idct saturation diffs =====\n" );          printf( "\n =====  fdct/idct precision diffs =====\n" );
1205    
1206    for(cpu = cpu_short_list; cpu->name!=0; ++cpu)    for(cpu = cpu_short_list; cpu->name!=0; ++cpu)
1207    {    {
# Line 782  Line 1227 
1227    }    }
1228  }  }
1229    
1230    void test_quant_bug()
1231    {
1232            const int max_Q = 31;
1233            int i, n, qm, q;
1234            CPU *cpu;
1235            int16_t  Src[8*8], Dst[8*8];
1236            uint8_t Quant[8*8];
1237            CPU cpu_bug_list[] = { { "PLAINC", 0 }, { "MMX   ", XVID_CPU_MMX }, {0,0} };
1238            uint16_t Crcs_Inter[2][32];
1239            uint16_t Crcs_Intra[2][32];
1240            printf( "\n =====  test MPEG4-quantize bug =====\n" );
1241    
1242            for(i=0; i<64; ++i) Src[i] = 2048*(i-32)/32;
1243    
1244    #if 1
1245            for(qm=1; qm<=255; ++qm)
1246            {
1247                    for(i=0; i<8*8; ++i) Quant[i] = qm;
1248                    set_inter_matrix( Quant );
1249    
1250                    for(n=0, cpu = cpu_bug_list; cpu->name!=0; ++cpu, ++n)
1251                    {
1252                            uint16_t s;
1253    
1254                            if (!init_cpu(cpu))
1255                                    continue;
1256    
1257                            for(q=1; q<=max_Q; ++q) {
1258                                    emms();
1259                                    quant4_inter( Dst, Src, q );
1260                                    emms();
1261                                    for(s=0, i=0; i<64; ++i) s+=((uint16_t)Dst[i])^i;
1262                                    Crcs_Inter[n][q] = s;
1263                            }
1264                    }
1265    
1266                    for(q=1; q<=max_Q; ++q)
1267                            for(i=0; i<n-1; ++i)
1268                                    if (Crcs_Inter[i][q]!=Crcs_Inter[i+1][q])
1269                                            printf( "Discrepancy Inter: qm=%d, q=%d  -> %d/%d !\n",
1270                                                            qm, q, Crcs_Inter[i][q], Crcs_Inter[i+1][q]);
1271            }
1272    #endif
1273    
1274    #if 1
1275            for(qm=1; qm<=255; ++qm)
1276            {
1277                    for(i=0; i<8*8; ++i) Quant[i] = qm;
1278                    set_intra_matrix( Quant );
1279    
1280                    for(n=0, cpu = cpu_bug_list; cpu->name!=0; ++cpu, ++n)
1281                    {
1282                            uint16_t s;
1283    
1284                            if (!init_cpu(cpu))
1285                                    continue;
1286    
1287                            for(q=1; q<=max_Q; ++q) {
1288                                    emms();
1289                                    quant4_intra( Dst, Src, q, q);
1290                                    emms();
1291                                    for(s=0, i=0; i<64; ++i) s+=((uint16_t)Dst[i])^i;
1292                                    Crcs_Intra[n][q] = s;
1293                            }
1294                    }
1295    
1296                    for(q=1; q<=max_Q; ++q)
1297                            for(i=0; i<n-1; ++i)
1298                                    if (Crcs_Intra[i][q]!=Crcs_Intra[i+1][q])
1299                                            printf( "Discrepancy Intra: qm=%d, q=%d  -> %d/%d!\n",
1300                                                            qm, q, Crcs_Inter[i][q], Crcs_Inter[i+1][q]);
1301            }
1302    #endif
1303    }
1304    
1305  /*********************************************************************  /*********************************************************************
1306   * main   * main
# Line 798  Line 1317 
1317    if (what==0 || what==5) test_quant();    if (what==0 || what==5) test_quant();
1318    if (what==0 || what==6) test_cbp();    if (what==0 || what==6) test_cbp();
1319    
1320    if (what==8) {          if (what==7) {
1321                    test_IEEE1180_compliance(-256, 255, 1);
1322    #if 0
1323                    test_IEEE1180_compliance(-256, 255,-1);
1324                    test_IEEE1180_compliance(  -5,   5, 1);
1325                    test_IEEE1180_compliance(  -5,   5,-1);
1326                    test_IEEE1180_compliance(-300, 300, 1);
1327                    test_IEEE1180_compliance(-300, 300,-1);
1328    #endif
1329            }
1330            if (what==8) test_dct_saturation(-256, 255);
1331    
1332            if (what==9) {
1333      int width, height;      int width, height;
1334      if (argc<5) {      if (argc<5) {
1335        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 1341 
1341    }    }
1342    
1343    if (what==-1) {    if (what==-1) {
     test_bugs1();  
1344      test_dct_precision_diffs();      test_dct_precision_diffs();
1345                    test_bugs1();
1346    }    }
1347            if (what==-2)
1348                    test_quant_bug();
1349    
1350    return 0;    return 0;
1351  }  }
1352    
1353  /*********************************************************************  /*********************************************************************
1354   * 'Reference' output (except for timing) on a PIII 1.13Ghz/linux   * 'Reference' output (except for timing) on a PIII 1.13Ghz/linux
1355   *********************************************************************/   *********************************************************************/
1356    
1357    /* as of 07/01/2002, there's a problem with mpeg4-quantization */
1358  /*  /*
1359    
1360   ===== test fdct/idct =====   ===== test fdct/idct =====
1361  PLAINC -  2.631 usec       iCrc=3  fCrc=-85  PLAINC -  3.312 usec       PSNR=13.291  MSE=3.000
1362  MMX    -  0.596 usec       iCrc=3  fCrc=-67  MMX    -  0.591 usec       PSNR=13.291  MSE=3.000
1363  MMXEXT -  0.608 usec       iCrc=3  fCrc=-67  MMXEXT -  0.577 usec       PSNR=13.291  MSE=3.000
1364  SSE2   -  0.605 usec       iCrc=3  fCrc=-67  SSE2   -  0.588 usec       PSNR=13.291  MSE=3.000
1365  3DNOW  - skipped...  3DNOW  - skipped...
1366  3DNOWE - skipped...  3DNOWE - skipped...
1367    
1368   ===  test block motion ===   ===  test block motion ===
1369  PLAINC - interp- h-round0 1.031 usec       iCrc=8107  PLAINC - interp- h-round0 0.911 usec       iCrc=8107
1370  PLAINC -           round1 1.022 usec       iCrc=8100  PLAINC -           round1 0.863 usec       iCrc=8100
1371  PLAINC - interp- v-round0 1.002 usec       iCrc=8108  PLAINC - interp- v-round0 0.860 usec       iCrc=8108
1372  PLAINC -           round1 1.011 usec       iCrc=8105  PLAINC -           round1 0.857 usec       iCrc=8105
1373  PLAINC - interp-hv-round0 1.623 usec       iCrc=8112  PLAINC - interp-hv-round0 2.103 usec       iCrc=8112
1374  PLAINC -           round1 1.621 usec       iCrc=8103  PLAINC -           round1 2.050 usec       iCrc=8103
 PLAINC - interpolate8x8_c 0.229 usec       iCrc=8107  
1375   ---   ---
1376  MMX    - interp- h-round0 0.105 usec       iCrc=8107  MMX    - interp- h-round0 0.105 usec       iCrc=8107
1377  MMX    -           round1 0.105 usec       iCrc=8100  MMX    -           round1 0.106 usec       iCrc=8100
1378  MMX    - interp- v-round0 0.106 usec       iCrc=8108  MMX    - interp- v-round0 0.106 usec       iCrc=8108
1379  MMX    -           round1 0.107 usec       iCrc=8105  MMX    -           round1 0.106 usec       iCrc=8105
1380  MMX    - interp-hv-round0 0.145 usec       iCrc=8112  MMX    - interp-hv-round0 0.145 usec       iCrc=8112
1381  MMX    -           round1 0.145 usec       iCrc=8103  MMX    -           round1 0.145 usec       iCrc=8103
 MMX    - interpolate8x8_c 0.229 usec       iCrc=8107  
1382   ---   ---
1383  MMXEXT - interp- h-round0 0.027 usec       iCrc=8107  MMXEXT - interp- h-round0 0.028 usec       iCrc=8107
1384  MMXEXT -           round1 0.041 usec       iCrc=8100  MMXEXT -           round1 0.041 usec       iCrc=8100
1385  MMXEXT - interp- v-round0 0.027 usec       iCrc=8108  MMXEXT - interp- v-round0 0.027 usec       iCrc=8108
1386  MMXEXT -           round1 0.040 usec       iCrc=8105  MMXEXT -           round1 0.041 usec       iCrc=8105
1387  MMXEXT - interp-hv-round0 0.070 usec       iCrc=8112  MMXEXT - interp-hv-round0 0.066 usec       iCrc=8112
1388  MMXEXT -           round1 0.066 usec       iCrc=8103  MMXEXT -           round1 0.065 usec       iCrc=8103
 MMXEXT - interpolate8x8_c 0.027 usec       iCrc=8107  
1389   ---   ---
1390  SSE2   - interp- h-round0 0.106 usec       iCrc=8107  SSE2   - interp- h-round0 0.109 usec       iCrc=8107
1391  SSE2   -           round1 0.105 usec       iCrc=8100  SSE2   -           round1 0.105 usec       iCrc=8100
1392  SSE2   - interp- v-round0 0.106 usec       iCrc=8108  SSE2   - interp- v-round0 0.106 usec       iCrc=8108
1393  SSE2   -           round1 0.106 usec       iCrc=8105  SSE2   -           round1 0.109 usec       iCrc=8105
1394  SSE2   - interp-hv-round0 0.145 usec       iCrc=8112  SSE2   - interp-hv-round0 0.145 usec       iCrc=8112
1395  SSE2   -           round1 0.145 usec       iCrc=8103  SSE2   -           round1 0.145 usec       iCrc=8103
 SSE2   - interpolate8x8_c 0.237 usec       iCrc=8107  
1396   ---   ---
1397  3DNOW  - skipped...  3DNOW  - skipped...
1398  3DNOWE - skipped...  3DNOWE - skipped...
1399    
1400   ======  test SAD ======   ======  test SAD ======
1401  PLAINC - sad8    0.296 usec       sad=3776  PLAINC - sad8    0.251 usec       sad=3776
1402  PLAINC - sad16   1.599 usec       sad=27214  PLAINC - sad16   1.601 usec       sad=27214
1403  PLAINC - sad16bi 2.350 usec       sad=26274  PLAINC - sad16bi 2.371 usec       sad=26274
1404  PLAINC - dev16   1.610 usec       sad=3344  PLAINC - dev16   1.564 usec       sad=3344
1405   ---   ---
1406  MMX    - sad8    0.057 usec       sad=3776  MMX    - sad8    0.057 usec       sad=3776
1407  MMX    - sad16   0.178 usec       sad=27214  MMX    - sad16   0.182 usec       sad=27214
1408  MMX    - sad16bi 2.381 usec       sad=26274  MMX    - sad16bi 2.462 usec       sad=26274
1409  MMX    - dev16   0.312 usec       sad=3344  MMX    - dev16   0.311 usec       sad=3344
1410   ---   ---
1411  MMXEXT - sad8    0.036 usec       sad=3776  MMXEXT - sad8    0.036 usec       sad=3776
1412  MMXEXT - sad16   0.106 usec       sad=27214  MMXEXT - sad16   0.109 usec       sad=27214
1413  MMXEXT - sad16bi 0.182 usec       sad=26274  MMXEXT - sad16bi 0.143 usec       sad=26274
1414  MMXEXT - dev16   0.193 usec       sad=3344  MMXEXT - dev16   0.192 usec       sad=3344
1415   ---   ---
1416  SSE2   - sad8    0.057 usec       sad=3776  SSE2   - sad8    0.057 usec       sad=3776
1417  SSE2   - sad16   0.178 usec       sad=27214  SSE2   - sad16   0.179 usec       sad=27214
1418  SSE2   - sad16bi 2.427 usec       sad=26274  SSE2   - sad16bi 2.456 usec       sad=26274
1419  SSE2   - dev16   0.313 usec       sad=3344  SSE2   - dev16   0.321 usec       sad=3344
1420   ---   ---
1421  3DNOW  - skipped...  3DNOW  - skipped...
1422  3DNOWE - skipped...  3DNOWE - skipped...
1423    
1424   ===  test transfer ===   ===  test transfer ===
1425  PLAINC - 8to16     0.124 usec       crc=28288  PLAINC - 8to16     0.151 usec       crc=28288
1426  PLAINC - 16to8     0.753 usec       crc=28288  PLAINC - 16to8     1.113 usec       crc=28288
1427  PLAINC - 8to8      0.041 usec       crc=20352  PLAINC - 8to8      0.043 usec       crc=20352
1428  PLAINC - 16to8add  0.916 usec       crc=25536  PLAINC - 16to8add  1.069 usec       crc=25536
1429  PLAINC - 8to16sub  0.812 usec       crc1=28064 crc2=16256  PLAINC - 8to16sub  0.631 usec       crc1=28064 crc2=16256
1430  PLAINC - 8to16sub2 0.954 usec       crc=20384  PLAINC - 8to16sub2 0.597 usec       crc=20384
1431   ---  ---
1432  MMX    - 8to16     0.037 usec       crc=28288  MMX    - 8to16     0.032 usec       crc=28288
1433  MMX    - 16to8     0.016 usec       crc=28288  MMX    - 16to8     0.024 usec       crc=28288
1434  MMX    - 8to8      0.018 usec       crc=20352  MMX    - 8to8      0.020 usec       crc=20352
1435  MMX    - 16to8add  0.044 usec       crc=25536  MMX    - 16to8add  0.043 usec       crc=25536
1436  MMX    - 8to16sub  0.065 usec       crc1=28064 crc2=16256  MMX    - 8to16sub  0.066 usec       crc1=28064 crc2=16256
1437  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  
1438   ---   ---
1439    
1440   =====  test quant =====   =====  test quant =====
1441  PLAINC -   quant4_intra 78.889 usec       crc=55827  PLAINC -   quant4_intra 74.248 usec       crc=29809
1442  PLAINC -   quant4_inter 71.957 usec       crc=58201  PLAINC -   quant4_inter 70.850 usec       crc=12574
1443  PLAINC - dequant4_intra 34.968 usec       crc=193340  PLAINC - dequant4_intra 40.628 usec       crc=24052
1444  PLAINC - dequant4_inter 40.792 usec       crc=116483  PLAINC - dequant4_inter 45.691 usec       crc=63847
1445  PLAINC -    quant_intra 30.845 usec       crc=56885  PLAINC -    quant_intra 43.357 usec       crc=25662
1446  PLAINC -    quant_inter 34.842 usec       crc=58056  PLAINC -    quant_inter 33.410 usec       crc=23972
1447  PLAINC -  dequant_intra 33.211 usec       crc=-7936  PLAINC -  dequant_intra 36.384 usec       crc=49900
1448  PLAINC -  dequant_inter 45.486 usec       crc=-33217  PLAINC -  dequant_inter 48.930 usec       crc=48899
1449   ---  ---
1450  MMX    -   quant4_intra 9.030 usec       crc=55827  MMX    -   quant4_intra 7.445 usec       crc=3459
1451  MMX    -   quant4_inter 8.234 usec       crc=58201  *** CRC ERROR! ***
1452  MMX    - dequant4_intra 18.330 usec       crc=193340  MMX    -   quant4_inter 5.384 usec       crc=51072
1453  MMX    - dequant4_inter 19.181 usec       crc=116483  *** CRC ERROR! ***
1454  MMX    -    quant_intra 7.124 usec       crc=56885  MMX    - dequant4_intra 5.515 usec       crc=24052
1455  MMX    -    quant_inter 6.861 usec       crc=58056  MMX    - dequant4_inter 7.745 usec       crc=63847
1456  MMX    -  dequant_intra 9.048 usec       crc=-7936  MMX    -    quant_intra 4.661 usec       crc=25662
1457  MMX    -  dequant_inter 8.203 usec       crc=-33217  MMX    -    quant_inter 4.406 usec       crc=23972
1458   ---  MMX    -  dequant_intra 4.928 usec       crc=49900
1459  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  
1460   ---   ---
1461    
1462   =====  test cbp =====   =====  test cbp =====
1463  PLAINC -   calc_cbp#1 0.545 usec       cbp=0x15  PLAINC -   calc_cbp#1 0.371 usec       cbp=0x15
1464  PLAINC -   calc_cbp#2 0.540 usec       cbp=0x38  PLAINC -   calc_cbp#2 0.432 usec       cbp=0x38
1465  PLAINC -   calc_cbp#3 0.477 usec       cbp=0xf  PLAINC -   calc_cbp#3 0.339 usec       cbp=0xf
1466  PLAINC -   calc_cbp#4 0.739 usec       cbp=0x5  PLAINC -   calc_cbp#4 0.506 usec       cbp=0x5
1467   ---   ---
1468  MMX    -   calc_cbp#1 0.136 usec       cbp=0x15  MMX    -   calc_cbp#1 0.136 usec       cbp=0x15
1469  MMX    -   calc_cbp#2 0.131 usec       cbp=0x38  MMX    -   calc_cbp#2 0.134 usec       cbp=0x38
1470  MMX    -   calc_cbp#3 0.132 usec       cbp=0xf  MMX    -   calc_cbp#3 0.138 usec       cbp=0xf
1471  MMX    -   calc_cbp#4 0.135 usec       cbp=0x5  MMX    -   calc_cbp#4 0.135 usec       cbp=0x5
1472   ---   ---
1473  SSE2   -   calc_cbp#1 0.135 usec       cbp=0x15  SSE2   -   calc_cbp#1 0.136 usec       cbp=0x15
1474  SSE2   -   calc_cbp#2 0.131 usec       cbp=0x38  SSE2   -   calc_cbp#2 0.133 usec       cbp=0x38
1475  SSE2   -   calc_cbp#3 0.134 usec       cbp=0xf  SSE2   -   calc_cbp#3 0.133 usec       cbp=0xf
1476  SSE2   -   calc_cbp#4 0.136 usec       cbp=0x5  SSE2   -   calc_cbp#4 0.141 usec       cbp=0x5
1477   ---   ---
1478    
1479  */  */

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

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