diff --git a/HACKING b/HACKING index 9a94f03b..5196b8dc 100644 --- a/HACKING +++ b/HACKING @@ -3,22 +3,20 @@ First, see the file STYLEGUIDE ************************************************************************ TESTING ======= -If you make changes, please test. There is a python -script in the test/ directory which will compare two versions -of lame using a bunch of CBR and ABR options. To run this -script, copy your favorite (and short!) wav file to the -lame/test directory, and run: + +If you make changes, please test. There is a python script in the test/ +directory which will compare two versions of lame using a bunch of CBR +and ABR options. To run this script, copy your favorite (and short!) wav +file to the lame/test directory, and run: % cd lame/test % ./lametest.py [-w] CBRABR.op castanets.wav lame_orig lame_new - - - ************************************************************************ LAME API +======== For a general outline of the code, see the file API. Also, frontend/main.c is a simple front end to libmp3lame.a @@ -35,13 +33,13 @@ lame_encode_frame_mp3(): iteration_loop() choose scalefactors (via iteration) which determine noise shapping, and choose best huffman tables for lossless compression - format_bitstream format the bitstream. when data+headers are complete, output to internal bit buffer. copy_buffer() copy internal bit buffer into user's mp3 buffer ************************************************************************ ADDING NEW OPTIONS +================== control variable goes in lame_global_flags struct. Assume the variable is called 'new_variable'. @@ -65,28 +63,27 @@ of the API). ************************************************************************ - THREADSAFE: +=========== -Lame should now be thread safe and re-entrant. -The only problem seems to be some OS's allocate small -stacks (< 128K) to threads launched by applications, and this -is not enough for LAME. Fix is to increase the stack space, -or move some of our automatic variables onto the heap with -by using bug-prove malloc()'s and free(). - +Lame should now be thread safe and re-entrant. The only problem seems to +be some OS's allocate small stacks (< 128K) to threads launched by +applications, and this is not enough for LAME. Fix is to increase the +stack space, or move some of our automatic variables onto the heap with +by using bug-proof malloc()'s and free(). ************************************************************************ Global Variables: +================= -There are two types of global variables. All data in -both structs is initialized to zero. +There are two types of global variables. All data in both structs is +initialized to zero. 1. lame_global_flags *gfp -These are input parameters which are set by the calling program, -and some information which the calling program may be interested in. +These are input parameters which are set by the calling program, and some +information which the calling program may be interested in. This struct instantiated by the call to lame_init(). diff --git a/INSTALL b/INSTALL index f0077aef..ee0b544a 100644 --- a/INSTALL +++ b/INSTALL @@ -15,17 +15,15 @@ mp3x A GTK based graphical MP3 frame analyzer. For debugging, lame_enc.dll a Windows DLL used by many GUIs which support lame. (Can only be compiled by MSVC???) - -lame.acm a Windows ACM codec which can be used by - many windows programs, and any directshow program. - See MSVC project files in ACM directory. - Right click on lame.inf to install. +lame.acm *** DEPRECATED *** + a Windows ACM codec which can be used by many windows programs, + and any directshow program. See MSVC project files in ACM + directory. Right click on lame.inf to install. lame_enc.dshow a Windows direct show filter for lame. Potentially has more flexability than the ACM codec, but code needs some work. See MSVC project files in dshow directory - libmp3lame.a the static encoding library used by all platforms, required by all the above targets. @@ -33,24 +31,21 @@ libmp3lame.a the static encoding library used by all platforms, required libmp3lame.so shared version of libmp3lame.a for *NIX platforms - -The following compile time options can be used. For libmp3lame.a -and lame_enc.dll, none are required. On non-unix systems, -these options must be set in config.h or in the IDE. +The following compile time options can be used. For libmp3lame.a and +lame_enc.dll, none are required. On non-unix systems, these options must +be set in config.h or in the IDE. On unix systems, they are set via ./configure. #define HAVE_MPGLIB compile in mpglib's mp3 *decoding* capibility #define HAVE_VORBIS compile in Vorbis decoding capibility (you need libvorbis already built) -#define NOANALYSIS do not compile in hooks used by the - MP3 frame analyzer. - +#define NOANALYSIS do not compile in hooks used by the + MP3 frame analyzer. Options for the command line encoder: -#define LIBSNDFILE to use Erik de Castro Lopo's libsndfile - for input. - +#define LIBSNDFILE to use Erik de Castro Lopo's libsndfile + for input. ======================================================================= @@ -59,7 +54,7 @@ Building the software on *NIX platforms using configure: Run the following commands: % ./configure -% make +% make % make install For a complete list of options, try "./configure --help" @@ -76,8 +71,9 @@ For the encoding library: For the LAME front end encoder: --with-fileio=lame Use lame's internal file io routines [default] - =sndfile Use Erik de Castro Lopo's libsndfile - (Supports many more input formats, but no stdin possible currently) + =sndfile Use Erik de Castro Lopo's libsndfile (Supports + many more input formats, but no stdin possible + currently) --with-sndfile-prefix=DIR Alternate location for libsndfile (if --with-fileio=sndfile) @@ -139,15 +135,13 @@ Building the software on *NIX platforms without configure: % make -f Makefile.unix - ======================================================================= Building the software on Windows with MSVC: -(or MSVC + 3rd party C compiler) +(or MSVC + 3rd party C compiler such as ICL) ======================================================================= -There are MSVC project files, and a Makefile.MSVC included -with the project. For production use, be sure to compile -a "Release" target, with the "maximum speed" compile -option, and #define NDEBUG. +There are MSVC project files, and a Makefile.MSVC included with the +project. For production use, be sure to compile a "Release" target, +with the "maximum speed" compile option, and #define NDEBUG. It is possible to compile the GTK frame analyzer under windows, see README.WINGTK @@ -166,15 +160,11 @@ Project files for the dll, ACM codec and directshow filter seem to be in better sahpe. - - - - ======================================================================= Building the software on Windows with free compilers: ======================================================================= -LAME can be compiled with various Windows MSDOS ports (all free) -of GCC (DJGPP, Mingw32). See README.DJGPP. +LAME can be compiled with various Windows ports (all free) of GCC (DJGPP, +Mingw32). See README.DJGPP. For Mingw32, you should now be able to use the Unix Makefile that comes with LAME. Try: "make -f Makefile.unix UNAME=MSDOS" @@ -202,5 +192,3 @@ Can DJGPP or Mingw32 produce lame_enc.dll? Various build options can be set in configMS.h - - diff --git a/LICENSE b/LICENSE index 790a7b9e..430a6a0e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,7 @@ Can I use LAME in my commercial program? -Yes, you can, under the restrictions of the LGPL. The easiest -way to do this is to: +Yes, you can, under the restrictions of the LGPL (see COPYING +in this folder). The easiest way to do this is to: 1. Link to LAME as separate library (libmp3lame.a on unix or lame_enc.dll or libmp3lame.dll on windows) diff --git a/README b/README index bd3ea8fb..77c6c47a 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ LAME 3.xx LAME Ain't an MP3 Encoder - http://lame.sf.net - May 2011 + http://lame.sf.net + May 2011 Originally developed by Mike Cheng (www.uq.net.au/~zzmcheng) and was latter developed by Mark Taylor (www.mp3dev.org). Currently maintained @@ -33,7 +33,7 @@ There is HTML documentation and a man page in the doc directory. ============================================================================ -LAME uses the MPGLIB decoding engine, from the MPG123 package, written +LAME uses the MPGLIB decoding engine, from the mpg123 package, written by: Michael Hipp (www.mpg123.de) MPGLIB is released under the GPL. Copyrights (c) 1999-2011 by The LAME Project diff --git a/README.WINGTK b/README.WINGTK index 1ec1cc77..826f1553 100644 --- a/README.WINGTK +++ b/README.WINGTK @@ -1,4 +1,4 @@ - Installation notes on MP3X (the LAME frame analyzer) for WIN32 + Installation notes on MP3X (the LAME frame analyzer) for WIN32 =========================================================================== Document History: @@ -30,7 +30,7 @@ You first need to get hold of the latest GTK and GLIB include files and lib files. You can download them freely from the WINGTK project WEB site. (see http://www.gtk.org, and click on the WINGTK link.) -Download: glib-dev-VERSION.zip, gtk+-dev-VERSION.zip and extralibs-dev-VERSION.zip +Download: glib-dev-VERSION.zip, gtk+-dev-VERSION.zip and extralibs-dev-VERSION.zip where VERSION indicates the release data, so it will look something like 20000805 unzip all three zip files in a WinGTK subdirectory, which is created from the lame @@ -43,15 +43,12 @@ You will end up with the following directory tree Set Mp3x as your current active project, recompile everything, and you're done. - =========================================================================== How to run and use the MP3 Frame analyzer =========================================================================== -To run MP3x.exe, you need -the GTK DLL files: Either instal them on your system, -or put them in the same directory as mp3x.exe resides. - +To run MP3x.exe, you need the GTK DLL files: Either instal them on your system, +or put them in the same directory mp3x.exe resides. Example: @@ -60,8 +57,4 @@ mp3x.exe myfile myfile can be a mp3 file, or a wav file. - === End of Document === - - - diff --git a/TODO b/TODO index 33d95751..dbd04b34 100644 --- a/TODO +++ b/TODO @@ -1,162 +1,138 @@ -1. bug in resample code: downsampling from 44101 to 44100 causes - a seg fault. Workaround in place for now: resampling disabled - if input/output samplerates agree to 4 digits. - +1. bug in resample code: downsampling from 44101 to 44100 causes + a seg fault. Workaround in place for now: resampling disabled + if input/output samplerates agree to 4 digits. 2. high bitrate encodings have trouble on some hardware players. -Track this down. Probably caused by --strictly-enforce-ISO and -IXMAX_VAL. Try setting IXMAX_VAL back to 8191 and/or -maxmp3buf=8*960 to see if there is a working combination. + Track this down. Probably caused by --strictly-enforce-ISO and + IXMAX_VAL. Try setting IXMAX_VAL back to 8191 and/or + maxmp3buf=8*960 to see if there is a working combination. -note: one of the decoder bugs was identified. It is caused by using -different block sizes on both channels. A parameter need to be -added to Lame to handle workarounds. + note: one of the decoder bugs was identified. It is caused by using + different block sizes on both channels. A parameter need to be + added to Lame to handle workarounds. -3 frontend: code is a complete mess. But it has so many debugged - features it will be a lot of work to re-write. +3 frontend: code is a complete mess. But it has so many debugged + features it will be a lot of work to re-write. -4. MSVC project files. It would be nice to create a working - MSVC6 workspace, which included all the projects as possible - targets: +4. MSVC project files. It would be nice to create a working + MSVC6 workspace, which included all the projects as possible + targets: lame.exe mp3x.exe (require GTK libs) lame_enc.dll ACM codec directshow codec - I think the only MSVC5 project that we need to preserve is - for lame_enc.dll, since Albert Faber (still?) doesn't use VC6? - But no reason we cant have VC5 and VC6 project files for the dll. - - - - + I think the only MSVC5 project that we need to preserve is + for lame_enc.dll, since Albert Faber (still?) doesn't use VC6? + But no reason we cant have VC5 and VC6 project files for the dll. -5. -NOGAP encoding: +5. NOGAP encoding: --nogap: more testing, fix options, test id3 tags? -Can we change id3 tags without reseting the encoder?? -At the end of encoding 1.wav, call lame_get_mf_samples_to_encode() -to find the number of non encoded buffered PCM samples. Then -encode samples from 2.wav until these PCM samples have been -encoded, *THEN* call lame_encode_flush_nogap() and close -out file 1.mp3. + -nogap: more testing, fix options, test id3 tags? + Can we change id3 tags without reseting the encoder?? + At the end of encoding 1.wav, call lame_get_mf_samples_to_encode() + to find the number of non encoded buffered PCM samples. Then + encode samples from 2.wav until these PCM samples have been + encoded, *THEN* call lame_encode_flush_nogap() and close + out file 1.mp3. + + + NOGAP decoding: + lame --decode --nogap file1.mp3 file2.mp3 file3.mp3 + should also work. What needs to be done: + get_audio.c: We need a way to open a second mp3 file, without + calling lame_decode_init() and reinitializing mpglib. + And the mpglib needs to know to look for new Xing + tags at the beginning of file2.mp3 and file3.mp3. -NOGAP decoding: -lame --decode --nogap file1.mp3 file2.mp3 file3.mp3 -should also work. What needs to be done: -get_audio.c: We need a way to open a second mp3 file, without - calling lame_decode_init() and reinitializing mpglib. - And the mpglib needs to know to look for new Xing - tags at the beginning of file2.mp3 and file3.mp3. +6. Does stdin work when LAME is compiled to use libsndfile? + (new version of libsndfile will support this - try this out) + + +7. LAME has problems with pure DC input. i.e. a square wave with + a frequency well below 20 Hz. Not very important, but it should + be fixed. + + +8. mgplib has bugs with i-stereo. flag denoting invalid + i-stereo value (= frame is m/s stereo) is not correct. + + +9. lowpass filter: for M/S stereo, use more filtering for the side + channel, less filtering for mid channel. We need to first replace + the polyphase filter with an FIR lowpass filter with finer frequency + resolution before implementing this. + + +10. LAME has a 31 point FIR filter used for resampling, which + can also be used as a lowpass. When resampling is done, + use that filter to also lowpass instead of the polyphase filter. + + +11. Even when resampling is not needed, should we use an FIR filter + for the lowpass? If it is not too much slower, yes. If it + is slower, then it should be an option since it will produce + higher quality. + + +12. We should consider moving the experts options from the *long + help* text into an *experts only* help text. The average Joe gets + knocked down by the huge number of possibilities to setup lame. -6. -Does stdin work when LAME is compiled to use libsndfile? -(new version of libsndfile will support this - try this out) - - -7. -LAME has problems with pure DC input. i.e. a square wave with -a frequency well below 20 Hz. Not very important, but it should -be fixed. - - -8. -mgplib has bugs with i-stereo. flag denoting invalid -i-stereo value (= frame is m/s stereo) is not correct. - -9. -lowpass filter: for M/S stereo, use more filtering for the side -channel, less filtering for mid channel. We need to first replace -the polyphase filter with an FIR lowpass filter with finer frequency -resolution before implementing this. - -10. -LAME has a 31 point FIR filter used for resampling, which -can also be used as a lowpass. When resampling is done, -use that filter to also lowpass instead of the polyphase filter. - -11. -Even when resampling is not needed, should we use an FIR filter -for the lowpass? If it is not too much slower, yes. If it -is slower, then it should be an option since it will produce -higher quality. - -12. -We should consider moving the experts options from the *long -help* text into an *experts only* help text. The average Joe gets -knocked down by the huge number of possibilities to setup lame. +50. Better tonality estimation. + Gpsycho uses predictability, and so needs a delay to detect the tonality + of a sound. + Nspsytune seems to miss tonals when several of them are too narrow. + We would probably need the best of both. +60. Different ATH handling for sfb21. We are using the minimum value of ath + in each whole sfb. in sfb21 this leads to very high bitrates. + We could perhaps use 2 or 3 ath partitions in sfb21 -50. -Better tonality estimation. -Gpsycho uses predictability, and so needs a delay to detect the tonality -of a sound. -Nspsytune seems to miss tonals when several of them are too narrow. -We would probably need the best of both. + note: partially done - -60. -Different ATH handling for sfb21. We are using the minimum value of ath -in each whole sfb. in sfb21 this leads to very high bitrates. -We could perhaps use 2 or 3 ath partitions in sfb21 - -note: partially done +70. Use mixed blocks. -70. -Use mixed blocks. +90. Use intensity stereo. This is a must-have for low bitrates, but if the + algorythm is very good it could also be used in every case. + Note: mpg123 (and all derivatives, like xmms and lame/mpglib) + have bugs in the intensity stereo decoding. Bugs have been there + for years since there are very few intensity stereo mp3's out there. - -90. -Use intensity stereo. This is a must-have for low bitrates, but if the -algorythm is very good it could also be used in every case. -Note: mpg123 (and all derivatives, like xmms and lame/mpglib) -have bugs in the intensity stereo decoding. Bugs have been there -for years since there are very few intensity stereo mp3's out there. +95. Merge GOGO's fast assembler routines. - - -998. -Merge GOGO's fast assembler routines. +96. It would be nice to save some information whilst encoding + a: wave -> mp3 + a RIFF/wave can contain LIST chunks with information + about author, title, etc. + ==> could go into TAG fields of resulting mp3 + b: mp3 -> mp3 + ==> we could copy the TAG directly + c: mp3 -> wave + ==> copy TAG into LIST chunk - -999. -It would be nice to save some information whilst encoding -a: wave -> mp3 - a RIFF/wave can contain LIST chunks with information - about author, title, etc. - ==> could go into TAG fields of resulting mp3 -b: mp3 -> mp3 - ==> we could copy the TAG directly -c: mp3 -> wave - ==> copy TAG into LIST chunk +97. Integrate plusV extensions -1500. -Integrate plusV extensions - - - -2000. -To be able to encode as fast as FastEnc \ No newline at end of file +99. To be able to encode as fast as FastEnc