                                                                                .
                                toolame
                an optimized mpeg 1/2 layer 2 audio encoder
                     www.cryogen.com/mikecheng

         All changes to the ISO source are licensed under the GPL  
                     (see COPYING for details)


INTRODUCTION

tooLAME is an optimized Mpeg Audio 1/2 Layer 2 encoder.  It is based heavily on 
    - the ISO dist10 code 
    - improvement to algorithms as part of the LAME project (www.sulaco.org/mp3)
    - work by myself and other contributors (see CONTRIBUTORS)

CONTRIBUTORS

Dist10 code writers
LAME specific contributions
	fht routines from Ron Mayer <mayer@acuson.com>
	fht tweaking by Mathew Hendry <math@vissci.com>
	window_subband & filter_subband from LAME circa v3.30 
		(multiple LAME authors)
		(before Takehiro's window/filter/mdct combination)
	
Oliver Lietz <lietz@nanocosmos.de>
	Tables now included in the exe!  (yay! :)

Patrick de Smet <pds@telin.rug.ac.be>
	scale_factor calc speedup.
	subband_quantization speedup

Federico Grau <grauf@rfa.org>
Bill Eldridge <bill@hk.rfa.org>
	option for "no padding"

Nick Burch  <gagravarr@SoftHome.net>
	WAV file reading
	os/2 Makefile mods.

Mike Cheng <mikecheng@cryogen.com>
	Most of the rest 

INSTALLATION

1. edit Makefile
2. 'make'

USAGE

         ./toolame [options] <input> <output>

Input File
	tooLAME parses AIFF and WAV files for file info
	raw PCM is assumed if no header is found
	for stdin use a -

Output File
	file is automatically renamed from *.* to *.mp2
	for stdout use a -

Input Options
	-s sfrq
		if inputting raw PCM sound, you must specify the sample rate
		default sample rate is 44.1khz.

	-a	
		downmix from stereo to mono
		if the incoming file is stereo, combine the audio into 
		a single channel

	-x 	
		force byte-swapping of the input.  (current endian detection if naff, 
		so if toolame just produces noise, just use -x )

Output Options
	-m mode
		the encoding mode (default 'j')
		's' stereo
		'd' dual channel
		'j' joint stereo
		'm' mono
	-p psy
		which psy model to use (default '1')
		Different models for the psychoacoustics
		Choice between 1 or 2.
	-b br
		the total bitrate (default '192')
	-v lev
		Switch on VBR mode *** experimental ***
		'lev' is the minimum MNR acceptable and the bitrate is increased
		until this criteria is met. Useful range -5 to 15. (usu 5)
		Only valid for 44.1khz input.  Anything else and it will choke.
		[need to properly switch over the alloc tables]

Operation
	-f 	
		fast mode turns off calculation of the psychoacoustic model.
		Instead a set of default values are assumed
	-q num
		quick mode calculates the psy model every 'num' frames.

Misc
	-d emp
		de-emphasis (default 'n')
	-c 	
		mark as copyright
	-o
		mark as original
	-e
		add error protection
	-r
		force padding bits off


RECOMMENDED SUPPORT SOFTWARE

* mp3_check  ftp://ftp.thedeepsky.com/outgoing/
	A frame checker for mpeg audio layer 2 and 3.
	Even groks layer2 VBR files.

* mpg123     http://mpg.123.de/  ?
	Supports layer2 VBR

REFERENCE PAPERS
(Specifically LayerII Papers)

Kumar, M & Zubair, M., A high performance software implementation of mpeg audio 
encoder, 1996, ICASSP Conf Proceedings (I think)

Fischer, K.A., Calculation of the psychoacoustic simultaneous masked threshold 
based on MPEG/Audio Encoder Model One, ICSI Technical Report, 1997
ftp://ftp.icsi.berkeley.edu/pub/real/kyrill/PsychoMpegOne.tar.Z 

Hyen-O et al, New Implementation techniques of a real-time mpeg-2 audio encoding 
system. p2287, ICASSP 99.

Imai, T., et al, MPEG-1 Audio real-time encoding system, IEEE Trans on Consumer
Electronics, v44, n3 1998. p888

Teh, D., et al, Efficient bit allocation algorithm for ISO/MPEG audio encoder,
Electronics Letters, v34, n8, p721

Murphy, C & Anandakumar, K, Real-time MPEG-1 audio coding and decoding on a DSP
Chip, IEEE Trans on Consumer Electronics, v43, n1, 1997 p40

Hans, M & Bhaskaran, V., A compliant MPEG-1 layer II audio decoder with 16-B 
arithmetic operations, IEEE Signal Proc Letters v4 n5 1997 p121

mikecheng@cryogen.com
