changeset 8491:ce25d80dd6c3

Use the XVID_API_UNSTABLE macro instead of a home-made one. Print a big warning if compiled for the unstable XViD tree.
author rguyom
date Wed, 18 Dec 2002 08:10:24 +0000
parents ac40496c7d9e
children 81f01b7b3f6d
files libmpcodecs/vd_xvid.c libmpcodecs/ve_xvid.c
diffstat 2 files changed, 69 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vd_xvid.c	Wed Dec 18 07:34:32 2002 +0000
+++ b/libmpcodecs/vd_xvid.c	Wed Dec 18 08:10:24 2002 +0000
@@ -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;
--- a/libmpcodecs/ve_xvid.c	Wed Dec 18 07:34:32 2002 +0000
+++ b/libmpcodecs/ve_xvid.c	Wed Dec 18 08:10:24 2002 +0000
@@ -22,16 +22,28 @@
 #include <xvid.h>
 #include "xvid_vbr.h"
 
-#ifndef PMV_EARLYSTOP16
-  #define XVID_DEV
+#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
 
-#include "cfgparser.h"
-
 /**********************************************************************/
 /* 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