Manual.txt for Version 2.60 of ISO/MPEG Audio Layer 3 software only 
encoder/decoder for PCs.

1. ENCODER V2.60
   =============

 L3ENC.EXE is an ISO/MPEG Layer-3 software only encoder. It takes 
 audio data files as input and delivers Layer-3 coded bitstream 
 files as output. Several options can be selected via command line 
 switches. Usage:
 
   L3ENC <audio_data> <bitstream> [-switch1 [-switch2 [...]]]

 L3ENC.EXE should work on any IBM PC compatible computer with a 386 type 
 CPU or better with external or built in 387 hardware floating point 
 support. A Pentium CPU or better is recommended.

 L3ENC uses the DOS extender GO32.EXE.

 PLEASE NOTE:
 ------------
 o For non-registered users, ancillary data processing is not supported.
 
 o Non-registered users may use the encoder only with the
   following options (input must be 44.1 kHz!):
   112 kbit/s stereo @ 44.1   kHz
    56 kbit/s stereo @ 22.05  kHz
    16 kbit/s mono   @ 11.025 kHz

 o Registered users may use the encoder additionally with the following
   options:
     8 kbit/s mono   @ 8                 kHz
    16 kbit/s mono   @ 11.025, 16        kHz
    24 kbit/s mono   @ 16,     22.05, 24 kHz.
    32 kbit/s mono   @ 16,     22.05, 24 kHz.
    56 kbit/s stereo @ 16,     22.05, 24 kHz.
    64 kbit/s stereo @ 16,     22.05, 24 kHz.
    56 kbit/s mono   @ 32,     44.1,  48 kHz
    64 kbit/s mono   @ 32,     44.1,  48 kHz
    96 kbit/s stereo @ 32,     44.1,  48 kHz
   112 kbit/s stereo @ 32,     44.1,  48 kHz
   128 kbit/s stereo @ 32,     44.1,  48 kHz
   256 kbit/s stereo @ 32,     44.1,  48 kHz
   If the input has a sampling frequency of x2, x3, x4 or x6, it is
   downsampled on the fly.
   If you need other bitrates, please contact layer3@iis.fhg.de.

1.1 <audio_data>: audio input file
 The first command line argument specifies the name for the PCM audio
 data file. Version 2.60 of the encoder accepts either raw PCM audio 
 data files, PCM audio data files in RIFF/WAVE format as used by
 Microsoft Windows, PCM audio data files in the sun .au or PCM audio
 data files in the Apple AIFF/AIFC format.
 The samples must be 16 bit signed integer values.
   
 for raw PCM audio data:
    By default the input file is assumed to contain raw PCM audio data.
    Stereo audio data is input in interleaved format, the first channel
    beeing the left channel.
      <sample #1 channel #1> <s. #1 ch. #2> <s.#2 ch.#1> <s.#2 ch.#2> ...
    Mono audio data has the format
      <sample #1> <sample #2> <sample #3> ....
    Whether the input file is treated as mono or stereo audio data is set
    by the downmix switch (1.4). Default is stereo.
    Please see for the -sr, -tfc and -tfs switches below.

 PLEASE NOTE: Non-registered users may use the encoder only with 
 .snd/.wav/.aiff files.

1.2 <bitstream>: Layer 3 output file
 The second command line argument specifies the name for the bitstream 
 output file. The extension of the file name should be .mp3.
 The format of the bitstream is as defined in the
 ISO/MPEG publications IS11172-3 (MPEG-1) and IS13818-3 (MPEG-2).
 For very low bitrates a special Fraunhofer format called "MPEG 2.5"
 is used.

1.3 bitrate
 The bitrate of the bitstream output is selected via the '-br' switch.  The 
 bitrate is specified in bits/second. The bitrate is the total bitrate for 
 all encoded channels, i.e. if you select 'br 112000' and 'stereo', both 
 channels will be stuffed into one bitstream of 112000 bits/second. 
 Valid bitrates are:
  o   8000 bit/s
  o  16000 bit/s
  o  24000 bit/s
  o  32000 bit/s
  o  56000 bit/s
  o  64000 bit/s
  o  96000 bit/s
  o 112000 bit/s
  o 128000 bit/s
  o 256000 bit/s

 The default bitrate is 112000 bit/s.

1.4 downmix
  If a stereo input file should be treated as mono, the '-dm' swich can be
  used.
  The mono signal is calculated by (l+r)/2.
 
1.5 high quality
  If the '-hq' option is specified, the encoder will try to produce higher
  audio quality, but at the cost of a reduced encoding speed.

1.6 crc check
 If '-crc' is asserted, ISO/MPEG crc checking is enabled. Without the 'crc' 
 switch, crc checking is disabled.

1.7 ancillary data
  If the '-anc <filename> <rate>' option is specified, the named file is
  is inserted as ancillary data in the bitstream.
  The rate is in bits/frame.

1.8 sampling rate
 If a raw PCM file is used as input, the '-sr' switch supports the encoder
 with the sampling rate.
 THIS IS NOT NEEDED FOR .wav/.snd/.aiff INPUT!

1.9 swap input samples
 If a raw PCM file is used as input, the '-tfs' switch swaps each 16 bit
 input sample prior to processing.
 THIS IS NOT NEEDED FOR .wav/.snd/.aiff INPUT!

1.10 number of channels
 If a raw PCM file is used as input, the '-tfc' switch indicates the number of
 channels (1=mono, 2=stereo).
 THIS IS NOT NEEDED FOR .wav/.snd/.aiff INPUT!

1.11 examples of switch settings
    l3enc infile.pcm out.mp3 -br 112000 -crc
    l3enc c:\music\pcm\newage.pcm c:\music\mp3\newage.mp3 -br 64000
    l3enc pop.wav pop.mp3 -br 96000

1.12 Encoding Recommendations
 Depending on the desired bitrate, the encoding process will be done
 with different parameter settings.
 'l3enc' supports three versions of Layer-3 bitstreams called MPEG-1,
 MPEG-2 and "MPEG 2.5". 
 The basic difference is the use of different sampling frequencies:

    MPEG-1     Layer 3       sampling frequencies 32, 44.1,   48 kHz
    MPEG-2     Layer 3       sampling frequencies 16, 22.05,  24 kHz
    "MPEG-2.5" Layer 3       sampling frequencies  8, 11.025, 12 kHz

 MPEG-1 supports higher audio bandwidth and is therefore the best 
 choice for high quality audio coding at bitrates >= 96 kbit/s (stereo) 
 or >= 48 kbit/s (mono). For bitrates <= 64 kbit/s (stereo) or
 <=32 kbit/s (mono),
MPEG-2 offers better sound quality compared
 to MPEG-1.
 "MPEG 2.5" is a special format developed for very low bitrates.

 l3enc selects between MPEG-1 and MPEG-2 automatically depending on the
 bitrate switch (see section 1.3)
 
 For the coding of stereo files with bitrates <=96 kbit/s, the encoder
 will use the
intensity stereo technique.
 Note, however, that the use of intensity stereo may demage information
 which is needed for sound processing schemes like Dolby Surround. 
 For bitrates >= 112 kbit/s, intensity stereo is not used.

 The following table summarizes the recommendations.

 - Coding of Mono Input

 bitrate       coding standard  
 -----------------------------
 <= 16 kbit/s  "MPEG-2.5"
 <= 40 kbit/s  MPEG-2
 >= 48 kbit/s  MPEG-1
	   
 - Coding of Stereo Input

 bitrate       coding standard  use of intensity stereo
 ------------------------------------------------------
 <= 64 kbit/s  MPEG-2           on
    96 kbit/s  MPEG-1           on
 >=112 kbit/s  MPEG-1           off


2. DECODER V2.60
   =============

 L3DEC.EXE is an ISO/MPEG Layer 3 software only decoder. It takes 
 Layer 3 bitstream files as input and delivers PCM audio data files 
 as output. A number of options can be selected via command line 
 switches. Usage:

	l3dec <bitstream> <audio_data> [-switch1 [switch2 [...]]]
 
 L3DEC.EXE should work on any IBM PC compatible computer with a 386 CPU 
 or better with external or built in 387 hardware floating point support.

 L3DEC uses the DOS extender GO32.EXE.

 If you specify no output file name and use the -sto option, the audio
 data is written to stdout. If you specify -sti, the decoder reads from stdin
 instead of the bitstream file.

2.1 <bitstream>: bitstream input file
 The format of the bitstream input file must comply with ISO/IEC
 IS11172-3 or IS 13818-3.
 The decoder will process all valid MPEG1 Layer-3 bitstream data 
 without restrictions to bitrate or sampling frequency.
 It supports also MPEG2 Layer-3 low sampling frequencies.
 For very low bitrates an special Fraunhofer format called "MPEG 2.5"
 is used.

2.2 <audio_data>: audio data output file
 Audio data is output as samples of 16 bit signed integer PCM data. 
 The default format is raw PCM data and can be either one channel or 
 two interleaved channels.
	format of one (mono) channel PCM audio data:
		<sample #1><sample #2>....
	format of two channel (stereo) PCM audio data:
		<spl.#1 ch.#1><spl.#1 ch.#2><sp.#2 ch.#1><spl.#2 ch.#2>...
 If one or two audio channels are used depends on the encoded information in 
 the bitstream. For stereo output data the first channel is the left 
 channel. Information about sampling frequency and number of used channels 
 is displayed at the beginning of the decoding process.

2.3 RIFF/WAVE format
 If selected by the '-wav' switch, audio data is output in RIFF/WAVE format 
 (*.WAV) as used by Microsoft Windows. The audio data itself is still 
 written as 16 bit PCM data as described in 2.2 but it is preceded by a 
 WAVE-header. The WAVE-Header contains information about the number of 
 channels (1 or 2), sampling frequency (32k/44.1k/48k) and used bits per 
 sample (16).

2.4 SND format
 If selected by the '-snd' switch, audio data files are output in
 the SND format used on SUN and NeXT-Workstations.

2.5 AIFF format
 If selected by the '-aif' switch, audio data files are output in
 the AIFF format.

2.6 AIFC format
 If selected by the '-aic' switch, audio data files are output in
 the AIFC format.

2.7 skip frames
 With the '-fb' option you can skip a number of frames in the bitstream 
 before the decoding starts. '-fb nnn' skips the first nnn frames. Each 
 frame contains 1152 (MPEG-1) or 576 (MPEG-2) samples of audio data.
 Depending on the sampling frequency used, the duration of a frame is
 calculated as 24 msec (@ 48kHz, 24kHz), 26.1 msec (@ 44.1kHz, 22.05kHz)
 or 36 msec (@ 32kHz, 16 kHz).

2.8 decode only nnn frames
 If you want to decode only a certain number of frames, specify the '-fn' 
 option. '-fn xxx' will decode only xxx frames (see also 2.6).

2.9 search again after loss of synchronisation
 Normally the decoding process is stopped, if a loss of synchronisation is 
 detected, i.e. the synch information is incorrect. To enable decoding of 
 partially damaged bitstream files, you may assert the '-sa' option. In 
 this mode the decoding is not stopped and the file is searched for valid 
 synch information until the end of file is encountered.

2.10 write audio data as ascii hex 24bit output file
 If the option '-h24 xxx' is specified an (additional) output file with 
 name 'xxx' is opened. PCM Audio data is output as 24 bit ascii hex values
 followed by carriage return and line feed. Accuracy of the output values
 is 24 bit compared to the 16 bits raw output mode. Files output in 
 'h24' format take four times the storage capacity necessary for raw 
 16bit output format.

2.11 ignore error messages
 If errors in the bitstream are detected, the decoding process is normally
 halted. If the '-ign' option is specified, the decoder tries to continue 
 with the decoding process.

2.11 accept free format bitstream
 If the '-ff' option is specified, a free format bitstream is accepted.

2.11 ancillary data
 If the bitstream contains ancillary data (user data integrated into
 the bitstream) the decoder can write this data into an ancillary 
 data file. Use the switch '-a file' to specify the filename for the
 ancillary data. The default alignment of ancillary data is byte
 aligned ('-aba'). You can also use the switch '-afh' for the FhG mode.
 In FhG-mode, ancillary data is framed, beginning with a Sync, a length
 byte and has a trailing checksum.

2.12 write to stdout
 If the '-sto' option is specified, the PCM data output is written to
 stdout.

2.13 read from stdin
 If the '-sti' option is specified, the bitstream input is read from
 stdin.


All brand names are registered trade marks of their respective owners.

