[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 1650, Sat Oct 22 22:32:44 2005 UTC revision 1651, Wed Oct 26 12:38:34 2005 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.25 2005-09-23 12:53:35 suxen_drol Exp $   * $Id: xvid_bench.c,v 1.26 2005-10-26 12:38:33 Skal Exp $
23   *   *
24   ****************************************************************************/   ****************************************************************************/
25    
# Line 518  Line 518 
518                             (iCrc!=8107)?"| ERROR": "" );                             (iCrc!=8107)?"| ERROR": "" );
519  #endif  #endif
520    
521        /* New functions for field prediction by CK 1.10.2005 */
522    #pragma NEW8X4
523                    TEST_MB(interpolate8x4_halfpel_h, 0);
524                    printf("%s - interpfield-h -round0 %.3f usec       crc32=0x%08x %s\n",
525                               cpu->name, t, iCrc,
526                               (iCrc!=0x9538d6df)?"| ERROR": "" );
527    
528                    TEST_MB(interpolate8x4_halfpel_h, 1);
529                    printf("%s -                round1 %.3f usec       crc32=0x%08x %s\n",
530                               cpu->name, t, iCrc,
531                               (iCrc!=0xde5f1db4)?"| ERROR": "" );
532    
533    
534                    TEST_MB(interpolate8x4_halfpel_v, 0);
535                    printf("%s - interpfield- v-round0 %.3f usec       crc32=0x%08x %s\n",
536                               cpu->name, t, iCrc,
537                               (iCrc!=0xea5a69ef)?"| ERROR": "" );
538    
539                    TEST_MB(interpolate8x4_halfpel_v, 1);
540                    printf("%s -                round1 %.3f usec       crc32=0x%08x %s\n",
541                               cpu->name, t, iCrc,
542                               (iCrc!=0x4f10ec0f)?"| ERROR": "" );
543    
544    
545                    TEST_MB(interpolate8x4_halfpel_hv, 0);
546                    printf("%s - interpfield-hv-round0 %.3f usec       crc32=0x%08x %s\n",
547                               cpu->name, t, iCrc,
548                               (iCrc!=0xf97ee367)?"| ERROR": "" );
549    
550                    TEST_MB(interpolate8x4_halfpel_hv, 1);
551                    printf("%s -                round1 %.3f usec       crc32=0x%08x %s\n",
552                               cpu->name, t, iCrc,
553                               (iCrc!=0xb6a9f581)?"| ERROR": "" );
554    /* End of 8x4 functions */
555    
556                  printf( " --- \n" );                  printf( " --- \n" );
557          }          }
558  }  }
# Line 625  Line 660 
660                                  cpu->name, t, s,                                  cpu->name, t, s,
661                                  (s!=0xee7ccbb4)?"| ERROR": "");                                  (s!=0xee7ccbb4)?"| ERROR": "");
662    
663        /* New functions for field prediction by CK 1.10.2005 */
664    #pragma NEW8X4
665                    TEST_TRANSFER(transfer8x4_copy, Dst8, Src8);
666                    printf("%s - 8to4      %.3f usec       crc32=0x%08x %s\n",
667                               cpu->name, t, s,
668                               (s!=0xbb9c3db5)?"| ERROR": "");
669    /* End of new functions */
670    
671                  TEST_TRANSFER(transfer8x8_copy, Dst8, Src8);                  TEST_TRANSFER(transfer8x8_copy, Dst8, Src8);
672                  printf("%s - 8to8      %.3f usec       crc32=0x%08x %s\n",                  printf("%s - 8to8      %.3f usec       crc32=0x%08x %s\n",
673                             cpu->name, t, s,                             cpu->name, t, s,
# Line 1779  Line 1822 
1822  }  }
1823    
1824  /*********************************************************************  /*********************************************************************
1825     * test compiler
1826     *********************************************************************/
1827    
1828    void test_compiler() {
1829      int nb_err = 0;
1830      int32_t v;
1831      if (sizeof(uint16_t)<2) {
1832        printf( "ERROR: sizeof(uint16_t)<2!\n" );
1833        nb_err++;
1834      }
1835      if (sizeof(int16_t)<2) {
1836        printf( "ERROR: sizeof(int16_t)<2!\n" );
1837        nb_err++;
1838      }
1839      if (sizeof(uint8_t)!=1) {
1840        printf( "ERROR: sizeof(uint8_t)!=1!\n" );
1841        nb_err++;
1842      }
1843      if (sizeof(int8_t)!=1) {
1844        printf( "ERROR: sizeof(uint8_t)!=1!\n" );
1845        nb_err++;
1846      }
1847      if (sizeof(uint32_t)<4) {
1848        printf( "ERROR: sizeof(uint8_t)<4!\n" );
1849        nb_err++;
1850      }
1851      if (sizeof(int32_t)<4) {
1852        printf( "ERROR: sizeof(uint32_t)<4!\n" );
1853        nb_err++;
1854      }
1855             /* yes, i know, this test is silly. But better be safe than sorry. :) */
1856      for(v=1000; v>=0; v--) {
1857        if ( (v>>2) != v/4)
1858          nb_err++;
1859      }
1860      for(v=-1000; v!=-1; v++) {
1861        if ( (v>>2) != (v/4)-!!(v%4))
1862          nb_err++;
1863      }
1864      if (nb_err!=0) {
1865        printf( "ERROR! please post your platform/compiler specs to xvid-devel@xvid.org !\n" );
1866      }
1867    }
1868    
1869    /*********************************************************************
1870   * main   * main
1871   *********************************************************************/   *********************************************************************/
1872    
# Line 1846  Line 1934 
1934          if (what==0 || what==10) test_sse();          if (what==0 || what==10) test_sse();
1935          if (what==0 || what==11) test_log2bin();          if (what==0 || what==11) test_log2bin();
1936          if (what==0 || what==12) test_gcd();          if (what==0 || what==12) test_gcd();
1937            if (what==0 || what==13) test_compiler();
1938    
1939    
1940          if (what==7) {          if (what==7) {

Legend:
Removed from v.1650  
changed lines
  Added in v.1651

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