@DATABACE mt3enC.Gukde

@IdTj 00

`AuTHOP{}ikhAel kheng}
lND EAMNl"mpenc.gi$e"
Nm`3%nc v0*3

Thys sof|wmr% !spnt Shareware or co-mercial or PD~
	t is `{"CctqrWabe" mi~k "CstarWare"}.  ***NEw*
* CstarWabepis jow TackYP/stCar Ware!!
Dodgy dkcs writdef ry @;" Michael Cheng " lynk A%thor"=

@",	dt0o|uctao& . li.k "Intr/d%ction"}
@{" R%qeivements j li.k "zeuir%menvs"=
@{"lHIstory`" link "H)s4ory"}
@k"$Usage "dlinj "Usage"}
@{"`S`eedf"`link bSpeed"}
@{" Projlem# " |ink "Proble-s}*@{" Source Code " link "Source"}
@{" Future " link "Future"}
@{" Acknowledgements " link "Acknowledgements"}
@{" Author " link "Author"}
@{" Appendix " link "Appendix"}

@ENDNODE

@NODE "CstarWare" "CstarWare"

CstarWare is now a another name for TackyPostcardWare.

If you find this software useful, I would request that you send me a 
postcard from your locality.  But not just any postcard! Oh no. That
would be too simple.  :)
I would like tacky postcards.  Preferably of some really miserable 
landmark that all the locals are embarassed about.  Please try and
find a card that has a local flavour about it, not just a generic
"nude girls at the beach" one.

See @{" Author " link "Author"} for my address.

@ENDNODE

@NODE "Introduction" "Introduction"

This is the amiga release version of ISO MPEG's public C source
code for mpeg audio layer 3 encoding.

The source if freely available from ISO MPEG, but they do not make any
testimony as to its usefulness, completeness or quickness.

This amiga release is beta-ish.  Make sure you read the @{"Problems" link "Problems"}
section for info.

@ENDNODE

@NODE "Requirements" "Requirements"

REQUIREMENTS

    - An Amiga (preferably with an FPU)

    - The fastest CPU you can find :)

    - ixemul.library v47.0 or greater.
	  ftp://ftp.ninemoons.com/pub/gg/current/amiga-bin/ixemul*bin*.lha  [full archive]
	 
@ENDNODE

@NODE "History" "History"


Version 0.3 (18 Nov 1997)
	- Added some Stephane Tavenard's memory optimizations from musicin, and adapted for mp3
	- Added Henryk Richter's ASM FFT routine from musicin
	- Added Stephane Tavenard's filter_subband() optimizations.
	- Implemented a better MDCT routine (70% faster than original)
	- Sped up a sparse matrix multiplication in l3psy.c
	- Default encoding is now 128kbs, mp3, stereo, 44.1khz.
	- Removed all LayerI and LayerII code.  Use musicin from aminet for these layers.
	- Added all the tables into the exe. Now stand alone exe.
	- Fixed some co-efficients in psy_data (I think).
	- The dodgy AIFF support in previous versions was due to non-standard AIFF from AHI.
	- Lots of little niggly things.

Version 0.2 (1 Oct 1997)
    - 25% faster
    - An internal cleanup of how I was patching things
    - debug file "dbf" left in code to help me debug.

Version 0.1d (26 June 1997)
    - Thanks to a suggestion from a guy on irc, I fudged the memory
	allocation so that the crash when stereo encoding no longer
	occurs.

Version 0.1c (11 June 1997)
    - Added to docs that you need ixemul v46.1 or better, and where
	to find that library
    - Includes an 060 version [mostly untested. Send me timing info]
    - Used Stephane Tavenard's FFT routines from musicin.
    - Included my source (for your amusement :)
    - Someone tested AIFF input files, and reckons it works
    - I found mp3enc about 25% faster than musicin for encoding mp2's.

Version 0.1b (29 May 1997)
    - Left some weird debugging info in the exes. Fixed that.
    - Not in wide release

Version 0.1 (27 May 1997)
    - First release to aminet
    - Basically the same as the old "masochist" dir in mp3.lha



@ENDNODE

@NODE "Usage" "Usage"

USAGE

The 'encode' program may either be run interactively at the command line,
or may be given exact command line arguments to run it without
interaction.

Interactive mode is quite self explanatory.

The following command line arguments are taken from the source code. Use
    encode -h
		to view the command options.

 -l  is followed by the layer number  (1,2,3) *NB Only LayerIII supported*
 -m  is followed by the mode ([s]tereo [j]ointstereo [d]ualchannel [m]ono)
 -p  is followed by the psychoacoustic model number (1,2)
 -s  is followed by the sampling rate
 -b  is followed by the total bitrate, irrespective of the mode
 -d  is followed by the emphasis flag ([n]one [5]0/15microseconds [c]citt)
 -c  is followed by the copyright/no_copyright flag
 -o  is followed by the original/not_original flag
 -e  is followed by the error_protection on/off flag

If the input file is in AIFF format, the sampling frequency is read
from the AIFF header. 


LIMITATIONS

    - Only psychoacoustic model 2 is available for mp3 encoding.
    - Joint Stereo encoding is not available for mp3 encoding.
    - As of v0.3 mp3enc does LayerIII encoding only.


EXAMPLE

    encode -l 3 -p 2 -s 44.1 -b 128 -m s spot1-s.pcm

since v0.3, the default encoding is now Layer3, 44.1khz stereo at 128kbps. 
So the above example is now equivalent to
	
	encode spot1-s.pcm

    The source file is "spot1.raw" which is a 44khz 16bit mono pcm file.
    It is being encoded to layer 3 (-l 3)
    Using psychoacoustic model 2 (-p 2)
    Source frequency is 44.1khz (-s 44.1)
    Total encoded bitrate is 128 (-b 128)
    mp3 mode is stereo (-m s)
    The output file is spot1-s.pcm.mpg (by default)



@ENDNODE


@NODE "Problems" "Problems"

PROBLEMS

    - watch the debug file 'dbf' for output. This file is *always* written in
	this release.  Usually it will just contain "MFCDBF".

    - Doesn't yet encode in the common "joint stereo" mp3 format.

@ENDNODE

@NODE "Speed" "Speed"

Encoding Layer 3 mpeg audio files is very CPU intensive.

If a P166 takes 15minutes to encode a 3.5 minute song using really good code from
Fraunhofer, you can expect your 25Mhz/040 running dodgy unix C source code to take 
a hell of a long time.

If you want to help me with benchmarking information, send me your computer specs,
the time taken to encode the file, and the actual playing time of the sound file. 
(NB I prefer timings to be done with Executive's 'timer' command)

@ENDNODE

@NODE "Source" "Source"

The complete mpeg audio demonstration C source is available from

ftp://ftp.tnt.uni-hannover.de/pub/MPEG/audio/mpeg2/software/technical_report/dist10.tar.gz


@ENDNODE

@NODE "Future" "Future"

FUTURE
    
    - @{"Optimize" link "Optimize"} code

    - Add in joint stereo encoding.

    - Add in LSF extensions 

    - PPC version
 
    - remove need for ixemul

@ENDNODE

@NODE "Optimize" "Optimize"

The code is written in ANSI C and is meant to be demonstrative C source
into how to implement the mpeg audio standard in software.  It was not
meant to be fast, tight or optimized for any particular processor.

@ENDNODE

@NODE "Acknowledgements" "Acknowledgements"

THANKS

    - Stéphane TAVENARD (tavenard@xiii.univ-angers.fr)for mpega, the best
	amiga mpeg audio player.

    - Henryk Richter for a great fast ASM FFT routine.

    - Thomas 'steiner' Andersson for providing me with *heaps* of timing,
	and feedback and kicks in the rear when I needed them.
 
    - Troels and SimD and Lazaruz and Jkay and others i've forgotten on #amiga
	for helping me test.

    - IanG for the unix amigaguide viewer (and letting me crash his PPC :)

    - ISO MPEG Audio Subgroup Software Simulation Group for making the
	source available.

    - Sinead O'Connor for musical inspiration

    - #amiga people for not killing me for whining so much


@ENDNODE

@NODE "Author" "Author"

C source is courtesy of the ISO MPEG Audio Subgroup Software Simulation
Group


Amiga compile is by me:
mike cheng
Cstar on #amiga
mikecheng@cryogen.com
http://linux.us.amiganet.org/cstar/  or http://linux.tc3net.com/cstar/

Postcards to:
Mike Cheng
30 Clarina St
Chapel Hill   4069
AUSTRALIA

Rewards of chocolate, nice email, cute female siblings or a life are welcome.
@ENDNODE

@NODE "Appendix" "Appendix"


@ENDNODE
