⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme

📁 mpeng Lib
💻
字号:
                             The MPEG Library                               Version 1.3.1                              8 August, 1999MPEG decoding engine (c) 1992 The Regents of the University of CaliforniaFront end (c) 1994-99 Gregory P. Ward (gward@python.net)The MPEG Library is a collection of C routines to decode MPEG-1 videostreams to a variety of colour schemes.  Most of the code in the librarycomes directly from an old version of the Berkeley MPEG player,"mpeg_play", an X11-specific implementation that worked fine butsuffered from minimal documentation and a lack of modularity.  A frontend to the Berkeley decoding engine was developed by Greg Ward at theMontreal Neurological Institute in May/June 1994 to facilitate thedevelopment of an MPEG player specifically for Silicon Graphicsworkstations; the decoding engine together with the MNI front endconstitute the MPEG Library.AVAILABILITY============Both the above-mentioned SGI-specific MPEG player (glmpeg_play) andthe MPEG Library itself are available from   ftp://ftp.bic.mni.mcgill.ca/pub/mpeg/as well as from the MPEG Library home page at   http://starship.python.net/~gward/mpeglib/The original Berkeley decoder is available at   ftp://mm-ftp.cs.berkeley.edu/pub/multimedia/mpeg/play/A great many other MPEG goodies (another encoder, sample MPEG files,etc.) can also be found on this FTP site -- good hunting ground for thebudding MPEG hacker.BUILDING THE LIBRARY (Unix)===========================The MPEG Library comes with a GNU-style configure script, meaning thatbuilding it should be a simple matter:    ./configure    makeNote that you must have an ANSI-compliant compiler to build the library.In general, you should use the same compiler on all code that is to belinked together; this means that (for example), compiling (say) the GIMPwith compiler X (ANSI compliant or not), and then linking with an MPEGlibrary built with compiler Y, is just asking for trouble.The configure script does make a good effort to find an ANSI-compliantcompiler.  The default is to use gcc, or cc if that's not found.  If gccis not found and cc is not ANSI-compliant, configure then takes a chanceand looks for acc -- the alternative ANSI compiler provided by Sun (at aprice).  (Of course, this is probably only meaningful on Sun platforms.)If none of these are found, configure crashes -- you'll have to run itagain, telling it the name of the compiler to use (see below for how todo this).Customizing the configuration-----------------------------You can set a number of environment variables before running `configure'to customize its operation.  All of them customize the pre-processing,compilation, and linking stages:   CC            C compiler to use   OPTIMIZE      compiler optimization/debugging flags   EXTRA_CFLAGS  any other compiler flags to use   INCLUDE_DIRS  -I flags for the pre-processor   DEFINES       -D or -U flags for the pre-processor   EXTRA_LDFLAGS extra linker flags to use when building the                  standalone executables (mpegtest and easympeg)For instance, on an SGI system, you might wish to use cc instead of gcc(SGI's compiler generally compiles a lot faster than gcc, and generatesslightly faster code.)  You could then run `configure' as follows:   CC=cc ./configure(That's assuming a Bourne-style shell, such as sh, zsh, ksh, or bash.For C-shell and descendents, use "env CC=cc ./configure".)Or you might need to specify extra flags to put your compiler into ANSImode; this is necessary on some versions of HP-UX as follows:   CC=cc EXTRA_CFLAGS=-Aa ./configureOr if your compiler is broken and generates bad code with -O2 (thedefault), you could tone down or turn off optimization:   OPTIMIZE=-O0 ./configureCustomizing the build---------------------All of the variables above can also be overridden at build time, e.g.   make CC=gcc EXTRA_CFLAGS=-Wallto use gcc and make it emit lots of warnings.  It's generally better todo the overriding at configure time, so that `configure' uses the sameflags for compiling test cases as you'll be using to compile thelibrary.Build targets-------------The default behaviour when you run "make" (or "make all") is to buildthe library plus whatever standalone executables are supported on yoursystem.  Source for the standlone executables lives in the `extras/'subdirectory.  The simple test program `mpegtest' is always built; itjust decodes an MPEG stream, optionally computing a checksum of eachdecoded frame.On IRIX systems (SGI workstations), you will also get `easympeg', asimple MPEG player that works under GL.  This is provided solely as anexample of how little code is needed to make a working MPEG player withthe MPEG Library; if you're interested in a full-blown MPEG player forSGI workstations, take a look at my glmpeg_play (available fromftp://ftp.bic.mni.mcgill.ca/pub/mpeg/).If you want to skip building these standalone executables, just run"make lib".Nit-picking optimizations-------------------------If you are building the library *exclusively* for use with a larger programthat takes care of all colour conversion tasks (such as the GIMP), then youcan save a bit of code size by omitting most of the colour conversion codesupplied with the library.  In this case, just run   ./configure --disable-ditherand you will build a reduced version of the library.  This is notnecessary to compile or link successfully -- it'll just save a littlespace.Note that this will result in a version of the library with reducedfunctionality; only do it if your sole purpose in building the library isto link it statically into a larger program (such as the GIMP) that takescare of colour conversion itself.BUILDING THE LIBRARY (Windows)==============================Starting with version 1.3.1, the MPEG Library should build under Windowsas well as Unix, using either Borland C++ 5.4 or Microsoft Visual C++6.0.  Thanks to George Yohng <yohng@dosware.8m.com> for providing theWindows port.Separate batch files are supplied for each compiler; if you're usingBorland C++, just run   build_bcwhich will create a single library file (mpegbc.lib) in the "lib"subdirectory.  For Visual C++, run   build_msvcwhich will create three library files in the "lib" subdirectory.  The threeversions of the library are:   mpegc.lib    - for single-threaded applications   mpegcmt.lib  - for multi-threaded applications   mpegcrt.lib  - for applications which use the dynamically loadable                  run-time library (msvcrt.dll)HOW TO USE THE LIBRARY======================There is a short but (hopefully) complete document in the "doc/"subdirectory of the MPEG Library distribution.  This is supplied inboth PostScript form and as LaTeX 2e source.  Comments and suggestionson the documentation are welcome.PROBLEMS?=========Anyone who has problems under Unix with configuring or compiling theMPEG Library, or linking it with other software, should contact me(gward@python.net).If you have problems with compiling or linking with the library underWindows, please contact George Yohng <yohng@dosware.8m.com>, since heprovided the Windows port and batch files.Problems with using the library (coredumps, memory leaks, and otherbugs; or misunderstood documentation) should first be dealt with byre-reading the documentation, and then by reading the source code.If, after carefully reading the documentation, conducting rigorousexperiments to isolate the source of the problem, and inspecting therelevant source code, you *still* can't figure out what's going on,contact me at gward@python.net.  I will ask if you have read thedocumentation, conducted experiments, and checked the source code,remind you that the library is unsupported free software, and gratefullyaccept a patch to fix any problems you may have found.EXAMPLES AND TESTING====================For a very simple MPEG player that uses the SGI Graphics Library todisplay frames, take a look at easympeg.c, included in the "extras/"subdirectory of this distribution.  (If you configured and built thelibrary on an SGI platform, easympeg should have been automaticallybuilt for you.)  Even if you don't have an SGI, the source code can beinstructive -- the calls to GL functions are not too intrusive, and nottoo hard to figure out either.  Also, it ought to be possible to convertthis program to OpenGL for improved portability.There is also a simple, portable (across Unix versions) program to testthe Library: extras/mpegtest.c.  It is similar in structure to easympeg,but with all display-related code removed, and with the addition of codeto time the playback and to compute simple image checksums.  The timingcode may be of interest (eg. to answer questions such as "Can I achievea playback rate of X on platform Y?" or "How much faster will playbackbe if I decode to shades of gray instead of full 24-bit colour?"), andthe checksum code provides a way to ensure that the library returnsidentical results across platforms (which is currently *not* the case,for reasons unknown to me).  Run "mpegtest <mpegfile>" to just gettiming information on the MPEG in <mpegfile>; add the "-checksum" optionto get checksum information; add "-dither <mode>" to try out variousdithering modes.  The possible values of <mode> are: "hybrid","hybrid2", "fs4", "fs2", "fs2fast", "2x2", "gray", "fullcolor", "none","ordered", "mono", "mono_threshold", "ordered2", and "mbordered".A tiny MPEG stream, test.mpg, is included with the distribution.  Youcan try mpegtest and easympeg on it, but don't expect perfection; forone thing, the library does *not* give identical results acrossplatforms, so the results of running "easympeg -checksum" will not beconsistent.I have also written glmpeg_play, a full-fledged MPEG player for SGIplatfoms (with frame-buffering, interactive controls, dynamic zooming,etc.).  It is available via anonymous ftp as explained above.FUTURE DIRECTIONS=================None planned, many required.  The MPEG Library is based on anout-of-date version of the Berkeley X11 MPEG player ("mpeg_play"), andshould be updated to the latest version of mpeg_play.  The currentversion is heavily dependent on global variables -- thus it's not evenremotely thread-safe, and you can't interleave the decoding of twostreams.  This is definitely not desirable, and could be fixed bycatching up with mpeg_play.  The MPEG Library should be restructured sothat it is easier to keep in sync with the Berkeley code in future.  Allexternal identifiers should be renamed to avoid conflict with othercode, and the interface revamped to be clearer, more consistent, andmodular for multi-threaded code and interleaved decoding of multiplestreams.  The library should probably be renamed to make it clear thatit only handles decoding of MPEG-1 video streams (there's a lot more tothe MPEG world now than there was in 1994).However, none of this will happen unless others step in to fill thebreach.  I have little to no interest in multimedia or desktop video,and do not intend to devote any significant time or energy tomaintaining the MPEG Library.  (This is entirely consistent -- it has,after all, taken me nearly three years to get this minor bugfix releaseout!)  So: if you *are* interested in seeing an open-source, documentedlibrary for decoding MPEG video streams become a better, morewidely-available and used thing, then please get in touch with me.  I'dlove to hand this code over to someone willing and able to look afterit.Late-breaking news: I just discovered the MPEG Software SimulationGroup's (MSSG) free MPEG-2 codec (that's "coder/decoder", ifyou're not up on your MPEG jargon).  This looks like what the MPEGLibrary should grow up to be if there was anyone to grow it.  I'llcontinue to release bug fixes to the MPEG Library, but I stronglysuggest that anyone writing new MPEG code should at least look at theMSSG's work:   http://www.mpeg.org/MPEG/MSSG/ACKNOWLEDGEMENTS================Thanks to:  * John Cristy for making the MPEG Library an optional add-on to    ImageMagick, providing me with more free publicity (and lots of    traffic on our ftp site!) than I could have imagined, and for    suggesting some important fixes early on  * Magnus Heldestat for providing patches to speed up full-colour    dithering  * Andrew Kuchling for extensive testing of beta versions of 1.2 on a    variety of Unix platforms  * Adam Moss for writing the mpeg plug-in for the GIMP, causing yet    more demand for the library  * George Yohng for porting the library to WindowsCOMPLETE LACK OF WARRANTY=========================This software is supplied without even the faintest shred of assurancethat it works in its entirety.  Copyright (c) 1994-99 by Gregory P. Ward.All rights reserved.This file is part of the MNI front end of the Berkeley MPEG decoder.Permission to use, copy, modify, and distribute this software and itsdocumentation for any purpose, without fee, and without written agreement ishereby granted, provided that the above copyright notice and the followingtwo paragraphs appear in all copies of this software.IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT,INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUTOF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THEUNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OFSUCH DAMAGE.THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUTNOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY ANDFITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDERIS ON AN "AS IS" BASIS, AND THE AUTHOR HAS NO OBLIGATION TO PROVIDEMAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.  Please drop me a line if you use the MPEG Library, either successfullyor not.  And if you use it unsuccessfully and find a nice, easy fix,do please let me know about it!  My email address isgward@python.net.$Id: README,v 1.9 1999/08/09 00:33:38 greg Rel $

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -