
                    ARM Shine v1.09 18/10/03
                    ------------------------

This is a port of a simple mp3 encoder. It is not a quality encoder so keep
the bitrate to at least 128K for stereo, or 64K for mono. The only control
for quality is the bitrate. Some music will sound okay, some will not.
The only advantage over other encoders is speed.

The input filetype is checked. If Wave (fb1), data (ffd), or CD audio (0cd)
it is processed accordingly. CD Audio files from AudioFS2 are processed as
raw data. Raw data files are assumed to be 44.1kHz signed linear 16 bit stereo.
They are also assumed to be little endian which should be the case when used
under RISC OS. You can force raw data by setting the -r switch. If the filetype
is unknown, wave is assumed as this is safer. The output filetype is set to
audio mpeg (1ad) after encoding is completed. The filenames can be specified
in normal RISC OS style, and the output filename must be specified.

Versions from 1.06 are 26/32 bit neutral.


USAGE   :  Shine [options] <infile> <outfile>

options :
   -h            this help message

   -b <bitrate>  set the bitrate [8-320], default 128kbit
   
   -c            set copyright flag, default off
   
   -o            reset original flag, default on
   
   -r [sample rate] Force loading a raw cd data file. Use this with filetypes
                 that would not be recognised. The sample rate is optional.
                 If not supplied, 44100 is assumed. Allowed values are
                 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000.
   
   -m            Produce a mono file from a stereo input. Mixes the two
                 channels into one. Has no effect if a mono wave file is
                 loaded. If used with the -r option, the data file is treated
                 as mono.
                 
   The following switches are for test purposes.
                 
   -ps           Force StrongArm code.
   -pa           Force normal Arm code.

Allowed bitrate/sample rate combinations are as follows.

Sample rates of 32000, 44100, 48000 produce MPEG1 format files.
MPEG1 bitrates are, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320

Sample rates of 16000, 22050, 24000 produce MPEG2 format files.
Sample rates of 8000, 11025, 12000 produce MPEG2.5 format files.
MPEG2/2.5 bitrates are, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160

Sample rates are in Hz, bitrates in kbps (kilo bits per second).
The default combination is 44100Hz and 128kbps

                 
examples:
  Put shine in the Library directory. Open a task window and at the command prompt,

  shine audiofs::12345.$.01 01        convert track 01 direct from CD 12345
                                      to an mp3 called 01 in the current directory,
                                      using AudioFS.
                                      
  shine -m -b 64 fred monofred        create a 64kb mono mp3 file from the
                                      stereo wave file fred. Both in the current
                                      directory
  

For the technically minded, this encoder contains the minimum required to
produce a valid bitstream. It does not have a psychoacoustic model, which
means,
1. It always uses long blocks.
2. Scalefactors are not used.
3. There is no outer iteration loop.
4. For stereo, it only uses 'Dual Channel' mode.
The win32 application 'EncSpot' reports it as the 'shine' encoder and gives
it a 'bad' quality rating. I believe it would report any encoder that
conformed to 1,2,and 4 above as shine.

The original source is by Gabriel Bouvigne and can be found at
 http://www.mp3-tech.org
along with a lot of other useful info.


History
-------
1.09 18/10/03 Compiled using StubsG

1.08 18/07/03 MPEG2/2.5 lower sampling frequencies support.

1.07 12/06/03 Assembler mod's and minor corrections thanks to Justin Fletcher.

1.06 17/12/02 Removed all test code. converted and compiled for 32 bit.

1.05 14/06/01 Oops, made mono work !

1.04 25/05/01 Added graphical frame display, test switches.
              Reservoir used to overcome the approximate 10% bit waste.
              Simplified bitstream formatter. Further simplification of
              main iteration loops.
              Speeded up subband filter matrix calculation by exploiting
              symmetry in coefficient tables, standard stuff.
              Modified frame counter display so it fits into the diddy
              MP3Encode status window.

1.03 14/05/01 -m switch for mono from stereo, or to force loading of
              mono raw data files.
              -o switch to reset 'original' flag.
              Adjusted input scaling to allow 6dB more headroom. It was
              too close to maximum on some tracks.

1.02 08/05/01 StrongArm and Normal versions combined. Detects Processor
              and uses appropriate code.
              Corrected 'bitstream error' on last frame as reported 
              by AMPlayer.
              Uses nice big buffers to reduce disc clatter.
              Recognises filetype 0cd as CD audio file so no need
              to use -r option with AudioFS2.

1.01 15/04/01 Global gain reduced by 1, (gain was slightly high).
              Stepsize range changed to simplify quantizer.
              Inner loops in filters and transform expanded to
              provide increased accuracy (64 bit accumulation),
              and a bit more speed.
            
1.00 24/03/01 Original release.


Pete Everett. 18/07/03
email: peter@everett9981.freeserve.co.uk
web: http://www.everett9981.freeserve.co.uk/pete.htm

------------------------------------------------------------------------------

