changeset 5551:73978162b6a1

soem fixes
author arpi
date Thu, 11 Apr 2002 02:50:47 +0000
parents 7d1dfb59c6c0
children 20b0864bc01e
files libmpcodecs/ve_divx4.c libmpcodecs/ve_lavc.c libmpcodecs/ve_rawrgb.c libmpcodecs/ve_vfw.c
diffstat 4 files changed, 20 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/ve_divx4.c	Wed Apr 10 23:23:36 2002 +0000
+++ b/libmpcodecs/ve_divx4.c	Thu Apr 11 02:50:47 2002 +0000
@@ -72,6 +72,13 @@
     else if(divx4_param.bitrate<=16000) divx4_param.bitrate*=1000;
     if(!divx4_param.quality) divx4_param.quality=5; // the quality of compression ( 1 - fastest, 5 - best )
 
+    // set some usefull defaults:
+    if(!divx4_param.min_quantizer) divx4_param.min_quantizer=2;
+    if(!divx4_param.max_quantizer) divx4_param.max_quantizer=31;
+    if(!divx4_param.rc_period) divx4_param.rc_period=2000;
+    if(!divx4_param.rc_reaction_period) divx4_param.rc_reaction_period=10;
+    if(!divx4_param.rc_reaction_ratio) divx4_param.rc_reaction_ratio=20;
+
     divx4_param.handle=NULL;
     encore(NULL,ENC_OPT_INIT,&divx4_param,NULL);
     vf->priv->enc_handle=divx4_param.handle;
@@ -157,7 +164,7 @@
 					       enc_result.quantizer);
 	}
     }
-    mencoder_write_frame(mux_v,vf->priv->enc_frame.length,enc_result.is_key_frame?0x10:0);
+    mencoder_write_chunk(mux_v,vf->priv->enc_frame.length,enc_result.is_key_frame?0x10:0);
 }
 
 //===========================================================================//
--- a/libmpcodecs/ve_lavc.c	Wed Apr 10 23:23:36 2002 +0000
+++ b/libmpcodecs/ve_lavc.c	Thu Apr 11 02:50:47 2002 +0000
@@ -225,9 +225,14 @@
     mencoder_write_chunk(mux_v,out_size,lavc_venc_context.key_frame?0x10:0);
 }
 
+static void uninit(struct vf_instance_s* vf){
+    avcodec_close(&lavc_venc_context);
+}
+
 //===========================================================================//
 
 static int vf_open(vf_instance_t *vf, char* args){
+    vf->uninit=uninit;
     vf->config=config;
     vf->control=control;
     vf->query_format=query_format;
--- a/libmpcodecs/ve_rawrgb.c	Wed Apr 10 23:23:36 2002 +0000
+++ b/libmpcodecs/ve_rawrgb.c	Thu Apr 11 02:50:47 2002 +0000
@@ -66,6 +66,7 @@
     mux_v->bih->biHeight=0;
     mux_v->bih->biCompression=0;
     mux_v->bih->biPlanes=1;
+    mux_v->bih->biBitCount=24;
 
     return 1;
 }
--- a/libmpcodecs/ve_vfw.c	Wed Apr 10 23:23:36 2002 +0000
+++ b/libmpcodecs/ve_vfw.c	Thu Apr 11 02:50:47 2002 +0000
@@ -37,9 +37,12 @@
     vfw_bih->biWidth=width;
     vfw_bih->biHeight=height;
     vfw_bih->biSizeImage=width*height*((vfw_bih->biBitCount+7)/8);
-    mux_v->bih->biWidth=width;
-    mux_v->bih->biHeight=height;
-    mux_v->bih->biSizeImage=width*height*((mux_v->bih->biBitCount+7)/8);
+
+    if(!vfw_start_encoder(vfw_bih, mux_v->bih)) return 0;
+
+//    mux_v->bih->biWidth=width;
+//    mux_v->bih->biHeight=height;
+//    mux_v->bih->biSizeImage=width*height*((mux_v->bih->biBitCount+7)/8);
 
     return 1;
 }