changeset 2642:0e6e13261d79

divx4_vbr -> mplayer integration
author arpi
date Fri, 02 Nov 2001 23:58:26 +0000
parents 41b67e5e5d38
children 9d0a638e211a
files Makefile divx4_vbr.c divx4_vbr.h
diffstat 3 files changed, 40 insertions(+), 35 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Fri Nov 02 23:53:44 2001 +0000
+++ b/Makefile	Fri Nov 02 23:58:26 2001 +0000
@@ -21,7 +21,7 @@
 # a BSD compatible 'install' program
 INSTALL = install
 
-SRCS_MENCODER = mencoder.c libvo/aclib.c libvo/img_format.c ima4.c xacodec.c cpudetect.c mp_msg.c ac3-iec958.c dec_audio.c dec_video.c codec-cfg.c cfgparser.c
+SRCS_MENCODER = divx4_vbr.c mencoder.c libvo/aclib.c libvo/img_format.c ima4.c xacodec.c cpudetect.c mp_msg.c ac3-iec958.c dec_audio.c dec_video.c codec-cfg.c cfgparser.c
 OBJS_MENCODER = $(SRCS_MENCODER:.c=.o)
 
 SRCS_MPLAYER = mplayer.c ima4.c xacodec.c cpudetect.c mp_msg.c ac3-iec958.c find_sub.c dec_audio.c dec_video.c codec-cfg.c subreader.c lirc_mp.c cfgparser.c mixer.c spudec.c
--- a/divx4_vbr.c	Fri Nov 02 23:53:44 2001 +0000
+++ b/divx4_vbr.c	Fri Nov 02 23:58:26 2001 +0000
@@ -36,6 +36,7 @@
  
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <sys/stat.h>
 #include <unistd.h>
 #include <fcntl.h>
@@ -45,7 +46,10 @@
 #include <stdint.h>
 
 #include "config.h"
-#include "transcode.h"
+
+#include "divx4_vbr.h"
+
+//#include "transcode.h"
 
 #define FALSE 0
 #define TRUE 1
@@ -82,39 +86,23 @@
 		short drop;
 	} entry;
 
-int m_iCount;
-int m_iQuant;
-int m_iCrispness;
-short m_bDrop;
-float m_fQuant;
+static int m_iCount;
+static int m_iQuant;
+static int m_iCrispness;
+static short m_bDrop;
+static float m_fQuant;
 
-int64_t m_lEncodedBits;
-int64_t m_lExpectedBits;
-
-FILE  *m_pFile;
-
-entry    vFrame;
-entry *m_vFrames;
-long	lFrameStart;
+static int64_t m_lEncodedBits;
+static int64_t m_lExpectedBits;
 
-int	iNumFrames;
-int	dummy;
-
-// methods from class VbrControl
-
-	void VbrControl_init_1pass_vbr(int quality, int crispness);
-	int VbrControl_init_2pass_vbr_encoding(const char* filename, int bitrate, double framerate, int crispness, int quality);
-	int VbrControl_init_2pass_vbr_analysis(const char* filename, int quality);
+static FILE  *m_pFile;
 
-	void VbrControl_update_1pass_vbr();
-	void VbrControl_update_2pass_vbr_encoding(int motion_bits, int texture_bits, int total_bits);
-	void VbrControl_update_2pass_vbr_analysis(int is_key_frame, int motion_bits, int texture_bits, int total_bits, int quant);
+static entry    vFrame;
+static entry *m_vFrames;
+static long	lFrameStart;
 
-	int VbrControl_get_quant();
-	void VbrControl_set_quant(float q);
-	int VbrControl_get_intra();
-	short VbrControl_get_drop();
-	void VbrControl_close();
+static int	iNumFrames;
+static int	dummy;
 
 
 void VbrControl_init_1pass_vbr(int quality, int crispness)
@@ -233,14 +221,14 @@
 		iNumFrames++;
 		average_complexity=complexity/iNumFrames;
 		
-		if (verbose & TC_DEBUG)	{
-		    fprintf(stderr, "(%s) frames %d, texture %lld, motion %lld, total %lld, complexity %lld\n", __FILE__, iNumFrames, text_bits, motion_bits, total_bits, complexity);
-		}
+//		if (verbose & TC_DEBUG)	{
+//		    fprintf(stderr, "(%s) frames %d, texture %lld, motion %lld, total %lld, complexity %lld\n", __FILE__, iNumFrames, text_bits, motion_bits, total_bits, complexity);
+//		}
 		
 		m_vFrames = (entry*)malloc(iNumFrames*sizeof(entry));
 		if (!m_vFrames) 
 		{	printf("out of memory");
-			return TC_EXPORT_ERROR;
+			return -2; //TC_EXPORT_ERROR;
 		}
 			
 	   fseek(m_pFile, lFrameStart, SEEK_SET);		// start again
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/divx4_vbr.h	Fri Nov 02 23:58:26 2001 +0000
@@ -0,0 +1,17 @@
+
+// methods from class VbrControl
+
+	void VbrControl_init_1pass_vbr(int quality, int crispness);
+	int VbrControl_init_2pass_vbr_encoding(const char* filename, int bitrate, double framerate, int crispness, int quality);
+	int VbrControl_init_2pass_vbr_analysis(const char* filename, int quality);
+
+	void VbrControl_update_1pass_vbr();
+	void VbrControl_update_2pass_vbr_encoding(int motion_bits, int texture_bits, int total_bits);
+	void VbrControl_update_2pass_vbr_analysis(int is_key_frame, int motion_bits, int texture_bits, int total_bits, int quant);
+
+	int VbrControl_get_quant();
+	void VbrControl_set_quant(float q);
+	int VbrControl_get_intra();
+	short VbrControl_get_drop();
+	void VbrControl_close();
+