[Mplayer-cvslog] CVS: main mencoder.c,1.33,1.34 cfg-mencoder.h,1.8,1.9
Arpi of Ize
arpi at mplayer.dev.hu
Fri Dec 7 00:59:55 CET 2001
Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv31011
Modified Files:
mencoder.c cfg-mencoder.h
Log Message:
new video codec: frameno (just the number of frame - for 3-pass encoding)
Index: mencoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/mencoder.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- mencoder.c 6 Dec 2001 22:27:09 -0000 1.33
+++ mencoder.c 6 Dec 2001 23:59:46 -0000 1.34
@@ -1,5 +1,7 @@
-#define VCODEC_DIVX4 1
+#define VCODEC_FRAMENO 1
+#define VCODEC_DIVX4 2
+
#define ACODEC_PCM 1
#define ACODEC_VBRMP3 2
@@ -288,6 +290,8 @@
char* filename=NULL;
int num_filenames;
+int decoded_frameno=0;
+
//int out_buffer_size=0x200000;
//unsigned char* out_buffer=malloc(out_buffer_size);
@@ -366,7 +370,7 @@
sh_video->codec=NULL;
-if(out_video_codec){
+if(out_video_codec>1){
if(video_family!=-1) mp_msg(MSGT_MENCODER,MSGL_INFO,MSGTR_TryForceVideoFmt,video_family);
while(1){
@@ -501,6 +505,16 @@
case 0:
mux_v->bih=sh_video->bih;
break;
+case VCODEC_FRAMENO:
+ mux_v->bih=malloc(sizeof(BITMAPINFOHEADER));
+ mux_v->bih->biSize=sizeof(BITMAPINFOHEADER);
+ mux_v->bih->biWidth=vo_w;
+ mux_v->bih->biHeight=vo_h;
+ mux_v->bih->biPlanes=1;
+ mux_v->bih->biBitCount=24;
+ mux_v->bih->biCompression=mmioFOURCC('F','r','N','o');
+ mux_v->bih->biSizeImage=mux_v->bih->biWidth*mux_v->bih->biHeight*(mux_v->bih->biBitCount/8);
+ break;
case VCODEC_DIVX4:
mux_v->bih=malloc(sizeof(BITMAPINFOHEADER));
mux_v->bih->biSize=sizeof(BITMAPINFOHEADER);
@@ -575,6 +589,9 @@
switch(mux_v->codec){
case 0:
break;
+case VCODEC_FRAMENO:
+ decoded_frameno=0;
+ break;
case VCODEC_DIVX4:
// init divx4linux:
divx4_param.x_dim=vo_w;
@@ -730,7 +747,7 @@
// get video frame!
in_size=video_read_frame(sh_video,&frame_time,&start,force_fps);
if(in_size<0){ eof=1; break; }
- sh_video->timer+=frame_time;
+ sh_video->timer+=frame_time; ++decoded_frameno;
v_timer_corr-=frame_time-(float)mux_v->h.dwScale/mux_v->h.dwRate;
@@ -763,6 +780,10 @@
mux_v->buffer=start;
if(skip_flag<=0) aviwrite_write_chunk(muxer,mux_v,muxer_f,in_size,(sh_video->ds->flags&1)?0x10:0);
break;
+case VCODEC_FRAMENO:
+ mux_v->buffer=&decoded_frameno; // tricky
+ aviwrite_write_chunk(muxer,mux_v,muxer_f,sizeof(int),0);
+ break;
case VCODEC_DIVX4:
blit_frame=decode_video(&video_out,sh_video,start,in_size,0);
if(skip_flag>0) break;
@@ -887,6 +908,12 @@
fseek(muxer_f,0,SEEK_SET);
aviwrite_write_header(muxer,muxer_f); // update header
fclose(muxer_f);
+
+printf("\nVideo stream: %8.3f kbit/s (%d bps) size: %d bytes %5.3f secs\n",
+ (float)(mux_v->size/mux_v->timer*8.0f/1000.0f), (int)(mux_v->size/mux_v->timer), mux_v->size, (float)mux_v->timer);
+if(sh_audio)
+printf("\nAudio stream: %8.3f kbit/s (%d bps) size: %d bytes %5.3f secs\n",
+ (float)(mux_a->size/mux_a->timer*8.0f/1000.0f), (int)(mux_a->size/mux_a->timer), mux_a->size, (float)mux_a->timer);
if(stream) free_stream(stream); // kill cache thread
Index: cfg-mencoder.h
===================================================================
RCS file: /cvsroot/mplayer/main/cfg-mencoder.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- cfg-mencoder.h 6 Dec 2001 22:27:09 -0000 1.8
+++ cfg-mencoder.h 6 Dec 2001 23:59:46 -0000 1.9
@@ -45,8 +45,9 @@
struct config ovc_conf[]={
{"copy", &out_video_codec, CONF_TYPE_FLAG, 0, 0, 0},
+ {"frameno", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_FRAMENO},
{"divx4", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_DIVX4},
- {"help", "\nAvailable codecs:\n copy\n divx4\n\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0},
+ {"help", "\nAvailable codecs:\n copy\n frameno\n divx4\n\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0},
{NULL, NULL, 0, 0, 0, 0}
};
More information about the MPlayer-cvslog
mailing list