[Mplayer-cvslog] CVS: main/libmpcodecs ve_divx4.c,1.8,1.9 ve_lavc.c,1.35,1.36

Richard Felker CVS rfelker at mplayerhq.hu
Sat Nov 2 03:44:22 CET 2002


Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var/tmp.root/cvs-serv32517/libmpcodecs

Modified Files:
	ve_divx4.c ve_lavc.c 
Log Message:
removed -pass nonsense from mencoder! it's now a suboption to -divx4opts


Index: ve_divx4.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ve_divx4.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ve_divx4.c	10 Sep 2002 22:18:32 -0000	1.8
+++ ve_divx4.c	2 Nov 2002 02:44:19 -0000	1.9
@@ -42,7 +42,7 @@
 #include "xvid_vbr.h"
 #endif
 
-extern int pass;
+static int pass;
 extern char* passtmpfile;
 extern void mencoder_write_chunk(aviwrite_stream_t *s,int len,unsigned int flags);
 
@@ -62,6 +62,7 @@
 #include "cfgparser.h"
 
 struct config divx4opts_conf[]={
+	{"pass", &pass, CONF_TYPE_INT, CONF_RANGE,0,2, NULL},
 	{"br", &divx4_param.bitrate, CONF_TYPE_INT, CONF_RANGE, 4, 24000000, NULL},
 	{"rc_period", &divx4_param.rc_period, CONF_TYPE_INT, 0,0,0, NULL},
 	{"rc_reaction_period", &divx4_param.rc_reaction_period, CONF_TYPE_INT, 0,0,0, NULL},

Index: ve_lavc.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ve_lavc.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- ve_lavc.c	29 Sep 2002 23:21:57 -0000	1.35
+++ ve_lavc.c	2 Nov 2002 02:44:19 -0000	1.36
@@ -25,7 +25,6 @@
 #endif
 
 extern char* passtmpfile;
-extern int pass;
 extern void mencoder_write_chunk(aviwrite_stream_t *s,int len,unsigned int flags);
 
 //===========================================================================//
@@ -348,11 +347,7 @@
 #endif
 
     /* lavc internal 2pass bitrate control */
-#ifdef HAVE_DIVX4ENCORE
     switch(lavc_param_vpass){
-#else
-    switch(lavc_param_vpass?lavc_param_vpass:pass){
-#endif
     case 1: 
 	lavc_venc_context->flags|= CODEC_FLAG_PASS1; 
 #if LIBAVCODEC_BUILD >= 4620
@@ -401,28 +396,6 @@
 	lavc_venc_context->quality = lavc_param_vqscale;
     }
 
-#ifdef HAVE_DIVX4ENCORE
-    switch(pass){
-    case 1:
-	if (VbrControl_init_2pass_vbr_analysis(passtmpfile, 5) == -1){
-	    mp_msg(MSGT_MENCODER,MSGL_ERR,"2pass failed: filename=%s\n", passtmpfile);
-	    pass=0;
-	}
-	break;
-    case 2:
-        if (VbrControl_init_2pass_vbr_encoding(passtmpfile,
-		    lavc_venc_context->bit_rate,
-		    (float)mux_v->h.dwRate/mux_v->h.dwScale,
-		    100, /* crispness */
-		    5) == -1){
-	    mp_msg(MSGT_MENCODER,MSGL_ERR,"2pass failed: filename=%s\n", passtmpfile);
-	    pass=0;
-	} else
-	    lavc_venc_context->flags|=CODEC_FLAG_QSCALE|CODEC_FLAG_TYPE; // VBR
-	break;
-    }
-#endif
-
     if (avcodec_open(lavc_venc_context, vf->priv->codec) != 0) {
 	mp_msg(MSGT_MENCODER,MSGL_ERR,MSGTR_CantOpenCodec);
 	return 0;
@@ -468,31 +441,8 @@
     lavc_venc_picture.linesize[1]=mpi->stride[1];
     lavc_venc_picture.linesize[2]=mpi->stride[2];
 
-#ifdef HAVE_DIVX4ENCORE
-    if(pass==2){ // handle 2-pass:
-	lavc_venc_context->flags|=CODEC_FLAG_QSCALE; // enable VBR
-	lavc_venc_context->quality=VbrControl_get_quant();
-	lavc_venc_context->key_frame=VbrControl_get_intra();
-	lavc_venc_context->gop_size=0x3fffffff;
 	out_size = avcodec_encode_video(lavc_venc_context, mux_v->buffer, mux_v->buffer_size,
 	    &lavc_venc_picture);
-	VbrControl_update_2pass_vbr_encoding(lavc_venc_context->mv_bits,
-	      lavc_venc_context->i_tex_bits+lavc_venc_context->p_tex_bits,
-	      8*out_size);
-    } else
-#endif
-    {
-	out_size = avcodec_encode_video(lavc_venc_context, mux_v->buffer, mux_v->buffer_size,
-	    &lavc_venc_picture);
-#ifdef HAVE_DIVX4ENCORE
-	if(pass==1){
-	  VbrControl_update_2pass_vbr_analysis(lavc_venc_context->key_frame,
-	      lavc_venc_context->mv_bits,
-	      lavc_venc_context->i_tex_bits+lavc_venc_context->p_tex_bits,
-	      8*out_size, lavc_venc_context->quality);
-	}
-#endif
-    }
 
     mencoder_write_chunk(mux_v,out_size,lavc_venc_context->key_frame?0x10:0);
     




More information about the MPlayer-cvslog mailing list