changeset 8032:136e7e515764

removed -pass nonsense from mencoder! it's now a suboption to -divx4opts
author rfelker
date Sat, 02 Nov 2002 02:44:19 +0000
parents ad62a544964c
children 2d1ed4487af7
files cfg-mencoder.h libmpcodecs/ve_divx4.c libmpcodecs/ve_lavc.c mencoder.c
diffstat 4 files changed, 2 insertions(+), 54 deletions(-) [+]
line wrap: on
line diff
--- a/cfg-mencoder.h	Sat Nov 02 01:18:54 2002 +0000
+++ b/cfg-mencoder.h	Sat Nov 02 02:44:19 2002 +0000
@@ -150,7 +150,6 @@
 	// override FOURCC in output file
 	{"ffourcc", &force_fourcc, CONF_TYPE_STRING, 0, 4, 4, NULL},
 
-	{"pass", &pass, CONF_TYPE_INT, CONF_RANGE,0,2, NULL},
 	{"passlogfile", &passtmpfile, CONF_TYPE_STRING, 0, 0, 0, NULL},
 	
 	{"vobsubout", &vobsub_out, CONF_TYPE_STRING, 0, 0, 0, NULL},
--- a/libmpcodecs/ve_divx4.c	Sat Nov 02 01:18:54 2002 +0000
+++ b/libmpcodecs/ve_divx4.c	Sat Nov 02 02:44:19 2002 +0000
@@ -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},
--- a/libmpcodecs/ve_lavc.c	Sat Nov 02 01:18:54 2002 +0000
+++ b/libmpcodecs/ve_lavc.c	Sat Nov 02 02:44:19 2002 +0000
@@ -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);
     
--- a/mencoder.c	Sat Nov 02 01:18:54 2002 +0000
+++ b/mencoder.c	Sat Nov 02 02:44:19 2002 +0000
@@ -140,9 +140,7 @@
 
 char *force_fourcc=NULL;
 
-int pass=0;
 char* passtmpfile="divx2pass.log";
-int pass_working=0;
 
 static int play_n_frames=-1;
 static int play_n_frames_mf=-1;