| 1 |
<html> |
| 2 |
<head> |
| 3 |
<title>TooLAME: MPEG 1/2 Layer II Audio Encoder</title> |
| 4 |
<style> |
| 5 |
<!-- BODY { BACKGROUND: #FFFFFF; COLOR: #000000; FONT-SIZE: 10pt; FONT-FAMILY: verdana, sans-serif } |
| 6 |
A { COLOR: #111177; TEXT-DECORATION: none } |
| 7 |
TD { font-size: medium; font-weight:normal } |
| 8 |
--!> |
| 9 |
</STYLE> |
| 10 |
</head> |
| 11 |
<body> |
| 12 |
<table border = 0 width="75%" align="center"><tr><td> |
| 13 |
|
| 14 |
<h2>tooLAME - an optimized mpeg 1/2 layer 2 audio encoder</h2> |
| 15 |
Copyright (C) 2002, 2003 Michael Cheng [mikecheng at NOT planckenergy com] remove the NOT |
| 16 |
http://www.planckenergy.com/</p> |
| 17 |
|
| 18 |
<h2>Contents</h2> |
| 19 |
<UL> |
| 20 |
<LI> LGPL |
| 21 |
<LI> Introduction |
| 22 |
<LI> Usage |
| 23 |
<LI> Examples |
| 24 |
<LI> Contributors |
| 25 |
<LI> References |
| 26 |
</UL> |
| 27 |
|
| 28 |
<h2>LGPL</h2> |
| 29 |
<pre> |
| 30 |
All changes to the ISO source are licensed under the LGPL |
| 31 |
(see LGPL.txt for details) |
| 32 |
|
| 33 |
tooLAME is free software; you can redistribute it and/or |
| 34 |
modify it under the terms of the GNU Lesser General Public |
| 35 |
License as published by the Free Software Foundation; either |
| 36 |
version 2.1 of the License, or (at your option) any later version. |
| 37 |
|
| 38 |
tooLAME is distributed in the hope that it will be useful, |
| 39 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 40 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 41 |
Lesser General Public License for more details. |
| 42 |
|
| 43 |
You should have received a copy of the GNU Lesser General Public |
| 44 |
License along with tooLAME; if not, write to the Free Software |
| 45 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 46 |
</pre> |
| 47 |
|
| 48 |
<h2>Introduction</h2> |
| 49 |
|
| 50 |
tooLAME is an optimized Mpeg Audio 1/2 Layer 2 encoder. It is based heavily on |
| 51 |
<UL> |
| 52 |
<LI>the ISO dist10 code |
| 53 |
<LI>improvement to algorithms as part of the LAME project (www.sulaco.org/mp3) |
| 54 |
<LI>work by myself and other contributors (see CONTRIBUTORS) |
| 55 |
</ul> |
| 56 |
<h2>Installation</h2> |
| 57 |
<OL> |
| 58 |
<LI> edit Makefile (at least change the architecture type [ARCH] to suit your machine) |
| 59 |
<LI> 'make' |
| 60 |
</ol> |
| 61 |
|
| 62 |
<h2>Usage</h2> |
| 63 |
|
| 64 |
<pre> |
| 65 |
./toolame [options] [input file] [output file] |
| 66 |
|
| 67 |
Input File |
| 68 |
tooLAME parses AIFF and WAV files for file info |
| 69 |
raw PCM is assumed if no header is found |
| 70 |
for stdin use a - |
| 71 |
|
| 72 |
Output File |
| 73 |
file is automatically renamed from *.* to *.mp2 |
| 74 |
for stdout use a - |
| 75 |
|
| 76 |
Input Options |
| 77 |
-s [int] |
| 78 |
if inputting raw PCM sound, you must specify the sample rate |
| 79 |
default sample rate is 44.1khz. |
| 80 |
|
| 81 |
-a |
| 82 |
downmix from stereo to mono |
| 83 |
if the incoming file is stereo, combine the audio into |
| 84 |
a single channel |
| 85 |
|
| 86 |
-x |
| 87 |
force byte-swapping of the input. (current endian detection is dodgy, |
| 88 |
so if toolame produces only noise, use -x ) |
| 89 |
|
| 90 |
-g |
| 91 |
swap the LR channels of a stereo file |
| 92 |
|
| 93 |
Output Options |
| 94 |
-m [char] |
| 95 |
the encoding mode (default 'j') |
| 96 |
's' stereo |
| 97 |
'd' dual channel |
| 98 |
'j' joint stereo |
| 99 |
'm' mono |
| 100 |
|
| 101 |
-p [int] |
| 102 |
which psy model to use (default '1') |
| 103 |
Different models for the psychoacoustics |
| 104 |
Models: -1 to 4 |
| 105 |
|
| 106 |
-b [int] |
| 107 |
the total bitrate |
| 108 |
For 48/44.1/32kHz default = 192 |
| 109 |
For 24/22.05/16kHz default = 96 |
| 110 |
|
| 111 |
-v [int] |
| 112 |
Switch on VBR mode. |
| 113 |
The higher the number the better the quality. |
| 114 |
Useful range -10 to 10. |
| 115 |
See README.VBR for details. |
| 116 |
|
| 117 |
|
| 118 |
Operation |
| 119 |
-f |
| 120 |
fast mode turns off calculation of the psychoacoustic model. |
| 121 |
Instead a set of default values are assumed |
| 122 |
|
| 123 |
-q [int] |
| 124 |
quick mode calculates the psy model every 'num' frames. |
| 125 |
|
| 126 |
Misc |
| 127 |
-d emp |
| 128 |
de-emphasis (default 'n') |
| 129 |
-c |
| 130 |
mark as copyright |
| 131 |
-o |
| 132 |
mark as original |
| 133 |
-e |
| 134 |
add error protection |
| 135 |
-r |
| 136 |
force padding bits off |
| 137 |
-D |
| 138 |
add DAB extensions |
| 139 |
-t [int] |
| 140 |
'talkativity' setting. 0 = no message. 3 = too much information |
| 141 |
(-t 20 will probably flood you off your terminal) |
| 142 |
</pre> |
| 143 |
|
| 144 |
<h2>Examples</h2> |
| 145 |
|
| 146 |
<pre> |
| 147 |
toolame sound.wav |
| 148 |
</pre> |
| 149 |
This will encode sound.wav to sound.mp2 using the default bitrate of 192 kbps |
| 150 |
and using the default psychoacoustic model (model 1)</p> |
| 151 |
|
| 152 |
<pre> |
| 153 |
toolame -p 2 -v 5 sound.wav newfile.mp2 |
| 154 |
</pre> |
| 155 |
Encode sound.wav to newfile.mp2 using psychoacoustic model 2 and encoding |
| 156 |
with variable bitrate. The high value of the "-v" argument means that |
| 157 |
the encoding will tend to favour higher bitrates.</p> |
| 158 |
|
| 159 |
<pre> |
| 160 |
toolame -p 2 -v -5 sound.wav newfile.mp2 |
| 161 |
</pre> |
| 162 |
Same as example above, except that the negative value of the "-v" argument |
| 163 |
means that the lower bitrates will be favoured over the higher ones.</p> |
| 164 |
|
| 165 |
<pre> |
| 166 |
cat sound.raw | toolame -s 22050 -f -b 96 - newfile.mp2 |
| 167 |
</pre> |
| 168 |
Toolame is encoding from stdin at a bitrate of 96kbps and is using the |
| 169 |
'fast' mode which means that no psychoacoustic modelling is done. The |
| 170 |
input file is raw pcm so the sample rate needs to be specified (22050Hz)</p> |
| 171 |
|
| 172 |
<h2>Contributors</h2> |
| 173 |
|
| 174 |
<UL> |
| 175 |
<LI>Dist10 code writers |
| 176 |
<LI>LAME specific contributions |
| 177 |
<UL> |
| 178 |
<LI>fht routines from Ron Mayer mayer at acuson.com |
| 179 |
<LI>fht tweaking by Mathew Hendry math at vissci.com |
| 180 |
<LI>window_subband & filter_subband from LAME circa v3.30 |
| 181 |
(multiple LAME authors) |
| 182 |
(before Takehiro's window/filter/mdct combination) |
| 183 |
</UL> |
| 184 |
<LI> Oliver Lietz - lietz at nanocosmos.de - Tables included in the exe |
| 185 |
|
| 186 |
<LI> Patrick de Smet - pds at telin.rug.ac.be - scale_factor calc speedup. subband_quantization speedup |
| 187 |
|
| 188 |
<LI> Federico Grau - grauf at rfa.org - and Bill Eldridge - bill at hk.rfa.org - option for "no padding" |
| 189 |
|
| 190 |
<LI> Nick Burch - gagravarr at SoftHome.net - WAV file reading, os/2 Makefile mods. |
| 191 |
|
| 192 |
<LI> Phillipe Jouguet - philippe.jouguet at vdldiffusion.com - DAB extensions. spelling, LSF using psyII, WAVE reading [02j] |
| 193 |
|
| 194 |
<LI> Henrik Herranen - leopold at vlsi.fi - fixed WAVE reading [02j] |
| 195 |
|
| 196 |
<LI> Andreas Neukoetter - anti at webhome.de - verbosity patch '-t' switch for transcode plugin [02j] |
| 197 |
|
| 198 |
<LI> Sami Sallinen - sami.sallinen at g-cluster.com - filter_subband loop unroll, psycho_i fix for "% 1408" calcs [02j] |
| 199 |
|
| 200 |
<LI> Ricardo Schelp - ricardoschelp at arnet.com.ar - merged window/filter subband for a nice speedup [02k] |
| 201 |
|
| 202 |
<LI> Nicolas Croiset - ncroiset at vdl.fr - DAB length control, ignore 4GB limit when reading from stdin, fixed bitstream ending to allow concatenation of mp2 files, fixes for psycho1 model [02k] |
| 203 |
|
| 204 |
<LI> Mike Cheng mikecheng at NOT planckenergy.com - Most of the rest |
| 205 |
|
| 206 |
</UL> |
| 207 |
|
| 208 |
<h2>References</h2> |
| 209 |
|
| 210 |
Kumar, M & Zubair, M., A high performance software implementation of mpeg audio |
| 211 |
encoder, 1996, ICASSP Conf Proceedings (I think)</p> |
| 212 |
|
| 213 |
Fischer, K.A., Calculation of the psychoacoustic simultaneous masked threshold |
| 214 |
based on MPEG/Audio Encoder Model One, ICSI Technical Report, 1997 |
| 215 |
ftp://ftp.icsi.berkeley.edu/pub/real/kyrill/PsychoMpegOne.tar.Z </p> |
| 216 |
|
| 217 |
Hyen-O et al, New Implementation techniques of a real-time mpeg-2 audio encoding |
| 218 |
system. p2287, ICASSP 99.</p> |
| 219 |
|
| 220 |
Imai, T., et al, MPEG-1 Audio real-time encoding system, IEEE Trans on Consumer |
| 221 |
Electronics, v44, n3 1998. p888</p> |
| 222 |
|
| 223 |
Teh, D., et al, Efficient bit allocation algorithm for ISO/MPEG audio encoder, |
| 224 |
Electronics Letters, v34, n8, p721</p> |
| 225 |
|
| 226 |
Murphy, C & Anandakumar, K, Real-time MPEG-1 audio coding and decoding on a DSP |
| 227 |
Chip, IEEE Trans on Consumer Electronics, v43, n1, 1997 p40</p> |
| 228 |
|
| 229 |
Hans, M & Bhaskaran, V., A compliant MPEG-1 layer II audio decoder with 16-B |
| 230 |
arithmetic operations, IEEE Signal Proc Letters v4 n5 1997 p121</p> |
| 231 |
|
| 232 |
[mikecheng at NOT planckenergy com] remove the NOT</p> |
| 233 |
|
| 234 |
</tr></td> |
| 235 |
</body> |
| 236 |
</html> |