[Mplayer-cvslog] CVS: main/libmpcodecs ve_xvid.c,1.10,1.11 vd_xvid.c,1.6,1.7

Rémi Guyomarch CVS rguyom at mplayerhq.hu
Wed Dec 18 09:10:44 CET 2002


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

Modified Files:
	ve_xvid.c vd_xvid.c 
Log Message:
Use the XVID_API_UNSTABLE macro instead of a home-made one.
Print a big warning if compiled for the unstable XViD tree.



Index: ve_xvid.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ve_xvid.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ve_xvid.c	15 Dec 2002 18:35:11 -0000	1.10
+++ ve_xvid.c	18 Dec 2002 08:10:24 -0000	1.11
@@ -22,16 +22,28 @@
 #include <xvid.h>
 #include "xvid_vbr.h"
 
-#ifndef PMV_EARLYSTOP16
-  #define XVID_DEV
-#endif
-
 #include "cfgparser.h"
 
+
+#ifdef XVID_API_UNSTABLE
+#warning *******************************************************************
+#warning **                                                               **
+#warning **  Y O U '' R E   U S I N G   U N S T A B L E   S O F T W A R E  **
+#warning **                                                               **
+#warning ** Streams produced by this version aren''nt probably compatible  **
+#warning ** with anything else, even the xvid decoder itself. There are   **
+#warning ** bugs, this code could crash, could blow up your PC or the     **
+#warning ** whole building !                                              **
+#warning ** If you want stable code and compatible streams, use stable    **
+#warning ** XViD releases (currently 0.9.x).                              **
+#warning **                                                               **
+#warning *******************************************************************
+#endif
+
 /**********************************************************************/
 /* motion estimation quality presets */
 static int const motion_presets[7] = {
-#ifdef XVID_DEV
+#ifdef XVID_API_UNSTABLE
 	0,
 	PMV_QUICKSTOP16,
 	0,
@@ -75,7 +87,7 @@
 static int xvidenc_debug = 0;
 static int xvidenc_hintedme = 0;
 static char* xvidenc_hintfile = "xvid_hint_me.dat";
-#ifdef XVID_DEV
+#ifdef XVID_API_UNSTABLE
 static int xvidenc_qpel = 0;
 static int xvidenc_max_bframes = 0;
 static int xvidenc_bquant_ratio = 125;
@@ -107,7 +119,7 @@
     { "debug", &xvidenc_debug, CONF_TYPE_FLAG, 0, 0, 1, NULL},
     { "hintedme", &xvidenc_hintedme, CONF_TYPE_FLAG, 0, 0, 1, NULL},
     { "hintfile", &xvidenc_hintfile, CONF_TYPE_STRING, 0, 0, 0, NULL},
-#ifdef XVID_DEV
+#ifdef XVID_API_UNSTABLE
     { "qpel", &xvidenc_qpel, CONF_TYPE_FLAG, 0, 0, 1, NULL},
     { "max_bframes", &xvidenc_max_bframes, CONF_TYPE_INT, CONF_RANGE, 0, 4, NULL},
     { "bquant_ratio", &xvidenc_bquant_ratio, CONF_TYPE_INT, CONF_RANGE, 0, 1000, NULL},
@@ -158,6 +170,24 @@
 	return -1;
     }
 
+#ifdef XVID_API_UNSTABLE
+    mp_msg (MSGT_MENCODER, MSGL_WARN,
+	    "\n"
+	    "*******************************************************************\n"
+	    "**                                                               **\n"
+	    "**  Y O U ' R E   U S I N G   U N S T A B L E   S O F T W A R E  **\n"
+	    "**                                                               **\n"
+	    "** Streams produced by this version aren'nt probably compatible  **\n"
+	    "** with anything else, even the xvid decoder itself. There are   **\n"
+	    "** bugs, this code could crash, could blow up your PC or the     **\n"
+	    "** whole building !                                              **\n"
+	    "** If you want stable code and compatible streams, use stable    **\n"
+	    "** XViD releases (currently 0.9.x).                              **\n"
+	    "**                                                               **\n"
+	    "*******************************************************************\n"
+	    "\n");
+#endif
+
     // initialize XViD core parameters
     // ===============================
     memset(&enc_param, 0, sizeof(enc_param));
@@ -171,7 +201,7 @@
 	enc_param.rc_bitrate = xvidenc_bitrate * 1000;
     else
 	enc_param.rc_bitrate = -1;
-#ifdef XVID_DEV
+#ifdef XVID_API_UNSTABLE
     if (xvidenc_max_bframes >= 1 && xvidenc_pass >= 1) {
 	mp_msg(MSGT_MENCODER,MSGL_WARN, "xvid: cannot use bframes with 2-pass, disabling bframes\n");
 	xvidenc_max_bframes = 0;
@@ -211,7 +241,7 @@
 	fp->enc_frame.general |= XVID_INTER4V;
     if (xvidenc_lumi_mask)
 	fp->enc_frame.general |= XVID_LUMIMASKING;
-#ifdef XVID_DEV
+#ifdef XVID_API_UNSTABLE
     if (xvidenc_qpel) {
 	fp->enc_frame.general |= XVID_QUARTERPEL;
 	fp->enc_frame.motion |= PMV_QUARTERPELREFINE16 | PMV_QUARTERPELREFINE8;
@@ -354,7 +384,7 @@
     fp->enc_frame.image = mpi->planes[0];
 
     // get quantizers & I/P decision from the VBR engine
-#ifdef XVID_DEV
+#ifdef XVID_API_UNSTABLE
     if (xvidenc_max_bframes >= 1) {
 	if (!xvidenc_fixed_quant) {
 	    // hack, the internal VBR engine isn't fixed-quant aware

Index: vd_xvid.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd_xvid.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- vd_xvid.c	15 Dec 2002 18:35:11 -0000	1.6
+++ vd_xvid.c	18 Dec 2002 08:10:24 -0000	1.7
@@ -12,8 +12,18 @@
 #include <divx4.h>
 #include <xvid.h>
 
-#ifndef PMV_EARLYSTOP16
-  #define XVID_DEV
+
+#ifdef XVID_API_UNSTABLE
+#warning *******************************************************************
+#warning **                                                               **
+#warning **  Y O U '' R E   U S I N G   U N S T A B L E   S O F T W A R E  **
+#warning **                                                               **
+#warning ** There are bugs, this code could crash, could blow up your PC  **
+#warning ** or the whole building and do many other nasty things !        **
+#warning **                                                               **
+#warning ** If you want stable code use stable XViD releases (0.9.x).     **
+#warning **                                                               **
+#warning *******************************************************************
 #endif
 
 static vd_info_t info = 
@@ -54,6 +64,22 @@
   priv_t* p;
   int cs;
 
+#ifdef XVID_API_UNSTABLE
+    mp_msg (MSGT_DECVIDEO, MSGL_WARN,
+	    "\n"
+	    "*******************************************************************\n"
+	    "**                                                               **\n"
+	    "**  Y O U ' R E   U S I N G   U N S T A B L E   S O F T W A R E  **\n"
+	    "**                                                               **\n"
+            "** There are bugs, this code could crash, could blow up your PC  **\n"
+	    "** or the whole building and do many other nasty things !        **\n"
+	    "**                                                               **\n"
+	    "** If you want stable code use stable XViD releases (0.9.x).     **\n"
+	    "**                                                               **\n"
+	    "*******************************************************************\n"
+	    "\n");
+#endif
+
   memset(&ini,0,sizeof(XVID_INIT_PARAM));
   memset(&dec_p,0,sizeof(XVID_DEC_PARAM));
 
@@ -169,7 +195,7 @@
 
   dec.bitstream = data;
   dec.length = len;
-#ifdef XVID_DEV
+#ifdef XVID_API_UNSTABLE
   dec.general |= XVID_DEC_LOWDELAY;
   dec.general |= XVID_DEC_DEBLOCKY;
   dec.general |= XVID_DEC_DEBLOCKUV;




More information about the MPlayer-cvslog mailing list