diff options
author | diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-07-14 17:14:16 +0000 |
---|---|---|
committer | diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-07-14 17:14:16 +0000 |
commit | f89a7da6043d51f97e8c8c9d7cae64d205b21866 (patch) | |
tree | dfb2920478c3c297ee68a0a5aaed33c9d3072fd9 | |
parent | cb2e693d2246c450842810b1e49452a49489938a (diff) | |
download | mpv-f89a7da6043d51f97e8c8c9d7cae64d205b21866.tar.bz2 mpv-f89a7da6043d51f97e8c8c9d7cae64d205b21866.tar.xz |
Remove support for obsolete and non-free divx4/odivx libraries.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19087 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | DOCS/man/en/mplayer.1 | 93 | ||||
-rw-r--r-- | DOCS/xml/en/codecs.xml | 71 | ||||
-rw-r--r-- | DOCS/xml/en/install.xml | 22 | ||||
-rw-r--r-- | cfg-common.h | 8 | ||||
-rw-r--r-- | cfg-mencoder.h | 20 | ||||
-rw-r--r-- | cfg-mplayer.h | 4 | ||||
-rw-r--r-- | codec-cfg.c | 2 | ||||
-rwxr-xr-x | configure | 133 | ||||
-rw-r--r-- | divx4_vbr.c | 406 | ||||
-rw-r--r-- | divx4_vbr.h | 17 | ||||
-rw-r--r-- | etc/codecs.conf | 39 | ||||
-rw-r--r-- | help/help_mp-en.h | 6 | ||||
-rw-r--r-- | libmpcodecs/Makefile | 9 | ||||
-rw-r--r-- | libmpcodecs/vd.c | 8 | ||||
-rw-r--r-- | libmpcodecs/vd_divx4.c | 327 | ||||
-rw-r--r-- | libmpcodecs/vd_odivx.c | 296 | ||||
-rw-r--r-- | libmpcodecs/ve.c | 4 | ||||
-rw-r--r-- | libmpcodecs/ve_divx4.c | 488 | ||||
-rw-r--r-- | libmpdemux/video.c | 4 | ||||
-rw-r--r-- | libvo/video_out.c | 1 | ||||
-rw-r--r-- | mencoder.c | 3 |
22 files changed, 9 insertions, 1954 deletions
@@ -8,6 +8,7 @@ MPlayer (1.0) Decoders: * liba52 updated to 0.7.4 (slightly faster) * SSE optimizations for mp3lib + * removed support for obsolete and non-free divx4 libraries Demuxers: * support for audio stream switching in MPEG-TS/PS, Matroska and @@ -20,6 +21,7 @@ MPlayer (1.0) MEncoder: * support of x264 encoding over lavc + * removed support for obsolete and non-free divx4 libraries Others: * SSA/ASS subtitle renderer diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1 index a2bdf7dfb9..a6ae60ce9a 100644 --- a/DOCS/man/en/mplayer.1 +++ b/DOCS/man/en/mplayer.1 @@ -3870,14 +3870,6 @@ Do not play/\:encode video. In many cases this will not work, use \-vc null \-vo null instead. . .TP -.B \-oldpp <quality> (OpenDivX only) (OBSOLETE) -Use the OpenDivX postprocessing code instead of the internal one. -Superseded by \-pp, the internal postprocessing offers better -quality and performance. -The valid range of \-oldpp values varies by codec, it is mostly -0\-6, where 0=disable, 6=slowest/\:best. -. -.TP .B \-pp <quality> (also see \-vf pp) Set the DLL postprocess level. This option is no longer usable with \-vf pp. @@ -3987,8 +3979,6 @@ See \-vc help for a full list of available codecs. .RSs .IPs "\-vc divx" Force Win32/\:VfW DivX codec, no fallback. -.IPs "\-vc divx4," -Try divx4linux codec first, then fall back on others. .IPs "\-vc -divxds,-divx," Skip Win32 DivX codecs. .IPs "\-vc ffmpeg12,mpeg12," @@ -6484,8 +6474,6 @@ Use \-ovc help to get a list of available video codecs. .RSs .IPs "\-ovc copy" no encoding, just streamcopy -.IPs "\-ovc divx4" -Encode to DivX4/\:DivX5. .IPs "\-ovc raw" Encode to an arbitrary uncompressed format (use '\-vf format' to select). .IPs "\-ovc lavc" @@ -6528,89 +6516,10 @@ syntax: .B \-<codec>opts <option1[=value],option2,...> . .PP -Where <codec> may be: lavc, xvidenc, divx4, lame, toolame, twolame, +Where <codec> may be: lavc, xvidenc, lame, toolame, twolame, nuv, xvfw, faac, x264enc, mpeg, lavf. . . -.SS divx4 (\-divx4opts) -. -DivX4 is obsolete and only supported for completeness. -For details about DivX4 options, read the source, most options are not -described here. -. -.TP -.B help\ \ \ -get help -. -.TP -.B br=<value> -Specify bitrate. -.RSs -.IPs 4\-16000 -(in kbit) -.IPs 16001\-24000000 -(in bit) -.RE -. -.TP -.B key=<value> -maximum keyframe interval (in frames) -. -.TP -.B deinterlace -Enable deinterlacing (avoid it, DivX4 is buggy). -. -.TP -.B q=<1\-5> -quality (1\-fastest, 5\-best) -. -.TP -.B min_quant=<1\-31> -minimum quantizer -. -.TP -.B max_quant=<1\-31> -maximum quantizer -. -.TP -.B rc_period=<value> -rate control period -. -.TP -.B rc_reaction_period=<value> -rate control reaction period -. -.TP -.B rc_reaction_ratio=<value> -rate control reaction ratio -. -.TP -.B crispness=<0\-100> -Specify crispness/\:smoothness. -. -.TP -.B pass=<1\-2> -With this you can encode two pass DivX4 files. -First encode with pass=1, then do another encode with the -same parameters and pass=2. -. -.TP -.B vbrpass=<0\-2> -Override the pass argument and use the XviD VBR library instead of DivX4 VBR. -Available options are: -.PD 0 -.RSs -.IPs 0 -one pass encoding (as in not putting pass on the command line) -.IPs 1 -Analysis (first) pass of two pass encoding. -The resulting AVI file can be directed to /dev/\:null. -.IPs 2 -Final (second) pass of two pass encoding. -.RE -.PD 1 -. -. .SS lame (\-lameopts) . .TP diff --git a/DOCS/xml/en/codecs.xml b/DOCS/xml/en/codecs.xml index 84b1bd5d5a..2ac51e4689 100644 --- a/DOCS/xml/en/codecs.xml +++ b/DOCS/xml/en/codecs.xml @@ -76,77 +76,6 @@ and help us add support for it. </para> -<sect2 id="divx4-5"> -<title>DivX4/DivX5</title> - -<para> -This section contains information about the DivX4 and DivX5 codecs of -<ulink url="http://www.projectmayo.com">Project Mayo</ulink>. -Their first available alpha version was OpenDivX 4.0 alpha 47 and 48. -Support for this was included in <application>MPlayer</application> in the -past, and built by default. We also used its postprocessing code to -optionally enhance visual quality of MPEG-1/2 movies. Now we use our own, -for all file types. -</para> - -<para> -The new generation of this codec is called DivX4 and can even decode -movies made with the infamous DivX codec! In addition it is much faster -than the native Win32 DivX DLLs but slower than -<systemitem class="library">libavcodec</systemitem>. -Hence its usage as a decoder is -<emphasis role="bold">discouraged</emphasis>. However, it is useful for -encoding. One disadvantage of this codec is that it is not available under an -Open Source license. -</para> - -<para> -DivX4 works in two modes: -<variablelist> -<varlistentry><term><option>-vc odivx</option></term> -<listitem><simpara> - Uses the codec in OpenDivX fashion. In this case it produces YV12 images - in its own buffer, and <application>MPlayer</application> does colorspace - conversion via libvo. (<emphasis role="bold">Fast, recommended!</emphasis>) - </simpara></listitem> -</varlistentry> -<varlistentry><term><option>-vc divx4</option></term> -<listitem><simpara> - Uses the colorspace conversion of the codec. In this mode you can use - YUY2/UYVY, too. (<emphasis role="bold">SLOW</emphasis>) - </simpara></listitem> -</varlistentry> -</variablelist> -</para> - -<para> -The <option>-vc odivx</option> method is usually faster, due to the fact -that it transfers image data in YV12 (planar YUV 4:2:0) format, thus -requiring much less bandwidth on the bus. For packed YUV modes (YUY2, UYVY) -use the <option>-vc divx4</option> method. For RGB modes the speed is the -same, differing at best according to your current color depth. -If your video output driver supports direct rendering, then <option>-vc -divx4</option> may be faster, or even the fastest solution. -</para> - -<para> -The DivX4/5 binary codec library can be downloaded from -<ulink url="http://avifile.sf.net">avifile</ulink> or -<ulink url="http://www.divx.com">divx.com</ulink> -Unpack it, run <filename>./install.sh</filename> as root and do not forget to add -<filename class="directory">/usr/local/lib</filename> to your -<filename>/etc/ld.so.conf</filename> and running <command>ldconfig</command>. -</para> - -<para> -<application>MPlayer</application> autodetects DivX4/DivX5 if it is -properly installed, just compile as usual. If it does not detect it, you -did not install or configure it correctly. -</para> - -</sect2> - - <sect2 id="ffmpeg" xreflabel="FFmpeg/libavcodec"> <title>FFmpeg/libavcodec</title> diff --git a/DOCS/xml/en/install.xml b/DOCS/xml/en/install.xml index c1aa0f6d3e..3ea2f15e4d 100644 --- a/DOCS/xml/en/install.xml +++ b/DOCS/xml/en/install.xml @@ -196,28 +196,6 @@ You need a fairly recent system. On Linux, 2.4.x kernels are recommended. <link linkend="sorenson">Sorenson video codec</link> section. </para></listitem> <listitem><para> - <emphasis role="bold">DivX4/DivX5</emphasis>: information about this codec is - available in the <link linkend="divx4-5">DivX4/DivX5</link> section. You possibly - don't want this codec as - <emphasis role="bold"><systemitem class="library">libavcodec</systemitem></emphasis> - (see above) is much faster and has better quality than this, for both decoding - and encoding. Features: - <itemizedlist> - <listitem><simpara> - one pass or two pass encoding with - <link linkend="mencoder"><application>MEncoder</application></link> - </simpara></listitem> - <listitem><simpara> - can play old <emphasis role="bold">DivX3</emphasis> movies much faster than - the Win32 DLL but slower than - <emphasis role="bold"><systemitem class="library">libavcodec</systemitem></emphasis>! - </simpara></listitem> - <listitem><simpara> - it's closed-source, and only a x86 version is available. - </simpara></listitem> - </itemizedlist> - </para></listitem> -<listitem><para> <emphasis role="bold">XviD</emphasis>: Open source encoding alternative to DivX4Linux. Features: <itemizedlist> diff --git a/cfg-common.h b/cfg-common.h index c863f4cc47..f27698b782 100644 --- a/cfg-common.h +++ b/cfg-common.h @@ -202,17 +202,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 diff --git a/cfg-mencoder.h b/cfg-mencoder.h index db0abb6340..64b821edc5 100644 --- a/cfg-mencoder.h +++ b/cfg-mencoder.h @@ -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 @@ extern m_option_t lavfopts_conf[]; 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 @@ m_option_t ovc_conf[]={ " 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 @@ m_option_t mencoder_opts[]={ // 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 @@ m_option_t mencoder_opts[]={ // 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 diff --git a/cfg-mplayer.h b/cfg-mplayer.h index 26316af6c6..55ce1d13bc 100644 --- a/cfg-mplayer.h +++ b/cfg-mplayer.h @@ -89,10 +89,6 @@ extern int enqueue; extern int guiWinID; #endif -#ifdef HAVE_ODIVX_POSTPROCESS -extern int use_old_pp; -#endif - #ifdef HAVE_XINERAMA extern int xinerama_screen; #endif diff --git a/codec-cfg.c b/codec-cfg.c index 21c3b89862..cdc0f70f52 100644 --- a/codec-cfg.c +++ b/codec-cfg.c @@ -284,11 +284,9 @@ static short get_driver(char *s,int audioflag) "null", "libmpeg2", "vfw", - "odivx", "dshow", "ffmpeg", "vfwex", - "divx4", "raw", "msrle", "xanim", @@ -260,8 +260,6 @@ Codecs: --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 @@ _vidix_external=auto _joystick=no _xvid=auto _x264=auto -_divx4linux=auto -_opendivx=no _lirc=auto _lircc=auto _gui=no @@ -1908,10 +1904,6 @@ for ac_option do --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 ;; @@ -6559,81 +6551,8 @@ else 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)" @@ -6665,29 +6584,6 @@ EOF 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" @@ -7435,10 +7331,6 @@ CONFIG_PP = yes CONFIG_MP3LAME = $_mp3lame LIBMENU = $_menu -DIVX = $_divx -OPENDIVX = $_opendivx -DIVX4ENCORE = $_divx_encore - MP3LIB = $_mp3lib LIBA52 = $_liba52 LIBMPEG2 = $_libmpeg2 @@ -7558,9 +7450,9 @@ X264_INC = $_inc_x264 X264_LIB = $_ld_x264 CONFIG_DTS = $_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 @@ -7743,16 +7635,6 @@ $_def_have_dvd -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 @@ -7768,10 +7650,6 @@ $_def_libdv /* 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 @@ -7941,9 +7819,6 @@ $_def_dvdnav_version $_def_libpostproc $_def_libpostproc_so -/* Define to include support for OpenDivx postprocessing */ -$_def_odivx_postprocess - /* Win32 DLL support */ $_def_win32 #define WIN32_PATH "$_win32libdir" diff --git a/divx4_vbr.c b/divx4_vbr.c deleted file mode 100644 index 8a4aa4fda8..0000000000 --- a/divx4_vbr.c +++ /dev/null @@ -1,406 +0,0 @@ -/* - * divx4_vbr.c - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of the Linux - * distribution for more details. - * - * 2-pass code OpenDivX port: - * Copyright (C) 2001 Christoph Lampert <gruel@gmx.de> - * - * Large parts of this code were taken from VbrControl() from the OpenDivX - * project, (C) divxnetworks, written by Eugene Kuznetsov <ekuznetsov@divxnetworks.com> - * with the permission of Darrius "Junto" Thompson, Director DivX - */ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> -#include <fcntl.h> -#include <math.h> -#include <inttypes.h> - -#include "divx4_vbr.h" - -#include "mp_msg.h" -#include "help_mp.h" - -//#include "transcode.h" - -#define FALSE 0 -#define TRUE 1 - -/* Absolute maximum and minimum quantizers used in VBR modes */ -static const int min_quantizer=1; -static const int max_quantizer=31; - -/* Limits on frame-level deviation of quantizer ( higher values - correspond to frames with more changes and vice versa ) */ -static const float min_quant_delta=-10.f; -static const float max_quant_delta=5.f; -/* Limits on stream-level deviation of quantizer ( used to make - overall bitrate of stream close to requested value ) */ -static const float min_rc_quant_delta=.6f; -static const float max_rc_quant_delta=1.5f; - -/* Crispness parameter controls threshold for decision whether - to skip the frame or to code it. */ -//static const float max_crispness=100.f; -/* Maximum allowed number of skipped frames in a line. */ -//static const int max_drops_line=0; // CHL We don't drop frames at the moment! - - -typedef struct entry_s - /* max 28 bytes/frame or 5 Mb for 2-hour movie */ - { - int quant; - int text_bits; - int motion_bits; - int total_bits; - float mult; - short is_key_frame; - short drop; - } entry; - -static int m_iCount; -static int m_iQuant; -/*static int m_iCrispness;*/ -static short m_bDrop; -static float m_fQuant; - -static int64_t m_lEncodedBits; -static int64_t m_lExpectedBits; - -static FILE *m_pFile; - -static entry vFrame; -static entry *m_vFrames; -static long lFrameStart; - -static int iNumFrames; -static int dummy; - - -void VbrControl_init_1pass_vbr(int quality, int crispness) -{ - m_fQuant=min_quantizer+((max_quantizer-min_quantizer)/6.)*(6-quality); - m_iCount=0; - m_bDrop=FALSE; - VbrControl_update_1pass_vbr(); -} - -int VbrControl_init_2pass_vbr_analysis(const char *filename, int quality) -{ - m_pFile=fopen(filename, "wb"); - if(m_pFile==0) - return -1; - m_iCount=0; - m_bDrop=FALSE; - fprintf(m_pFile, "##version 1\n"); - fprintf(m_pFile, "quality %d\n", quality); - return 0; -} - -int VbrControl_init_2pass_vbr_encoding(const char *filename, int bitrate, double framerate, int crispness, int quality) -{ - int i; - - int64_t text_bits=0; - int64_t total_bits=0; - int64_t complexity=0; - int64_t new_complexity=0; - int64_t motion_bits=0; - int64_t denominator=0; - float qual_multiplier=1.; - char head[20]; - - int64_t desired_bits; - int64_t non_text_bits; - - float average_complexity; - - m_pFile=fopen(filename, "rb"); - if(m_pFile==0) - return -1; - m_bDrop=FALSE; - m_iCount=0; - - fread(head, 10, 1, m_pFile); - if(!strncmp("##version ", head, 10)) - { - int version; - int iOldQual; - float old_qual, new_qual; - fscanf(m_pFile, "%d\n", &version); - fscanf(m_pFile, "quality %d\n", &iOldQual); - switch(iOldQual) - { - case 5: - old_qual=1.f; - break; - case 4: - old_qual=1.1f; - break; - case 3: - old_qual=1.25f; - break; - case 2: - old_qual=1.4f; - break; - case 1: - old_qual=2.f; - break; - } - switch(quality) - { - case 5: - new_qual=1.f; - break; - case 4: - new_qual=1.1f; - break; - case 3: - new_qual=1.25f; - break; - case 2: - new_qual=1.4f; - break; - case 1: - new_qual=2.f; - break; - } - qual_multiplier=new_qual/old_qual; - } - else - fseek(m_pFile, 0, SEEK_SET); - - lFrameStart=ftell(m_pFile); // save current position - -/* removed C++ dependencies, now read file twice :-( */ - - - while(!feof(m_pFile)) - { fscanf(m_pFile, "Frame %d: intra %hd, quant %d, texture %d, motion %d, total %d\n", - &iNumFrames, &(vFrame.is_key_frame), &(vFrame.quant), &(vFrame.text_bits), &(vFrame.motion_bits), &(vFrame.total_bits)); - - vFrame.total_bits+=vFrame.text_bits*(qual_multiplier-1); - vFrame.text_bits*=qual_multiplier; - text_bits +=(int64_t)vFrame.text_bits; - motion_bits += (int64_t)vFrame.motion_bits; - total_bits +=(int64_t)vFrame.total_bits; - complexity +=(int64_t)vFrame.text_bits*vFrame.quant; - -// printf("Frames %d, texture %d, motion %d, quant %d total %d ", -// iNumFrames, vFrame.text_bits, vFrame.motion_bits, vFrame.quant, vFrame.total_bits); -// printf("texture %d, total %d, complexity %lld \n",vFrame.text_bits,vFrame.total_bits, complexity); - } - 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); -// } - - m_vFrames = malloc(iNumFrames*sizeof(entry)); - if (!m_vFrames) - { mp_msg(MSGT_FIXME, MSGL_FIXME,MSGTR_OutOfMemory); - return -2; //TC_EXPORT_ERROR; - } - - fseek(m_pFile, lFrameStart, SEEK_SET); // start again - - for (i=0;i<iNumFrames;i++) - { fscanf(m_pFile, "Frame %d: intra %hd, quant %d, texture %d, motion %d, total %d\n", - &dummy, &(m_vFrames[i].is_key_frame), &(m_vFrames[i].quant), - &(m_vFrames[i].text_bits), &(m_vFrames[i].motion_bits), - &(m_vFrames[i].total_bits)); - - m_vFrames[i].total_bits += m_vFrames[i].text_bits*(qual_multiplier-1); - m_vFrames[i].text_bits *= qual_multiplier; - } - - if (m_pFile) - { fclose(m_pFile); - m_pFile=NULL; - } - - desired_bits=(int64_t)bitrate*(int64_t)iNumFrames/framerate; - non_text_bits=total_bits-text_bits; - - if(desired_bits<=non_text_bits) - { -/* char s[200];*/ - mp_msg(MSGT_FIXME, MSGL_FIXME, MSGTR_OverridingTooLowBitrate, - (float)(non_text_bits*framerate/(int64_t)iNumFrames)); - - desired_bits=non_text_bits*3/2; -/* - m_fQuant=max_quantizer; - for(int i=0; i<iNumFrames; i++) - { - m_vFrames[i].drop=0; - m_vFrames[i].mult=1; - } - VbrControl_set_quant(m_fQuant); - return 0; -*/ - } - - desired_bits -= non_text_bits; - /** - BRIEF EXPLANATION OF WHAT'S GOING ON HERE. - We assume that - text_bits=complexity / quantizer - total_bits-text_bits = const(complexity) - where 'complexity' is a characteristic of the frame - and does not depend much on quantizer dynamics. - Using this equation, we calculate 'average' quantizer - to be used for encoding ( 1st order effect ). - Having constant quantizer for the entire stream is not - very convenient - reconstruction errors are - more noticeable in low-motion scenes. To compensate - this effect, we multiply quantizer for each frame by - (complexity/average_complexity)^k, - ( k - parameter of adjustment ). k=0 means 'no compensation' - and k=1 is 'constant bitrate mode'. We choose something in - between, like 0.5 ( 2nd order effect ). - **/ - - average_complexity=complexity/iNumFrames; - - for(i=0; i<iNumFrames; i++) - { - float mult; - if(m_vFrames[i].is_key_frame) - { - if((i+1<iNumFrames) && (m_vFrames[i+1].is_key_frame)) - mult=1.25; - else - mult=.75; - } - else - { - mult=m_vFrames[i].text_bits*m_vFrames[i].quant; - mult=(float)sqrt(mult/average_complexity); - -// if(i && m_vFrames[i-1].is_key_frame) -// mult *= 0.75; - if(mult<0.5) - mult=0.5; - if(mult>1.5) - mult=1.5; - } - - m_vFrames[i].mult=mult; - m_vFrames[i].drop=FALSE; - new_complexity+=m_vFrames[i].text_bits*m_vFrames[i].quant; |