[Mplayer-cvslog] CVS: main mplayer.c,1.406,1.407 mencoder.c,1.91,1.92 dec_video.c,1.107,1.108
Nick Kurshev
nick at mplayer.dev.hu
Sun Feb 24 12:23:56 CET 2002
Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv23234/main
Modified Files:
mplayer.c mencoder.c dec_video.c
Log Message:
max & average benchmarks
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.406
retrieving revision 1.407
diff -u -r1.406 -r1.407
--- mplayer.c 24 Feb 2002 04:56:54 -0000 1.406
+++ mplayer.c 24 Feb 2002 11:23:48 -0000 1.407
@@ -176,7 +176,10 @@
// benchmark:
double video_time_usage=0;
double vout_time_usage=0;
+double max_video_time_usage=0;
+double max_vout_time_usage=0;
static double audio_time_usage=0;
+static double max_audio_time_usage=0;
static int total_time_usage_start=0;
static int benchmark=0;
@@ -249,6 +252,7 @@
static int force_srate=0;
static int frame_dropping=0; // option 0=no drop 1= drop vo 2= drop decode
static int play_n_frames=-1;
+static int our_n_frames;
// screen info:
char* video_driver=NULL; //"mga"; // default
@@ -1560,7 +1564,8 @@
total_time_usage_start=GetTimer();
audio_time_usage=0; video_time_usage=0; vout_time_usage=0;
-
+max_audio_time_usage=0; max_video_time_usage=0; max_vout_time_usage=0;
+our_n_frames=play_n_frames;
while(!eof){
// unsigned int aq_total_time=GetTimer();
float aq_sleep_time=0;
@@ -1573,6 +1578,7 @@
/*========================== PLAY AUDIO ============================*/
while(sh_audio){
unsigned int t;
+ double tt;
int playsize;
ao_data.pts=sh_audio->timer*90000.0;
@@ -1602,7 +1608,10 @@
}
}
current_module=NULL; // Leave AUDIO decoder module
- t=GetTimer()-t;audio_time_usage+=t*0.000001;
+ t=GetTimer()-t;
+ tt = t*0.000001f;
+ audio_time_usage+=tt;
+ if(tt > max_audio_time_usage) max_audio_time_usage = tt;
if(playsize>sh_audio->a_buffer_len) playsize=sh_audio->a_buffer_len;
@@ -2840,18 +2849,33 @@
if(benchmark){
double tot=video_time_usage+vout_time_usage+audio_time_usage;
double total_time_usage;
+ max_video_time_usage *= our_n_frames;
+ max_vout_time_usage *= our_n_frames;
+ max_audio_time_usage *= our_n_frames;
total_time_usage_start=GetTimer()-total_time_usage_start;
total_time_usage = (float)total_time_usage_start*0.000001;
- mp_msg(MSGT_CPLAYER,MSGL_INFO,"\nBENCHMARKs: V:%8.3fs VO:%8.3fs A:%8.3fs Sys:%8.3fs = %8.3fs\n",
+ mp_msg(MSGT_CPLAYER,MSGL_INFO,"\nAVE BENCHMARKs: V:%8.3fs VO:%8.3fs A:%8.3fs Sys:%8.3fs = %8.3fs\n",
video_time_usage,vout_time_usage,audio_time_usage,
total_time_usage-tot,total_time_usage);
if(total_time_usage>0.0)
- mp_msg(MSGT_CPLAYER,MSGL_INFO,"BENCHMARK%%: V:%8.4f%% VO:%8.4f%% A:%8.4f%% Sys:%8.4f%% = %8.4f%%\n",
+ mp_msg(MSGT_CPLAYER,MSGL_INFO,"AVE BENCHMARK%%: V:%8.4f%% VO:%8.4f%% A:%8.4f%% Sys:%8.4f%% = %8.4f%%\n",
100.0*video_time_usage/total_time_usage,
100.0*vout_time_usage/total_time_usage,
100.0*audio_time_usage/total_time_usage,
100.0*(total_time_usage-tot)/total_time_usage,
100.0);
+ mp_msg(MSGT_CPLAYER,MSGL_INFO,"\nMAX BENCHMARKs: V:%8.3fs VO:%8.3fs A:%8.3fs\n",
+ max_video_time_usage,max_vout_time_usage,
+ max_audio_time_usage);
+ if(total_time_usage>0.0)
+ mp_msg(MSGT_CPLAYER,MSGL_INFO,"MAX BENCHMARK%%: V:%8.4f%% VO:%8.4f%% A:%8.4f%% = %8.4f%%\n",
+ 100.0*max_video_time_usage/total_time_usage,
+ 100.0*max_vout_time_usage/total_time_usage,
+ 100.0*max_audio_time_usage/total_time_usage,
+ 100.0*max_video_time_usage/total_time_usage+
+ 100.0*max_vout_time_usage/total_time_usage+
+ 100.0*max_audio_time_usage/total_time_usage
+ );
}
if(eof == PT_NEXT_ENTRY || eof == PT_PREV_ENTRY) {
Index: mencoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/mencoder.c,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -r1.91 -r1.92
--- mencoder.c 20 Feb 2002 17:02:31 -0000 1.91
+++ mencoder.c 24 Feb 2002 11:23:48 -0000 1.92
@@ -150,6 +150,8 @@
double video_time_usage=0;
double vout_time_usage=0;
+double max_video_time_usage=0;
+double max_vout_time_usage=0;
static double audio_time_usage=0;
static int total_time_usage_start=0;
static int benchmark=0;
Index: dec_video.c
===================================================================
RCS file: /cvsroot/mplayer/main/dec_video.c,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -r1.107 -r1.108
--- dec_video.c 17 Feb 2002 20:51:50 -0000 1.107
+++ dec_video.c 24 Feb 2002 11:23:48 -0000 1.108
@@ -40,6 +40,8 @@
extern double video_time_usage;
extern double vout_time_usage;
+extern double max_video_time_usage;
+extern double max_vout_time_usage;
extern vo_vaa_t vo_vaa;
extern int frameratecode2framerate[16];
@@ -819,6 +821,7 @@
unsigned int t=GetTimer();
unsigned int t2;
+double tt;
painted = 0;
#ifdef USE_MP_IMAGE
@@ -1211,7 +1214,10 @@
}
#endif
-t2=GetTimer();t=t2-t;video_time_usage+=t*0.000001f;
+t2=GetTimer();t=t2-t;
+tt = t*0.000001f;
+video_time_usage+=tt;
+if(tt > max_video_time_usage) max_video_time_usage=tt;
if(painted) return 1;
switch(blit_frame){
case 3:
@@ -1268,7 +1274,10 @@
else
video_out->draw_frame(mpi->planes);
#endif
- t2=GetTimer()-t2;vout_time_usage+=t2*0.000001f;
+ t2=GetTimer()-t2;
+ tt=t2*0.000001f;
+ vout_time_usage+=tt;
+ if(tt > max_vout_time_usage) max_vout_time_usage = tt;
blit_frame=1;
break;
}
More information about the MPlayer-cvslog
mailing list