[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 1801, Wed Nov 26 09:31:06 2008 UTC revision 2021, Wed Jul 6 10:25:14 2011 UTC
# Line 19  Line 19 
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
21   *   *
22   * $Id: xvid_bench.c,v 1.37 2008-11-26 09:31:06 Isibaar Exp $   * $Id$
23   *   *
24   ****************************************************************************/   ****************************************************************************/
25    
# Line 47  Line 47 
47  #include "xvid.h"  #include "xvid.h"
48    
49  // inner guts  // inner guts
50    #include "portab.h"
51  #include "dct/idct.h"  #include "dct/idct.h"
52  #include "dct/fdct.h"  #include "dct/fdct.h"
53  #include "image/colorspace.h"  #include "image/colorspace.h"
# Line 413  Line 414 
414    
415                  t = gettime_usec();                  t = gettime_usec();
416                  emms();                  emms();
417                    for(tst=0; tst<nb_tests; ++tst) s = sad8bi(Cur, Ref1, Ref2, 8);
418                    emms();
419                    t = (gettime_usec() - t) / nb_tests;
420                    printf( "%s - sad8bi %.3f usec       sad=%d %s\n",
421                                    cpu->name, t, s,
422                                    (s!=4002)?"| ERROR": "" );
423    
424                    t = gettime_usec();
425                    emms();
426                  for(tst=0; tst<nb_tests; ++tst) s = dev16(Cur, 16);                  for(tst=0; tst<nb_tests; ++tst) s = dev16(Cur, 16);
427                  emms();                  emms();
428                  t = (gettime_usec() - t) / nb_tests;                  t = (gettime_usec() - t) / nb_tests;
# Line 1793  Line 1803 
1803                  TEST_YUYV(yv12_to_uyvy_altivec_c, 4, with_flip);                  TEST_YUYV(yv12_to_uyvy_altivec_c, 4, with_flip);
1804                  printf(" yv12_to_uyvy_altivec_c %.3f usec       crc32=0x%08x %s\n",                  printf(" yv12_to_uyvy_altivec_c %.3f usec       crc32=0x%08x %s\n",
1805                          t, iCrc, (iCrc!=yuv_CRCs[4][with_flip])?"| ERROR": "" );                          t, iCrc, (iCrc!=yuv_CRCs[4][with_flip])?"| ERROR": "" );
   
                 TEST_YUYV(yv12_to_bgra_altivec_c, 4, with_flip);  
                 printf(" yv12_to_bgra_altivec_c %.3f usec       crc32=0x%08x %s\n",  
                         t, iCrc, (iCrc!=yuv_CRCs[5][with_flip])?"| ERROR": "" );  
1806  #endif  #endif
1807          }          }
1808          printf( " --- \n" );          printf( " --- \n" );
# Line 2196  Line 2202 
2202          int width, height;          int width, height;
2203          uint32_t chksum = 0;          uint32_t chksum = 0;
2204          const char * test_bitstream = 0;          const char * test_bitstream = 0;
2205    #if defined(WIN32) && defined(ARCH_IS_X86_64)
2206            DECLARE_ALIGNED_MATRIX(xmm_save, 2, 4, uint64_t, 16);
2207            // assumes xmm6 and xmm7 won't be falsely preserved by C code
2208            for(c=0;c<4;c++)
2209                    xmm_save[c] = read_counter();
2210            prime_xmm(xmm_save);
2211    #endif
2212    
2213          cpu_mask = 0;  // default => will use autodectect          cpu_mask = 0;  // default => will use autodectect
2214          for(c=1; c<argc; ++c)          for(c=1; c<argc; ++c)
# Line 2275  Line 2288 
2288          if (what==-2)          if (what==-2)
2289                  test_quant_bug();                  test_quant_bug();
2290    
2291    #if defined(WIN32) && defined(ARCH_IS_X86_64)
2292            get_xmm(xmm_save+4);
2293            if (memcmp(xmm_save, xmm_save+4, 4*sizeof(int64_t))) {
2294                    printf("\nWIN64 ERROR: XMM6 and XMM7 contents not preserved!\n"
2295                           "        XMM6                             XMM7\n"
2296                           "Before: %.16I64X%.16I64X %.16I64X%.16I64X\n"
2297                           "After:  %.16I64X%.16I64X %.16I64X%.16I64X",
2298                            xmm_save[0],xmm_save[1],xmm_save[2],xmm_save[3],
2299                            xmm_save[4],xmm_save[5],xmm_save[6],xmm_save[7]);
2300            } else {
2301                    printf("\nWIN64: XMM6 and XMM7 contents preserved correctly.\n");
2302            }
2303    #endif
2304    
2305          if ((what >= 0 && what <= 6) || what == 10) {          if ((what >= 0 && what <= 6) || what == 10) {
2306                  printf("\n\n"                  printf("\n\n"
2307                             "NB: If a function isn't optimised for a specific set of intructions,\n"                             "NB: If a function isn't optimised for a specific set of intructions,\n"

Legend:
Removed from v.1801  
changed lines
  Added in v.2021

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