# HG changeset patch # User alex # Date 1057354697 0 # Node ID 17554a75a65442bc3dd5c845c48f0896b431afe7 # Parent d054f589ee0323968503719da9ff20e8283b5caa getcpucaps support diff -r d054f589ee03 -r 17554a75a654 mp3lib/test.c --- a/mp3lib/test.c Fri Jul 04 21:35:43 2003 +0000 +++ b/mp3lib/test.c Fri Jul 04 21:38:17 2003 +0000 @@ -12,6 +12,9 @@ #include "mp3lib/mp3.h" #include "config.h" +#include "../cpudetect.h" +extern CpuCaps gCpuCaps; + static inline unsigned int GetTimer(){ struct timeval tv; struct timezone tz; @@ -42,6 +45,8 @@ mp3file=fopen((argc>1)?argv[1]:"test.mp3","rb"); if(!mp3file){ printf("file not found\n"); exit(1); } + + GetCpuCaps(&gCpuCaps); // MPEG Audio: #ifdef USE_FAKE_MONO @@ -64,7 +69,7 @@ length=(float)total/(float)(MP3_samplerate*MP3_channels*2); printf("\nDecoding time: %8.6f\n",(float)time1*0.000001f); printf("Uncompressed size: %d bytes (%8.3f secs)\n",total,length); - printf("CPU usage at normal playback: %5.2f %\n",time1*0.0001f/length); + printf("CPU usage at normal playback: %5.2f %%\n",time1*0.0001f/length); fclose(mp3file);