[MPlayer-dev-eng] [PATCH] remove opendivx/divx4 support

Diego Biurrun diego at biurrun.de
Wed Jul 12 03:19:07 CEST 2006


The opendivx/divx4 libraries are obsolete and non-free.  We have better
alternatives under free licenses.  I just recently fixed a wrong include
path in vd_odivx.c, I'm not sure if any of it compiles or if anybody
uses it.

In a word I think its time has come.  Attached is a patch to remove all
divx4/opendivx remnants from the code, minus a good chunk from the man
page and the codecs.xml file.  I've also skipped the vd_odivx.c,
vd_divx4.c and ve_divx4.c files, for obvious reasons.

What's the deal with divx4_vbr.[ch]?  IIUC they are not used outside of
divx4 and could be removed as well.  Since I still don't encode I
wouldn't know how to test this offhand, though ;)

Now please keep the flames down.

Diego
-------------- next part --------------
Index: configure
===================================================================
--- configure	(revision 19021)
+++ configure	(working copy)
@@ -261,8 +261,6 @@
   --disable-real         disable RealPlayer DLL support [autodetect]
   --disable-xvid         disable XviD codec [autodetect]
   --disable-x264         disable H.264 encoder [autodetect]
-  --disable-divx4linux   disable DivX4linux/Divx5linux codec [autodetect]
-  --enable-opendivx      enable _old_ OpenDivx codec [disable]
   --disable-libavutil    disable libavutil [autodetect]
   --disable-libavcodec   disable libavcodec [autodetect]
   --disable-libavformat  disable libavformat [autodetect]
@@ -1661,8 +1659,6 @@
 _joystick=no
 _xvid=auto
 _x264=auto
-_divx4linux=auto
-_opendivx=no
 _lirc=auto
 _lircc=auto
 _gui=no
@@ -1908,10 +1904,6 @@
   --disable-xvid)	_xvid=no	;;
   --enable-x264)        _x264=yes       ;;
   --disable-x264)       _x264=no        ;;
-  --enable-divx4linux)	_divx4linux=yes	;;
-  --disable-divx4linux)	_divx4linux=no	;;
-  --enable-opendivx)	_opendivx=yes	;;
-  --disable-opendivx)	_opendivx=no	;;
   --enable-libavutil)	_libavutil=yes	;;
   --disable-libavutil)	_libavutil=no	;;
   --enable-libavutil_so)	_libavutil_so=yes	;;
@@ -6578,81 +6570,8 @@
 fi
 echores "$_x264"
 
-echocheck "DivX4linux/DivX5linux/OpenDivX decore"
-# DivX5: DEC_OPT_MEMORY_REQS - DivX4: DEC_OPT_FRAME_311
-cat > $TMPC << EOF
-#include <decore.h>
-int main(void) { (void) decore(0, 0, 0, 0);  return DEC_OPT_FRAME_311; }
-EOF
-if test "$_divx4linux" != no && cc_check $_ld_lm -ldivxdecore ; then
-  _divx=yes
-  _opendivx=no
-  _ld_decore='-ldivxdecore'
-  _def_decore='#define NEW_DECORE 1'
-  _def_divx='#define USE_DIVX'
-  _def_divx5='#undef DECORE_DIVX5'
-  _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
-  _codecmodules="divx4linux $_codecmodules"
-  _res_comment="DivX4linux - with libdivxdecore.so"
-else
-# if test "$_divx4linux" != no ; then 
-# DivX5 check
-# OdivxPP disabled because of:
-# ld: Warning: type of symbol `dering' changed from 1 to 2 in opendivx/postprocess.o
-cat > $TMPC << EOF
-#include <decore.h>
-int main(void) { (void) decore(0, 0, 0, 0);  return DEC_OPT_INIT; }
-EOF
-if test "$_divx4linux" != no && cc_check $_ld_lm -ldivxdecore ; then
-  _divx=yes
-  _opendivx=no
-#  _ld_decore='-ldivxdecore opendivx/postprocess.o'
-  _ld_decore='-ldivxdecore'
-  _def_decore='#define NEW_DECORE 1'
-  _def_divx='#define USE_DIVX'
-  _def_divx5='#define DECORE_DIVX5 1'
-#  _def_odivx_postprocess='#define HAVE_ODIVX_POSTPROCESS 1'
-  _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
-  _codecmodules="divx5linux $_codecmodules"
-  _nocodecmodules="divx4linux $_nocodecmodules"
-  _res_comment="DivX5linux - with libdivxdecore.so"
-elif test "$_opendivx" != no ; then
-  _divx=yes
-  _opendivx=yes
-  _ld_decore='opendivx/libdecore.a'
-  _def_decore='#undef NEW_DECORE'
-  _def_divx='#define USE_DIVX'
-  _def_divx5='#undef DECORE_DIVX5'
-  _def_odivx_postprocess='#define HAVE_ODIVX_POSTPROCESS 1'
-  _codecmodules="opendivx $_codecmodules"
-  _nocodecmodules="divx5linux $_nocodecmodules"
-  _res_comment="OpenDivX"
-elif test "$_xvidcompat" = yes ; then
-  _divx=yes
-  _opendivx=no
-  _ld_decore=''
-  _def_decore='#define NEW_DECORE 1'
-  _def_divx='#define USE_DIVX 1'
-  _def_divx5='#undef DECORE_DIVX5'
-  _def_decore_xvid='#define DECORE_XVID 1'
-  _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
-  _nocodecmodules="opendivx divx5linux divx4linux $_nocodecmodules"
-  _res_comment="XviD compat."
-else
-  _divx=no
-  _opendivx=no
-  _ld_decore=''
-  _def_decore='#undef NEW_DECORE'
-  _def_divx='#undef USE_DIVX'
-  _def_divx5='#undef DECORE_DIVX5'
-  _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
-  _nocodecmodules="opendivx $_nocodecmodules"
-fi # DivX5 check
-fi
-echores "$_divx"
 
-
-# mencoder requires (optional) those libs: libmp3lame and divx4linux encore
+# mencoder requires (optional) those libs: libmp3lame
 if test "$_mencoder" != no ; then
 
   echocheck "libmp3lame (for mencoder)"
@@ -6684,29 +6603,6 @@
   fi
   echores "$_mp3lame"
 
-
-  echocheck "DivX4linux encore (for mencoder)"
-  cat > $TMPC << EOF
-#include <encore2.h>
-int main(void) { (void) encore(0, 0, 0, 0); return 0; }
-EOF
-  if test "$_divx4linux" != no && cc_check -ldivxencore $_ld_lm ; then
-    _divx_encore=yes
-    _def_encore='#define HAVE_DIVX4ENCORE 1'
-    _ld_encore='-ldivxencore'
-    _res_comment="DivX4linux - with libdivxencore.so"
-  elif test "$_xvidcompat" = yes ; then
-    _divx_encore=yes
-    _def_encore='#define HAVE_DIVX4ENCORE 1'
-    _ld_encore=''
-    _def_encore_xvid='#define ENCORE_XVID 1'
-    _res_comment="XviD compatibility"
-  else
-    _divx_encore=no
-    _def_encore='#undef HAVE_DIVX4ENCORE'
-  fi
-  echores "$_divx_encore"
-
 fi
 
 echocheck "mencoder"
@@ -7469,10 +7365,6 @@
 CONFIG_MP3LAME = $_mp3lame
 LIBMENU = $_menu
 
-DIVX     = $_divx
-OPENDIVX = $_opendivx
-DIVX4ENCORE = $_divx_encore
-
 MP3LIB = $_mp3lib
 LIBA52 = $_liba52
 LIBMPEG2 = $_libmpeg2
@@ -7596,9 +7488,9 @@
 CONFIG_DTS = $_libdts
 DTS_INC = $_inc_libdts
 DTS_LIB = $_ld_libdts
-DECORE_LIB = $_ld_decore $_ld_mp3lame
+DECORE_LIB = $_ld_mp3lame
 MENCODER = $_mencoder
-ENCORE_LIB =  $_ld_encore $_ld_mp3lame
+ENCORE_LIB = $_ld_mp3lame
 DIRECTFB_INC = $_inc_directfb
 DIRECTFB_LIB = $_ld_directfb
 CDDA = $_cdda
@@ -7773,16 +7665,6 @@
    -cache <kilobytes> */
 #define USE_STREAM_CACHE 1
 
-/* Define to include support for XviD/Divx4Linux/OpenDivx */
-$_def_divx
-
-/* Define to use the new XviD/DivX4Linux library instead of open source OpenDivX */
-/* You have to change DECORE_LIBS in config.mak, too! */
-$_def_decore
-
-/* Define if you are using DivX5Linux Decore library */
-$_def_divx5
-
 /* Define if you are using XviD library */
 $_def_xvid3
 $_def_xvid4
@@ -7798,10 +7680,6 @@
 /* If build mencoder */
 $_mencoder_flag
 
-/* Indicates if XviD/Divx4linux encore is available
-   Note: for mencoder */
-$_def_encore
-
 /* Indicates if libmp3lame is available
    Note: for mencoder */
 $_def_mp3lame
@@ -7974,9 +7852,6 @@
 $_def_libpostproc
 $_def_libpostproc_so
 
-/* Define to include support for OpenDivx postprocessing */
-$_def_odivx_postprocess
-
 /* Win32 DLL support */
 $_def_win32
 #define WIN32_PATH "$_win32libdir"
Index: libmpcodecs/vd.c
===================================================================
--- libmpcodecs/vd.c	(revision 19021)
+++ libmpcodecs/vd.c	(working copy)
@@ -34,8 +34,6 @@
 extern vd_functions_t mpcodecs_vd_dmo;
 extern vd_functions_t mpcodecs_vd_vfw;
 extern vd_functions_t mpcodecs_vd_vfwex;
-extern vd_functions_t mpcodecs_vd_odivx;
-extern vd_functions_t mpcodecs_vd_divx4;
 extern vd_functions_t mpcodecs_vd_raw;
 extern vd_functions_t mpcodecs_vd_hmblck;
 extern vd_functions_t mpcodecs_vd_xanim;
@@ -67,12 +65,6 @@
         &mpcodecs_vd_vfw,
         &mpcodecs_vd_vfwex,
 #endif
-#ifdef USE_DIVX
-        &mpcodecs_vd_odivx,
-#ifdef NEW_DECORE
-        &mpcodecs_vd_divx4,
-#endif
-#endif
         &mpcodecs_vd_lzo,
         &mpcodecs_vd_raw,
         &mpcodecs_vd_hmblck,
Index: libmpcodecs/Makefile
===================================================================
--- libmpcodecs/Makefile	(revision 19021)
+++ libmpcodecs/Makefile	(working copy)
@@ -104,12 +104,6 @@
 ifeq ($(LIBTHEORA),yes)
 VIDEO_SRCS+=vd_theora.c
 endif
-ifeq ($(DIVX),yes)
-VIDEO_SRCS+=vd_odivx.c
-  ifneq ($(OPENDIVX),yes)
-  VIDEO_SRCS+=vd_divx4.c
-  endif
-endif
 ifeq ($(XVID4),yes)
 VIDEO_SRCS+=vd_xvid4.c
 else
@@ -244,9 +238,6 @@
   ENCODER_SRCS+=ve_xvid.c
   endif
 endif
-ifeq ($(DIVX4ENCORE),yes)
-ENCODER_SRCS+=ve_divx4.c
-endif
 ifeq ($(X264),yes)
 ENCODER_SRCS+=ve_x264.c
 endif
Index: libmpcodecs/ve.c
===================================================================
--- libmpcodecs/ve.c	(revision 19021)
+++ libmpcodecs/ve.c	(working copy)
@@ -9,7 +9,6 @@
 #include "mp_image.h"
 #include "vf.h"
 
-extern vf_info_t ve_info_divx4;
 extern vf_info_t ve_info_lavc;
 extern vf_info_t ve_info_vfw;
 extern vf_info_t ve_info_raw;
@@ -20,9 +19,6 @@
 extern vf_info_t ve_info_x264;
 
 static vf_info_t* encoder_list[]={
-#ifdef HAVE_DIVX4ENCORE
-    &ve_info_divx4,
-#endif
 #ifdef USE_LIBAVCODEC
     &ve_info_lavc,
 #endif
Index: cfg-common.h
===================================================================
--- cfg-common.h	(revision 19021)
+++ cfg-common.h	(working copy)
@@ -199,17 +199,9 @@
 	{"vc", &video_codec_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL},
 
 	// postprocessing:
-	{"divxq", "-divxq has been renamed to -pp (postprocessing), use -pp.\n",
-            CONF_TYPE_PRINT, 0, 0, 0, NULL},
 #ifdef USE_LIBAVCODEC
 	{"pp", &divx_quality, CONF_TYPE_INT, 0, 0, 0, NULL},
 #endif
-#ifdef HAVE_ODIVX_POSTPROCESS
-        {"oldpp", &use_old_pp, CONF_TYPE_FLAG, 0, 0, 1, NULL},
-#else
-        {"oldpp", "MPlayer was compiled without the OpenDivX library.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
-#endif
-	{"npp", "-npp has been removed, use -vf pp and read the fine manual.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
 #if defined(USE_LIBPOSTPROC) || defined(USE_LIBPOSTPROC_SO)
         {"pphelp", &pp_help, CONF_TYPE_PRINT_INDIRECT, CONF_NOCFG, 0, 0, NULL},
 #endif
Index: cfg-mplayer.h
===================================================================
--- cfg-mplayer.h	(revision 19021)
+++ cfg-mplayer.h	(working copy)
@@ -89,10 +89,6 @@
 extern int guiWinID;
 #endif
 
-#ifdef HAVE_ODIVX_POSTPROCESS
-extern int use_old_pp;
-#endif
-
 #ifdef HAVE_XINERAMA
 extern int xinerama_screen;
 #endif
Index: cfg-mencoder.h
===================================================================
--- cfg-mencoder.h	(revision 19021)
+++ cfg-mencoder.h	(working copy)
@@ -8,19 +8,12 @@
 #ifdef USE_FAKE_MONO
 extern int fakemono; // defined in dec_audio.c
 #endif
-#ifdef HAVE_ODIVX_POSTPROCESS
-extern int use_old_pp;
-#endif
 
 extern int sws_flags;
 extern int readPPOpt(void *, char *arg);
 extern void revertPPOpt(void *conf, char* opt);
 extern char *pp_help;
 
-#ifdef HAVE_DIVX4ENCORE
-extern m_option_t divx4opts_conf[];
-#endif
-
 #ifdef HAVE_MP3LAME
 extern m_option_t lameopts_conf[];
 #endif
@@ -62,7 +55,6 @@
 m_option_t ovc_conf[]={
 	{"copy", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_COPY, NULL},
 	{"frameno", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_FRAMENO, NULL},
-	{"divx4", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_DIVX4, NULL},
 	{"lavc", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_LIBAVCODEC, NULL},
 //	{"null", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_NULL, NULL},
 	{"raw", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_RAW, NULL},
@@ -77,13 +69,6 @@
 	"   frameno  - special audio-only file for 3-pass encoding, see DOCS.\n"
 	"   raw      - uncompressed video. Use fourcc option to set format explicitly.\n"
 	"   nuv      - nuppel video\n"
-#ifdef HAVE_DIVX4ENCORE
-#ifdef ENCORE_XVID
-	"   divx4    - XviD (divx4linux compatibility mode)\n"
-#else
-	"   divx4    - divx4linux/divx5linux library (depends on configuration)\n"
-#endif
-#endif
 #ifdef USE_LIBAVCODEC
 	"   lavc     - libavcodec codecs - best quality!\n"
 #endif
@@ -239,7 +224,7 @@
 	// override avi aspect autodetection
 	{"force-avi-aspect", &avi_aspect_override, CONF_TYPE_FLOAT, CONF_RANGE|CONF_GLOBAL, 0.2, 3.0, NULL},
 
-	{"pass", "-pass is obsolete, use -lavcopts vpass=n, -xvidencopts pass=n, -divx4opts pass=n\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
+	{"pass", "-pass is obsolete, use -lavcopts vpass=n, -xvidencopts pass=n\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
 	{"passlogfile", &passtmpfile, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL},
 	
 	{"vobsubout", &vobsub_out, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL},
@@ -258,9 +243,6 @@
 	// info header strings
 	{"info", info_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
 
-#ifdef HAVE_DIVX4ENCORE
-	{"divx4opts", divx4opts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
-#endif
 #ifdef HAVE_MP3LAME
 	{"lameopts", lameopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
 #endif
Index: mencoder.c
===================================================================
--- mencoder.c	(revision 19021)
+++ mencoder.c	(working copy)
@@ -1,7 +1,6 @@
 #define VCODEC_COPY 0
 #define VCODEC_FRAMENO 1
 // real codecs:
-#define VCODEC_DIVX4 2
 #define VCODEC_LIBAVCODEC 4
 #define VCODEC_VFW 7
 #define VCODEC_LIBDV 8
@@ -831,8 +830,6 @@
     static vf_instance_t * ve = NULL;
   if (!ve) {
     switch(mux_v->codec){
-    case VCODEC_DIVX4:
-	sh_video->vfilter=vf_open_encoder(NULL,"divx4",(char *)mux_v); break;
     case VCODEC_LIBAVCODEC:
         sh_video->vfilter=vf_open_encoder(NULL,"lavc",(char *)mux_v); break;
     case VCODEC_RAW:
Index: etc/codecs.conf
===================================================================
--- etc/codecs.conf	(revision 19021)
+++ etc/codecs.conf	(working copy)
@@ -612,45 +612,6 @@
   out BGR32,BGR24,BGR16,BGR15
   dll "libxvidcore.a"
 
-; divx4 does direct render, and is native on Linux
-
-videocodec odivx
-  info "OpenDivX API (ODIVX,DIVX4,DIVX5,XVID)"
-  comment "with postprocessing"
-  status working
-  fourcc mp4v
-  fourcc DIVX,divx
-  fourcc DIV1,div1 divx
-;  fourcc MP4S,mp4s	; ISO MPEG-4 Video V1
-  fourcc MP43,mp43,DIV3,div3,DIV4,div4 DIV3  ; for DivX4Linux only!
-  fourcc AP41 DIV3	  ; AngelPotion stuff
-  fourcc xvid,XVID,XviD
-  fourcc DX50,BLZ0 DX50
-  format 0x4
-  driver odivx
-  dll "libdivxdecore.so"
-  out YV12,I420,IYUV
-
-videocodec divx4
-  info "DivX4Linux API (DIVX4,DIVX5,XVID)"
-  comment "with postprocessing"
-  status working
-  fourcc mp4v
-  fourcc DIVX,divx
-  fourcc DIV1,div1 divx
-;  fourcc MP4S,mp4s	; ISO MPEG-4 Video V1
-  fourcc MP43,mp43,DIV3,div3,DIV4,div4 DIV3  ; for DivX4Linux only!
-  fourcc AP41 DIV3	  ; AngelPotion stuff
-  fourcc xvid,XVID,XviD
-  fourcc DX50,BLZ0 DX50
-  format 0x4
-  driver divx4
-  dll "libdivxdecore.so"
-;  out I420 ; planar direct rendering
-  out YUY2
-  out UYVY
-  out BGR32,BGR24,BGR16,BGR15
-
 ; is divx4vfw stable enough, working everywhere and faster than divxds?
 
 videocodec divx4vfw
Index: libvo/video_out.c
===================================================================
--- libvo/video_out.c	(revision 19021)
+++ libvo/video_out.c	(working copy)
@@ -79,7 +79,6 @@
 extern vo_functions_t video_out_tdfxfb;
 extern vo_functions_t video_out_s3fb;
 extern vo_functions_t video_out_null;
-//extern vo_functions_t video_out_odivx;
 extern vo_functions_t video_out_zr;
 extern vo_functions_t video_out_zr2;
 extern vo_functions_t video_out_bl;


More information about the MPlayer-dev-eng mailing list